secure-preferences
secure-preferences copied to clipboard
How to set `SecurePreferences` as default shared preferences?
I would like the PreferenceManager.getDefaultSharedPreferences(this)
method to return my SecurePreferences
instance.
So is it possible to set SecurePreferences
as default shared preferences and is there maybe some way to have PreferenceFragmentCompat
use SecurePreferences
?
+1 would love to use this with PreferenceFragmentCompat
You should just write a helper class to deal with preferences anyway, and use SecurePreferences there.
The main issue with using with PreferenceFragmentCompat
or any preference screen where the android system/xml if interacting directly with SecurePreferences
is that it'll need to reference the hashed key name. It's doable but clunky.
I'll leave this open to update readme/sample app with an example of how to achieve this.