capacitor-secure-storage icon indicating copy to clipboard operation
capacitor-secure-storage copied to clipboard

feat: Android EncryptedSharedPreferences

Open joshuaGnol opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

Android have a secure storage - EncryptedSharedPreferences

Describe the solution you'd like

Will you consider to go for EncryptedSharedPreferences as Android official secure storage?

Additional context

As SharedPreferences is then extended to Encrypted Shared Preferences which store data in the same way (key, value pairs) but in an encrypted way. Both keys and values are stored encrypted.

joshuaGnol avatar Mar 28 '23 08:03 joshuaGnol

Didn't know about that. Will consider it.

aparajita avatar Mar 28 '23 20:03 aparajita

It isn't quite as simple as you think.

It's unlikely to happen (at least by me), because it will require converting the existing data and a bunch of extra code. I have neither the time nor the appetite to do it. If someone wants to submit a PR I'll take a look. The PR must:

  • Check if the API is 23+ and return SharedPreferences or EncryptedSharedPreferences accordingly.
  • If API 23+, convert existing data.
  • Exclude encrypted shared prefs from backup.

aparajita avatar Dec 07 '23 22:12 aparajita