scottyab / secure-preferences

Android Shared preference wrapper than encrypts the values of Shared Preferences. It's not bullet proof security but rather a quick win for incrementally making your android app more secure.
1.53k stars 235 forks source link

How to set `SecurePreferences` as default shared preferences? #51

Open rmunk opened 8 years ago

rmunk commented 8 years ago

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?

nilsi commented 8 years ago

+1 would love to use this with PreferenceFragmentCompat

ashishkhatri commented 7 years ago

You should just write a helper class to deal with preferences anyway, and use SecurePreferences there.

scottyab commented 7 years ago

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.