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);