Skip to content

Instantly share code, notes, and snippets.

@ed-george
Created June 4, 2022 00:11
Embed
What would you like to do?
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