mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
fix: initDecryptData #2105
This commit is contained in:
@@ -134,12 +134,12 @@ class DeviceUnlockManager(private var appContext: Context) {
|
|||||||
@Synchronized fun initEncryptData(
|
@Synchronized fun initEncryptData(
|
||||||
actionIfCypherInit: (cryptoPrompt: DeviceUnlockCryptoPrompt) -> Unit
|
actionIfCypherInit: (cryptoPrompt: DeviceUnlockCryptoPrompt) -> Unit
|
||||||
) {
|
) {
|
||||||
initEncryptData(actionIfCypherInit, true)
|
initEncryptData(true, actionIfCypherInit)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Synchronized private fun initEncryptData(
|
@Synchronized private fun initEncryptData(
|
||||||
actionIfCypherInit: (cryptoPrompt: DeviceUnlockCryptoPrompt) -> Unit,
|
firstLaunch: Boolean,
|
||||||
firstLaunch: Boolean
|
actionIfCypherInit: (cryptoPrompt: DeviceUnlockCryptoPrompt) -> Unit
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
getSecretKey()?.let { secretKey ->
|
getSecretKey()?.let { secretKey ->
|
||||||
@@ -168,7 +168,7 @@ class DeviceUnlockManager(private var appContext: Context) {
|
|||||||
Log.e(TAG, "Unable to initialize encrypt data", invalidKeyException)
|
Log.e(TAG, "Unable to initialize encrypt data", invalidKeyException)
|
||||||
if (firstLaunch) {
|
if (firstLaunch) {
|
||||||
deleteAllEntryKeysInKeystoreForBiometric(appContext)
|
deleteAllEntryKeysInKeystoreForBiometric(appContext)
|
||||||
initEncryptData(actionIfCypherInit, false)
|
initEncryptData(false, actionIfCypherInit)
|
||||||
} else {
|
} else {
|
||||||
throw invalidKeyException
|
throw invalidKeyException
|
||||||
}
|
}
|
||||||
@@ -195,6 +195,13 @@ class DeviceUnlockManager(private var appContext: Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Synchronized fun initDecryptData(
|
@Synchronized fun initDecryptData(
|
||||||
|
ivSpecValue: ByteArray,
|
||||||
|
actionIfCypherInit: (cryptoPrompt: DeviceUnlockCryptoPrompt) -> Unit
|
||||||
|
) {
|
||||||
|
initDecryptData(ivSpecValue, true, actionIfCypherInit)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Synchronized private fun initDecryptData(
|
||||||
ivSpecValue: ByteArray,
|
ivSpecValue: ByteArray,
|
||||||
firstLaunch: Boolean = true,
|
firstLaunch: Boolean = true,
|
||||||
actionIfCypherInit: (cryptoPrompt: DeviceUnlockCryptoPrompt) -> Unit
|
actionIfCypherInit: (cryptoPrompt: DeviceUnlockCryptoPrompt) -> Unit
|
||||||
|
|||||||
Reference in New Issue
Block a user