[BUG] Biometric unlock of database lose key file config
Checks
- [x] I have read the FAQ section, searched the open issues, and still think this is a new bug.
Describe the bug you encountered:
Since the last 1.12-r5 version installed from the beta program on play store, when I enable biometric full unlock for my database the app sometime forget to use the key file and the fingerprint unlock then fails. I then have to select again the key file and enter my password. I'm on a Pixel 7 with Android 15.
Describe what you expected to happen:
No response
What version of Keepass2Android are you using?
1.12-r5
Which version of Android are you on?
15
I confirm this bug since 1.12-r5 Also on pixel 7 with android 15.
Here are the logs of the error :
12/05/2025 23:55:25:786 -- CFS: OpenWhenNoLocalChanges
12/05/2025 23:55:25:787 -- CFS: hashing cached version
12/05/2025 23:55:25:843 -- PasswordModeSpinner item selected: 0
12/05/2025 23:55:25:843 -- PasswordModeSpinner item selected: 0
12/05/2025 23:55:26:347 -- SelectCurrentDbActivity.OnStop 1
12/05/2025 23:55:26:348 -- FileSelect.OnStop
12/05/2025 23:55:26:378 -- FileSelect.OnDestroyTrue
12/05/2025 23:55:26:379 -- SelectCurrentDbActivity.OnStop 2
12/05/2025 23:55:26:380 -- SelectCurrentDbActivity.OnDestroyTrue 2
12/05/2025 23:55:26:381 -- FileSelect.OnStop
12/05/2025 23:55:26:403 -- FileSelect.OnDestroyTrue
12/05/2025 23:55:27:636 -- FP: Decrypting
12/05/2025 23:55:27:645 -- GeneralSecurityException in DecryptStored
12/05/2025 23:55:27:666 -- Java.Security.GeneralSecurityException: Exception_WasThrown, Java.Security.GeneralSecurityException
---> Java.Lang.Exception: Key user not authenticated (internal Keystore code: -26 message: system/security/keystore2/src/operation.rs:835: KeystoreOperation::update
Caused by:
0: system/security/keystore2/src/operation.rs:385: Trying to get auth tokens.
1: In AuthInfo::get_auth_tokens.
2: system/security/keystore2/src/enforcements.rs:90: No operation auth token received.
3: Error::Km(r#KEY_USER_NOT_AUTHENTICATED))
--- End of managed Java.Lang.Exception stack trace ---
android.security.KeyStoreException: Key user not authenticated (internal Keystore code: -26 message: system/security/keystore2/src/operation.rs:835: KeystoreOperation::update
Caused by:
0: system/security/keystore2/src/operation.rs:385: Trying to get auth tokens.
1: In AuthInfo::get_auth_tokens.
2: system/security/keystore2/src/enforcements.rs:90: No operation auth token received.
3: Error::Km(r#KEY_USER_NOT_AUTHENTICATED)) (public error code: 2 internal Keystore code: -26)
at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:428)
at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:79)
at android.security.KeyStoreOperation.update(KeyStoreOperation.java:118)
at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.update(KeyStoreCryptoOperationChunkedStreamer.java:222)
at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.update(KeyStoreCryptoOperationChunkedStreamer.java:156)
at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:179)
at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:624)
at javax.crypto.Cipher.doFinal(Cipher.java:2074)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:31)
at android.os.Handler.handleCallback(Handler.java:991)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8934)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
--- End of managed Java.Lang.Exception stack trace ---
android.security.KeyStoreException: Key user not authenticated (internal Keystore code: -26 message: system/security/keystore2/src/operation.rs:835: KeystoreOperation::update
Caused by:
0: system/security/keystore2/src/operation.rs:385: Trying to get auth tokens.
1: In AuthInfo::get_auth_tokens.
2: system/security/keystore2/src/enforcements.rs:90: No operation auth token received.
3: Error::Km(r#KEY_USER_NOT_AUTHENTICATED)) (public error code: 2 internal Keystore code: -26)
at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:428)
at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:79)
at android.security.KeyStoreOperation.update(KeyStoreOperation.java:118)
at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.update(KeyStoreCryptoOperationChunkedStreamer.java:222)
at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.update(KeyStoreCryptoOperationChunkedStreamer.java:156)
at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:179)
at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:624)
at javax.crypto.Cipher.doFinal(Cipher.java:2074)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:31)
at android.os.Handler.handleCallback(Handler.java:991)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8934)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
Exception_EndOfInnerExceptionStack
at Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualObjectMethod(JniObjectReference , JniObjectReference , JniMethodInfo , JniArgumentValue* )
at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeNonvirtualObjectMethod(String , IJavaPeerable , JniArgumentValue* )
at Javax.Crypto.Cipher.DoFinal(Byte[] )
at keepass2android.BiometricDecryption.Decrypt(String encryted)
at keepass2android.BiometricDecryption.DecryptStored(String prefKey)
at keepass2android.PasswordActivity.OnBiometricAuthSucceeded()
--- End of managed Java.Security.GeneralSecurityException stack trace ---
javax.crypto.IllegalBlockSizeException
at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:634)
at javax.crypto.Cipher.doFinal(Cipher.java:2074)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:31)
at android.os.Handler.handleCallback(Handler.java:991)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8934)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
Caused by: android.security.KeyStoreException: Key user not authenticated (internal Keystore code: -26 message: system/security/keystore2/src/operation.rs:835: KeystoreOperation::update
Caused by:
0: system/security/keystore2/src/operation.rs:385: Trying to get auth tokens.
1: In AuthInfo::get_auth_tokens.
2: system/security/keystore2/src/enforcements.rs:90: No operation auth token received.
3: Error::Km(r#KEY_USER_NOT_AUTHENTICATED)) (public error code: 2 internal Keystore code: -26)
at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:428)
at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:79)
at android.security.KeyStoreOperation.update(KeyStoreOperation.java:118)
at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.update(KeyStoreCryptoOperationChunkedStreamer.java:222)
at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.update(KeyStoreCryptoOperationChunkedStreamer.java:156)
at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:179)
at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:624)
... 11 more
--- End of managed Java.Security.GeneralSecurityException stack trace ---
javax.crypto.IllegalBlockSizeException
at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:634)
at javax.crypto.Cipher.doFinal(Cipher.java:2074)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:31)
at android.os.Handler.handleCallback(Handler.java:991)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8934)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
Caused by: android.security.KeyStoreException: Key user not authenticated (internal Keystore code: -26 message: system/security/keystore2/src/operation.rs:835: KeystoreOperation::update
Caused by:
0: system/security/keystore2/src/operation.rs:385: Trying to get auth tokens.
1: In AuthInfo::get_auth_tokens.
2: system/security/keystore2/src/enforcements.rs:90: No operation auth token received.
3: Error::Km(r#KEY_USER_NOT_AUTHENTICATED)) (public error code: 2 internal Keystore code: -26)
at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:428)
at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:79)
at android.security.KeyStoreOperation.update(KeyStoreOperation.java:118)
at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.update(KeyStoreCryptoOperationChunkedStreamer.java:222)
at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.update(KeyStoreCryptoOperationChunkedStreamer.java:156)
at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:179)
at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:624)
... 11 more
12/05/2025 23:55:27:712 -- parsing autofillStructure...
12/05/2025 23:55:27:716 -- Parsing done
12/05/2025 23:55:27:717 -- cannot autofill
12/05/2025 23:55:29:838 -- CFS: Files in Sync
12/05/2025 23:55:29:888 -- Pre-loading database file completed
12/05/2025 23:55:34:340 -- PasswordActivity.OnPause 3
12/05/2025 23:55:34:399 -- AppSettingsActivity.OnCreate 4
12/05/2025 23:55:34:399 -- AppSettingsActivity:apptask= 4
12/05/2025 23:55:34:405 -- AppSettingsActivity.OnStart 4
12/05/2025 23:55:34:406 -- AppSettingsActivity.OnResume 4
12/05/2025 23:55:34:406 -- DB null 4
12/05/2025 23:55:34:921 -- PasswordActivity.OnStop 3
12/05/2025 23:55:36:809 -- AppSettingsActivity.OnPause 4
12/05/2025 23:55:37:391 -- AppSettingsActivity.OnStop 4
12/05/2025 23:55:39:824 -- AppSettingsActivity.OnStart 4
12/05/2025 23:55:39:825 -- AppSettingsActivity.OnResume 4
12/05/2025 23:55:39:825 -- DB null 4
12/05/2025 23:55:44:767 -- AppSettingsActivity.OnPause 4
12/05/2025 23:55:49:232 -- AppSettingsActivity.OnResume 4
12/05/2025 23:55:49:232 -- DB null 4
12/05/2025 23:55:50:494 -- AppSettingsActivity.OnPause 4
12/05/2025 23:55:50:982 -- AppSettingsActivity.OnStop 4
12/05/2025 23:56:06:512 -- parsing autofillStructure...
12/05/2025 23:56:06:513 -- Parsing done
12/05/2025 23:56:06:514 -- cannot autofill
12/05/2025 23:56:37:263 -- parsing autofillStructure...
12/05/2025 23:56:37:267 -- DAL verification failed for com.foxdebug.acodefree/localhost
12/05/2025 23:56:37:268 -- Parsing done
12/05/2025 23:56:37:268 -- cannot autofill
The issue lies in the pixel android os. The may-2025 update should fix the issue: https://issuetracker.google.com/issues/401226624
It does not fix this issue on my Pixel 7a with the May-2025 update (build BP1A.250505.005.B1)
Can confirm the bug in version 1.12-r5 on Samsung Galaxy S20 FE 5G (Android 13, april 2025 update - and prior version) as well. Bio-Unlock for "password + keyfile" works, but after some time, it flips back to "password only". Then bio-unlock tries to unlock it without the keyfile and fails.
So please don't investigate in this as just an pixel 7 os problem :) Thank You :)
I would suggest to attach the application log when you have a moment or for the futur comment as having the log makes it much easier for devs to reproduce and diagnose the problem—especially when various device model are involved.
To enable the log:
- 3 top left dots
- settings
- App
- log
- use file log
Then later when the biometric fails, same steps with send logs
You're right, here we go.
Additional info: after bio-unlock failed because of missing key file, login method automatically switched back to "password + key file", but without bio-unlock :)
Same issue here on a Motorola Edge 30 Neo, Biometric unlock fails a couple of hours after enabling it.
Details
26/05/2025 17:38:43:178 -- DatabaseSettingsActivity.OnPause 9
26/05/2025 17:38:43:181 -- Timeout start 26/05/2025 17:38:43:190 -- GroupActivity.OnStart 7 26/05/2025 17:38:43:191 -- GroupActivity.OnResume 7 26/05/2025 17:38:43:191 -- DatabaseIsUnlocked=True 7 26/05/2025 17:38:43:191 -- Timeout cancel 26/05/2025 17:38:43:744 -- DatabaseSettingsActivity.OnStop 9 26/05/2025 17:38:43:747 -- DatabaseSettingsActivity.OnDestroyTrue 9 26/05/2025 17:38:46:75 -- Locking database 26/05/2025 17:38:46:115 -- OngoingNotificationsService.OnDestroy 26/05/2025 17:38:46:118 -- Finishing crc64c98c008c0cd742cb.GroupActivity due to database lock 26/05/2025 17:38:46:120 -- GroupActivity.OnPause 7 26/05/2025 17:38:46:131 -- SelectCurrentDbActivity.OnStart 5 26/05/2025 17:38:46:132 -- SelectCurrentDbActivity 5: OnActivityResult FirstUser/0 26/05/2025 17:38:46:132 -- TryGetFromActivityResult: no data 26/05/2025 17:38:46:133 -- SelectCurrentDbActivity.OnResume 5 26/05/2025 17:38:46:133 -- DB null 5 26/05/2025 17:38:46:157 -- SelectCurrentDbActivity.OnPause 5 26/05/2025 17:38:46:179 -- FileSelect.OnCreate 26/05/2025 17:38:46:202 -- FileSelect.OnStart 26/05/2025 17:38:46:231 -- PasswordActivity.OnCreate 10 26/05/2025 17:38:46:232 -- PasswordActivity:apptask= 10 26/05/2025 17:38:46:281 -- GetIocFromLaunchIntent() 26/05/2025 17:38:46:281 -- no keyprovider specified 26/05/2025 17:38:46:282 -- Reset keyfile 26/05/2025 17:38:46:294 -- PasswordActivity.OnStart 10 26/05/2025 17:38:46:295 -- FP: Create BiometricDecryption 26/05/2025 17:38:46:295 -- FP: Init for Dec 26/05/2025 17:38:46:298 -- alias: keepass2android.kp2a_ioc_2D93EED3628C8DD14F134423D3FFB6E18D72F83F16E1081571C3B23AC90E0535 26/05/2025 17:38:46:298 -- KS: end aliases 26/05/2025 17:38:46:318 -- Fingerprint: StartListening 26/05/2025 17:38:46:322 -- PasswordActivity.OnResume 10 26/05/2025 17:38:46:322 -- DB null 10 26/05/2025 17:38:46:323 -- starting: True, Finishing: False, _performingLoad: False 26/05/2025 17:38:46:338 -- content://Klirre-sync.kdbx isCached = True 26/05/2025 17:38:46:339 -- Pre-loading database file starting 26/05/2025 17:38:46:363 -- content://Klirre-sync.kdbx isCached = True 26/05/2025 17:38:46:382 -- content://Klirre-sync.kdbx localVersionHash = 2332709F8CD81647FAB2A5BD2A6A387ADE49508BA139FC3B3B85EC2496D38D28 26/05/2025 17:38:46:412 -- PasswordModeSpinner item selected: 0 26/05/2025 17:38:46:413 -- content://Klirre-sync.kdbx baseVersionHash = 2332709F8CD81647FAB2A5BD2A6A387ADE49508BA139FC3B3B85EC2496D38D28 26/05/2025 17:38:46:413 -- CFS: OpenWhenNoLocalChanges 26/05/2025 17:38:46:415 -- CFS: hashing cached version 26/05/2025 17:38:46:438 -- content://Klirre-sync.kdbx isCached = True 26/05/2025 17:38:46:438 -- keepass2android.Io.OfflineModeException: Working offline. at keepass2android.Io.OfflineSwitchableFileStorage.AssertOnline() at keepass2android.Io.OfflineSwitchableFileStorage.OpenFileForRead(IOConnectionInfo ioc) at keepass2android.Io.CachingFileStorage.UpdateCacheFromRemote(IOConnectionInfo ioc, String cachedFilePath) at keepass2android.Io.CachingFileStorage.OpenFileForReadWhenNoLocalChanges(IOConnectionInfo ioc, String cachedFilePath) at keepass2android.Io.CachingFileStorage.OpenFileForRead(IOConnectionInfo ioc) 26/05/2025 17:38:46:444 -- Pre-loading database file completed 26/05/2025 17:38:46:958 -- GroupActivity.OnStop 7 26/05/2025 17:38:46:960 -- GroupActivity.OnDestroyTrue 7 26/05/2025 17:38:46:992 -- SelectCurrentDbActivity.OnStop 5 26/05/2025 17:38:46:993 -- FileSelect.OnStop 26/05/2025 17:38:47:17 -- FileSelect.OnDestroyTrue 26/05/2025 17:38:48:237 -- Fingerprint: StopListening having prompt 26/05/2025 17:38:48:239 -- PasswordActivity.OnPause 10 26/05/2025 17:38:48:298 -- PasswordActivity.OnStop 10 26/05/2025 17:38:49:484 -- PasswordActivity.OnStart 10 26/05/2025 17:38:49:485 -- PasswordActivity.OnResume 10 26/05/2025 17:38:49:485 -- DB null 10 26/05/2025 17:38:49:488 -- starting: True, Finishing: False, _performingLoad: False 26/05/2025 17:38:49:511 -- content://Klirre-sync.kdbx isCached = True 26/05/2025 17:38:49:624 -- parsing autofillStructure... 26/05/2025 17:38:49:625 -- Parsing done 26/05/2025 17:38:49:625 -- cannot autofill 26/05/2025 17:38:52:518 -- Fingerprint: StopListening having prompt 26/05/2025 17:38:52:520 -- PasswordActivity.OnPause 10 26/05/2025 17:38:52:526 -- PasswordActivity.OnStop 10 26/05/2025 17:38:52:604 -- SelectCurrentDbActivity.OnDestroyTrue 5 26/05/2025 17:38:52:610 -- PasswordActivity.OnDestroyTrue 10 26/05/2025 17:41:36:730 -- SelectCurrentDbActivity.OnDestroyTrue 1 26/05/2025 17:42:20:637 -- Creating application keepass2android.keepass2android. Version=206 26/05/2025 17:42:20:751 -- parsing autofillStructure... 26/05/2025 17:42:20:763 -- Parsing done 26/05/2025 17:42:20:765 -- cannot autofill 26/05/2025 17:49:11:182 -- parsing autofillStructure... 26/05/2025 17:49:11:183 -- Parsing done 26/05/2025 17:49:11:185 -- cannot autofill 26/05/2025 19:01:38:338 -- Creating application keepass2android.keepass2android. Version=206 26/05/2025 19:01:38:501 -- parsing autofillStructure... 26/05/2025 19:01:38:509 -- Parsing done 26/05/2025 19:01:38:518 -- AF: (query.IncompatiblePackageAndDomain == false) 26/05/2025 19:01:38:520 -- AF: BuildEntryDatasets 26/05/2025 19:01:38:529 -- AF: BuildEntryDatasets found 0 entries 26/05/2025 19:01:38:650 -- return autofill success 26/05/2025 19:01:39:330 -- ChooseForAutofillActivityBase.OnCreate 26/05/2025 19:01:39:370 -- ChooseForAutofillActivityBase: ExtraDisplayWarning = None 26/05/2025 19:01:39:519 -- SelectCurrentDbActivity.OnCreate 0 26/05/2025 19:01:39:520 -- SelectCurrentDbActivity:apptask= 0 26/05/2025 19:01:39:550 -- Loaded task keepass2android.SearchUrlTask 26/05/2025 19:01:39:551 -- Task in activity SelectCurrentDbActivity 0 changed to SearchUrlTask 26/05/2025 19:01:39:565 -- SelectCurrentDbActivity.OnStart 0 26/05/2025 19:01:39:568 -- SelectCurrentDbActivity.OnResume 0 26/05/2025 19:01:39:569 -- DB null 0 26/05/2025 19:01:39:584 -- SelectCurrentDbActivity.OnPause 0 26/05/2025 19:01:39:606 -- FileSelect.OnCreate 26/05/2025 19:01:39:705 -- FileSelect.OnStart 26/05/2025 19:01:39:856 -- SelectCurrentDbActivity.OnStop 0 26/05/2025 19:01:39:858 -- SelectCurrentDbActivity.OnDestroyFalse 0 26/05/2025 19:01:39:864 -- SelectCurrentDbActivity.OnCreate 1 26/05/2025 19:01:39:865 -- SelectCurrentDbActivity:apptask= 1 26/05/2025 19:01:39:871 -- Loaded task keepass2android.NullTask 26/05/2025 19:01:39:871 -- Task in activity SelectCurrentDbActivity 1 changed to NullTask 26/05/2025 19:01:39:873 -- SelectCurrentDbActivity.OnStart 1 26/05/2025 19:01:39:876 -- SelectCurrentDbActivity.OnResume 1 26/05/2025 19:01:39:876 -- DB null 1 26/05/2025 19:01:39:884 -- SelectCurrentDbActivity.OnPause 1 26/05/2025 19:01:39:889 -- ChooseForAutofillActivityBase.OnCreate 26/05/2025 19:01:39:890 -- ChooseForAutofillActivityBase: ExtraDisplayWarning = None 26/05/2025 19:01:39:922 -- SelectCurrentDbActivity.OnCreate 2 26/05/2025 19:01:39:922 -- SelectCurrentDbActivity:apptask= 2 26/05/2025 19:01:39:927 -- Loaded task keepass2android.SearchUrlTask 26/05/2025 19:01:39:927 -- Task in activity SelectCurrentDbActivity 2 changed to SearchUrlTask 26/05/2025 19:01:39:929 -- SelectCurrentDbActivity.OnStart 2 26/05/2025 19:01:39:931 -- SelectCurrentDbActivity.OnResume 2 26/05/2025 19:01:39:931 -- DB null 2 26/05/2025 19:01:39:940 -- SelectCurrentDbActivity.OnPause 2 26/05/2025 19:01:39:954 -- FileSelect.OnCreate 26/05/2025 19:01:39:980 -- FileSelect.OnStart 26/05/2025 19:01:40:12 -- PasswordActivity.OnCreate 3 26/05/2025 19:01:40:13 -- PasswordActivity:apptask= 3 26/05/2025 19:01:40:142 -- GetIocFromLaunchIntent() 26/05/2025 19:01:40:142 -- no keyprovider specified 26/05/2025 19:01:40:144 -- Reset keyfile 26/05/2025 19:01:40:576 -- PasswordActivity.OnStart 3 26/05/2025 19:01:40:584 -- FP: Create BiometricDecryption 26/05/2025 19:01:40:593 -- FP: Init for Dec 26/05/2025 19:01:40:597 -- alias: keepass2android.kp2a_ioc_2D93EED3628C8DD14F134423D3FFB6E18D72F83F16E1081571C3B23AC90E0535 26/05/2025 19:01:40:598 -- KS: end aliases 26/05/2025 19:01:40:647 -- Fingerprint: StartListening 26/05/2025 19:01:40:699 -- PasswordActivity.OnNewIntent 3 26/05/2025 19:01:40:701 -- GetIocFromLaunchIntent() 26/05/2025 19:01:40:701 -- no keyprovider specified 26/05/2025 19:01:40:701 -- Reset keyfile 26/05/2025 19:01:40:718 -- PasswordActivity.OnStart 3 26/05/2025 19:01:40:719 -- FP: Create BiometricDecryption 26/05/2025 19:01:40:720 -- FP: Init for Dec 26/05/2025 19:01:40:724 -- alias: keepass2android.kp2a_ioc_2D93EED3628C8DD14F134423D3FFB6E18D72F83F16E1081571C3B23AC90E0535 26/05/2025 19:01:40:724 -- KS: end aliases 26/05/2025 19:01:40:793 -- Fingerprint: StartListening 26/05/2025 19:01:40:797 -- PasswordActivity.OnResume 3 26/05/2025 19:01:40:798 -- DB null 3 26/05/2025 19:01:40:803 -- starting: True, Finishing: False, _performingLoad: False 26/05/2025 19:01:40:835 -- content://Klirre-sync.kdbx isCached = True 26/05/2025 19:01:40:887 -- Pre-loading database file starting 26/05/2025 19:01:40:917 -- content://Klirre-sync.kdbx isCached = True 26/05/2025 19:01:40:938 -- content://Klirre-sync.kdbx localVersionHash = 2332709F8CD81647FAB2A5BD2A6A387ADE49508BA139FC3B3B85EC2496D38D28 26/05/2025 19:01:40:953 -- content://Klirre-sync.kdbx baseVersionHash = 2332709F8CD81647FAB2A5BD2A6A387ADE49508BA139FC3B3B85EC2496D38D28 26/05/2025 19:01:40:953 -- CFS: OpenWhenNoLocalChanges 26/05/2025 19:01:40:954 -- CFS: hashing cached version 26/05/2025 19:01:40:991 -- content://Klirre-sync.kdbx isCached = True 26/05/2025 19:01:40:998 -- keepass2android.Io.OfflineModeException: Working offline. at keepass2android.Io.OfflineSwitchableFileStorage.AssertOnline() at keepass2android.Io.OfflineSwitchableFileStorage.OpenFileForRead(IOConnectionInfo ioc) at keepass2android.Io.CachingFileStorage.UpdateCacheFromRemote(IOConnectionInfo ioc, String cachedFilePath) at keepass2android.Io.CachingFileStorage.OpenFileForReadWhenNoLocalChanges(IOConnectionInfo ioc, String cachedFilePath) at keepass2android.Io.CachingFileStorage.OpenFileForRead(IOConnectionInfo ioc) 26/05/2025 19:01:41:96 -- PasswordModeSpinner item selected: 0 26/05/2025 19:01:41:96 -- PasswordModeSpinner item selected: 0 26/05/2025 19:01:41:108 -- Pre-loading database file completed 26/05/2025 19:01:41:718 -- SelectCurrentDbActivity.OnStop 1 26/05/2025 19:01:41:719 -- FileSelect.OnStop 26/05/2025 19:01:41:742 -- FileSelect.OnDestroyTrue 26/05/2025 19:01:41:744 -- SelectCurrentDbActivity.OnStop 2 26/05/2025 19:01:41:745 -- SelectCurrentDbActivity.OnDestroyTrue 2 26/05/2025 19:01:41:746 -- FileSelect.OnStop 26/05/2025 19:01:41:783 -- FileSelect.OnDestroyTrue 26/05/2025 19:01:42:812 -- FP: Decrypting 26/05/2025 19:01:42:826 -- GeneralSecurityException in DecryptStored 26/05/2025 19:01:42:839 -- Java.Security.GeneralSecurityException: Exception_WasThrown, Java.Security.GeneralSecurityException ---> Java.Lang.Exception: Key user not authenticated (internal Keystore code: -26 message: system/security/keystore2/src/operation.rs:836: KeystoreOperation::update
Caused by: 0: system/security/keystore2/src/operation.rs:383: Trying to get auth tokens. 1: In AuthInfo::get_auth_tokens. 2: system/security/keystore2/src/enforcements.rs:99: No operation auth token received. 3: Error::Km(r#KEY_USER_NOT_AUTHENTICATED))
--- End of managed Java.Lang.Exception stack trace --- android.security.KeyStoreException: Key user not authenticated (internal Keystore code: -26 message: system/security/keystore2/src/operation.rs:836: KeystoreOperation::update
Caused by: 0: system/security/keystore2/src/operation.rs:383: Trying to get auth tokens. 1: In AuthInfo::get_auth_tokens. 2: system/security/keystore2/src/enforcements.rs:99: No operation auth token received. 3: Error::Km(r#KEY_USER_NOT_AUTHENTICATED)) (public error code: 2 internal Keystore code: -26) at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:386) at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:78) at android.security.KeyStoreOperation.update(KeyStoreOperation.java:115) at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.update(KeyStoreCryptoOperationChunkedStreamer.java:222) at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.update(KeyStoreCryptoOperationChunkedStreamer.java:156) at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:179) at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:618) at javax.crypto.Cipher.doFinal(Cipher.java:2074) at mono.java.lang.RunnableImplementor.n_run(Native Method) at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:31) at android.os.Handler.handleCallback(Handler.java:1000) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loopOnce(Looper.java:242) at android.os.Looper.loop(Looper.java:362) at android.app.ActivityThread.main(ActivityThread.java:8393) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:992)
--- End of managed Java.Lang.Exception stack trace --- android.security.KeyStoreException: Key user not authenticated (internal Keystore code: -26 message: system/security/keystore2/src/operation.rs:836: KeystoreOperation::update
Caused by: 0: system/security/keystore2/src/operation.rs:383: Trying to get auth tokens. 1: In AuthInfo::get_auth_tokens. 2: system/security/keystore2/src/enforcements.rs:99: No operation auth token received. 3: Error::Km(r#KEY_USER_NOT_AUTHENTICATED)) (public error code: 2 internal Keystore code: -26) at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:386) at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:78) at android.security.KeyStoreOperation.update(KeyStoreOperation.java:115) at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.update(KeyStoreCryptoOperationChunkedStreamer.java:222) at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.update(KeyStoreCryptoOperationChunkedStreamer.java:156) at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:179) at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:618) at javax.crypto.Cipher.doFinal(Cipher.java:2074) at mono.java.lang.RunnableImplementor.n_run(Native Method) at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:31) at android.os.Handler.handleCallback(Handler.java:1000) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loopOnce(Looper.java:242) at android.os.Looper.loop(Looper.java:362) at android.app.ActivityThread.main(ActivityThread.java:8393) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:992)
Exception_EndOfInnerExceptionStack at Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualObjectMethod(JniObjectReference , JniObjectReference , JniMethodInfo , JniArgumentValue* ) at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeNonvirtualObjectMethod(String , IJavaPeerable , JniArgumentValue* ) at Javax.Crypto.Cipher.DoFinal(Byte[] ) at keepass2android.BiometricDecryption.Decrypt(String encryted) at keepass2android.BiometricDecryption.DecryptStored(String prefKey) at keepass2android.PasswordActivity.OnBiometricAuthSucceeded() --- End of managed Java.Security.GeneralSecurityException stack trace --- javax.crypto.IllegalBlockSizeException at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:628) at javax.crypto.Cipher.doFinal(Cipher.java:2074) at mono.java.lang.RunnableImplementor.n_run(Native Method) at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:31) at android.os.Handler.handleCallback(Handler.java:1000) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loopOnce(Looper.java:242) at android.os.Looper.loop(Looper.java:362) at android.app.ActivityThread.main(ActivityThread.java:8393) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:992) Caused by: android.security.KeyStoreException: Key user not authenticated (internal Keystore code: -26 message: system/security/keystore2/src/operation.rs:836: KeystoreOperation::update
Caused by: 0: system/security/keystore2/src/operation.rs:383: Trying to get auth tokens. 1: In AuthInfo::get_auth_tokens. 2: system/security/keystore2/src/enforcements.rs:99: No operation auth token received. 3: Error::Km(r#KEY_USER_NOT_AUTHENTICATED)) (public error code: 2 internal Keystore code: -26) at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:386) at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:78) at android.security.KeyStoreOperation.update(KeyStoreOperation.java:115) at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.update(KeyStoreCryptoOperationChunkedStreamer.java:222) at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.update(KeyStoreCryptoOperationChunkedStreamer.java:156) at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:179) at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:618) ... 11 more
--- End of managed Java.Security.GeneralSecurityException stack trace --- javax.crypto.IllegalBlockSizeException at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:628) at javax.crypto.Cipher.doFinal(Cipher.java:2074) at mono.java.lang.RunnableImplementor.n_run(Native Method) at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:31) at android.os.Handler.handleCallback(Handler.java:1000) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loopOnce(Looper.java:242) at android.os.Looper.loop(Looper.java:362) at android.app.ActivityThread.main(ActivityThread.java:8393) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:992) Caused by: android.security.KeyStoreException: Key user not authenticated (internal Keystore code: -26 message: system/security/keystore2/src/operation.rs:836: KeystoreOperation::update
Caused by: 0: system/security/keystore2/src/operation.rs:383: Trying to get auth tokens. 1: In AuthInfo::get_auth_tokens. 2: system/security/keystore2/src/enforcements.rs:99: No operation auth token received. 3: Error::Km(r#KEY_USER_NOT_AUTHENTICATED)) (public error code: 2 internal Keystore code: -26) at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:386) at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:78) at android.security.KeyStoreOperation.update(KeyStoreOperation.java:115) at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.update(KeyStoreCryptoOperationChunkedStreamer.java:222) at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.update(KeyStoreCryptoOperationChunkedStreamer.java:156) at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:179) at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:618) ... 11 more
26/05/2025 19:01:42:955 -- parsing autofillStructure... 26/05/2025 19:01:42:968 -- Parsing done 26/05/2025 19:01:42:969 -- cannot autofill 26/05/2025 19:01:50:808 -- PasswordActivity.OnPause 3 26/05/2025 19:01:50:892 -- AppSettingsActivity.OnCreate 4 26/05/2025 19:01:50:893 -- AppSettingsActivity:apptask= 4 26/05/2025 19:01:50:907 -- AppSettingsActivity.OnStart 4 26/05/2025 19:01:50:908 -- AppSettingsActivity.OnResume 4 26/05/2025 19:01:50:909 -- DB null 4 26/05/2025 19:01:51:391 -- PasswordActivity.OnStop 3 26/05/2025 19:01:54:506 -- AppSettingsActivity.OnPause 4 26/05/2025 19:01:58:62 -- AppSettingsActivity.OnResume 4 26/05/2025 19:01:58:63 -- DB null 4 26/05/2025 19:02:00:369 -- PasswordActivity.OnStart 3 26/05/2025 19:02:00:370 -- PasswordActivity.OnResume 3 26/05/2025 19:02:00:370 -- DB null 3 26/05/2025 19:02:00:371 -- starting: True, Finishing: False, _performingLoad: False 26/05/2025 19:02:00:399 -- content://Klirre-sync.kdbx isCached = True 26/05/2025 19:02:00:421 -- AppSettingsActivity.OnPause 4 26/05/2025 19:02:00:461 -- AppSettingsActivity.OnStop 4 26/05/2025 19:02:02:503 -- PasswordActivity.OnPause 3 26/05/2025 19:02:02:549 -- PasswordActivity.OnStop 3 26/05/2025 19:02:18:844 -- parsing autofillStructure... 26/05/2025 19:02:18:845 -- Parsing done 26/05/2025 19:02:18:845 -- AF: (query.IncompatiblePackageAndDomain == false) 26/05/2025 19:02:18:846 -- AF: BuildEntryDatasets 26/05/2025 19:02:18:846 -- AF: BuildEntryDatasets found 0 entries 26/05/2025 19:02:18:850 -- return autofill success 26/05/2025 19:04:13:139 -- parsing autofillStructure... 26/05/2025 19:04:13:139 -- Parsing done 26/05/2025 19:04:13:140 -- AF: (query.IncompatiblePackageAndDomain == false) 26/05/2025 19:04:13:140 -- AF: BuildEntryDatasets 26/05/2025 19:04:13:141 -- AF: BuildEntryDatasets found 0 entries 26/05/2025 19:04:13:144 -- return autofill success 26/05/2025 19:05:03:532 -- AppSettingsActivity.OnStart 4 26/05/2025 19:05:03:534 -- AppSettingsActivity.OnResume 4 26/05/2025 19:05:03:534 -- DB null 4
I've observed this both before and after applying the May update
It only seems to happen if you trigger the password entry from Gboard/chrome and the DB is locked. If you first open keepass, then unlock the DB with fingerprint, the chrome/Gboard selector works fine
No, the biometric is also revoked/the bug occurs when passing directly from the launcher
I can confirm this bug also with Version 1.12-r5 on Samsung S22 / Android 14 Patch Level March 2025.
It only seems to happen if you trigger the password entry from Gboard/chrome and the DB is locked. If you first open keepass, then unlock the DB with fingerprint, the chrome/Gboard selector works fine
I also run into the problem that the configuration changes from Passwort + keyfile to Password only, when starting Keepass via AutoFill from withing e.g. Chrome. (I don't use biometric access)
My problem is that I have imported the keyfile into the app private data of Keepass2Andorid. Once the configuration has changed to Password only there doesn't seem to be a way to restore the old config as I have not found a way to select the imported keyfile as keyfile. For security reasons the external keyfile has been deleted after the import.
Thanks to everybody for providing hints.
I've been investigating on this for a while now but I still cannot reproduce the issue on any of my devices. Can you please answer these questions:
- Are you using a "Work profile" on your Android ?
- Are you all using Gboard?
- How do you unlock the device?
- Did you try to disable KP2A's biometric unlock (settings - database settings - biometric unlock) and re-enable it?
Thanks to everybody for providing hints.
I've been investigating on this for a while now but I still cannot reproduce the issue on any of my devices. Can you please answer these questions:
* Are you using a "[Work profile](https://support.google.com/work/android/answer/6191949?hl=en&ref_topic=13624267&sjid=8073358762884405120-EU)" on your Android ? * Are you all using Gboard? * How do you unlock the device? * Did you try to disable KP2A's biometric unlock (settings - database settings - biometric unlock) and re-enable it?
Hi! Thanks for investigating, heres my replies:
- No work profile, it's my private phone and I've only got one profile.
- Yes, I use Gboard, latest update available on my Motorola Edge 30 Neo.
- I unlock using the same fingerprint that fails in K2A.
- Yes, I've tried that fix but it does not help. The biometric unlock fails and is set to off, then I get the question if I want to use biometric unlock as soon as I unlock the database manually.
If you have any other questions or suggestions It'll happily assist in any way possible.
Thanks for investigating
- No workprofile
- Yes, Gboard
- Unlock with fingerprint
- Yes, tried it, but not fixing the issue. What works is opening Keepass2Android manually now and then, then I don't get into this issue.
Thanks
- no work profile
- Gboard
- fingerprint
- yes
I was trying to consistently reproduce the issue and in the process reinstalled the app. It's been fine for a few days now when it would previously fail pretty often.
you might also try to install https://github.com/PhilippC/keepass2android/releases/tag/v1.12-r5-test2901. I have reverted the biometric library there. I'm not really expecting this to make a difference, but I thought it's still worth a try.
you might also try to install https://github.com/PhilippC/keepass2android/releases/tag/v1.12-r5-test2901. I have reverted the biometric library there. I'm not really expecting this to make a difference, but I thought it's still worth a try.
Installed, It'll try it for a few days to see if it makes any difference.
I tried reinstalling the app a few weeks back, but it made no difference then.
Thank you.
- No
- AnySoftKeyboard
- I use the fingerprint
- yes, also clear cache and data and reintall. Since android may update, it crashes less often.
you might also try to install https://github.com/PhilippC/keepass2android/releases/tag/v1.12-r5-test2901. I have reverted the biometric library there. I'm not really expecting this to make a difference, but I thought it's still worth a try.
Yes, it seems to be an issue with the biometric library, I created a ticket at google : https://issuetracker.google.com/u/1/issues/420520233
Thanks for investigating
- No workprofile
- Yes, Gboard
- Unlock with fingerprint
- Yes, tried it, but not fixing the issue. What works is opening Keepass2Android manually now and then, then I don't get into this issue.
same
you might also try to install https://github.com/PhilippC/keepass2android/releases/tag/v1.12-r5-test2901. I have reverted the biometric library there. I'm not really expecting this to make a difference, but I thought it's still worth a try.
Installed, It'll try it for a few days to see if it makes any difference.
I tried reinstalling the app a few weeks back, but it made no difference then.
The new version made no difference, as expected. If you get any new ideas, hit me up and It'll test it.
Thanks for investigating
- No workprofile
- Yes, Gboard
- Unlock with fingerprint
- Yes, tried it, but not fixing the issue. What works is opening Keepass2Android manually now and then, then I don't get into this issue.
same
Hey, need to make an addition to nr 4: Bio-Unlock just failed for me even while manually opening keepass2android. prior i unlocked the db manually and went to db settings -> enabled full bio unlock -> waited some hours -> opened app manually -> „password + keyfile“ setting lost :(
will try to reproduce and deliver logs
thank you for your effort
Is there any description available how the cryptographic process when opening a keepass db changes in case biometric authentication is used? It would be good to know for understanding if this is really a bug with the biometric authentication or just coincidence and it doesn't have anything to do with biometric authentication.
New behaviour on my device: I enabled quickunlock because i got tired of typing the entire master password every time I used keepass, now fingerprint works for quickunlock. Maybe the app keeps running in the background if that makes a difference?
Hi,
Are you using a "Work profile" on your Android ?
No
Are you all using Gboard?
Yes, and I trigger the issue only by autofill from Gboard (but not everytime, mostly when the application has been closed for a while)
How do you unlock the device?
Fingerprint
Did you try to disable KP2A's biometric unlock (settings - database settings - biometric unlock) and re-enable it?
Yes, no change
Currently on 1.12-r5-test2901
* Are you using a "[Work profile]
Nope
* Are you all using Gboard?
Nope
- How do you unlock the device? Fingerprint & Face unlock * Did you try to disable KP2A's biometric unlock (settings - database settings - biometric unlock) and re-enable it?
Yep, no help.
I have a Work Profile, but am installed on the Personal Profile.
Using GBoard
Unlock the device with Fingerprint
I have tried disable / reenable and this always fixed it for a while, but always eventually returns.
Pixel 6, Android 15, May 5 update. K2A 1.12-r5
Updated to Android 16, still has the same issue No work profile Using GBoard Unlocks with finger print
Thanks for your feedback! It's still a mystery to me... Is there anybody here experiencing the fingeprint issue who DOES NOT have a key file?