fix preferences migration

This commit is contained in:
lucky 2022-01-03 15:57:34 +03:00
parent 0ff328e285
commit 083a1e1cdc
1 changed files with 4 additions and 1 deletions

View File

@ -13,6 +13,9 @@ class Preferences(ctx: Context) {
private const val WIPE_DATA = "wipe_data"
private const val WIPE_ESIM = "wipe_esim"
private const val MAX_FAILED_PASSWORD_ATTEMPTS = "max_failed_password_attempts"
// migration
private const val DO_WIPE = "do_wipe"
}
private val mk = MasterKeys.getOrCreate(MasterKeys.AES256_GCM_SPEC)
@ -37,7 +40,7 @@ class Preferences(ctx: Context) {
set(value) = prefs.edit { putBoolean(CODE_ENABLED, value) }
var isWipeData: Boolean
get() = prefs.getBoolean(WIPE_DATA, false)
get() = prefs.getBoolean(WIPE_DATA, prefs.getBoolean(DO_WIPE, false))
set(value) = prefs.edit { putBoolean(WIPE_DATA, value) }
var isWipeESIM: Boolean