From f10a99ce41a4a7abf4322e2c649c15c1f5e257ee Mon Sep 17 00:00:00 2001 From: Harris Date: Mon, 7 Jun 2021 15:23:20 +1000 Subject: [PATCH] fix: don't put encrypted in encrypted --- .../org/thoughtcrime/securesms/crypto/IdentityKeyUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/crypto/IdentityKeyUtil.java b/app/src/main/java/org/thoughtcrime/securesms/crypto/IdentityKeyUtil.java index c48f900f3f..356a8a6fd1 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/crypto/IdentityKeyUtil.java +++ b/app/src/main/java/org/thoughtcrime/securesms/crypto/IdentityKeyUtil.java @@ -138,11 +138,11 @@ public class IdentityKeyUtil { Editor preferencesEditor = preferences.edit(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - KeyStoreHelper.SealedData encryptedSecret = KeyStoreHelper.seal(value.getBytes()); boolean isEncryptedSuffix = key.endsWith(ENCRYPTED_SUFFIX); if (isEncryptedSuffix) { - preferencesEditor.putString(key, encryptedSecret.serialize()); + preferencesEditor.putString(key, value); } else { + KeyStoreHelper.SealedData encryptedSecret = KeyStoreHelper.seal(value.getBytes()); preferencesEditor.putString(key+ENCRYPTED_SUFFIX, encryptedSecret.serialize()); } } else {