-
Notifications
You must be signed in to change notification settings - Fork 666
Fix keychain biometric prompts on Android #6631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c13f0a5
to
87e97b7
Compare
Updated with our latest solution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍🏽
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌮
* Use storage type RSA * Log supported biometry result
* Use storage type RSA * Log supported biometry result
Fixes APP-2622
What changed (plus any additional context for devs)
When upgrading
react-native-keychain
to v9 it now uses insteadBLOCK_MODE_GCM
ofBLOCK_MODE_ECB
which supports biometrics authentication. This means that it will prompt for biometrics when trying to encrypt or decrypt values.The issue is that when restoring multiple wallets from a backup it executes many operations requiring encryption in a row and it seems like pixel device rate limit how often the prompt can be shown and the encryption key generated is only valid for 5 seconds because of the config in react-native-keychain. This means that sometimes the generated key is expired, but the system will not allow showing a biometrics prompt yet.
To fix this we can increase the validity of the key to 5 minutes to reduce the number of prompts, and I think this still keeps good safety, while avoiding to spam the user.
Another alternative would be to force using an encryption method without biometrics prompt, but this is better in my opinion.
Screen recordings / screenshots
Tested by @ibrahimtaveras00 on Pixel device where the issue happened.
screen-20250514-181209.mp4
What to test
Restore a wallet from backup as described in the notion document.