android-password-store / Android-Password-Store

Android application compatible with ZX2C4's Pass command line application
https://passwordstore.app
GNU General Public License v3.0
2.53k stars 251 forks source link

fix crash due to passphrase caching after biom. authentication expired #3141

Closed agrahn closed 1 month ago

agrahn commented 1 month ago

I discovered another spot where app crash may occur due to expiration of biometric authentication while attempting to write to EncryptedSharedPreferences. It happens if the dialog for entering the passphrase is OK-closed after prior authentication has expired (keeping device awake by tapping on the dialog for a minute or so, then tapping OK):

https://github.com/android-password-store/Android-Password-Store/blob/7010ee85b4bdfa0c8120f15597a9471151576b2c/app/src/main/java/app/passwordstore/ui/crypto/DecryptActivity.kt#L218

The PR wraps the line in question in a runCatching block, such that if passphrase caching fails, the DecryptActivity screen is still completed and displayed. Similary, with AutofillDecryptActivity, decrypted credentials are now still filled in on a login form, even if caching fails.