在Android应用程序中注册用户指纹

Roh*_*oha 7 java android rsa-key-fingerprint android-studio android-fingerprint-api

我想制作一个Android应用程序,该应用程序注册用户指纹(从设备的指纹扫描仪中获取)并将其存储在数据结构或密钥存储提供程序中,下一次用户放置指纹扫描仪时,应该从存储在数据中的指纹进行身份验证结构或来自android keystore provider。如果有人可以帮助我如何解决这个问题。提前致谢。

Ami*_*zan 1

抱歉,据我所知,无法注册指纹。用户应在设置中注册他/她的手指。您只需检查用户指纹即可进行身份验证。如果没有注册手指或没有指纹传感器,轻松烘烤它。

\n\n
//Check whether the device has a fingerprint sensor//\n        if (!mFingerprintManager.isHardwareDetected()) {\n            // If a fingerprint sensor isn\xe2\x80\x99t available, then inform the user that they\xe2\x80\x99ll be unable to use your app\xe2\x80\x99s fingerprint functionality//\n            textView.setText("Your device doesn\'t support fingerprint authentication");\n        }\n        //Check whether the user has granted your app the USE_FINGERPRINT permission//\n        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {\n            // If your app doesn\'t have this permission, then display the following text//\n            Toast.makeText(EnterPinActivity.this, "Please enable the fingerprint permission", Toast.LENGTH_LONG).show();\n        }\n\n        //Check that the user has registered at least one fingerprint//\n        if (!mFingerprintManager.hasEnrolledFingerprints()) {\n            // If the user hasn\xe2\x80\x99t configured any fingerprints, then display the following message//\n            Toast.makeText(EnterPinActivity.this, "No fingerprint configured. Please register at least one fingerprint in your device\'s Settings", Toast.LENGTH_LONG).show();\n        }\n\n        //Check that the lockscreen is secured//\n        if (!mKeyguardManager.isKeyguardSecure()) {\n            // If the user hasn\xe2\x80\x99t secured their lockscreen with a PIN password or pattern, then display the following text//\n            Toast.makeText(EnterPinActivity.this, "Please enable lockscreen security in your device\'s Settings", Toast.LENGTH_LONG).show();\n        }\n
Run Code Online (Sandbox Code Playgroud)\n\n

查看本教程以了解如何检查用户指纹:

\n\n

链接 1 \n链接 2

\n

  • @RohitSaroha,我在我的应用程序中实现了触摸登录是不可能的。为什么它不可能,因为在身份验证成功时,您会得到 FingerprintManager.AuthenticationResult 对象,其中包含一个密码对象作为成员变量,每个手指具有不同的签名值,并且它返回不同的值同一根手指的价值也是如此......再加上对在这里帮助你的人给予一些尊重,说“你怎么能说这是不可能的”是不礼貌的......祝你编码愉快 (6认同)