You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.
I'm sorry but your explanation and sample project are very vague and can't figure it out. Could you please explain how to get data from encrypted sharedPrefs?!
What is wrong with this code? it's like your sample project but the value won't be decrypted! :
//Set data
SecurePreferences sharedPrefs = new SecurePreferences(context, password, "vault");
SecurePreferences.Editor editor = sharedPrefs.edit();
editor.putString(KEY_USERNAME, username);
editor.commit();
//Get decrypted data (WONT WORK)
SharedPreferences securePreferences = context.getSharedPreferences("vault", Context.MODE_PRIVATE);
for (Map.Entry<String, ?> entry : securePreferences.getAll().entrySet()) {
String key = entry.getKey();
if (key.equals(SecurePreferences.hashPrefKey(KEY_USERNAME))) {
MY_USERNAME = securePreferences.getString(key,""); //Returns encrypted value
}
}
The text was updated successfully, but these errors were encountered:
1mohammad7
changed the title
Cant get decryped value
Cant get decrypted value
Jan 25, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm sorry but your explanation and sample project are very vague and can't figure it out. Could you please explain how to get data from encrypted sharedPrefs?!
What is wrong with this code? it's like your sample project but the value won't be decrypted! :
The text was updated successfully, but these errors were encountered: