Skip to content

Commit

Permalink
Merge pull request #46 from zVolt/dev
Browse files Browse the repository at this point in the history
allow biometric weak as well
  • Loading branch information
zkhan93 authored Oct 4, 2022
2 parents 34db58d + 78e95ba commit cf2d15f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/src/main/java/io/github/zkhan93/familyfinance/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import static androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_STRONG;
import static androidx.biometric.BiometricManager.Authenticators.DEVICE_CREDENTIAL;
import static androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_WEAK;


import android.app.Application;
import android.content.SharedPreferences;
Expand Down Expand Up @@ -65,7 +67,7 @@ public void setBiometricAuthValidFromTimeToNow() {
public void requestAuth(FragmentActivity activity){

if (BiometricManager.from(getApplicationContext())
.canAuthenticate(BIOMETRIC_STRONG | DEVICE_CREDENTIAL) ==
.canAuthenticate(BIOMETRIC_STRONG | BIOMETRIC_WEAK | DEVICE_CREDENTIAL) ==
BiometricManager.BIOMETRIC_SUCCESS) {
requestBiometricAuth(activity);
} else {
Expand Down Expand Up @@ -120,7 +122,7 @@ public void onAuthenticationFailed() {
.setSubtitle("Log in using your biometric credential");

if (Build.VERSION.SDK_INT > 29) {
builder = builder.setAllowedAuthenticators(BIOMETRIC_STRONG | DEVICE_CREDENTIAL);
builder = builder.setAllowedAuthenticators(BIOMETRIC_STRONG | BIOMETRIC_WEAK | DEVICE_CREDENTIAL);
}else{
builder.setDeviceCredentialAllowed(true);
}
Expand Down

0 comments on commit cf2d15f

Please sign in to comment.