cap-go / capacitor-native-biometric Goto Github PK
View Code? Open in Web Editor NEWThis project forked from epicshaggy/capacitor-native-biometric
License: MIT License
This project forked from epicshaggy/capacitor-native-biometric
License: MIT License
Latest Dependencies:
@capacitor/cli: 5.4.1
@capacitor/core: 5.4.1
@capacitor/android: 5.4.1
@capacitor/ios: 5.4.1
Installed Dependencies:
@capacitor/cli: 5.2.3
@capacitor/core: 5.2.2
@capacitor/android: 5.2.2
@capacitor/ios: 5.2.2
Installed Dependencies:
@capgo/cli: 3.13.31
@capgo/capacitor-native-biometric: 5.1.0
✓ Latest Dependencies:
@capgo/cli: 3.13.31
@capgo/capacitor-native-biometric: 5.1.0
Faceid on newer Android platforms
Currently this plugin is checking for the availability of faceId via "android.hardware.biometrics.face" but according to the docs: https://developer.android.com/reference/android/hardware/biometrics/package-summary this on longer exists. Seeing as this was a fork of an older package I believe this was deprecated around Android 11-12 range. This is preventing phones with FaceId from returning "Multiple" or "True" when Touch + FaceId is available or just FaceId is available.
If phone has faceId capability it should be detected as available.
Im logging the following Android code out and it's returning false for a OnePlusOne7 with faceId available and enrolled at the OS level.
boolean hasFaceFeature = getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE);
Log.d("BiometricFeatureCheck", "Device has FEATURE_FACE: " + hasFaceFeature);
npm --version output: 8.19.2
node --version output: v16.18.1
pod --version output (iOS issues only): N/A
Hey guys! How's it going? Hope you are doing well :)
I'm using @capgo/capacitor-native-biometric
to set and retrieve the user's credentials to then sign in but I updated the iOS version and now it doesn't work anymore. Any suggestion?
Error message:
"The operation couldn’t be completed. (CapgoCapacitorNativeBiometric.NativeBiometric.KeychainError error 1.)"
Hi,
it looks like IOS 17 is not supported by the plugin at this time. By mistake, I posted to original epicshaggy. Error will probably be related to your fork.
We get an error:
Error: The operation couldn't be completed. (CapgoCapacitorNativeBiometric.NativeBiometric.KeyChainError error 0
when we call
await NativeBiometric.setCredentials({
username: credentials.email,
password: credentials.password,
server: APP_ID,
});
It would be nice if the plugin supports the new IOS 17 as well.
Thank you for your interest.
Latest Dependencies:
@capacitor/cli: 5.4.1
@capacitor/core: 5.4.1
@capacitor/android: 5.4.1
@capacitor/ios: 5.4.1
Installed Dependencies:
@capacitor/cli: 5.2.3
@capacitor/core: 5.2.2
@capacitor/android: 5.2.2
@capacitor/ios: 5.2.2
Installed Dependencies:
@capgo/cli: 3.13.31
@capgo/capacitor-native-biometric: 5.1.0
✓ Latest Dependencies:
@capgo/cli: 3.13.31
@capgo/capacitor-native-biometric: 5.1.0
SetCredentials does not work and Android Errors:
await NativeBiometric.deleteCredentials({
server: BIOMETRIC_SERVER,
});
await NativeBiometric.setCredentials({
username: mobileNumber,
password: 'password',
server: BIOMETRIC_SERVER,
});
Results In: "Failed to Set Credentials" being thrown
Biometrics should work and credentials should be set
Calling Simply doing this on certain devices such as a OnePlus7 results in the following being logged to logcat & the error reported above being sent to JS error object:
await NativeBiometric.deleteCredentials({
server: BIOMETRIC_SERVER,
});
await NativeBiometric.setCredentials({
username: mobileNumber,
password: 'password',
server: BIOMETRIC_SERVER,
});
2023-09-22 13:49:17.374 1484-1484/? E/SchedAssist: ofbSetSfMsgTrans pid(1484) failed with error=Permission denied
2023-09-22 13:49:17.566 1484-1484/? E/SchedAssist: ofbSetSfMsgTrans pid(1484) failed with error=Permission denied
2023-09-22 13:49:17.582 1484-1484/? E/SchedAssist: ofbSetSfMsgTrans pid(1484) failed with error=Permission denied
2023-09-22 13:49:17.665 804-24181/? E/keystore2: keystore2::gc: Error trying to delete blob entry. In process_one_key: Trying to unwrap to-be-deleted blob.
Caused by:
0: In unwrap_key: Required super decryption key is not in memory.
1: Error::Rc(ResponseCode(2))
2023-09-22 13:49:17.668 1484-1484/? E/SchedAssist: ofbSetSfMsgTrans pid(1484) failed with error=Permission denied
2023-09-22 13:49:17.681 804-20811/? E/keystore2: keystore2::error: In get_security_level: No such security level.
Caused by:
Error::Km(ErrorCode(-68))
2023-09-22 13:49:17.685 1484-1484/? E/SchedAssist: ofbSetSfMsgTrans pid(1484) failed with error=Permission denied
2023-09-22 13:49:17.698 804-818/? E/keystore2: keystore2::error: In create_operation. Failed to handle super encryption.
Caused by:
0: In unwrap_key: Required super decryption key is not in memory.
1: Error::Rc(ResponseCode(2))
2023-09-22 13:49:17.702 1484-1484/? E/SchedAssist: ofbSetSfMsgTrans pid(1484) failed with error=Permission denied
2023-09-22 13:49:17.711 1484-1484/? E/SchedAssist: ofbSetSfMsgTrans pid(1484) failed with error=Permission denied
2023-09-22 13:49:17.719 1484-1484/? E/SchedAssist: ofbSetSfMsgTrans pid(1484) failed with error=Permission denied
2023-09-22 13:49:17.727 1484-1484/? E/SchedAssist: ofbSetSfMsgTrans pid(1484) failed with error=Permission denied
2023-09-22 13:49:17.735 1484-1484/? E/SchedAssist: ofbSetSfMsgTrans pid(1484) failed with error=Permission denied
npm --version
output: 8.19.2
node --version
output: v16.18.1
pod --version
output (iOS issues only): N/A
tried 5.4.1. and 5.3.0
Tested using Nexus 10 API 33 emulator.
This is from Android studio Logcat
Caused by: java.security.ProviderException: Keystore key generation failed
at android.security.keystore2.AndroidKeyStoreKeyGeneratorSpi.engineGenerateKey(AndroidKeyStoreKeyGeneratorSpi.java:413)
at javax.crypto.KeyGenerator.generateKey(KeyGenerator.java:612)
at ee.forgr.biometric.NativeBiometric.generateKey(NativeBiometric.java:383)
at ee.forgr.biometric.NativeBiometric.generateKey(NativeBiometric.java:357)
at ee.forgr.biometric.NativeBiometric.getKey(NativeBiometric.java:396)
at ee.forgr.biometric.NativeBiometric.encryptString(NativeBiometric.java:319)
at ee.forgr.biometric.NativeBiometric.setCredentials(NativeBiometric.java:202)
at java.lang.reflect.Method.invoke(Native Method)
at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:138)
at com.getcapacitor.Bridge.lambda$callPluginMethod$0(Bridge.java:774)
at com.getcapacitor.Bridge.$r8$lambda$ehFTi5f4HhVNFKTbCKAYDkpQYRA(Unknown Source:0)
at com.getcapacitor.Bridge$$ExternalSyntheticLambda3.run(Unknown Source:8)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: android.security.KeyStoreException: System error (internal Keystore code: 4 message: In generate_key.
It works when downgraded to 5.0.1.
Need to be able to block FACE (not Fingerprint) biometrics on Android.
The more mainstream android devices feature pretty good face unlock but, the fact is Android uses 2 dimensional scanning and many android devices still unlock with a photo printout ( See this video: https://www.youtube.com/watch?v=ybdmGMOMPWw ). This is not secure and we should have an option to block Face Unlock from being an option on Android.
Android
Boolean that if false does not provide option for Face Unlock
See this video: https://www.youtube.com/watch?v=ybdmGMOMPWw
Capacitor Doctor
Latest Dependencies:
@capacitor/cli: 5.6.0
@capacitor/core: 5.6.0
@capacitor/android: 5.6.0
@capacitor/ios: 5.6.0
Installed Dependencies:
@capacitor/cli: 5.3.0
@capacitor/core: 5.6.0
@capacitor/android: 5.6.0
@capacitor/ios: 5.6.0
[info] Using Gemfile: RubyGems bundle installed
[success] iOS looking great! 👌
[success] Android looking great! 👌
Capgo Doctor
OS: darwin Darwin Kernel Version 22.6.0: Wed Jul 5 22:22:52 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T8103
Node: v20.8.1
Installed Dependencies:
@capgo/cli: 3.14.54
@capgo/capacitor-native-biometric: 5.1.0
✓ Latest Dependencies:
@capgo/cli: 3.14.54
@capgo/capacitor-native-biometric: 5.1.0
✅ All dependencies are up to date
Error on call setCredentials on Android API 34
Error: Failed to save credentials
Save credential
call setCredentials using Android version 14
npm --version
output: 10.1.0
node --version
output: v20.8.1
pod --version
output (iOS issues only):
Failed to save credentials
android.security.keystore.UserNotAuthenticatedException: User not authenticated
Device: Samsung S23
One UI 6.0
Android version 14
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 5.3.0
@capacitor/core: 5.3.0
@capacitor/android: 5.3.0
@capacitor/ios: 5.3.0
Installed Dependencies:
@capacitor/cli: 5.0.4
@capacitor/android: 5.0.4
@capacitor/core: 5.0.4
@capacitor/ios: 5.0.4
[success] iOS looking great! 👌
[error] Missing <manifest package=""> attribute in app/src/main
💊 Capgo Doctor 💊
OS: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:19 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T8103
Installed Dependencies:
@capgo/cli: 3.13.11
@capgo/capacitor-native-biometric: ^5.0.1
✓ Latest Dependencies:
@capgo/cli: 3.13.11
@capgo/capacitor-native-biometric: 5.0.1
iOs, Android
I have 2 apps with one codebase and one backend - test and prod. Capability is on. FaceId is on. On test biometrics works fine. On prod app face id is triggered, verification is passed, but after that i can't set/get credentials, receiving:
⚡️ To Native -> NativeBiometric verifyIdentity 95732660
⚡️ TO JS undefined
⚡️ To Native -> NativeBiometric getCredentials 95732661
ERROR MESSAGE: {"errorMessage":"The operation couldn’t be completed. (CapgoCapacitorNativeBiometric.NativeBiometric.KeychainError error 1.)","message":"The operation couldn’t be completed. (CapgoCapacitorNativeBiometric.NativeBiometric.KeychainError error 1.)"}
npm --version
output: 9.5.1
node --version
output: v18.16.0
pod --version
output (iOS issues only): 1.12.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.