安卓指纹识别每段时间只允许5次尝试。

9
我正在开发一个需要使用指纹识别打开Activity的Android应用。我刚刚注意到当我使用指纹解锁手机后,我的应用程序中扫描指纹的尝试次数仅为4次。
例如: - 手机已解锁 - 使用指纹解锁手机 - 打开我的指纹应用程序 - 无法尝试扫描指纹超过4次
另一个场景是: - 指纹应用已经打开 - 只有5次尝试会被接受,应用将不再尝试扫描指纹 - 等待一段时间后,同样只有在一定时间内的5次尝试将被接受
这个问题有解决办法吗?
2个回答

6
我做了一些研究,找到了Android 6.0兼容性定义文件

在指纹传感器部分中指出:

设备实现应该包括指纹传感器以确保安全的锁屏。如果设备实现包括指纹传感器,并具有相应的第三方开发人员API,则:

必须对指纹验证进行至少30秒的速率限制,在5次错误尝试后。

所以...我想目前没有解决方法。


1
当前文档链接在此处 -> https://source.android.com/compatibility/6.0/android-6.0-cdd#7_3_10_fingeprint - Michał Tajchert
1
简述:最多5次错误尝试。 - Ahmed Nabil
[C-1-5] 在指纹验证中,出现五次错误尝试后,必须至少限制30秒的尝试速率。 https://source.android.com/compatibility/android-cdd#7_3_10_1_fingerprint_sensors - Keisuke KATO

3
在寻找解决与我遇到的相同问题时,我偶然发现了这个stackoverflow。
无论如何,使用最新的API BiometricPrompt,我们现在可以通过重写AuthenticationCallback来自定义行为。
BiometricPrompt.AuthenticationCallback() {
    override fun onAuthenticationError(
        errorCode: Int,
        errString: CharSequence
    ) {
        super.onAuthenticationError(errorCode, errString)
    }

    override fun onAuthenticationSucceeded(
        result: BiometricPrompt.AuthenticationResult
    ) {
        super.onAuthenticationSucceeded(result)
    }

    // called when an attempt to authenticate with biometrics fails
    // i.e. invalid fingerprint
    override fun onAuthenticationFailed() {
        super.onAuthenticationFailed()
        // keep track of a counter here and decide when to dismiss the dialog
        biometricPrompt?.cancelAuthentication()
    }
}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接