我正在使用Reprint库进行指纹身份验证。但Reprint.isHardwarePresent()方法在某些指纹支持的设备上返回false。
if (Reprint.isHardwarePresent() && Reprint.hasFingerprintRegistered()) {
Reprint.authenticate(new AuthenticationListener() {
@Override
public void onSuccess(int moduleTag) {
numpad.setDesc(getString(R.string.success_fingerprint));
startActivity(new Intent(SigninActivity.this, MainActivity.class));
finish();
}
@Override
public void onFailure(AuthenticationFailureReason failureReason, boolean fatal, CharSequence errorMessage, int moduleTag, int errorCode) {
Log.d(TAG, "Fingerprint Error :"+errorMessage.toString());
if(prefHelper.isVibrateWhenWrong()) feedbackHelper.vibrateNorm();
ivFingerPrint.getDrawable().setColorFilter(getResources().getColor(R.color.colorWrong), PorterDuff.Mode.MULTIPLY );
new Handler().postDelayed(new Runnable() {
public void run() {
ivFingerPrint.getDrawable().clearColorFilter();
}
}, 500);
}
});
}
我的第二个问题,有时Reprint.Authenticate没有开始。它记录了这个
V/FingerprintService: handleError(client=mypackagename, error = 5)
谢谢:)