指纹识别

指纹识别
我们可以在手机中保存多个指纹,当我们解锁的时候任意一个录入的手指都能够打开手机。但是,如果是支付宝就不可以了。
支付宝涉及到钱财,安全级别就很高了。当我们打开支付宝的指纹功能,他会提示我们录入指纹,这时候会跟我们的指纹库对比,如果有,则录入成功,保存该指纹的信息。
当我们用另外一个手指测试,其实

“`
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
mErrorTextView.removeCallbacks(mResetErrorTextRunnable);
mIcon.setImageResource(R.drawable.ic_fingerprint_success);
mErrorTextView.setTextColor(
mErrorTextView.getResources().getColor(R.color.success_color, null));
mErrorTextView.setText(
mErrorTextView.getResources().getString(R.string.fingerprint_success));
mIcon.postDelayed(new Runnable() {
@Override
public void run() {
mCallback.onAuthenticated();
}
}, SUCCESS_DELAY_MILLIS);

//通过反射来获取
try {

    Method method1 = result.getClass().getMethod("getCryptoObject");
    Object cryptoObject = method1.invoke(result, new Object[]{});

    Method method2 = result.getClass().getMethod("getFingerprint");
    Object fingerPrint = method2.invoke(result, new Object[]{});

} catch ( NoSuchMethodException e ) {
    e.printStackTrace();
} catch (InvocationTargetException e) {
    e.printStackTrace();
} catch (IllegalAccessException e) {
    e.printStackTrace();
}

}
“`在这个方法中,已经是表示正确的返回,只是我们要比较一下指纹的信息是否和我们当时录入的一致。如果一致,则认为是正确的,否则失败。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值