naoufal / react-native-touch-id

React Native authentication with the native Touch ID popup.
https://www.npmjs.com/package/react-native-touch-id
1.48k stars 477 forks source link

[Android] SecurityException whilst executing TouchID.isSupported() #114

Open edcrampin opened 6 years ago

edcrampin commented 6 years ago

Hi,

I seem to be getting a strange error occurring whilst my Android device is executing TouchID.isSupported(). Stack trace as below:

java.lang.SecurityException: Permission Denial: getCurrentUser() from pid=11470, uid=10183 requires android.permission.INTERACT_ACROSS_USERS
    at android.os.Parcel.readException(Parcel.java:1620)
    at android.os.Parcel.readException(Parcel.java:1573)
    at android.hardware.fingerprint.IFingerprintService$Stub$Proxy.hasEnrolledFingerprints(IFingerprintService.java:503)
    at android.hardware.fingerprint.FingerprintManager.hasEnrolledFingerprints(FingerprintManager.java:776)
    at com.rnfingerprint.FingerprintAuthModule.isFingerprintAuthAvailable(FingerprintAuthModule.java:128)
    at com.rnfingerprint.FingerprintAuthModule.isSupported(FingerprintAuthModule.java:62)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:374)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
    at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
    at android.os.Looper.loop(Looper.java:148)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
    at java.lang.Thread.run(Thread.java:818)

I understand the INTERACT_ACROSS_USERS permission is part of system-level permissions, so not quite sure on the resolution of this one?

Device: Samsung J5

Thanks.

dafanasiev commented 6 years ago

@edcrampin did you see https://stackoverflow.com/questions/28134128/android-permission-interact-across-users-full ? Can you say where you app installed (system partition?) ?

Also please read: https://developer.android.com/about/versions/marshmallow/android-6.0 Maybe you need to add <uses-permission android:name="android.permission.USE_FINGERPRINT" /> to manifest...

zibs commented 6 years ago

It could be you're using a secondary user on the device that is not the main user that has registered their fingerprints?