From bee12732fa4b02ec11c09da2816d4ff61000eb21 Mon Sep 17 00:00:00 2001 From: Marta Carlos <101343976+OS-martacarlos@users.noreply.github.com> Date: Thu, 22 Feb 2024 09:46:22 +0000 Subject: [PATCH] RMET-3176 :: Merge development into main/outsystems (#13) * fix: catch two possible biometric erros (#10) - BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED - BIOMETRIC_STATUS_UNKNOWN https://outsystemsrd.atlassian.net/browse/RMET-3176 * RMET-3176 :: raise android biometric version (#11) * fix: catch two possible biometric erros - BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED - BIOMETRIC_STATUS_UNKNOWN https://outsystemsrd.atlassian.net/browse/RMET-3176 * fix: raise androidx biometric version https://outsystemsrd.atlassian.net/browse/RMET-3176 * feat: raise lib version (#12) https://outsystemsrd.atlassian.net/browse/RMET-3176 --- CHANGELOG.md | 5 ++++- package.json | 2 +- plugin.xml | 2 +- src/android/Fingerprint.java | 9 +++++++-- src/android/PluginError.java | 6 +++++- src/android/build.gradle | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84791d23..ff5e389c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,10 @@ All notable changes to this project will be documented in this file. -## [Unreleased] +## [4.0.1-OS5] + +### 19-02-2024 +- [Android] Add catch to two biometric errors. (https://outsystemsrd.atlassian.net/browse/RMET-3176) ## [4.0.1-OS4] diff --git a/package.json b/package.json index 4948c519..883bf76c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-fingerprint-aio", - "version": "4.0.1-OS4", + "version": "4.0.1-OS5", "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 96dfd10e..74546a66 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/Fingerprint.java b/src/android/Fingerprint.java index 3bf9ab43..19fed1ef 100644 --- a/src/android/Fingerprint.java +++ b/src/android/Fingerprint.java @@ -136,16 +136,21 @@ private void sendError(Intent intent) { } private PluginError canAuthenticate() { - int error = BiometricManager.from(cordova.getContext()).canAuthenticate(); + int error = BiometricManager.from(cordova.getContext()).canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_WEAK); + switch (error) { case BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE: case BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE: return PluginError.BIOMETRIC_HARDWARE_NOT_SUPPORTED; case BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED: return PluginError.BIOMETRIC_NOT_ENROLLED; + case BiometricManager.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED: + return PluginError.BIOMETRIC_SECURITY_VULNERABILITY; case BiometricManager.BIOMETRIC_SUCCESS: - default: return null; + case BiometricManager.BIOMETRIC_STATUS_UNKNOWN: + default: + return PluginError.BIOMETRIC_UNKNOWN_ERROR; } } diff --git a/src/android/PluginError.java b/src/android/PluginError.java index 6f8b09d3..9349147f 100644 --- a/src/android/PluginError.java +++ b/src/android/PluginError.java @@ -13,7 +13,11 @@ public enum PluginError { BIOMETRIC_LOCKED_OUT(-111, "Too many failed attempts. Try again later."), BIOMETRIC_LOCKED_OUT_PERMANENT(-112), BIOMETRIC_NO_SECRET_FOUND(-113), - BIOMETRIC_ARGS_PARSING_FAILED(-115); + BIOMETRIC_ARGS_PARSING_FAILED(-115), + + BIOMETRIC_SECURITY_VULNERABILITY(-116, + "A security vulnerability has been discovered with one or more hardware sensors. The affected sensor(s) are unavailable until a security update has addressed the issue."), + ; private int value; private String message; diff --git a/src/android/build.gradle b/src/android/build.gradle index a12ec27b..82f3bef2 100644 --- a/src/android/build.gradle +++ b/src/android/build.gradle @@ -1,5 +1,5 @@ dependencies { - implementation "androidx.biometric:biometric:1.0.1" + implementation "androidx.biometric:biometric:1.1.0" } android {