【问题标题】:Android - Fingerprint scanner stops working after 5 attempts?Android - 指纹扫描仪在 5 次尝试后停止工作?
【发布时间】:2017-10-19 15:55:18
【问题描述】:

在 Android 6.0 (Marshmallow) 中使用指纹扫描仪时出现了一个奇怪的问题,我一直无法解决。

我搜遍了,只能看到与硬件缺陷有关的东西。

该应用程序可以很好地接受、加密、解密和验证指纹,但是它只允许尝试 5 次,然后由于某种原因停止工作。 (更多内容见下文)

我已将应用程序设置为允许用户在实施安全锁定计时器之前进行四次扫描尝试,但是如果我故意未能通过 4 次身份验证。然后我等待 5 分钟的锁定期然后回来我只能扫描我的手指一次,之后指纹似乎停止侦听,直到我从 Applications Manager 强制退出应用程序?

然后它再次接受指纹。

验证失败回调代码:

@Override
public void onAuthenticationFailed() {
    authenticationDialog.dismiss();
    cancellationSignal.cancel();

    //Add one to the number of attempts taken
    attemptCount += 1;

    if (attemptCount < maxAttempAllowance) {
        AlertDialog.Builder message = new AlertDialog.Builder(appContext);
        message.setTitle("Authentication Failed");
        message.setMessage("The finger you scanned is not registered in your devices settings or your device failed to identify you.");
        message.setPositiveButton("Try Again", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
                showAuthenticationDialog();
                startAuth(manager, cryptoObject);
            }
        });
        message.setIcon(R.drawable.cross_flat);
        message.setCancelable(false);
        message.show();
    }
    else {
        AlertDialog.Builder message = new AlertDialog.Builder(appContext);
        message.setTitle("Authentication Failed");
        message.setMessage("You have exceeded the maximum login attempts allowed. Try again in 5 minutes.");
        message.setIcon(R.drawable.cross_flat);
        message.setCancelable(false);
        message.show();
        setSecurityBanTimer();
    }
}

即使没有锁定安全码,扫描仪仍然只能接受 5 次打印。

【问题讨论】:

  • attemptCountsetSecurityBanTimer 之后重置?
  • 我会改变它,并在大约 2 分钟内告诉你它是否修复。 :)
  • 这并不能解决问题。

标签: java android fingerprint


【解决方案1】:

我发现 API 会强制安全性在第 5 次和进一步尝试之间有 30 秒的间隔。

这意味着如果应用程序的安全性将锁定设置为 4,则扫描仪将在第 5 次尝试后无响应。

文档:

具有安全锁屏的设备实现应该包括指纹传感器。如果设备实现包含指纹传感器并具有供第三方开发人员使用的相应 API,则: 必须在 5 次指纹验证错误试验后限制尝试次数至少 30 秒。

查找信息here

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-05-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多