Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Fingerprint Sensor - Android Emulator

How to disable Fingerprint sensor in Android Emulator? I could not find any option in settings window or config.ini file.

By default, all the emulators above SDK 23 have fingerprint support. I would like to test my flow in above SDK 23 with no fingerprint support.

like image 426
Ponsuyambu Avatar asked May 01 '18 20:05

Ponsuyambu


People also ask

How do I disable fingerprint on emulator?

In the folder there should be four files - uevent , bind and the ones we will need unbind and deviceName . Now the system will think that there is no fingerprint sensor in the system... till the next reboot.

How do I enable fingerprint on Android emulator?

Run your Android emulator and go to Settings->Security & location->Fingerprint. If you have set up your PIN, enter it on your emulator. If you haven't set up your PIN, Android emulator will prompt you to add it at this point. Click Add fingerprint.

How do I permanently disable fingerprint scanner?

Open Settings > Lock Screen and Security > Screen Lock Type and toggle off all the options under the Biometrics section.

How do I temporarily disable biometrics on Android?

To do this, jump into the Settings menu, then tap the “Security & Location” option. On the Security & Location page, tap the “Lock Screen Preferences” setting. On the next page, turn on the “Show Lockdown” toggle. Bam, you're there.


2 Answers

It is not possible to achieve with conventional methods. There are unconventional though.

The reason you cannot disable is that its presence is regulated not via Android Framework but via underlaying Linux OS as for all the other sensors. Thus if your system has driver for this sensor - Android will think that this sensor is present.

So fingerprint sensor presence is driver dependent. The solution is easy now. If there will be no driver - there will be no sensor present. All you have to do is to disable(disconnect from the OS) driver. For that you will need

  • root
  • adb shell or some terminal app installed(su or something)

I am not completely sure how fingerprint driver is depicted in the system(I was doing it with other sensor) but after not very long googling and using of extrapolation I think it may be called something like fpc.

So you may want to search for this in the system drives folder - something like /sys/bus/(platform/spi/blablabla/something)/drivers/fpc.../

In the folder there should be four files - uevent, bind and the ones we will need unbind and deviceName.

And now unbind the sensor - echo deviceName > /sys/bus/(platform/spi/blablabla/something)/drivers/fpc.../unbind

Now the system will think that there is no fingerprint sensor in the system... till the next reboot.

I was doing this on the real device and with other sensor but I think the method should be pretty much the same.

Inspiration taken from here

Hope it helps.

like image 97
Pavlo Ostasha Avatar answered Sep 18 '22 14:09

Pavlo Ostasha


There is no clear way to override it in the emulator settings. A workaround would be to extend either BiometricPrompt (API 28+) or FingerprintManagerCompat (27 and below) and provide your own implementation. For an extension of FingerprintManagerCompat you would override isHardwareDetected() to be something like

    override fun isHardwareDetected() {           if (System.getProperty("os.arch") == "mips64") {                 return false;           }            return super.isHardwareDetected()     } 

For BiometricPrompt you would override BiometricPrompt.authenticate() in a similar manner to return the constant BIOMETRIC_ERROR_HW_UNAVAILABLE.

like image 41
James Jordan Taylor Avatar answered Sep 20 '22 14:09

James Jordan Taylor