From 8d80295e075817f335084c6a5e92e24b03014924 Mon Sep 17 00:00:00 2001 From: Gilbert Gilb's Date: Tue, 4 Sep 2018 20:59:00 +0200 Subject: [PATCH 1/6] Implement requiresSetup for PCloud. Also consider error 2095 as a logout, so that the user can re-login. --- .../keepass2android/javafilestorage/PCloudFileStorage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/JavaFileStorage/app/src/main/java/keepass2android/javafilestorage/PCloudFileStorage.java b/src/java/JavaFileStorage/app/src/main/java/keepass2android/javafilestorage/PCloudFileStorage.java index ddfeb0e8..daeea34f 100644 --- a/src/java/JavaFileStorage/app/src/main/java/keepass2android/javafilestorage/PCloudFileStorage.java +++ b/src/java/JavaFileStorage/app/src/main/java/keepass2android/javafilestorage/PCloudFileStorage.java @@ -52,7 +52,7 @@ public class PCloudFileStorage extends JavaFileStorageBase @Override public boolean requiresSetup(String path) { - return true; + return !this.isConnected(); } @Override @@ -372,7 +372,7 @@ public class PCloudFileStorage extends JavaFileStorageBase private Exception convertApiError(ApiError e) { String strErrorCode = String.valueOf(e.errorCode()); - if (strErrorCode.startsWith("1") || "2000".equals(strErrorCode)) { + if (strErrorCode.startsWith("1") || "2000".equals(strErrorCode) || "2095".equals(strErrorCode)) { this.clearAuthToken(); return new UserInteractionRequiredException("Unlinked from PCloud! User must re-link.", e); } else if (strErrorCode.startsWith("2")) { From 382c96f587d94f4b7606db07e5a1100d0e34bbb4 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 17 Sep 2018 16:08:24 +0200 Subject: [PATCH 2/6] NextCloud -> Nextcloud --- src/keepass2android/Resources/values/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/keepass2android/Resources/values/strings.xml b/src/keepass2android/Resources/values/strings.xml index 0da7b0dd..bd63d3b5 100644 --- a/src/keepass2android/Resources/values/strings.xml +++ b/src/keepass2android/Resources/values/strings.xml @@ -513,8 +513,8 @@ Enter OwnCloud login data: OwnCloud URL (ex: owncloud.me.com) - Enter NextCloud login data: - NextCloud URL (ex: nextcloud.me.com) + Enter Nextcloud login data: + Nextcloud URL (ex: nextcloud.me.com) host (ex: 192.168.0.1) port @@ -536,7 +536,7 @@ HTTP (WebDav) HTTPS (WebDav) OwnCloud - NextCloud + Nextcloud Dropbox Dropbox (KP2A folder) If you do not want to give KP2A access to your full Dropbox, you may select this option. It will request only access to the folder Apps/Keepass2Android. This is especially suited when creating a new database. If you already have a database, click this option to create the folder, then place your file inside the folder (from your PC) and then select this option again for opening the file. From d731d55a7a7df9eba804346b72429996e950c525 Mon Sep 17 00:00:00 2001 From: Christopher Nash Date: Thu, 4 Oct 2018 14:28:19 -0600 Subject: [PATCH 3/6] Added Logo to README.md Added the Keepass2Android Logo to README.md to give it a little more "flare" when viewing it on Github. --- docs/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/README.md b/docs/README.md index 7a02a751..1d385bb5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,3 +1,6 @@ +

Keepass2Android LogoKeepass2Android

+ + # What is Keepass2Android? Keepass2Android is a password manager app. It allows to store and retrieve passwords and other sensitive information in a file called "database". This database is secured with a so-called master password. The master password typically is a strong password and can be complemented with a second factor for additional security. The password database file can be synchronized across different devices. This works best using one of the built-in cloud storage options, but can also be performed with third-party apps. Keepass2Android is compatible with Keepass 1 and Keepass 2 on Windows and KeepassX on Linux. From 25d1b6b695129c44525d5f1951534bb9e0767f1b Mon Sep 17 00:00:00 2001 From: Gilbert Gilb's Date: Fri, 2 Nov 2018 23:30:59 +0100 Subject: [PATCH 4/6] Fix PCloud not overwriting uploaded files. When uploading an existing file into PCloud, it appends a version number by default (e.g. "MyDb (2).kdbx", "MyDb (3).kdbx" and so on). This behavior is not desirable in K2PA case. The workaroundfor this is to upload the file with a temporary name and then rename it to its final name. This may also avoid corruption with failed uploads depending on how PCloud handles uploads. See https://github.com/PhilippC/keepass2android/issues/512#issuecomment-435475365 --- .../keepass2android/javafilestorage/PCloudFileStorage.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/java/JavaFileStorage/app/src/main/java/keepass2android/javafilestorage/PCloudFileStorage.java b/src/java/JavaFileStorage/app/src/main/java/keepass2android/javafilestorage/PCloudFileStorage.java index daeea34f..5ef0ffb0 100644 --- a/src/java/JavaFileStorage/app/src/main/java/keepass2android/javafilestorage/PCloudFileStorage.java +++ b/src/java/JavaFileStorage/app/src/main/java/keepass2android/javafilestorage/PCloudFileStorage.java @@ -14,6 +14,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; +import java.util.UUID; import java.util.regex.Pattern; import com.pcloud.sdk.ApiClient; @@ -135,8 +136,10 @@ public class PCloudFileStorage extends JavaFileStorageBase String filePath = path.substring(0, path.lastIndexOf("/") + 1); RemoteFolder remoteFolder = this.getRemoteFolderByPath(filePath); + String tempName = "." + UUID.randomUUID().toString(); try { - this.apiClient.createFile(remoteFolder, filename, dataSource).execute(); + RemoteFile remoteFile = this.apiClient.createFile(remoteFolder, tempName, dataSource).execute(); + this.apiClient.rename(remoteFile, filename).execute(); } catch (ApiError e) { throw convertApiError(e); } From cf77a9eae23dc8bcb56c4c3136453e8eb02f08bc Mon Sep 17 00:00:00 2001 From: Sebastian Jakubiak <23054974+jakseb@users.noreply.github.com> Date: Tue, 6 Nov 2018 20:28:42 +0100 Subject: [PATCH 5/6] Fix formatting in docs/Keepass2Android-Apk.md --- docs/Keepass2Android-Apk.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Keepass2Android-Apk.md b/docs/Keepass2Android-Apk.md index 7286f2b0..080f9498 100644 --- a/docs/Keepass2Android-Apk.md +++ b/docs/Keepass2Android-Apk.md @@ -2,7 +2,7 @@ Keepass2Android's apk is pretty big, e.g. when comparing to Keepassdroid. The ma Here's a list of what is contained in the Keepass2Android 0.9.1 application package: -{{ +``` Mono for Android .net dlls 5.0 MB Runtime 2.5 MB @@ -22,4 +22,4 @@ Java/Mono bindings 0.5 MB rest 0.3 MB TOTAL 13 MB -}} \ No newline at end of file +``` From 3fb5749c86a058fdfa86a820ccfa197db34abfda Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Thu, 8 Nov 2018 05:44:04 +0100 Subject: [PATCH 6/6] avoid leakage of IOC username/password to logcat/debuglog for some protocols --- src/Kp2aBusinessLogic/Io/CachingFileStorage.cs | 4 +++- src/Kp2aBusinessLogic/Io/JavaFileStorage.cs | 5 +++-- src/keepass2android/fileselect/FileStorageSetupActivity.cs | 2 +- .../fileselect/FileStorageSetupInitiatorActivity.cs | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Kp2aBusinessLogic/Io/CachingFileStorage.cs b/src/Kp2aBusinessLogic/Io/CachingFileStorage.cs index d6948b5c..30ebeecc 100644 --- a/src/Kp2aBusinessLogic/Io/CachingFileStorage.cs +++ b/src/Kp2aBusinessLogic/Io/CachingFileStorage.cs @@ -168,7 +168,9 @@ namespace keepass2android.Io if (!IsCached(ioc)) throw; - Kp2aLog.Log("couldn't open from remote " + ioc.Path); +#if DEBUG + Kp2aLog.Log("couldn't open from remote " + ioc.Path); +#endif Kp2aLog.Log(ex.ToString()); _cacheSupervisor.CouldntOpenFromRemote(ioc, ex); diff --git a/src/Kp2aBusinessLogic/Io/JavaFileStorage.cs b/src/Kp2aBusinessLogic/Io/JavaFileStorage.cs index 0e6870e0..443d5f83 100644 --- a/src/Kp2aBusinessLogic/Io/JavaFileStorage.cs +++ b/src/Kp2aBusinessLogic/Io/JavaFileStorage.cs @@ -233,7 +233,6 @@ namespace keepass2android.Io public FileDescription GetFileDescription(IOConnectionInfo ioc) { - Kp2aLog.Log("GetFileDescription "+ioc.Path); try { return ConvertToFileDescription(Jfs.GetFileEntry(IocToPath(ioc))); @@ -302,7 +301,9 @@ namespace keepass2android.Io public void OnResume(IFileStorageSetupActivity activity) { +#if DEBUG Kp2aLog.Log("JFS/OnResume Ioc.Path=" +activity.Ioc.Path+". Path="+((IJavaFileStorageFileStorageSetupActivity)activity).Path); +#endif _jfs.OnResume(((IJavaFileStorageFileStorageSetupActivity) activity)); } @@ -366,4 +367,4 @@ namespace keepass2android.Io } } #endif -} \ No newline at end of file + } \ No newline at end of file diff --git a/src/keepass2android/fileselect/FileStorageSetupActivity.cs b/src/keepass2android/fileselect/FileStorageSetupActivity.cs index 25ae1667..d7ea2953 100644 --- a/src/keepass2android/fileselect/FileStorageSetupActivity.cs +++ b/src/keepass2android/fileselect/FileStorageSetupActivity.cs @@ -44,7 +44,7 @@ namespace keepass2android.fileselect Ioc = new IOConnectionInfo(); PasswordActivity.SetIoConnectionFromIntent(Ioc, Intent); - Kp2aLog.Log("FSSA.OnCreate with " + Ioc.Path); + Kp2aLog.Log("FSSA.OnCreate"); ProcessName = Intent.GetStringExtra(FileStorageSetupDefs.ExtraProcessName); IsForSave = Intent.GetBooleanExtra(FileStorageSetupDefs.ExtraIsForSave, false); diff --git a/src/keepass2android/fileselect/FileStorageSetupInitiatorActivity.cs b/src/keepass2android/fileselect/FileStorageSetupInitiatorActivity.cs index 4544fb5d..3591d0aa 100644 --- a/src/keepass2android/fileselect/FileStorageSetupInitiatorActivity.cs +++ b/src/keepass2android/fileselect/FileStorageSetupInitiatorActivity.cs @@ -32,7 +32,7 @@ namespace keepass2android public void StartSelectFileProcess(IOConnectionInfo ioc, bool isForSave, int requestCode) { - Kp2aLog.Log("FSSIA: StartSelectFileProcess "+ioc.Path); + Kp2aLog.Log("FSSIA: StartSelectFileProcess "); Intent fileStorageSetupIntent = new Intent(_activity, typeof(FileStorageSetupActivity)); fileStorageSetupIntent.PutExtra(FileStorageSetupDefs.ExtraProcessName, FileStorageSetupDefs.ProcessNameSelectfile); fileStorageSetupIntent.PutExtra(FileStorageSetupDefs.ExtraIsForSave, isForSave);