From 08a7ed8f53ce9f296be630ecf43272af69fd03c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Rejdak?= Date: Tue, 7 Apr 2026 12:59:59 +0200 Subject: [PATCH] bump version of react-native-biometrics, remove patches that introduced changes from this version --- ios/Podfile.lock | 28 +- package-lock.json | 8 +- package.json | 2 +- ...0+001+biometry-temporary-new-release.patch | 511 ------------------ .../react-native-biometrics/details.md | 14 - 5 files changed, 12 insertions(+), 551 deletions(-) delete mode 100644 patches/@sbaiahmed1/react-native-biometrics/@sbaiahmed1+react-native-biometrics+0.14.0+001+biometry-temporary-new-release.patch delete mode 100644 patches/@sbaiahmed1/react-native-biometrics/details.md diff --git a/ios/Podfile.lock b/ios/Podfile.lock index b4a40339469e..90a1fce3818b 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -490,7 +490,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -516,7 +515,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -541,7 +539,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -568,7 +565,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -594,7 +590,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -620,7 +615,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -646,7 +640,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -672,7 +665,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -698,7 +690,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -724,7 +715,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -750,7 +740,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -776,7 +765,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -802,7 +790,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -828,7 +815,6 @@ PODS: - React-jsinspectorcdp - React-jsitooling - React-perflogger - - React-rendererconsistency - React-runtimeexecutor - React-runtimescheduler - React-utils @@ -3515,7 +3501,7 @@ PODS: - React-perflogger (= 0.83.1) - React-utils (= 0.83.1) - SocketRocket - - ReactNativeBiometrics (0.14.0): + - ReactNativeBiometrics (0.15.0): - boost - DoubleConversion - fast_float @@ -4768,7 +4754,7 @@ SPEC CHECKSUMS: AirshipServiceExtension: 50d11b2f62c4a490d4e81a1c36f70e2ecb70a27e AppAuth: d4f13a8fe0baf391b2108511793e4b479691fb73 AppLogs: 3bc4e9b141dbf265b9464409caaa40416a9ee0e0 - boost: 659a89341ea4ab3df8259733813b52f26d8be9a5 + boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90 DoubleConversion: cb417026b2400c8f53ae97020b2be961b59470cb EXConstants: b3c63be5f8648e4ab8e6ff5099b62f629247f969 expensify-react-native-background-task: 03c640e1f5649692d058cba48c0a138f024a6dd3 @@ -4808,7 +4794,7 @@ SPEC CHECKSUMS: GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 GzipSwift: 893f3e48e597a1a4f62fafcb6514220fcf8287fa - hermes-engine: 6bc8fb50f6b2eb191c5be0f853dc1b2f63dbce95 + hermes-engine: 0711ccb14bd615969ef611bc6c2483ea2ed3b09e libavif: 84bbb62fb232c3018d6f1bab79beea87e35de7b7 libdav1d: 23581a4d8ec811ff171ed5e2e05cd27bad64c39f libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8 @@ -4836,7 +4822,7 @@ SPEC CHECKSUMS: React: 4bc1f928568ad4bcfd147260f907b4ea5873a03b React-callinvoker: 87f8728235a0dc62e9dc19b3851c829d9347d015 React-Codegen: 4b8b4817cea7a54b83851d4c1f91f79aa73de30a - React-Core: 176a81025968530159589ec4a67fe2962909fce9 + React-Core: 76bed73b02821e5630e7f2cb2e82432ee964695d React-CoreModules: 752dbfdaeb096658aa0adc4a03ba6214815a08df React-cxxreact: b6798528aa601c6db66e6adc7e2da2b059c8be74 React-debug: b2c9f60a9b7a81cefd737cb61e31c2bc39fdfe17 @@ -4888,7 +4874,7 @@ SPEC CHECKSUMS: React-NativeModulesApple: e554252d69442010807867cc7d70c0008048ad20 React-networking: 669cb54cc7e5b65d7dafeeb36970a1421adc8bb3 React-oscompat: 80166b66da22e7af7fad94474e9997bd52d4c8c6 - React-perflogger: decbf4d10c1f77d687af1d83a6ba9dc1b23715d6 + React-perflogger: d6797918d2b1031e91a9d8f5e7fdd2c8728fb390 React-performancecdpmetrics: 7706707d5dd49d708518a91abe456dcb585a5865 React-performancetimeline: c9807b559901c4298a92f6bcb069f49f518b7020 React-RCTActionSheet: 3bd5f5db9f983cf38d51bb9a7a198e2ebea94821 @@ -4904,7 +4890,7 @@ SPEC CHECKSUMS: React-RCTSettings: 2c45623d6c0f30851a123f621eb9d32298bcbb0c React-RCTText: 0ee70f5dc18004b4d81b2c214267c6cbec058587 React-RCTVibration: 88557e21e7cc3fe76b5b174cba28ff45c6def997 - React-rendererconsistency: 5236fe878921773ef9274c44e189e057672ef5bc + React-rendererconsistency: ac8a9e9ee3eb299458cc848944133ff4be46cc41 React-renderercss: f04cbe3b06ee071c6ca724f41a3c3aa31332601e React-rendererdebug: 2a2e4f7d42abcbec2047e989a1afda5d62905679 React-RuntimeApple: ce2ae0ea88316a7c708be1e6601e4ec5f6febdce @@ -4918,7 +4904,7 @@ SPEC CHECKSUMS: ReactAppDependencyProvider: 0eb286cc274abb059ee601b862ebddac2e681d01 ReactCodegen: d663254bf59e57e5ed7c65638bd45f358a373bba ReactCommon: 15e1e727fa34f760beb7dd52928687fda8edf8dc - ReactNativeBiometrics: f2356e3e148ff77f0e4763b4b79183eaa044a0dd + ReactNativeBiometrics: a0cbd0e25b86964883d38331f32c7643022b7284 ReactNativeHybridApp: 16ebccf5382436fcb9303ab5f4b50d9942bccf5c RNAppleAuthentication: 9027af8aa92b4719ef1b6030a8e954d37079473a RNCClipboard: e560338bf6cc4656a09ff90610b62ddc0dbdad65 diff --git a/package-lock.json b/package-lock.json index deb47c70ee6e..92da93168d06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,7 +48,7 @@ "@react-navigation/stack": "7.8.5", "@react-ng/bounds-observer": "^0.2.1", "@rnmapbox/maps": "10.1.44", - "@sbaiahmed1/react-native-biometrics": "0.14.0", + "@sbaiahmed1/react-native-biometrics": "0.15.0", "@sentry/react-native": "8.2.0", "@shopify/flash-list": "2.3.0", "@shopify/react-native-skia": "^2.4.14", @@ -13475,9 +13475,9 @@ "license": "MIT" }, "node_modules/@sbaiahmed1/react-native-biometrics": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@sbaiahmed1/react-native-biometrics/-/react-native-biometrics-0.14.0.tgz", - "integrity": "sha512-Q20kLHiMi6QjHzZJJFmfNYFlsPiKJxj4lDO5yf6svu7oK1NM9a4paPXQoxQaXzcvPNsItGtciTAR80vbV0jVCw==", + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@sbaiahmed1/react-native-biometrics/-/react-native-biometrics-0.15.0.tgz", + "integrity": "sha512-z/CWCcQZWGj8WRSsxu8flNydLAOS33Cv9tFPY4EuUm7Z47ADxjenoi/RFWNmJEQ5dIbGYC+q8WyzP0yWebawQA==", "license": "MIT", "workspaces": [ "example" diff --git a/package.json b/package.json index a60aa49e5cfa..881c383c1173 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "@react-navigation/stack": "7.8.5", "@react-ng/bounds-observer": "^0.2.1", "@rnmapbox/maps": "10.1.44", - "@sbaiahmed1/react-native-biometrics": "0.14.0", + "@sbaiahmed1/react-native-biometrics": "0.15.0", "@sentry/react-native": "8.2.0", "@shopify/flash-list": "2.3.0", "@shopify/react-native-skia": "^2.4.14", diff --git a/patches/@sbaiahmed1/react-native-biometrics/@sbaiahmed1+react-native-biometrics+0.14.0+001+biometry-temporary-new-release.patch b/patches/@sbaiahmed1/react-native-biometrics/@sbaiahmed1+react-native-biometrics+0.14.0+001+biometry-temporary-new-release.patch deleted file mode 100644 index e872e3635596..000000000000 --- a/patches/@sbaiahmed1/react-native-biometrics/@sbaiahmed1+react-native-biometrics+0.14.0+001+biometry-temporary-new-release.patch +++ /dev/null @@ -1,511 +0,0 @@ -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/README.md b/node_modules/@sbaiahmed1/react-native-biometrics/README.md -index 9fdbbf1..af3a1e2 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/README.md -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/README.md -@@ -305,6 +305,14 @@ android { - -keep class com.sbaiahmed1.reactnativebiometrics.** { *; } - ``` - -+### Importing Types on Non-Native Platforms -+ -+The `AuthType` and `BiometricStrength` enums can be safely imported from `@sbaiahmed1/react-native-biometrics/types` on non-mobile platforms (e.g. web), as this entry point does not load native modules. -+ -+```typescript -+import { AuthType, BiometricStrength } from '@sbaiahmed1/react-native-biometrics/types'; -+``` -+ - ## 📖 Usage - - ### 🔍 Quick Start -@@ -745,7 +753,7 @@ const isSensorAvailable = (): Promise => { - type SensorInfo = { - available: boolean; // Whether biometric auth is available - biometryType?: string; // Type of biometry ('FaceID', 'TouchID', 'Fingerprint', etc.) -- isDeviceSecure?: boolean; // Whether the device has a passcode/PIN/password set -+ isDeviceSecure: boolean; // Whether the device has a passcode/PIN/password set - error?: string; // Error message if not available - errorCode?: string; // Error code if not available (platform-specific) - } -@@ -827,6 +835,14 @@ type KeyResult = { - - `biometricStrength` (optional): Biometric strength requirement (`'strong'` or `'weak'`). - - `allowDeviceCredentials` (optional, default `false`): When `true`, the key can be unlocked by biometrics OR device credentials (PIN/passcode). Requires Android API 30+. - - `failIfExists` (optional, default `false`): When `true`, rejects with `KEY_ALREADY_EXISTS` if a key with the alias already exists instead of overwriting it. -+- `biometricStrength` (optional): Uses `BiometricStrength.Strong` or `BiometricStrength.Weak`. On iOS, `Strong` binds new keys to `.biometryCurrentSet`; `Weak`/unset uses `.biometryAny` for backward compatibility. -+- `allowDeviceCredentials` (optional, default `false`): When `true`, the key can be unlocked by biometrics OR device credentials (PIN/passcode). On iOS this uses `.userPresence` to allow passcode fallback; on Android this requires API 30+. -+- `failIfExists` (optional, default `false`): When `true`, rejects with `KEY_ALREADY_EXISTS` if a key with the alias already exists instead of overwriting it. -+ -+**iOS migration guidance** -+- Existing keys keep the access-control policy they were created with; this setting only affects newly created keys. -+- If you switch iOS key creation to `BiometricStrength.Strong`, recreate keys (`deleteKeys` + `createKeys`) to migrate. -+- Keys created with `.biometryCurrentSet` are invalidated when biometric enrollment changes. - - > 📖 **For detailed key type information, security considerations, and advanced usage patterns, see the [Cryptographic Keys Guide](./docs/CRYPTOGRAPHIC_KEYS.md)** - -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/android/src/main/java/com/sbaiahmed1/reactnativebiometrics/ReactNativeBiometricsSharedImpl.kt b/node_modules/@sbaiahmed1/react-native-biometrics/android/src/main/java/com/sbaiahmed1/reactnativebiometrics/ReactNativeBiometricsSharedImpl.kt -index ad238c8..ee32aeb 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/android/src/main/java/com/sbaiahmed1/reactnativebiometrics/ReactNativeBiometricsSharedImpl.kt -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/android/src/main/java/com/sbaiahmed1/reactnativebiometrics/ReactNativeBiometricsSharedImpl.kt -@@ -760,6 +760,7 @@ class ReactNativeBiometricsSharedImpl(private val context: ReactApplicationConte - val authTypeValue = when (authResult.authenticationType) { - BiometricPrompt.AUTHENTICATION_RESULT_TYPE_DEVICE_CREDENTIAL -> 1 - BiometricPrompt.AUTHENTICATION_RESULT_TYPE_BIOMETRIC -> 2 -+ BiometricPrompt.AUTHENTICATION_RESULT_TYPE_UNKNOWN -> -1 - else -> 0 - } - successResult.putInt("authType", authTypeValue) -@@ -1296,6 +1297,7 @@ class ReactNativeBiometricsSharedImpl(private val context: ReactApplicationConte - val authTypeValue = when (authResult.authenticationType) { - BiometricPrompt.AUTHENTICATION_RESULT_TYPE_DEVICE_CREDENTIAL -> 1 - BiometricPrompt.AUTHENTICATION_RESULT_TYPE_BIOMETRIC -> 2 -+ BiometricPrompt.AUTHENTICATION_RESULT_TYPE_UNKNOWN -> -1 - else -> 0 - } - result.putInt("authType", authTypeValue) -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/ios/ReactNativeBiometrics.swift b/node_modules/@sbaiahmed1/react-native-biometrics/ios/ReactNativeBiometrics.swift -index f44289c..79eab8f 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/ios/ReactNativeBiometrics.swift -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/ios/ReactNativeBiometrics.swift -@@ -3,6 +3,7 @@ import LocalAuthentication - import React - import Security - import CryptoKit -+import CryptoTokenKit - - @objc(ReactNativeBiometrics) - class ReactNativeBiometrics: RCTEventEmitter { -@@ -34,6 +35,65 @@ class ReactNativeBiometrics: RCTEventEmitter { - return generateKeyAlias(customAlias: customAlias, configuredAlias: configuredKeyAlias) - } - -+ private func biometricDomainStateStorageKey(for keyTag: String) -> String { -+ return "ReactNativeBiometricsDomainState.\(keyTag)" -+ } -+ -+ private func clearStoredBiometricDomainState(for keyTag: String) { -+ UserDefaults.standard.removeObject(forKey: biometricDomainStateStorageKey(for: keyTag)) -+ } -+ -+ private func persistCurrentBiometricDomainState(for keyTag: String) { -+ let context = LAContext() -+ var error: NSError? -+ -+ guard context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error), -+ let domainState = context.evaluatedPolicyDomainState else { -+ clearStoredBiometricDomainState(for: keyTag) -+ return -+ } -+ -+ UserDefaults.standard.set( -+ domainState.base64EncodedString(), -+ forKey: biometricDomainStateStorageKey(for: keyTag) -+ ) -+ } -+ -+ private func hasBiometricDomainStateChanged(for keyTag: String) -> Bool { -+ guard let storedDomainStateBase64 = UserDefaults.standard.string( -+ forKey: biometricDomainStateStorageKey(for: keyTag) -+ ), -+ let storedDomainState = Data(base64Encoded: storedDomainStateBase64) else { -+ // Keys that do not use .biometryCurrentSet intentionally do not store domain state. -+ return false -+ } -+ -+ let context = LAContext() -+ var error: NSError? -+ -+ let canEvaluate = context.canEvaluatePolicy( -+ .deviceOwnerAuthenticationWithBiometrics, -+ error: &error -+ ) -+ -+ if !canEvaluate { -+ switch error.flatMap({ LAError.Code(rawValue: $0.code) }) { -+ case .biometryNotEnrolled: -+ return true -+ case .biometryLockout: -+ return false -+ default: -+ return false -+ } -+ } -+ -+ guard let currentDomainState = context.evaluatedPolicyDomainState else { -+ return true -+ } -+ -+ return storedDomainState != currentDomainState -+ } -+ - @objc - override static func requiresMainQueueSetup() -> Bool { - return false -@@ -392,6 +452,12 @@ class ReactNativeBiometrics: RCTEventEmitter { - biometricKeyType = .ec256 - } - -+ // iOS migration-safe behavior: -+ // - default/weak -> .biometryAny (backward-compatible with existing keys) -+ // - strong -> .biometryCurrentSet (invalidated on biometric enrollment change) -+ let biometricStrengthValue = (biometricStrength as String?)?.lowercased() -+ let useBiometryCurrentSet = biometricStrengthValue == "strong" -+ - // Check if key already exists when failIfExists is true - if failIfKeyExists { - let checkQuery = createKeychainQuery(keyTag: keyTag, includeSecureEnclave: biometricKeyType == .ec256) -@@ -430,7 +496,8 @@ class ReactNativeBiometrics: RCTEventEmitter { - // Create access control for biometric authentication - guard let accessControl = createBiometricAccessControl( - for: biometricKeyType, -- allowDeviceCredentialsFallback: deviceCredentialsFallback -+ allowDeviceCredentialsFallback: deviceCredentialsFallback, -+ useBiometryCurrentSet: useBiometryCurrentSet - ) else { - ReactNativeBiometricDebug.debugLog("createKeys failed - Could not create access control") - handleError(.accessControlCreationFailed, reject: reject) -@@ -470,6 +537,14 @@ class ReactNativeBiometrics: RCTEventEmitter { - "publicKey": publicKeyBase64 - ] - -+ let shouldPersistBiometricDomainState = !deviceCredentialsFallback && useBiometryCurrentSet -+ -+ if !shouldPersistBiometricDomainState { -+ clearStoredBiometricDomainState(for: keyTag) -+ } else { -+ persistCurrentBiometricDomainState(for: keyTag) -+ } -+ - ReactNativeBiometricDebug.debugLog("Keys created successfully with tag: \(keyTag), type: \(biometricKeyType)") - resolve(result) - } -@@ -497,6 +572,7 @@ class ReactNativeBiometrics: RCTEventEmitter { - let checkStatus = SecItemCopyMatching(query as CFDictionary, nil) - - if checkStatus == errSecItemNotFound { -+ clearStoredBiometricDomainState(for: keyTag) - ReactNativeBiometricDebug.debugLog("No key found with tag '\(keyTag)' - nothing to delete") - resolve(["success": true]) - return -@@ -507,11 +583,12 @@ class ReactNativeBiometrics: RCTEventEmitter { - - switch deleteStatus { - case errSecSuccess: -- ReactNativeBiometricDebug.debugLog("Key with tag '\(keyTag)' deleted successfully") -+ ReactNativeBiometricDebug.debugLog("Deletion succeeded for key with tag '\(keyTag)'; verifying removal") - - // Verify deletion - let verifyStatus = SecItemCopyMatching(query as CFDictionary, nil) - if verifyStatus == errSecItemNotFound { -+ clearStoredBiometricDomainState(for: keyTag) - ReactNativeBiometricDebug.debugLog("Keys deleted and verified successfully") - resolve(["success": true]) - } else { -@@ -520,6 +597,7 @@ class ReactNativeBiometrics: RCTEventEmitter { - } - - case errSecItemNotFound: -+ clearStoredBiometricDomainState(for: keyTag) - ReactNativeBiometricDebug.debugLog("No key found with tag '\(keyTag)' - nothing to delete") - resolve(["success": true]) - -@@ -710,6 +788,15 @@ class ReactNativeBiometrics: RCTEventEmitter { - checks["keyAccessible"] = true - checks["hardwareBacked"] = isHardwareBacked - -+ if hasBiometricDomainStateChanged(for: keyTag) { -+ checks["keyAccessible"] = false -+ integrityResult["integrityChecks"] = checks -+ integrityResult["error"] = ReactNativeBiometricsError.biometryCurrentSetChanged.errorInfo.message -+ ReactNativeBiometricDebug.debugLog("validateKeyIntegrity - Biometric enrollment change detected for keyTag: \(keyTag)") -+ resolve(integrityResult) -+ return -+ } -+ - // Perform signature test - let testData = "integrity_test_data".data(using: .utf8)! - let algorithm = getSignatureAlgorithm(for: keyRef) -@@ -740,6 +827,8 @@ class ReactNativeBiometrics: RCTEventEmitter { - biometricsError = .userCancel - } else if errorCode == errSecAuthFailed { - biometricsError = .authenticationFailed -+ } else if errorCode == TKError.Code.corruptedData.rawValue { -+ biometricsError = .keyAccessFailed - } else { - biometricsError = .signatureCreationFailed - } -@@ -879,6 +968,19 @@ class ReactNativeBiometrics: RCTEventEmitter { - - // Force cast SecKey since conditional downcast to CoreFoundation types always succeeds - let keyRef = result as! SecKey -+ -+ if hasBiometricDomainStateChanged(for: keyTag) { -+ let biometricsError = ReactNativeBiometricsError.biometryCurrentSetChanged -+ ReactNativeBiometricDebug.debugLog("verifyKeySignature failed - \(biometricsError.errorInfo.message)") -+ resolve([ -+ "success": false, -+ "error": biometricsError.errorInfo.message, -+ "errorCode": biometricsError.errorInfo.code, -+ "authType": 0 -+ ]) -+ return -+ } -+ - let algorithm = getSignatureAlgorithm(for: keyRef) - - // Decode data based on input encoding -@@ -910,6 +1012,8 @@ class ReactNativeBiometrics: RCTEventEmitter { - biometricsError = ReactNativeBiometricsError.userCancel - } else if errorCode == errSecAuthFailed { - biometricsError = ReactNativeBiometricsError.authenticationFailed -+ } else if errorCode == TKError.Code.corruptedData.rawValue { -+ biometricsError = ReactNativeBiometricsError.keyAccessFailed - } else { - biometricsError = ReactNativeBiometricsError.signatureCreationFailed - } -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/ios/ReactNativeBiometricsError.swift b/node_modules/@sbaiahmed1/react-native-biometrics/ios/ReactNativeBiometricsError.swift -index ed56895..3e5b93e 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/ios/ReactNativeBiometricsError.swift -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/ios/ReactNativeBiometricsError.swift -@@ -35,6 +35,7 @@ public enum ReactNativeBiometricsError: Error { - case keychainQueryFailed - case invalidKeyReference - case keyIntegrityCheckFailed -+ case biometryCurrentSetChanged - - case signatureCreationFailed - case signatureVerificationFailed -@@ -123,6 +124,11 @@ public enum ReactNativeBiometricsError: Error { - return ("INVALID_KEY_REFERENCE", "Invalid key reference") - case .keyIntegrityCheckFailed: - return ("KEY_INTEGRITY_CHECK_FAILED", "Key integrity verification failed") -+ case .biometryCurrentSetChanged: -+ return ( -+ "BIOMETRY_CURRENT_SET_CHANGED", -+ "Biometric enrollment changed. Re-enrollment required" -+ ) - - // Signature Errors - case .signatureCreationFailed: -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/ios/Utils.swift b/node_modules/@sbaiahmed1/react-native-biometrics/ios/Utils.swift -index 50010e0..427dcfc 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/ios/Utils.swift -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/ios/Utils.swift -@@ -160,19 +160,22 @@ public func createKeychainQuery( - */ - public func createBiometricAccessControl( - for keyType: BiometricKeyType = .ec256, -- allowDeviceCredentialsFallback: Bool = false -+ allowDeviceCredentialsFallback: Bool = false, -+ useBiometryCurrentSet: Bool = false - ) -> SecAccessControl? { - // Determine the authentication constraint: -- // - .biometryAny: biometrics only (no passcode fallback) -- // - .userPresence: biometry first, with passcode fallback if biometry fails or is unavailable -+ // - .biometryAny: biometrics only, supports legacy key behavior across enrollments. -+ // - .biometryCurrentSet: biometrics only, bound to the currently enrolled set. -+ // Any enrollment change invalidates the key and requires re-enrollment. -+ // - .userPresence: biometry first, with passcode fallback if biometry fails -+ // or is unavailable. This cannot be tied to the current biometric set. - let authConstraint: SecAccessControlCreateFlags = allowDeviceCredentialsFallback - ? .userPresence -- : .biometryAny -+ : (useBiometryCurrentSet ? .biometryCurrentSet : .biometryAny) - - // For RSA keys (not in Secure Enclave), we use access control matching old Objective-C implementation - if keyType == .rsa2048 { -- // Use kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly with authConstraint, preserving the old default behavior -- // (when allowDeviceCredentials is false, authConstraint = .biometryAny) -+ // Use kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly with authConstraint. - return SecAccessControlCreateWithFlags( - kCFAllocatorDefault, - kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, -@@ -311,14 +314,25 @@ public func exportPublicKeyToBase64(_ publicKey: SecKey) -> String? { - #if targetEnvironment(simulator) - /// Derives the appropriate LAPolicy from a key's SecAccessControl. - /// Compares the access control against known biometry-only configurations --/// (the same .biometryAny / .userPresence split used in createBiometricAccessControl). --/// .biometryAny -> .deviceOwnerAuthenticationWithBiometrics -+/// (the same split used in createBiometricAccessControl). -+/// .biometryAny/.biometryCurrentSet -> .deviceOwnerAuthenticationWithBiometrics - /// .userPresence -> .deviceOwnerAuthentication - public func deriveLAPolicy(from accessControl: SecAccessControl) -> LAPolicy { - // On simulator, .privateKeyUsage is omitted so the flags are just the auth constraint. -- -- if let ref = SecAccessControlCreateWithFlags(kCFAllocatorDefault, kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, .biometryAny, nil), -- CFEqual(accessControl, ref) { -+ if let currentSetRef = SecAccessControlCreateWithFlags( -+ kCFAllocatorDefault, -+ kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, -+ .biometryCurrentSet, -+ nil -+ ), CFEqual(accessControl, currentSetRef) { -+ return .deviceOwnerAuthenticationWithBiometrics -+ } -+ if let anyRef = SecAccessControlCreateWithFlags( -+ kCFAllocatorDefault, -+ kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, -+ .biometryAny, -+ nil -+ ), CFEqual(accessControl, anyRef) { - return .deviceOwnerAuthenticationWithBiometrics - } - -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/package.json b/node_modules/@sbaiahmed1/react-native-biometrics/package.json -index 51dae57..06cef2c 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/package.json -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/package.json -@@ -16,6 +16,17 @@ - "default": "./lib/commonjs/index.js" - } - }, -+ "./types": { -+ "source": "./src/types.ts", -+ "import": { -+ "types": "./lib/typescript/module/src/types.d.ts", -+ "default": "./lib/module/types.js" -+ }, -+ "require": { -+ "types": "./lib/typescript/commonjs/src/types.d.ts", -+ "default": "./lib/commonjs/types.js" -+ } -+ }, - "./package.json": "./package.json" - }, - "files": [ -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/lib/commonjs/types.js b/node_modules/@sbaiahmed1/react-native-biometrics/lib/commonjs/types.js -index 3d0dfae..c4cee42 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/lib/commonjs/types.js -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/lib/commonjs/types.js -@@ -16,6 +16,7 @@ let BiometricStrength = exports.BiometricStrength = /*#__PURE__*/function (Biome - * available on the device, due to platform limitations. - */ - let AuthType = exports.AuthType = /*#__PURE__*/function (AuthType) { -+ AuthType[AuthType["Unknown"] = -1] = "Unknown"; - AuthType[AuthType["None"] = 0] = "None"; - AuthType[AuthType["DeviceCredentials"] = 1] = "DeviceCredentials"; - AuthType[AuthType["Biometrics"] = 2] = "Biometrics"; -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/lib/module/types.js b/node_modules/@sbaiahmed1/react-native-biometrics/lib/module/types.js -index 4d45270..d01ff06 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/lib/module/types.js -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/lib/module/types.js -@@ -13,6 +13,7 @@ export let BiometricStrength = /*#__PURE__*/function (BiometricStrength) { - * available on the device, due to platform limitations. - */ - export let AuthType = /*#__PURE__*/function (AuthType) { -+ AuthType[AuthType["Unknown"] = -1] = "Unknown"; - AuthType[AuthType["None"] = 0] = "None"; - AuthType[AuthType["DeviceCredentials"] = 1] = "DeviceCredentials"; - AuthType[AuthType["Biometrics"] = 2] = "Biometrics"; -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/commonjs/src/NativeReactNativeBiometrics.d.ts b/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/commonjs/src/NativeReactNativeBiometrics.d.ts -index ef7dfc7..22d53c9 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/commonjs/src/NativeReactNativeBiometrics.d.ts -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/commonjs/src/NativeReactNativeBiometrics.d.ts -@@ -12,7 +12,7 @@ export interface Spec extends TurboModule { - available: boolean; - biometryType?: 'Biometrics' | 'FaceID' | 'TouchID' | 'None' | 'Unknown'; - error?: string; -- isDeviceSecure?: boolean; -+ isDeviceSecure: boolean; - }>; - simplePrompt(promptMessage: string, biometricStrength?: 'weak' | 'strong'): Promise<{ - success: boolean; -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/commonjs/src/index.d.ts b/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/commonjs/src/index.d.ts -index 5e3544c..4b96fc9 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/commonjs/src/index.d.ts -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/commonjs/src/index.d.ts -@@ -55,7 +55,7 @@ export type BiometricSensorInfo = { - errorCode?: string; - fallbackUsed?: boolean; - biometricStrength?: BiometricStrength; -- isDeviceSecure?: boolean; -+ isDeviceSecure: boolean; - }; - export type BiometricAuthOptions = { - title?: string; -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/commonjs/src/types.d.ts b/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/commonjs/src/types.d.ts -index cd3d3c4..a9a0e8c 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/commonjs/src/types.d.ts -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/commonjs/src/types.d.ts -@@ -9,6 +9,7 @@ export declare enum BiometricStrength { - * available on the device, due to platform limitations. - */ - export declare enum AuthType { -+ Unknown = -1, - None = 0, - DeviceCredentials = 1, - Biometrics = 2, -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/module/src/NativeReactNativeBiometrics.d.ts b/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/module/src/NativeReactNativeBiometrics.d.ts -index ef7dfc7..22d53c9 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/module/src/NativeReactNativeBiometrics.d.ts -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/module/src/NativeReactNativeBiometrics.d.ts -@@ -12,7 +12,7 @@ export interface Spec extends TurboModule { - available: boolean; - biometryType?: 'Biometrics' | 'FaceID' | 'TouchID' | 'None' | 'Unknown'; - error?: string; -- isDeviceSecure?: boolean; -+ isDeviceSecure: boolean; - }>; - simplePrompt(promptMessage: string, biometricStrength?: 'weak' | 'strong'): Promise<{ - success: boolean; -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/module/src/index.d.ts b/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/module/src/index.d.ts -index 5e3544c..4b96fc9 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/module/src/index.d.ts -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/module/src/index.d.ts -@@ -55,7 +55,7 @@ export type BiometricSensorInfo = { - errorCode?: string; - fallbackUsed?: boolean; - biometricStrength?: BiometricStrength; -- isDeviceSecure?: boolean; -+ isDeviceSecure: boolean; - }; - export type BiometricAuthOptions = { - title?: string; -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/module/src/types.d.ts b/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/module/src/types.d.ts -index cd3d3c4..a9a0e8c 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/module/src/types.d.ts -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/lib/typescript/module/src/types.d.ts -@@ -9,6 +9,7 @@ export declare enum BiometricStrength { - * available on the device, due to platform limitations. - */ - export declare enum AuthType { -+ Unknown = -1, - None = 0, - DeviceCredentials = 1, - Biometrics = 2, -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/src/NativeReactNativeBiometrics.ts b/node_modules/@sbaiahmed1/react-native-biometrics/src/NativeReactNativeBiometrics.ts -index 02e63af..80f6178 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/src/NativeReactNativeBiometrics.ts -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/src/NativeReactNativeBiometrics.ts -@@ -20,7 +20,7 @@ export interface Spec extends TurboModule { - available: boolean; - biometryType?: 'Biometrics' | 'FaceID' | 'TouchID' | 'None' | 'Unknown'; - error?: string; -- isDeviceSecure?: boolean; -+ isDeviceSecure: boolean; - }>; - simplePrompt( - promptMessage: string, -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/src/index.tsx b/node_modules/@sbaiahmed1/react-native-biometrics/src/index.tsx -index a8ef764..1a8d4e9 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/src/index.tsx -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/src/index.tsx -@@ -668,7 +668,7 @@ export type BiometricSensorInfo = { - errorCode?: string; - fallbackUsed?: boolean; - biometricStrength?: BiometricStrength; -- isDeviceSecure?: boolean; -+ isDeviceSecure: boolean; - }; - - export type BiometricAuthOptions = { -diff --git a/node_modules/@sbaiahmed1/react-native-biometrics/src/types.ts b/node_modules/@sbaiahmed1/react-native-biometrics/src/types.ts -index cbfd187..7e9a545 100644 ---- a/node_modules/@sbaiahmed1/react-native-biometrics/src/types.ts -+++ b/node_modules/@sbaiahmed1/react-native-biometrics/src/types.ts -@@ -10,6 +10,7 @@ export enum BiometricStrength { - * available on the device, due to platform limitations. - */ - export enum AuthType { -+ Unknown = -1, - None = 0, - DeviceCredentials = 1, - Biometrics = 2, diff --git a/patches/@sbaiahmed1/react-native-biometrics/details.md b/patches/@sbaiahmed1/react-native-biometrics/details.md deleted file mode 100644 index 64f25c9a5655..000000000000 --- a/patches/@sbaiahmed1/react-native-biometrics/details.md +++ /dev/null @@ -1,14 +0,0 @@ -# `@sbaiahmed1/react-native-biometrics` patches - - -### [@sbaiahmed1+react-native-biometrics+0.14.0+001+biometry-temporary-new-release.patch](@sbaiahmed1+react-native-biometrics+0.14.0+001+biometry-temporary-new-release.patch) - -- Reason: - - ``` - Temporary patch to include unreleased changes from the upstream library. Will be removed once a new version is published to npm. - ``` - -- Upstream PR/issue: [#81](https://github.com/sbaiahmed1/react-native-biometrics/pull/81), [#84](https://github.com/sbaiahmed1/react-native-biometrics/pull/84), [#86](https://github.com/sbaiahmed1/react-native-biometrics/pull/86), [#87](https://github.com/sbaiahmed1/react-native-biometrics/pull/87) -- E/App issue: [#86440](https://github.com/Expensify/App/pull/86440) -- PR introducing patch: [#86310](https://github.com/Expensify/App/pull/86310)