[Android] How to check the secret of the application and protect it ?

kokchai
1 min readMay 23, 2020

Prerequisites:

Good to have a rooted device to save much effort and go deeper

How to list the data in SharedReferences ?

  1. Open Terminal / DOS prompt
  2. Type “adb shell”
  3. Type “cd /data/data/<your app package>” // e.g.: com.app.abc
  4. You can see any or all of the directories:
    app_textures, cache, databases, no_backup, app_webview, code_cache, files, shared_prefs
  5. Type “cd shared_prefs”
  6. You can open any XML file to see what’s the content
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="key">value</string>
</map>

All of the key / value you store via API https://developer.android.com/reference/android/content/SharedPreferences.Editor will be in the file.

How to protect you SharedReferences data ?

  • Store key and name which is not understandable, e.g.: <string name=”yke”>evlua</string>

Used in:

--

--