bitwarden / android

Bitwarden mobile apps (Password Manager and Authenticator) for Android.

Home Page:https://bitwarden.com

Repository from Github https://github.combitwarden/androidRepository from Github https://github.combitwarden/android

FC when switching account

kslcsdalsadg opened this issue · comments

Steps To Reproduce

  1. Login in a account
  2. Login in other account
  3. Return to the first account
    FC and can't never restart the app without deleting app data

I use autohosted server and do not know if the issue also occurs at bitwarden, but the issue occurs at 2025.1.1 and no issue at 2025.1.0

Expected Result

No FC when switching accounts

Actual Result

--------- switch to crash
02-04 06:36:14.901 12574 12574 E AndroidRuntime: FATAL EXCEPTION: main
02-04 06:36:14.901 12574 12574 E AndroidRuntime: Process: com.x8bit.bitwarden, PID: 12574
02-04 06:36:14.901 12574 12574 E AndroidRuntime: javax.crypto.BadPaddingException
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:630)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at javax.crypto.Cipher.doFinal(Cipher.java:2074)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at r6.u0.R(Unknown Source:113)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at a7.N.invokeSuspend(Unknown Source:43)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at Z9.a.resumeWith(Unknown Source:7)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at ua.I.run(Unknown Source:109)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at ua.V.d0(Unknown Source:23)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at ua.k.o(Unknown Source:80)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at ua.k.p(Unknown Source:2)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at wa.j.a(Unknown Source:6)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at wa.h.I(Unknown Source:84)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at wa.h.g(Unknown Source:56)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at wa.h.m(Unknown Source:107)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at h7.d.i(Unknown Source:2)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at a7.x.invoke(Unknown Source:116)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at D8.b.invoke(Unknown Source:31)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at D8.d.K(Unknown Source:15)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at A2.J.run(Unknown Source:152)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:991)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:102)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:232)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:317)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:8826)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:369)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [r0{Cancelling}@2945b22, Dispatchers.Main.immediate]
02-04 06:36:14.901 12574 12574 E AndroidRuntime: Caused by: android.security.KeyStoreException: Invalid argument (internal Keystore code: -38 message: system/security/keystore2/src/operation.rs:848: KeystoreOperation::finish
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 
02-04 06:36:14.901 12574 12574 E AndroidRuntime: Caused by:
02-04 06:36:14.901 12574 12574 E AndroidRuntime:     0: system/security/keystore2/src/operation.rs:429: Finish failed.
02-04 06:36:14.901 12574 12574 E AndroidRuntime:     1: Error::Km(r#INVALID_ARGUMENT)) (public error code: 10 internal Keystore code: -38)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:416)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:79)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at android.security.KeyStoreOperation.finish(KeyStoreOperation.java:132)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.finish(KeyStoreCryptoOperationChunkedStreamer.java:228)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:181)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:624)
02-04 06:36:14.901 12574 12574 E AndroidRuntime: 	... 27 more
--------- switch to main

Screenshots or Videos

No response

Additional Context

No response

Build Version

2025.1.1

What server are you connecting to?

Self-host

Self-host Server Version

2025.1.1

Environment Details

Device: Google Pixel 7 Pro, Android 15, GrapheneOS

Issue Tracking Info

  • I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.

Thank you for your report! We've added this to our internal board for review.
ID: PM-17951

Duplicate of #4659