我想制作一个Android应用程序,它注册用户指纹(来自设备的指纹扫描仪)并将其存储在数据结构或密钥存储提供商中,下次用户放入他的指纹扫描仪时,他应该进行身份验证来自存储在数据结构中的指纹或来自android密钥库提供程序的指纹。 如果有人可以帮我解决这个问题。 提前致谢。
答案 0 :(得分:0)
很抱歉,据我所知,无法注册指纹。用户应在设置中注册他/她的手指。您只需检查用户指纹以进行身份验证。如果没有注册手指或没有指纹传感器,请轻松烘烤。
//Check whether the device has a fingerprint sensor//
if (!mFingerprintManager.isHardwareDetected()) {
// If a fingerprint sensor isn’t available, then inform the user that they’ll be unable to use your app’s fingerprint functionality//
textView.setText("Your device doesn't support fingerprint authentication");
}
//Check whether the user has granted your app the USE_FINGERPRINT permission//
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
// If your app doesn't have this permission, then display the following text//
Toast.makeText(EnterPinActivity.this, "Please enable the fingerprint permission", Toast.LENGTH_LONG).show();
}
//Check that the user has registered at least one fingerprint//
if (!mFingerprintManager.hasEnrolledFingerprints()) {
// If the user hasn’t configured any fingerprints, then display the following message//
Toast.makeText(EnterPinActivity.this, "No fingerprint configured. Please register at least one fingerprint in your device's Settings", Toast.LENGTH_LONG).show();
}
//Check that the lockscreen is secured//
if (!mKeyguardManager.isKeyguardSecure()) {
// If the user hasn’t secured their lockscreen with a PIN password or pattern, then display the following text//
Toast.makeText(EnterPinActivity.this, "Please enable lockscreen security in your device's Settings", Toast.LENGTH_LONG).show();
}
查看本教程以了解检查用户指纹的方法:
答案 1 :(得分:0)
由于已存储在android安全场所中,因此无法注册指纹并且无法访问指纹数据
答案 2 :(得分:0)
注册后,您可以从android检索指纹ID。
因此,您可以利用android的设置活动在个人那里注册和匹配指纹ID,这样,您就可以将其用于识别和验证。
致谢。