Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Biometrics must support BIOMETRIC_STRONG
Browse files Browse the repository at this point in the history
  • Loading branch information
M3DZIK committed Feb 27, 2024
1 parent 2b9c3c1 commit 4290273
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fun showBiometricPromptForUnlock(
.setTitle(context.getString(R.string.BiometricUnlock_Title))
.setSubtitle(context.getString(R.string.BiometricUnlock_Subtitle))
.setNegativeButtonText(context.getString(R.string.BiometricUnlock_Button_UsePassword))
.setAllowedAuthenticators(BiometricManager.Authenticators.BIOMETRIC_STRONG)
.build()

showBiometricPrompt(context, promptInfo, cipher, onAuthenticationSucceeded, onAuthenticationFailed)
Expand All @@ -34,6 +35,7 @@ fun showBiometricPromptForSetup(
.setTitle(context.getString(R.string.BiometricSetup_Title))
.setSubtitle(context.getString(R.string.BiometricSetup_Subtitle))
.setNegativeButtonText(context.getString(R.string.BiometricSetup_Button_Cancel))
.setAllowedAuthenticators(BiometricManager.Authenticators.BIOMETRIC_STRONG)
.build()

showBiometricPrompt(context, promptInfo, cipher, onAuthenticationSucceeded, onAuthenticationFailed)
Expand Down Expand Up @@ -68,7 +70,7 @@ private fun showBiometricPrompt(
fun checkIfBiometricAvailable(context: Context): Boolean {
val status =
BiometricManager.from(context)
.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_WEAK)
.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_STRONG)

// return true when available
return status == BiometricManager.BIOMETRIC_SUCCESS
Expand Down

0 comments on commit 4290273

Please sign in to comment.