Skip to content

Instantly share code, notes, and snippets.

@ed-george
Created June 4, 2022 00:11
Show Gist options
  • Save ed-george/b1c411a5004f4d296dc1068219a2ced9 to your computer and use it in GitHub Desktop.
Save ed-george/b1c411a5004f4d296dc1068219a2ced9 to your computer and use it in GitHub Desktop.
Unpacking Android Security: Part 2 - Insecure Data Storage (Example 5)
val Context.dataStore by preferencesDataStore(name = "insecure-data-store")
val pref1 = stringPreferencesKey("example_pref")
val pref2 = stringPreferencesKey("example_pref_2")
dataStore.edit { settings ->
settings[pref1] = "My 1st Pref"
settings[pref2] = "My 2nd Pref"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment