From af068349e45733594a1b669b29489c60b2afb98d Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Fri, 12 Sep 2025 14:14:06 +0200 Subject: [PATCH 1/2] fix: Upgrade to 4.1.8 --- CHANGELOG | 8 ++++++++ app/build.gradle | 4 ++-- fastlane/metadata/android/en-US/changelogs/141.txt | 6 ++++++ fastlane/metadata/android/fr-FR/changelogs/141.txt | 6 ++++++ 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/141.txt create mode 100644 fastlane/metadata/android/fr-FR/changelogs/141.txt diff --git a/CHANGELOG b/CHANGELOG index 6acc3f201..23aeb1c88 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,11 @@ +KeePassDX(4.1.8) + * Updated to API 35 minimum SDK 19 #2073 #2138 #2067 #2133 #1687 (Thx @Dev-ClayP) + * Remember last read-only state #2099 #2100 (Thx @rmacklin) + * Fix merge deletion #1516 + * Fix space in search #175 + * Fix deletable recycle bin #2163 + * Small fixes + KeePassDX(4.1.7) * Fix CipherDatabase for biometric states #2119 diff --git a/app/build.gradle b/app/build.gradle index 4b5287f6a..090ae8234 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "com.kunzisoft.keepass" minSdkVersion 19 targetSdkVersion 35 - versionCode = 139 - versionName = "4.1.7" + versionCode = 141 + versionName = "4.1.8" multiDexEnabled true testApplicationId = "com.kunzisoft.keepass.tests" diff --git a/fastlane/metadata/android/en-US/changelogs/141.txt b/fastlane/metadata/android/en-US/changelogs/141.txt new file mode 100644 index 000000000..7316a4d1f --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/141.txt @@ -0,0 +1,6 @@ + * Updated to API 35 minimum SDK 19 #2073 #2138 #2067 #2133 #1687 (Thx @Dev-ClayP) + * Remember last read-only state #2099 #2100 (Thx @rmacklin) + * Fix merge deletion #1516 + * Fix space in search #175 + * Fix deletable recycle bin #2163 + * Small fixes \ No newline at end of file diff --git a/fastlane/metadata/android/fr-FR/changelogs/141.txt b/fastlane/metadata/android/fr-FR/changelogs/141.txt new file mode 100644 index 000000000..c89f4045d --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/141.txt @@ -0,0 +1,6 @@ + * Mise à jour vers API 35 minimum SDK 19 #2073 #2138 #2067 #2133 #1687 (Thx @Dev-ClayP) + * Sauvegarde du dernier état lecture seule #2099 #2100 (Thx @rmacklin) + * Correction de la suppression lors d'un merge #1516 + * Correction des espaces dans la recherche #175 + * Correction de la poubelle supprimable #2163 + * Petites corrections \ No newline at end of file From da8ef9340cf4f96dda5f9277e2c22149576e259e Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Fri, 12 Sep 2025 15:23:32 +0200 Subject: [PATCH 2/2] fix: Loading ViewModel --- .../activities/MainCredentialActivity.kt | 67 ++++++++++--------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt b/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt index cd45b54a3..4bca99154 100644 --- a/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt +++ b/app/src/main/java/com/kunzisoft/keepass/activities/MainCredentialActivity.kt @@ -43,6 +43,7 @@ import androidx.biometric.BiometricManager import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.fragment.app.commit import androidx.lifecycle.Lifecycle +import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import com.google.android.material.snackbar.Snackbar @@ -75,8 +76,8 @@ import com.kunzisoft.keepass.services.DatabaseTaskNotificationService.Companion. import com.kunzisoft.keepass.services.DatabaseTaskNotificationService.Companion.DATABASE_URI_KEY import com.kunzisoft.keepass.services.DatabaseTaskNotificationService.Companion.MAIN_CREDENTIAL_KEY import com.kunzisoft.keepass.services.DatabaseTaskNotificationService.Companion.READ_ONLY_KEY -import com.kunzisoft.keepass.settings.DeviceUnlockSettingsActivity import com.kunzisoft.keepass.settings.AppearanceSettingsActivity +import com.kunzisoft.keepass.settings.DeviceUnlockSettingsActivity import com.kunzisoft.keepass.settings.PreferencesUtil import com.kunzisoft.keepass.tasks.ActionRunnable import com.kunzisoft.keepass.utils.BACK_PREVIOUS_KEYBOARD_ACTION @@ -107,7 +108,11 @@ class MainCredentialActivity : DatabaseModeActivity() { private var deviceUnlockFragment: DeviceUnlockFragment? = null private val mDatabaseFileViewModel: DatabaseFileViewModel by viewModels() - private val mDeviceUnlockViewModel: DeviceUnlockViewModel by viewModels() + private val mDeviceUnlockViewModel: DeviceUnlockViewModel? by lazy { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + ViewModelProvider(this)[DeviceUnlockViewModel::class.java] + } else null + } private val mPasswordActivityEducation = PasswordActivityEducation(this) @@ -177,7 +182,7 @@ class MainCredentialActivity : DatabaseModeActivity() { // Listen password checkbox to init advanced unlock and confirmation button mainCredentialView?.onConditionToStoreCredentialChanged = { _, verified -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - mDeviceUnlockViewModel.checkConditionToStoreCredential( + mDeviceUnlockViewModel?.checkConditionToStoreCredential( condition = verified ) } @@ -242,29 +247,31 @@ class MainCredentialActivity : DatabaseModeActivity() { lifecycleScope.launch { repeatOnLifecycle(Lifecycle.State.STARTED) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - mDeviceUnlockViewModel.uiState.collect { uiState -> - // New value received - uiState.credentialRequiredCipher?.let { cipher -> - mDeviceUnlockViewModel.encryptCredential( - credential = getCredentialForEncryption(), - cipher = cipher - ) - } - uiState.cipherEncryptDatabase?.let { cipherEncryptDatabase -> - onCredentialEncrypted(cipherEncryptDatabase) - mDeviceUnlockViewModel.consumeCredentialEncrypted() - } - uiState.cipherDecryptDatabase?.let { cipherDecryptDatabase -> - onCredentialDecrypted(cipherDecryptDatabase) - mDeviceUnlockViewModel.consumeCredentialDecrypted() - } - uiState.exception?.let { error -> - Snackbar.make( - coordinatorLayout, - deviceUnlockError(error, this@MainCredentialActivity), - Snackbar.LENGTH_LONG - ).asError().show() - mDeviceUnlockViewModel.exceptionShown() + mDeviceUnlockViewModel?.let { deviceUnlockViewModel -> + deviceUnlockViewModel.uiState.collect { uiState -> + // New value received + uiState.credentialRequiredCipher?.let { cipher -> + deviceUnlockViewModel.encryptCredential( + credential = getCredentialForEncryption(), + cipher = cipher + ) + } + uiState.cipherEncryptDatabase?.let { cipherEncryptDatabase -> + onCredentialEncrypted(cipherEncryptDatabase) + deviceUnlockViewModel.consumeCredentialEncrypted() + } + uiState.cipherDecryptDatabase?.let { cipherDecryptDatabase -> + onCredentialDecrypted(cipherDecryptDatabase) + deviceUnlockViewModel.consumeCredentialDecrypted() + } + uiState.exception?.let { error -> + Snackbar.make( + coordinatorLayout, + deviceUnlockError(error, this@MainCredentialActivity), + Snackbar.LENGTH_LONG + ).asError().show() + deviceUnlockViewModel.exceptionShown() + } } } } @@ -517,7 +524,7 @@ class MainCredentialActivity : DatabaseModeActivity() { } else { // Init Biometric elements if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - mDeviceUnlockViewModel.connect(databaseFileUri) + mDeviceUnlockViewModel?.connect(databaseFileUri) } } @@ -661,7 +668,7 @@ class MainCredentialActivity : DatabaseModeActivity() { try { menu.findItem(R.id.menu_open_file_read_mode_key) } catch (e: Exception) { - Log.e(TAG, "Unable to find read mode menu") + Log.e(TAG, "Unable to find read mode menu", e) } performedNextEducation(menu) }, @@ -690,7 +697,7 @@ class MainCredentialActivity : DatabaseModeActivity() { }) } } - } catch (ignored: Exception) {} + } catch (_: Exception) {} } } @@ -727,7 +734,7 @@ class MainCredentialActivity : DatabaseModeActivity() { override fun onDestroy() { super.onDestroy() if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - mDeviceUnlockViewModel.disconnect() + mDeviceUnlockViewModel?.disconnect() } }