Reputation: 8058
I am working in a project where I have to migrate to Encrypted shared preference refer this link more for Encrypted Shared Preference. I have implemented the pref successfully but my issue is if the shared pref file is already existed it won't encrypt the existing data stored in Pref. Only the new value which will be stored gets encrypted.
So how to properly migrate to Encrypted shared pref and check whether Pref is already encrypted or not. Anyone knows any best practise.
I have figured out a way where i can check a key if its present in pref which is __androidx_security_crypto_encrypted_prefs_key_keyset__
. If it is present means pref is encrypted pref else not and then i can migrate the way i want to migrate the shared pref if its not encrypted yet.
Upvotes: 1
Views: 571