Skip to content

Commit 5f9f19e

Browse files
committed
Fail closed when encrypted prefs are unavailable
1 parent df3daa5 commit 5f9f19e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/com/thinkoff/clawwatch/SecurePrefs.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ object SecurePrefs {
5353
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
5454
)
5555
} catch (e: Exception) {
56-
Log.w(TAG, "EncryptedSharedPreferences unavailable, falling back to plaintext", e)
57-
appContext.getSharedPreferences(LEGACY_PREFS_NAME, Context.MODE_PRIVATE)
56+
Log.e(TAG, "EncryptedSharedPreferences unavailable; refusing plaintext secret storage", e)
57+
throw IllegalStateException("Encrypted storage unavailable on this device", e)
5858
}
5959

6060
migrateLegacyIfPresent(appContext, secure)

0 commit comments

Comments
 (0)