AndroidBiometricPrompt:在允许使用设备凭据的情况下,人脸认证被忽略。
创始人
2024-10-06 12:03:46
0

为了解决这个问题,需要在使用BiometricPrompt进行身份验证时,显式地禁用设备凭据。以下是一个示例:

private fun showBiometricPrompt(context: Context) {
    val executor = ContextCompat.getMainExecutor(context)
    val biometricPrompt = BiometricPrompt(context, executor, object : BiometricPrompt.AuthenticationCallback() {
        override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
            super.onAuthenticationSucceeded(result)
            // Handle authentication successful.
        }

        override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
            super.onAuthenticationError(errorCode, errString)
            // Handle authentication error.
        }

        override fun onAuthenticationFailed() {
            super.onAuthenticationFailed()
            // Handle authentication failed.
        }
    })

    val promptInfo = BiometricPrompt.PromptInfo.Builder()
        .setTitle("Authentication Title")
        .setSubtitle("Authentication Subtitle")
        .setDescription("Authentication Description")
        .setDeviceCredentialAllowed(false) // Disable device credential.
        .build()

    biometricPrompt.authenticate(promptInfo)
}

相关内容

热门资讯

解密透视!hardrock作必... 解密透视!hardrock作必弊!总是是有辅助技巧(了解有挂)-哔哩哔哩1.hardrock作必弊 ...
开挂透视!wepoker透视功... 开挂透视!wepoker透视功能下载,aapoker怎么设置提高好牌几率,办法教程(有挂攻略)-哔哩...
必备透视!拱趴大菠萝辅助神器!... 必备透视!拱趴大菠萝辅助神器!都是是真的有辅助app(有挂细节)-哔哩哔哩;1、拱趴大菠萝辅助神器公...
揭幕透视!aapoker辅助器... 揭幕透视!aapoker辅助器是真的吗,werplan脚本,教程书教程(有挂透明挂)-哔哩哔哩1、a...
曝光透视!拱趴大菠萝万能挂!竟... 曝光透视!拱趴大菠萝万能挂!竟然是真的有辅助软件(发现有挂)-哔哩哔哩拱趴大菠萝万能挂辅助器是一种具...
关于透视!德普之星app安卓版... 关于透视!德普之星app安卓版破解版,哈糖大菠萝有挂吗5个常用方法,办法教程(了解有挂)-哔哩哔哩1...
详细透视!德州透视是真的吗!一... 详细透视!德州透视是真的吗!一直是有辅助技巧(果真有挂)-哔哩哔哩德州透视是真的吗能透视中分为三种模...
辅助透视!wpk俱乐部怎么作必... 辅助透视!wpk俱乐部怎么作必弊,xpoker辅助,模块教程(真是有挂)-哔哩哔哩wpk俱乐部怎么作...
普及透视!德州局透视脚本下载安... 普及透视!德州局透视脚本下载安装最新版本!一贯是有辅助教程(有挂秘籍)-哔哩哔哩1、上手简单,内置详...
普及透视!wepoker辅助工... 普及透视!wepoker辅助工具,hardrock作必弊,项目教程(有挂详情)-哔哩哔哩1、起透看视...