@capgo/capacitor-native-biometric 8.0.4 → 8.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -34,6 +34,7 @@ import java.security.KeyStore;
|
|
|
34
34
|
import java.security.KeyStoreException;
|
|
35
35
|
import java.security.NoSuchAlgorithmException;
|
|
36
36
|
import java.security.NoSuchProviderException;
|
|
37
|
+
import java.security.ProviderException;
|
|
37
38
|
import java.security.SecureRandom;
|
|
38
39
|
import java.security.UnrecoverableEntryException;
|
|
39
40
|
import java.security.cert.CertificateException;
|
|
@@ -376,7 +377,20 @@ public class NativeBiometric extends Plugin {
|
|
|
376
377
|
try {
|
|
377
378
|
key = generateKey(KEY_ALIAS, true);
|
|
378
379
|
} catch (StrongBoxUnavailableException e) {
|
|
380
|
+
// Retry without StrongBox if it's unavailable
|
|
379
381
|
key = generateKey(KEY_ALIAS, false);
|
|
382
|
+
} catch (ProviderException e) {
|
|
383
|
+
// ProviderException can be thrown for various device-specific keystore issues
|
|
384
|
+
// Retry without StrongBox as a fallback
|
|
385
|
+
try {
|
|
386
|
+
key = generateKey(KEY_ALIAS, false);
|
|
387
|
+
} catch (StrongBoxUnavailableException ex) {
|
|
388
|
+
// This shouldn't happen when isStrongBoxBacked=false, but handle it anyway
|
|
389
|
+
throw new GeneralSecurityException("Failed to generate key without StrongBox", ex);
|
|
390
|
+
} catch (ProviderException ex) {
|
|
391
|
+
// If it still fails without StrongBox, wrap and rethrow
|
|
392
|
+
throw new GeneralSecurityException("Keystore key generation failed", ex);
|
|
393
|
+
}
|
|
380
394
|
}
|
|
381
395
|
return key;
|
|
382
396
|
}
|
|
@@ -11,7 +11,7 @@ import LocalAuthentication
|
|
|
11
11
|
|
|
12
12
|
@objc(NativeBiometricPlugin)
|
|
13
13
|
public class NativeBiometricPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
14
|
-
private let pluginVersion: String = "8.0.
|
|
14
|
+
private let pluginVersion: String = "8.0.5"
|
|
15
15
|
public let identifier = "NativeBiometricPlugin"
|
|
16
16
|
public let jsName = "NativeBiometric"
|
|
17
17
|
public let pluginMethods: [CAPPluginMethod] = [
|
package/package.json
CHANGED