After upgraded to SDK 34, I have an issue on a Samsung A7 phone with Android 9. On other phones I’ve tested no issue. If I install the app from my beta-channel on Google Play and try to login, nothing happens when clicking the button. But if I then close the app, delete App data from the Android settings, open the app and try to login in again, it’s working as expected. One of the things happening when clicking the login-button is using the expo-secure-store.
I’ve attacked the phone to my computer and fetched the log using Logcat, trying to identify the difference between the to executions. I found this section in the log from:
2019-07-31 19:39:18.831 3594-3594/? W/keymaster_tee: [WRN]start nwd_get_key_characteristics
2019-07-31 19:39:18.833 3594-3594/? W/keymaster_tee: [WRN]ret OK PARAMS: A32 P0 P1 B32 P1 AR1 S256 2019.07.31,19:39:18.314
2019-07-31 19:39:18.838 3594-3594/? W/keymaster_tee: [WRN]start nwd_get_key_characteristics
2019-07-31 19:39:18.840 3594-3594/? W/keymaster_tee: [WRN]ret OK PARAMS: A32 P0 P1 B32 P1 AR1 S256 2019.07.31,19:39:18.314
2019-07-31 19:39:18.841 3594-3594/? W/keymaster_tee: [WRN]start nwd_get_key_characteristics
2019-07-31 19:39:18.843 3594-3594/? W/keymaster_tee: [WRN]ret OK PARAMS: A32 P0 P1 B32 P1 AR1 S256 2019.07.31,19:39:18.314
2019-07-31 19:39:18.843 3594-3594/? W/keymaster_tee: [WRN]begin req PARAMS: A32 B32 P1
2019-07-31 19:39:18.849 3594-3594/? W/keymaster_tee: [WRN]Returning with error: -30
2019-07-31 19:39:18.849 3594-3594/? W/keymaster2_mdfpp: exit finish function, returned -30
2019-07-31 19:39:18.849 3884-3884/? W/keystore: finish : hidlCb error -30
2019-07-31 19:39:18.851 10809-11082/? W/ExpoSecureStore: javax.crypto.AEADBadTagException
at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:517)
at javax.crypto.Cipher.doFinal(Cipher.java:2055)
at expo.modules.securestore.SecureStoreModule$AESEncrypter.decryptItem(SecureStoreModule.java:433)
at expo.modules.securestore.SecureStoreModule.readJSONEncodedItem(SecureStoreModule.java:188)
at expo.modules.securestore.SecureStoreModule.getItemImpl(SecureStoreModule.java:159)
at expo.modules.securestore.SecureStoreModule.getValueWithKeyAsync(SecureStoreModule.java:147)
at java.lang.reflect.Method.invoke(Native Method)
at org.unimodules.a.c.invokeExportedMethod(ExportedModule.java:97)
at org.unimodules.adapters.react.NativeModulesProxy.callMethod(NativeModulesProxy.java:117)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:214)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232)
at java.lang.Thread.run(Thread.java:764)
Caused by: android.security.KeyStoreException: Signature/MAC verification failed
at android.security.KeyStore.getKeyStoreException(KeyStore.java:1168)
at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:224)
at android.security.keystore.AndroidKeyStoreAuthenticatedAESCipherSpi$BufferAllOutputUntilDoFinalStreamer.doFinal(AndroidKeyStoreAuthenticatedAESCipherSpi.java:373)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:506)
at javax.crypto.Cipher.doFinal(Cipher.java:2055)
at expo.modules.securestore.SecureStoreModule$AESEncrypter.decryptItem(SecureStoreModule.java:433)
at expo.modules.securestore.SecureStoreModule.readJSONEncodedItem(SecureStoreModule.java:188)
at expo.modules.securestore.SecureStoreModule.getItemImpl(SecureStoreModule.java:159)
at expo.modules.securestore.SecureStoreModule.getValueWithKeyAsync(SecureStoreModule.java:147)
at java.lang.reflect.Method.invoke(Native Method)
at org.unimodules.a.c.invokeExportedMethod(ExportedModule.java:97)
at org.unimodules.adapters.react.NativeModulesProxy.callMethod(NativeModulesProxy.java:117)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:214)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232)
at java.lang.Thread.run(Thread.java:764)
And the log from the working execution looks like this:
2019-07-31 19:36:52.867 3594-3594/? W/keymaster_tee: [WRN]start nwd_generate_key
2019-07-31 19:36:52.870 3594-3594/? W/keymaster_tee: [WRN]ret OK PARAMS: A32 P0 P1 B32 P1 AR1 S256 2019.07.31,19:36:52.868
2019-07-31 19:36:52.886 3594-3594/? W/keymaster_tee: [WRN]start nwd_get_key_characteristics
2019-07-31 19:36:52.887 3594-3594/? W/keymaster_tee: [WRN]ret OK PARAMS: A32 P0 P1 B32 P1 AR1 S256 2019.07.31,19:36:52.868
2019-07-31 19:36:52.895 3594-3594/? W/keymaster_tee: [WRN]start nwd_get_key_characteristics
2019-07-31 19:36:52.897 3594-3594/? W/keymaster_tee: [WRN]ret OK PARAMS: A32 P0 P1 B32 P1 AR1 S256 2019.07.31,19:36:52.868
2019-07-31 19:36:52.899 3594-3594/? W/keymaster_tee: [WRN]start nwd_get_key_characteristics
2019-07-31 19:36:52.901 3594-3594/? W/keymaster_tee: [WRN]ret OK PARAMS: A32 P0 P1 B32 P1 AR1 S256 2019.07.31,19:36:52.868
2019-07-31 19:36:52.901 3594-3594/? W/keymaster_tee: [WRN]begin req PARAMS: A32 B32 P1
2019-07-31 19:36:52.909 3884-3884/? W/keystore: ENTER remove operation from uid 10223
Does anyone knows thats the issue here? I’m using Expo 34.0.3 and expo-secure-store 6.0.0.