From 209301bb806205a396e71791b64022a8a9b16f78 Mon Sep 17 00:00:00 2001 From: "artur.jaskevich" Date: Thu, 15 Nov 2018 11:36:46 +0600 Subject: [PATCH] [FIXED] KeyStore exception android.os.ServiceSpecificException: (code 7) --- .../online/securedpreferencestore/EncryptionManager.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/securedpreferencestore/src/main/java/devliving/online/securedpreferencestore/EncryptionManager.java b/securedpreferencestore/src/main/java/devliving/online/securedpreferencestore/EncryptionManager.java index 0d48b5b..2a4ae7b 100644 --- a/securedpreferencestore/src/main/java/devliving/online/securedpreferencestore/EncryptionManager.java +++ b/securedpreferencestore/src/main/java/devliving/online/securedpreferencestore/EncryptionManager.java @@ -688,8 +688,7 @@ byte[] decryptAESCompat(EncryptedData encryptedData) throws UnsupportedEncodingE void loadKey(SharedPreferences prefStore) throws KeyStoreException, UnrecoverableEntryException, NoSuchAlgorithmException, NoSuchPaddingException, NoSuchProviderException, InvalidKeyException, IOException { if (!isCompatMode) { if (mStore.containsAlias(AES_KEY_ALIAS) && mStore.entryInstanceOf(AES_KEY_ALIAS, KeyStore.SecretKeyEntry.class)) { - KeyStore.SecretKeyEntry entry = (KeyStore.SecretKeyEntry) mStore.getEntry(AES_KEY_ALIAS, null); - aesKey = entry.getSecretKey(); + aesKey = (SecretKey) mStore.getKey(AES_KEY_ALIAS, null); } } else { aesKey = getFallbackAESKey(prefStore);