Secured-Preference-Store icon indicating copy to clipboard operation
Secured-Preference-Store copied to clipboard

KeyStore exception in log on Android 9 device

Open kfjtrifork opened this issue 7 years ago • 6 comments

Thx for a great library. When running on a Android 9 device (Pixel) I see an error in the log. This happens both when target api is set to Android 9 (28) and earlier (tested with 26). This exception is not propagated to the calling app. This error does not occur when running older Android devices (tested on Android 8 and 6). I can't tell the severity of this error (the call to "KeyStore.entryInstanceOf" probably fails, which is part of an if statement) but hope you can :) BR, Kristian

Stacktrace: W/KeyStore: KeyStore exception android.os.ServiceSpecificException: (code 7) at android.os.Parcel.createException(Parcel.java:1956) at android.os.Parcel.readException(Parcel.java:1910) at android.os.Parcel.readException(Parcel.java:1860) at android.security.IKeystoreService$Stub$Proxy.get(IKeystoreService.java:786) at android.security.KeyStore.get(KeyStore.java:195) at android.security.keystore.AndroidKeyStoreSpi.engineGetCertificate(AndroidKeyStoreSpi.java:144) at java.security.KeyStoreSpi.engineEntryInstanceOf(KeyStoreSpi.java:583) at java.security.KeyStore.entryInstanceOf(KeyStore.java:1631) at devliving.online.securedpreferencestore.EncryptionManager.loadKey(EncryptionManager.java:690) at devliving.online.securedpreferencestore.EncryptionManager.setup(EncryptionManager.java:228) at devliving.online.securedpreferencestore.EncryptionManager.(EncryptionManager.java:201) at devliving.online.securedpreferencestore.SecuredPreferenceStore.(SecuredPreferenceStore.java:79) at devliving.online.securedpreferencestore.SecuredPreferenceStore.init(SecuredPreferenceStore.java:134) at devliving.online.securedpreferencestore.SecuredPreferenceStore.init(SecuredPreferenceStore.java:142) at ...

kfjtrifork avatar Oct 04 '18 13:10 kfjtrifork

looking into it!

iamMehedi avatar Dec 05 '18 05:12 iamMehedi

Seeing the same error when using implementation 'online.devliving:securedpreferencestore:0.7.4'. Only on OS 9 devices.

brspurri avatar Mar 31 '19 19:03 brspurri

also seen at https://github.com/googlesamples/android-BasicAndroidKeyStore/issues/3

ber4444 avatar Apr 10 '19 18:04 ber4444

Hi! Any news or feedback on this? I'm experiencing the same thing in Android 9.

AlvaroBro avatar Aug 05 '19 09:08 AlvaroBro

Possible fix?

https://stackoverflow.com/questions/52024752/android-9-keystore-exception-android-os-servicespecificexception

jonreeve avatar Oct 14 '19 15:10 jonreeve

Hi! Still I'm getting the same exception even after changing getKey() and getCertificate() methods instead of getEntry() in Android 9. Is there any updated solution on this?

MarimuthuP avatar Jul 12 '21 20:07 MarimuthuP