Skip to content
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

Replaced BiometricPrompt with createConfirmDeviceCredentialIntent on Android 10+ and fallback mode enabled #425

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/android/BiometricActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ private void authenticateToEncrypt(boolean invalidateOnEnrollment) throws Crypto
}

private void justAuthenticate() {
mBiometricPrompt.authenticate(createPromptInfo());
if (mPromptInfo.isDeviceCredentialAllowed() && Build.VERSION.SDK_INT > Build.VERSION_CODES.P) { // TODO: remove after fix https://issuetracker.google.com/issues/142740104
// Replace bugged Android 10+ Biometrics API with legacy KeyguardManager
showAuthenticationScreen();
}else{
mBiometricPrompt.authenticate(createPromptInfo());
}
}

private void authenticateToDecrypt() throws CryptoException {
Expand Down Expand Up @@ -169,11 +174,6 @@ private void onError(int errorCode, @NonNull CharSequence errString) {
finishWithError(PluginError.BIOMETRIC_DISMISSED);
return;
case BiometricPrompt.ERROR_NEGATIVE_BUTTON:
// TODO: remove after fix https://issuetracker.google.com/issues/142740104
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P && mPromptInfo.isDeviceCredentialAllowed()) {
showAuthenticationScreen();
return;
}
finishWithError(PluginError.BIOMETRIC_DISMISSED);
break;
case BiometricPrompt.ERROR_LOCKOUT:
Expand Down