The common location where SharedPreferences are stored in Android apps is:
/data/data//shared_prefs/
You need to handle Verison under API 23
private static SharedPreferences getSharedPreferences(Context mContext) throws NullPointerException {
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
String masterKeyAlias = null;
try {
masterKeyAlias = MasterKeys.getOrCreate(MasterKeys.AES256_GCM_SPEC);
sharedPreferences = EncryptedSharedPreferences.create(
"secret_shared_prefs",
masterKeyAlias,
mContext,
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
);
} catch (GeneralSecurityException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
} else {
sharedPreferences = mContext.getSharedPreferences(tag, Context.MODE_PRIVATE);
}
return sharedPreferences;
}