简体   繁体   English

Android - 指纹扫描仪在5次尝试后停止工作?

[英]Android - Fingerprint scanner stops working after 5 attempts?

A bit of a weird issue when using the fingerprint scanner in Android 6.0 (Marshmallow) that I am stuck with and can't figure out. 在Android 6.0(Marshmallow)中使用指纹扫描仪时我遇到了一些奇怪的问题,我无法理解。

I have searched all over but can only see things related to hardware defects. 我搜遍了所有但只能看到与硬件缺陷有关的事情。

The application accepts, encrypts, decrypts and validates fingerprints just fine, however it only allows 5 attempts before it for some reason stops working. 该应用程序接受,加密,解密和验证指纹就好了,但它只能在它出于某种原因停止工作之前进行5次尝试。 (More on that below) (以下更多内容)

I have setup the application to allow the user four scan attempts before implementing a security lockout timer, however if I intentionally fail to authenticate 4 times. 我已经设置了应用程序,允许用户在实施安全锁定计时器之前进行四次扫描尝试,但是如果我故意无法进行4次身份验证。 Then I wait to lockout period of 5 minutes and come back I can only scan my finger once, after that the fingerprint appears to stop listening until I force quit the application from Applications Manager? 然后我等待锁定5分钟的时间然后回来我只能扫描我的手指一次,之后指纹似乎停止听,直到我强行退出Applications Manager中的应用程序?

It then accepts fingerprints again. 然后它再次接受指纹。

Code for authenticationFailed callback: authenticationFailed回调代码:

@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();
    }
}

Even without the lockout security code the scanner still only accepts 5 prints. 即使没有锁定安全代码,扫描仪仍然只接受5次打印。

I have found at that the API forces the security to have a 30 second gap between 5th and further attempts. 我发现API强制安全性在第5次尝试和进一步尝试之间有30秒的差距。

This means that the scanner will be unresponsive after the 5th attempt if the security of the application sets lockout at 4. 这意味着如果应用程序的安全性将锁定设置为4,则在第5次尝试后扫描程序将无响应。

Documentation: 文档:

Device implementations with a secure lock screen SHOULD include a fingerprint sensor. 具有安全锁定屏幕的设备实现应该包括指纹传感器。 If a device implementation includes a fingerprint sensor and has a corresponding API for third-party developers, it: MUST rate limit attempts for at least 30 seconds after 5 false trials for fingerprint verification. 如果设备实现包括指纹传感器并且具有针对第三方开发人员的相应API,则:在指纹验证的5次错误试验后,必须至少30秒的速率限制尝试。

Find information here . 在此查找信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM