Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #8324 - Only use encrypted storage for Nightly/Debug populations
Browse files Browse the repository at this point in the history
  • Loading branch information
ekager committed Feb 16, 2020
1 parent 324fe64 commit 84774d2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/src/main/java/org/mozilla/fenix/components/Core.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import mozilla.components.lib.dataprotect.generateEncryptionKey
import mozilla.components.service.sync.logins.AsyncLoginsStorageAdapter
import mozilla.components.service.sync.logins.SyncableLoginsStore
import org.mozilla.fenix.AppRequestInterceptor
import org.mozilla.fenix.Config
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
Expand Down Expand Up @@ -217,9 +218,15 @@ class Core(private val context: Context) {

/**
* Shared Preferences that encrypt/decrypt using Android KeyStore and lib-dataprotect for 23+
* otherwise simply stored
* only on Nightly/Debug for now, otherwise simply stored.
* See https://github.com/mozilla-mobile/fenix/issues/8324
*/
fun getSecureAbove22Preferences() = SecureAbove22Preferences(context, KEY_STORAGE_NAME)
fun getSecureAbove22Preferences() =
SecureAbove22Preferences(
context = context,
name = KEY_STORAGE_NAME,
forceInsecure = !Config.channel.isNightlyOrDebug
)

val passwordsEncryptionKey: String =
getSecureAbove22Preferences().getString(PASSWORDS_KEY)
Expand Down

0 comments on commit 84774d2

Please sign in to comment.