【发布时间】: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 次打印。
【问题讨论】:
-
是
attemptCount在setSecurityBanTimer之后重置? -
我会改变它,并在大约 2 分钟内告诉你它是否修复。 :)
-
这并不能解决问题。
标签: java android fingerprint