androidsharedpreferencesandroid-sharedpreferences

Are SharedPreferences read-only?


I know that SharedPreferences is an efficient way to store data but is the database used by android to store SharedPreferences read only even if you have root access?

Thanks in advance!


Solution

  • There is nothing you can do if a user has SUDO permission on the device. If a device is rooted, they can dig into your SharedPreferences all they want.

    If you are storing passwords or other sensitive data in your app's local data, consider doing some sort of obfuscation like SHA or MD5 hashing before adding to prefs.