Open Pey-crypto opened 4 years ago
Same problem here. There are (unfortunately) some new Android phones which have only face unlock and no fingerprint hardware. Would love to fallback to phone pin in such cases.
Actually kinda weird...i just read AuthenticationHelper.java. The code does utilize androidx.biometric.BiometricPrompt, but I noticed that the fallback has not been set in promptInfo in the else statement
Adding .setDeviceCredentialAllowed(true) in else statement might fix the problem...but this is not even a solution
`//` API 23 - 28 with fingerprint
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
FingerprintManager fingerprintManager = (FingerprintManager) context
.getSystemService(Context.FINGERPRINT_SERVICE);
if (fingerprintManager.hasEnrolledFingerprints()) {
authHelper = new AuthenticationHelper(lifecycle, (FragmentActivity) activity, call, completionHandler,
false);
authHelper.authenticate();
return;
}
}
// API 23 or higher with device credentials
KeyguardManager keyguardManager = (KeyguardManager) context.getSystemService(KEYGUARD_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && keyguardManager.isDeviceSecure()) {
String title = call.argument("signInTitle");
String reason = call.argument("localizedReason");
Intent authIntent = keyguardManager.createConfirmDeviceCredentialIntent(title, reason);
activity.startActivityForResult(authIntent, LOCK_REQUEST_CODE);
return;
}``
This block can be avoided Androidx is already handling everything from Android 6 to the latest version
@Pey-crypto @aghanti7 Is this on physical phones or on emulators? What phones/emulators are you using?
Physical Phones such as alcatel 1x or Nokia 1...These devices run android 8 or higher but do not have a fingerprint scanner https://www.gsmarena.com/alcatel_1x-9086.php
This is difficult to reproduce. I only have Pixel 1-3 phones for testing and Android 8 emulators appear to always show fingerprint as available hardware – even when emulating a phone that does not have that hardware.
I added some additional hardware and enrollment checks in #3, but I am not sure that addresses the issue reported.
The issue still exists. Kinda frustrating is it possible to add an Fingerprint Check at Fingerprint Manager https://developer.android.com/reference/android/hardware/fingerprint/FingerprintManager#FINGERPRINT_ERROR_HW_NOT_PRESENT
In Iphone if faceid is enabled it shows enter passcode or password to proceed instead of asking for faceid.
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.hardware.fingerprint.FingerprintManager.hasEnrolledFingerprints()' on a null object reference
The app had no problems running in a biometric phone but has problems running in a non-biometric phone