GithubHelp home page GithubHelp logo

cap-go / capacitor-native-biometric Goto Github PK

View Code? Open in Web Editor NEW

This project forked from epicshaggy/capacitor-native-biometric

33.0 33.0 12.0 5.97 MB

License: MIT License

JavaScript 1.29% Ruby 2.22% Objective-C 2.24% Java 57.66% TypeScript 11.20% Swift 25.39%

capacitor-native-biometric's People

Contributors

aamanzi avatar alexcroox avatar brian-weasner avatar epicshaggy avatar github-actions[bot] avatar jmartinezehp avatar kalimantos avatar kyoz avatar leandroperini avatar mohdiarra avatar myles-trevino avatar pzontrop avatar riderx avatar sarogfx avatar squio avatar tolutronics avatar uonick avatar williamhexa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

capacitor-native-biometric's Issues

bug: Android (FaceId) Not Detecting Availability Properly (OnePlus One)

Bug Report

Capacitor Version

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

Plugin Version

 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

Platform(s)

Faceid on newer Android platforms

Current Behavior

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.

Expected Behavior

If phone has faceId capability it should be detected as available.

Code Reproduction

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);

Other Technical Details

npm --version output: 8.19.2

node --version output: v16.18.1

pod --version output (iOS issues only): N/A

Additional Context

Credentials not working on iOS 16.5.1

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.)"

bug: In IOS 17, the plugin propably does not work properly

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.

bug: Android Biometric (OnePlus, Galaxy) Devices Error in KeyStore Encryption

Bug Report

Capacitor Version

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

Plugin Version

 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

Platform(s)

  • Android Devices (So far have tracked OnePlus & Galaxy)
  • Pixel Devices seem to work (note: mine has touchID while the others use faceId)

Current Behavior

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

Expected Behavior

Biometrics should work and credentials should be set

Code Reproduction

            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


Other Technical Details

npm --version output: 8.19.2

node --version output: v16.18.1

pod --version output (iOS issues only): N/A

Additional Context

bug: The android app crashes with version 5.1.0

Bug Report

Capacitor Version

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.

feat: Ability to block Face ID on Android

Feature Request

Need to be able to block FACE (not Fingerprint) biometrics on Android.

Description

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.

Platform(s)

Android

Preferred Solution

Boolean that if false does not provide option for Face Unlock

Additional Context

See this video: https://www.youtube.com/watch?v=ybdmGMOMPWw

bug: User not authenticated on setCredentials (Android 14)

Bug Report

Capacitor Version

 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! 👌

Plugin Version

   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

Platform(s)

  • Android

Current Behavior

Error on call setCredentials on Android API 34
Error: Failed to save credentials

Expected Behavior

Save credential

Code Reproduction

call setCredentials using Android version 14

Other Technical Details

npm --version output: 10.1.0
node --version output: v20.8.1

pod --version output (iOS issues only):

Additional Context

Failed to save credentials
  android.security.keystore.UserNotAuthenticatedException: User not authenticated

Device: Samsung S23
One UI 6.0
Android version 14

bug: Receiving error code 1 for no reaon

Bug Report

Capacitor Version

💊   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

Plugin Version

     💊   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

Platform(s)

iOs, Android

Current Behavior

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.)"}

Expected Behavior

Code Reproduction

Other Technical Details

npm --version output: 9.5.1

node --version output: v18.16.0

pod --version output (iOS issues only): 1.12.1

Additional Context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.