nisrulz / easydeviceinfo

:iphone: [Android Library] Get device information in a super easy way.
Apache License 2.0
1.75k stars 227 forks source link

android.permission.INTERACT_ACROSS_USERS Crash on Marshmallow (Android 6.1) #23

Open rayliverified opened 4 years ago

rayliverified commented 4 years ago

Calling areFingerprintsEnrolled causes a crash for Samsung users on Android Marshmallow (6.1). Error:

Caused by java.lang.SecurityException Permission Denial: getCurrentUser() from pid=9160, uid=10126 requires android.permission.INTERACT_ACROSS_USERS github.nisrulz.easydeviceinfo.base.EasyFingerprintMod.areFingerprintsEnrolled

Stacktrace:

android.os.Parcel.readException (Parcel.java:1621)
android.os.Parcel.readException (Parcel.java:1574)
android.hardware.fingerprint.IFingerprintService$Stub$Proxy.hasEnrolledFingerprints (IFingerprintService.java:503)
android.hardware.fingerprint.FingerprintManager.hasEnrolledFingerprints (FingerprintManager.java:776)
github.nisrulz.easydeviceinfo.base.EasyFingerprintMod.areFingerprintsEnrolled (EasyFingerprintMod.java:79)

For now, my solution is to disable fingerprint check for users on Marshmallow. Any ideas what might be happening?

nisrulz commented 4 years ago

Looks like it cannot request the permission at all because it needs to be signed by firmware key

I think I will have to code around this issue.

Thank you for reporting. I will add a fix soon.

rayliverified commented 4 years ago

Any update on a fix? I've found few more bugs in this library so I'll probably submit a PR for a fix.

nisrulz commented 4 years ago

Actually things have changed and the Fingerprint API is deprecated. I have to now re-implement this using the Biometric API which would possibly take care of all such scenario (atleast that is what Google seems to claims)

rayliverified commented 4 years ago

Hmmm, please share your findings when you look into it. I haven't looked into the Biometrics because I have a library that uses Fingerprint and suspect it would be a pain to migrate.