@Override protected void onPause() { super.onPause(); mFingerPrintAuthHelper.stopAuth(); }
/** * Get the {@link FingerPrintAuthHelper} * * @param context instance of the caller. * @param callback {@link FingerPrintAuthCallback} to get notify whenever authentication success/fails. * @return {@link FingerPrintAuthHelper} */ @SuppressWarnings("ConstantConditions") public static FingerPrintAuthHelper getHelper(@NonNull Context context, @NonNull FingerPrintAuthCallback callback) { if (context == null) { throw new IllegalArgumentException("Context cannot be null."); } else if (callback == null) { throw new IllegalArgumentException("FingerPrintAuthCallback cannot be null."); } return new FingerPrintAuthHelper(context, callback); }
@TargetApi(23) @Nullable private FingerprintManager.CryptoObject getCryptoObject() { return cipherInit() ? new FingerprintManager.CryptoObject(mCipher) : null; }
if (isScanning) stopAuth(); if (!checkFingerPrintAvailability(mContext)) return; FingerprintManager.CryptoObject cryptoObject = getCryptoObject(); if (cryptoObject == null) { mCallback.onAuthFailed(AuthErrorCodes.NON_RECOVERABLE_ERROR, ERROR_FAILED_TO_INIT_CHIPPER);
@Override protected void onResume() { super.onResume(); mGoToSettingsBtn.setVisibility(View.GONE); mAuthMsgTv.setText("Scan your finger"); //start finger print authentication mFingerPrintAuthHelper.startAuth(); }
boolean isKeyGenerated = generateKey();
mFingerPrintAuthHelper = FingerPrintAuthHelper.getHelper(this, this);