From 7776dd6af401655d505f398d45af9921f935a043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Fri, 7 Jul 2023 16:48:22 +0200 Subject: [PATCH] Make password dialog behavior the same as with protected PDFs --- app/build.gradle | 2 +- .../filemanager/pro/activities/DecompressActivity.kt | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 27fdbdfa..ce63b924 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -64,7 +64,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:db25f91be3' + implementation 'com.github.SimpleMobileTools:Simple-Commons:a8693482e8' implementation 'com.github.tibbi:AndroidPdfViewer:e6a533125b' implementation 'com.github.Stericson:RootTools:df729dcb13' implementation 'com.github.Stericson:RootShell:1.6' diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt index 415f4255..a1e73c1c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt @@ -29,6 +29,7 @@ class DecompressActivity : SimpleActivity() { private var currentPath = "" private var uri: Uri? = null private var password: String? = null + private var passwordDialog: EnterPasswordDialog? = null override fun onCreate(savedInstanceState: Bundle?) { isMaterialActivity = true @@ -195,7 +196,7 @@ class DecompressActivity : SimpleActivity() { if (passwordException.type == Type.WRONG_PASSWORD) { if (password != null) { showErrorToast(getString(R.string.invalid_password)) - finish() + passwordDialog?.clearPassword() } else { askForPassword() } @@ -216,10 +217,11 @@ class DecompressActivity : SimpleActivity() { val listItem = ListItem(filename, filename.getFilenameFromPath(), zipEntry.isDirectory, 0, 0L, lastModified, false, false) allFiles.add(listItem) } + passwordDialog?.dismiss(notify = false) } private fun askForPassword() { - EnterPasswordDialog( + passwordDialog = EnterPasswordDialog( this, callback = { newPassword -> password = newPassword