mirror of
https://github.com/bitwarden/android.git
synced 2025-12-12 08:40:49 -06:00
Update the Androidx Crypto library (#5527)
This commit is contained in:
parent
46656d659e
commit
9274e0f349
@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("DEPRECATION")
|
||||||
|
|
||||||
package com.bitwarden.data.datasource.disk.di
|
package com.bitwarden.data.datasource.disk.di
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
@ -37,13 +39,12 @@ object PreferenceModule {
|
|||||||
fun provideEncryptedSharedPreferences(
|
fun provideEncryptedSharedPreferences(
|
||||||
application: Application,
|
application: Application,
|
||||||
): SharedPreferences =
|
): SharedPreferences =
|
||||||
@Suppress("TooGenericExceptionCaught")
|
|
||||||
try {
|
try {
|
||||||
getEncryptedSharedPreferences(application = application)
|
getEncryptedSharedPreferences(application = application)
|
||||||
} catch (e: GeneralSecurityException) {
|
} catch (_: GeneralSecurityException) {
|
||||||
// Handle when a bad master key or key-set has been attempted
|
// Handle when a bad master key or key-set has been attempted
|
||||||
destroyEncryptedSharedPreferencesAndRebuild(application = application)
|
destroyEncryptedSharedPreferencesAndRebuild(application = application)
|
||||||
} catch (e: RuntimeException) {
|
} catch (@Suppress("TooGenericExceptionCaught") _: RuntimeException) {
|
||||||
// Handle KeystoreExceptions that get wrapped up in a RuntimeException
|
// Handle KeystoreExceptions that get wrapped up in a RuntimeException
|
||||||
destroyEncryptedSharedPreferencesAndRebuild(application = application)
|
destroyEncryptedSharedPreferencesAndRebuild(application = application)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ androidxHiltNavigationCompose = "1.2.0"
|
|||||||
androidxLifecycle = "2.9.1"
|
androidxLifecycle = "2.9.1"
|
||||||
androidxNavigation = "2.9.1"
|
androidxNavigation = "2.9.1"
|
||||||
androidxRoom = "2.7.2"
|
androidxRoom = "2.7.2"
|
||||||
androidxSecurityCrypto = "1.1.0-alpha06"
|
androidxSecurityCrypto = "1.1.0-beta01"
|
||||||
androidxSplash = "1.1.0-rc01"
|
androidxSplash = "1.1.0-rc01"
|
||||||
androidxWork = "2.10.2"
|
androidxWork = "2.10.2"
|
||||||
bitwardenSdk = "1.0.0-20250708.105256-238"
|
bitwardenSdk = "1.0.0-20250708.105256-238"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user