From a680db97070253d3dd2f54335d2773fa3eb3fff5 Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Tue, 12 Aug 2025 15:20:32 +0200 Subject: [PATCH] fix: initDecryptData #2105 --- .../keepass/biometric/DeviceUnlockManager.kt | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/kunzisoft/keepass/biometric/DeviceUnlockManager.kt b/app/src/main/java/com/kunzisoft/keepass/biometric/DeviceUnlockManager.kt index 6f4df8dcd..769838a8f 100644 --- a/app/src/main/java/com/kunzisoft/keepass/biometric/DeviceUnlockManager.kt +++ b/app/src/main/java/com/kunzisoft/keepass/biometric/DeviceUnlockManager.kt @@ -196,15 +196,8 @@ class DeviceUnlockManager(private var appContext: Context) { @Synchronized fun initDecryptData( ivSpecValue: ByteArray, + firstLaunch: Boolean = true, actionIfCypherInit: (cryptoPrompt: DeviceUnlockCryptoPrompt) -> Unit - ) { - initDecryptData(ivSpecValue, actionIfCypherInit, true) - } - - @Synchronized private fun initDecryptData( - ivSpecValue: ByteArray, - actionIfCypherInit: (cryptoPrompt: DeviceUnlockCryptoPrompt) -> Unit, - firstLaunch: Boolean ) { try { // important to restore spec here that was used for decryption @@ -232,7 +225,7 @@ class DeviceUnlockManager(private var appContext: Context) { Log.e(TAG, "Unable to initialize decrypt data", unrecoverableKeyException) if (firstLaunch) { deleteKeystoreKey() - initDecryptData(ivSpecValue, actionIfCypherInit, firstLaunch) + initDecryptData(ivSpecValue, false, actionIfCypherInit) } else { throw unrecoverableKeyException } @@ -240,7 +233,7 @@ class DeviceUnlockManager(private var appContext: Context) { Log.e(TAG, "Unable to initialize decrypt data", invalidKeyException) if (firstLaunch) { deleteAllEntryKeysInKeystoreForBiometric(appContext) - initDecryptData(ivSpecValue, actionIfCypherInit, firstLaunch) + initDecryptData(ivSpecValue, false, actionIfCypherInit) } else { throw invalidKeyException }