mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 06:53:44 +00:00
fix: don't double encrypt on save
This commit is contained in:
parent
91aefb7c87
commit
596b02cfaf
@ -139,7 +139,12 @@ public class IdentityKeyUtil {
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
KeyStoreHelper.SealedData encryptedSecret = KeyStoreHelper.seal(value.getBytes());
|
||||
preferencesEditor.putString(key+ENCRYPTED_SUFFIX, encryptedSecret.serialize());
|
||||
boolean isEncryptedSuffix = key.endsWith(ENCRYPTED_SUFFIX);
|
||||
if (isEncryptedSuffix) {
|
||||
preferencesEditor.putString(key, encryptedSecret.serialize());
|
||||
} else {
|
||||
preferencesEditor.putString(key+ENCRYPTED_SUFFIX, encryptedSecret.serialize());
|
||||
}
|
||||
} else {
|
||||
preferencesEditor.putString(key, value);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user