Update the Androidx Crypto library (#5527)

This commit is contained in:
David Perez 2025-07-14 16:36:13 -05:00 committed by GitHub
parent 46656d659e
commit 9274e0f349
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -1,3 +1,5 @@
@file:Suppress("DEPRECATION")
package com.bitwarden.data.datasource.disk.di
import android.app.Application
@ -37,13 +39,12 @@ object PreferenceModule {
fun provideEncryptedSharedPreferences(
application: Application,
): SharedPreferences =
@Suppress("TooGenericExceptionCaught")
try {
getEncryptedSharedPreferences(application = application)
} catch (e: GeneralSecurityException) {
} catch (_: GeneralSecurityException) {
// Handle when a bad master key or key-set has been attempted
destroyEncryptedSharedPreferencesAndRebuild(application = application)
} catch (e: RuntimeException) {
} catch (@Suppress("TooGenericExceptionCaught") _: RuntimeException) {
// Handle KeystoreExceptions that get wrapped up in a RuntimeException
destroyEncryptedSharedPreferencesAndRebuild(application = application)
}

View File

@ -22,7 +22,7 @@ androidxHiltNavigationCompose = "1.2.0"
androidxLifecycle = "2.9.1"
androidxNavigation = "2.9.1"
androidxRoom = "2.7.2"
androidxSecurityCrypto = "1.1.0-alpha06"
androidxSecurityCrypto = "1.1.0-beta01"
androidxSplash = "1.1.0-rc01"
androidxWork = "2.10.2"
bitwardenSdk = "1.0.0-20250708.105256-238"