-
Notifications
You must be signed in to change notification settings - Fork 3.4k
android: implement biometric authentication (fingerprint) #10340
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
base: master
Are you sure you want to change the base?
Conversation
SomberNight
left a comment
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.
just some quick comments, I haven't really looked at this
electrum/simple_config.py
Outdated
| WALLET_ANDROID_USE_BIOMETRIC_AUTHENTICATION = ConfigVar('android_use_biometrics', default=False, type_=bool) | ||
| WALLET_ANDROID_BIOMETRIC_DATA = ConfigVar( | ||
| 'android_biometric_data', default='', type_=str, | ||
| short_desc=lambda: 'Wallet password encrypted with android biometric authentication key' |
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.
i18n localization missing
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.
Yeah I intentionally didn't add it as the description is not being used, but added the description as i thought of it as a more productive use of the space than adding a simple comment, probably the worst of both worlds.
I removed the description and use a more descriptive variable name now (*BIOMETRIC_DATA sounded a bit ambiguous).
electrum/gui/qml/qebiometrics.py
Outdated
| jPythonActivity.startActivityForResult(intent, 12345) # Request code | ||
|
|
||
| def _on_activity_result(self, requestCode: int, resultCode: int, intent): | ||
| if requestCode != 12345: | ||
| return |
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.
No magic numbers. Create a named constant for it.
E.g. (though this example is in java)
electrum/electrum/gui/qml/java_classes/org/electrum/qr/SimpleScannerActivity.java
Line 33 in cb7e550
| private static final int MY_PERMISSIONS_CAMERA = 1002; |
Also, just noticed we don't really do this for the qr scanner?? weird. I guess we should.
electrum/electrum/gui/qml/qeqrscanner.py
Lines 57 to 60 in cb7e550
| jpythonActivity.startActivityForResult(intent, 0) | |
| def on_qr_activity_result(self, requestCode, resultCode, intent): | |
| try: |
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.
Created constants and added a commit 3d72275 to also use a requestCode in the QR code scanner.
f724c33 to
3d72275
Compare
Allows to unlock the android app with the android biometric api (e.g. fingerprint). Can be enabled in the settings.
|
I assume this will be combined with #10339? (as handing over the wallet password to some biometric backend is a risk) |
|
@accumulator no, the PRs are independent. |
Allows to unlock the android app with the android biometric api (e.g. fingerprint). Can be enabled in the settings.
The initial version was LLM generated but i reviewed it and rewrote a couple things.
TODO: checkbox to enable it in the wizard during wallet setup once one password is enforced for creation of new wallets
closes #7560