jeroentrappers / flutter_keychain

A flutter plugin for secure storage on Android via KeyStore and iOS via Keychain
Other
56 stars 41 forks source link

Library not working in Android 9 #10

Closed Vanethos closed 4 years ago

Vanethos commented 5 years ago

When using this library ion Android 9, the following occurs:

W/KeyStore( 1614): KeyStore exception
W/KeyStore( 1614): android.os.ServiceSpecificException:  (code 7)
W/KeyStore( 1614):      at android.os.Parcel.createException(Parcel.java:1964)
W/KeyStore( 1614):      at android.os.Parcel.readException(Parcel.java:1918)
W/KeyStore( 1614):      at android.os.Parcel.readException(Parcel.java:1868)
W/KeyStore( 1614):      at android.security.IKeystoreService$Stub$Proxy.get(IKeystoreService.java:786)
W/KeyStore( 1614):      at android.security.KeyStore.get(KeyStore.java:195)
W/KeyStore( 1614):      at android.security.keystore.AndroidKeyStoreSpi.engineGetCertificateChain(AndroidKeyStoreSpi.java:118)
W/KeyStore( 1614):      at java.security.KeyStoreSpi.engineGetEntry(KeyStoreSpi.java:484)
W/KeyStore( 1614):      at java.security.KeyStore.getEntry(KeyStore.java:1560)
W/KeyStore( 1614):      at be.appmire.flutterkeychain.RsaKeyStoreKeyWrapper.createRSAKeysIfNeeded(FlutterKeychainPlugin.kt:125)
W/KeyStore( 1614):      at be.appmire.flutterkeychain.RsaKeyStoreKeyWrapper.<init>(FlutterKeychainPlugin.kt:48)
W/KeyStore( 1614):      at be.appmire.flutterkeychain.FlutterKeychainPlugin$Companion.registerWith(FlutterKeychainPlugin.kt:280)
W/KeyStore( 1614):      at be.appmire.flutterkeychain.FlutterKeychainPlugin.registerWith(Unknown Source:2)
W/KeyStore( 1614):      at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:31)
W/KeyStore( 1614):      at com.ianum.ianumflutter.MainActivity.onCreate(MainActivity.kt:12)
W/KeyStore( 1614):      at android.app.Activity.performCreate(Activity.java:7155)
W/KeyStore( 1614):      at android.app.Activity.performCreate(Activity.java:7146)
W/KeyStore( 1614):      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1288)
W/KeyStore( 1614):      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3037)
W/KeyStore( 1614):      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3197)
W/KeyStore( 1614):      at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
W/KeyStore( 1614):      at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
W/KeyStore( 1614):      at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
W/KeyStore( 1614):      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1926)
W/KeyStore( 1614):      at android.os.Handler.dispatchMessage(Handler.java:106)
W/KeyStore( 1614):      at android.os.Looper.loop(Looper.java:193)
W/KeyStore( 1614):      at android.app.ActivityThread.main(ActivityThread.java:6923)
W/KeyStore( 1614):      at java.lang.reflect.Method.invoke(Native Method)
W/KeyStore( 1614):      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
W/KeyStore( 1614):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

This may happen due to the fact that Android changed the way it accesses the Keychain: https://stackoverflow.com/a/52295484/4499889

d-silveira commented 4 years ago

if this pull request was already accepted, couldn't this issue be closed and a new version be released?

thanks

jeroentrappers commented 4 years ago

The pull request still contains unnecessary log statements. Therefore I cannot merge it.

dexcell commented 4 years ago

Shouldn't this is marked as severe bug problem? Maybe you can merge and remove the log afterwards.

pkvpraveen commented 4 years ago

@jeroentrappers Seems like this is long pending. Can I use this package for android 9? is this fixed?

sjapps commented 4 years ago

@jeroentrappers Can we merge this?

Vanethos commented 4 years ago

Removed the other log that was in the PR