diff --git a/CHANGELOG.md b/CHANGELOG.md index ff5e389..fca6ffc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All notable changes to this project will be documented in this file. +## [4.0.1-OS6] + +### 27-11-2024 +- [Android] Fix issue where multiple wrong biometric attempts would cause the plugin to return lockout automatically in future prompts. ## [4.0.1-OS5] diff --git a/package.json b/package.json index 883bf76..5c1970c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-fingerprint-aio", - "version": "4.0.1-OS5", + "version": "4.0.1-OS6", "description": "Cordova plugin to use fingerprint authentication on Android and iOS", "cordova": { "id": "cordova-plugin-fingerprint-aio", diff --git a/plugin.xml b/plugin.xml index 74546a6..86de59c 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,5 +1,5 @@ - + FingerprintAllInOne Cordova plugin to use fingerprint on Android and iOS MIT diff --git a/src/android/BiometricActivity.java b/src/android/BiometricActivity.java index 5d68a04..df8fb43 100644 --- a/src/android/BiometricActivity.java +++ b/src/android/BiometricActivity.java @@ -24,7 +24,7 @@ public class BiometricActivity extends AppCompatActivity { private CryptographyManager mCryptographyManager; private static final String SECRET_KEY = "__aio_secret_key"; private BiometricPrompt mBiometricPrompt; - private static int numFailedAttempts = 0; + private int numFailedAttempts = 0; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { @@ -40,11 +40,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { mPromptInfo = new PromptInfo.Builder(getIntent().getExtras()).build(); - if(numFailedAttempts >= mPromptInfo.getMaxAttempts()) { - onError(PluginError.BIOMETRIC_LOCKED_OUT.getValue(), PluginError.BIOMETRIC_LOCKED_OUT.getMessage()); - return; - } - mCryptographyManager = new CryptographyManagerImpl(); final Handler handler = new Handler(Looper.getMainLooper()); Executor executor = handler::post; @@ -136,6 +131,7 @@ public void onAuthenticationFailed() { if(numFailedAttempts >= mPromptInfo.getMaxAttempts()) { onError(PluginError.BIOMETRIC_LOCKED_OUT.getValue(), PluginError.BIOMETRIC_LOCKED_OUT.getMessage()); mBiometricPrompt.cancelAuthentication(); + numFailedAttempts = 0; } } };