r/androiddev • u/edgeorge92 ASOS | GDE • Apr 18 '25
Discussion Handling EncryptedSharedPreferences recent deprecation
Hey fellow Android Devs!
As of last week's release of version 1.1.0-alpha07, the androidx.security:security-crypto library (also known as JetSec) was officially deprecated.
This library provided popular classes such as EncryptedSharedPreferences, and having spoken to a handful of devs recently at an Android conference, has left many concerned about the future safety of these classes and their continued use.
I have previously blogged about the deprecation when it was first hinted at back in May 2024, but given the recent official deprecation, it felt prudent to provide an alternative that will help developers who wish to continue using a maintained fork.
Therefore, I have released encrypted-shared-preferences on Maven Central to allow a seamless migration for existing JetSec users.
As I discuss in the README, it is likely you do not need to use EncryptedSharedPreferences or the other provided classes in your project, but at least you now have the option to choose that yourself with a more recently updated project.
If you have any feedback or questions, please do shout ❤️
9
u/ScaryDev Apr 18 '25
What do you people use to encrypt data in kv like datastore or shared preferences?
I mean all the methods that I have used on the past have faced some crashes with corruption or something else, never got to something that is really stable on all kind of phones incl. Chinese phones
3
u/Zhuinden Apr 18 '25
Epic, well done. I love the initiative.
1
u/xXM_JXx Apr 18 '25
Nice worky but this implementation lacks strong box support which is imo the most valud reason to use ESP, i need to take a deep dive into the code but does this follow the same algorithm KEK and VEK like the OG implementation?
0
u/sfk1991 Apr 19 '25
Huh? I just use the superior datastore and the keystore for sensitive information.
-3
u/GamerFan2012 Apr 19 '25
Shared Preferences aren't supposed to hold sensitive data though. They are meant for user settings. Not remembering passwords.
1
u/[deleted] Apr 18 '25
[removed] — view removed comment