From 88612e2aad5a4cbb6ee069f9495345d0d932c88a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20=C3=87akar?= Date: Fri, 27 Dec 2024 15:36:16 +0300 Subject: [PATCH 1/4] Fix issue #4304 - The cause of the error is that the password validation logic runs for both password fields at the same time. When entering the first password, the second password field is empty, which causes the 'passwords do not match' error. This can be fixed by updating the code as follows: --- .../ui/dialogs/EncryptAuthenticateDialog.kt | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptAuthenticateDialog.kt b/app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptAuthenticateDialog.kt index 11763e598b..3841007f70 100644 --- a/app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptAuthenticateDialog.kt +++ b/app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptAuthenticateDialog.kt @@ -201,15 +201,19 @@ object EncryptAuthenticateDialog { warningTextInputLayout, btnOK, ) { text: String -> - if (text.isNotBlank() && - text == comparingPasswordField.text.toString() && - filenameIsValid(encryptSaveAsEditText.text.toString(), useAzeEncrypt) - ) { - ReturnState() - } else if (text.isBlank()) { - ReturnState(STATE_ERROR, R.string.field_empty) + if (text.isNotBlank()) { + if (comparingPasswordField.text.toString().isBlank() || + text == comparingPasswordField.text.toString()) { + if (filenameIsValid(encryptSaveAsEditText.text.toString(), useAzeEncrypt)) { + ReturnState() + } else { + ReturnState(STATE_ERROR, R.string.empty_string) + } + } else { + ReturnState(STATE_ERROR, R.string.password_no_match) + } } else { - ReturnState(STATE_ERROR, R.string.password_no_match) + ReturnState(STATE_ERROR, R.string.field_empty) } } From 844d568a96dee1e373d3cfe2616bc68e3e197c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20=C3=87akar?= Date: Sat, 28 Dec 2024 00:10:59 +0300 Subject: [PATCH 2/4] Fix formatting issues with Spotless --- .vscode/settings.json | 3 +++ .../filemanager/ui/dialogs/EncryptAuthenticateDialog.kt | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..c5f3f6b9c7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "interactive" +} \ No newline at end of file diff --git a/app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptAuthenticateDialog.kt b/app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptAuthenticateDialog.kt index 3841007f70..57b5b8a56b 100644 --- a/app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptAuthenticateDialog.kt +++ b/app/src/main/java/com/amaze/filemanager/ui/dialogs/EncryptAuthenticateDialog.kt @@ -202,8 +202,9 @@ object EncryptAuthenticateDialog { btnOK, ) { text: String -> if (text.isNotBlank()) { - if (comparingPasswordField.text.toString().isBlank() || - text == comparingPasswordField.text.toString()) { + if (comparingPasswordField.text.toString().isBlank() || + text == comparingPasswordField.text.toString() + ) { if (filenameIsValid(encryptSaveAsEditText.text.toString(), useAzeEncrypt)) { ReturnState() } else { From c3797021f8f006ffea3fee90e7c8096b865392de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20=C3=87akar?= Date: Mon, 30 Dec 2024 16:18:23 +0300 Subject: [PATCH 3/4] change updateBuildConfiguration: automatic --- .vscode/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index c5f3f6b9c7..e0f15db2eb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "java.configuration.updateBuildConfiguration": "interactive" + "java.configuration.updateBuildConfiguration": "automatic" } \ No newline at end of file From b9e642874fc5cbd5e9ff5a041f7fff7b9e0f0c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20=C3=87akar?= Date: Tue, 31 Dec 2024 10:48:06 +0300 Subject: [PATCH 4/4] edit --- .vscode/settings.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index e0f15db2eb..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "java.configuration.updateBuildConfiguration": "automatic" -} \ No newline at end of file