Skip to content

Instantly share code, notes, and snippets.

@tdcolvin
Created February 3, 2023 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdcolvin/64bc216c04d32f34ec18a1c56b06bf0b to your computer and use it in GitHub Desktop.
Save tdcolvin/64bc216c04d32f34ec18a1c56b06bf0b to your computer and use it in GitHub Desktop.
private val sharedPreferences by lazy {
//The name of the file on disk will be this, plus the ".xml" extension.
val sharedPrefsFile = "sharedPrefs"
//Create the EncryptedSharedPremises using the key above
EncryptedSharedPreferences.create(
sharedPrefsFile,
mainKeyAlias,
getApplication(),
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment