iamMehedi / Secured-Preference-Store

A cryptography library and a SharedPreferences wrapper for Android that encrypts the content with 256 bit AES encryption. The Encryption key is securely stored in device's KeyStore.
563 stars 97 forks source link

Cannot connect to keystore #34

Open yan-lixin opened 6 years ago

yan-lixin commented 6 years ago

Cannot connect to keystore android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:617)
at android.security.IKeystoreService$Stub$Proxy.begin(IKeystoreService.java:1255)

This mistake happens occasionally. The wrong place is the 496th line of EncryptionManager.

yan-lixin commented 6 years ago

Cannot connect to keystore android.os.DeadObjectException at android.os.BinderProxy.transactNative(Native Method) at android.os.BinderProxy.transact(Binder.java:617) at android.security.IKeystoreService$Stub$Proxy.begin(IKeystoreService.java:1255) at android.security.KeyStore.begin(KeyStore.java:488) at android.security.keystore.AndroidKeyStoreCipherSpiBase.ensureKeystoreOperationInitialized(AndroidKeyStoreCipherSpiBase.java:248) at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineInit(AndroidKeyStoreCipherSpiBase.java:148) at javax.crypto.Cipher.tryTransformWithProvider(Cipher.java:2973) at javax.crypto.Cipher.tryCombinations(Cipher.java:2884) at javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider(Cipher.java:2789) at javax.crypto.Cipher.chooseProvider(Cipher.java:956) at javax.crypto.Cipher.init(Cipher.java:1329) at javax.crypto.Cipher.init(Cipher.java:1267) at devliving.online.securedpreferencestore.EncryptionManager.decryptAES(EncryptionManager.java:496) at devliving.online.securedpreferencestore.EncryptionManager.decrypt(EncryptionManager.java:341) at devliving.online.securedpreferencestore.EncryptionManager.tryDecrypt(EncryptionManager.java:286) at devliving.online.securedpreferencestore.EncryptionManager.decrypt(EncryptionManager.java:385) at devliving.online.securedpreferencestore.SecuredPreferenceStore.getString(SecuredPreferenceStore.java:192)