From a29414fce6b192ab9a7a37938a9596b8511ce06b Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Sun, 23 Aug 2020 18:51:36 +0200 Subject: Prevent racing double commits on password creation (#1047) Co-authored-by: Harsh Shandilya (cherry picked from commit 2c8999c1bff1c82b047e7111d47c539fc6207336) --- .../com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt index 1376dd04..44376c0a 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt @@ -426,13 +426,15 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB returnIntent.putExtra(RETURN_EXTRA_USERNAME, username) } - lifecycleScope.launch { - commitChange( - getString( - R.string.git_commit_edit_text, - getLongName(fullPath, repoPath, editName) + if (editing) { + lifecycleScope.launch { + commitChange( + getString( + R.string.git_commit_edit_text, + getLongName(fullPath, repoPath, editName) + ) ) - ) + } } if (directoryInputLayout.isVisible && directoryInputLayout.isEnabled && oldFileName != null) { -- cgit v1.2.3 From e4ce435f002b866adb5f8c81a488816ef8a0d1d0 Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Mon, 24 Aug 2020 09:11:40 +0200 Subject: Return HTTPS URI username from CredentialsProvider (#1049) Let the PasswordFinderCredentialsProvider support Username as a CredentialItem type and return the user part of the repository URI when it is requested. (cherry picked from commit 679037b81dee889bdd3b79bd02c37353df63ccc5) --- app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt b/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt index 881b8807..62d6879c 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt +++ b/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt @@ -58,6 +58,7 @@ abstract class GitOperation(gitDir: File, internal val callingActivity: Fragment override fun get(uri: URIish?, vararg items: CredentialItem): Boolean { for (item in items) { when (item) { + is CredentialItem.Username -> item.value = uri?.user is CredentialItem.Password -> item.value = passwordFinder.reqPassword(null) else -> UnsupportedCredentialItem(uri, item.javaClass.name) } @@ -66,7 +67,7 @@ abstract class GitOperation(gitDir: File, internal val callingActivity: Fragment } override fun supports(vararg items: CredentialItem) = items.all { - it is CredentialItem.Password + it is CredentialItem.Username || it is CredentialItem.Password } } -- cgit v1.2.3 From 4a4e48dc345cd6110313774b15692e1bd8cceae9 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 24 Aug 2020 12:44:24 +0530 Subject: build: bump version Signed-off-by: Harsh Shandilya --- app/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d83d6f88..0374254b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -30,8 +30,8 @@ android { defaultConfig { applicationId = "dev.msfjarvis.aps" - versionCode = 11110 - versionName = "1.11.1" + versionCode = 11120 + versionName = "1.11.2" } lintOptions { -- cgit v1.2.3