mibrito707 / cordova-plugin-secure-storage-echo

Secure storage plugin for Apache Cordova

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trouble with emulator

oddcb opened this issue · comments

Hi. Inside encryptionKeysAvailable() in RSA.java there is a check for keyInfo.isInsideSecureHardware(). In the emulator this method seems to returns false (Tested in P/Q emulators). In turn when the app is relaunched the key for the app is regenerated. Screen lock setup with pin and fingerprint in the emulator.

Do you know of any workarounds? The plugin otherwise seems to work as intended on a physical device (Pixel 2)

I am also facing the same issue. Any solutions?

Hello,
I'm having the same issue. My understanding is that the device need to have physical chip providing a Trusted Execution Environment (TEE) in order for the keyInfo.isInsideSecureHardware() to return true. If this is true, that means we cannot test storing/retrieving key on emulator. Does anyone know if all physical android devices has TEE ?

To work around this ON EMULATOR, i modified platforms\android\app\src\main\java\com\crypho\plugins\RSA.java to return true in method isEntryAvailable() (replace "return keyInfo.isInsideSecureHardware()" with "return true") to bypass the TEE test. Then rebuilt and redeployed to emulator. Please remember to revert this change BEFORE building for real device