androidappiumui-automationandroid-fingerprint-api

check android device fingerprint status via adb


I am automating the Android app using appium and i have a scenario which need to be verified on both Fringerprint available and not available devices.

To get the devices details like device OS version, name etc. i am using the adb shell command like

adb shell getprop ro.build.version.release

like this i tried to get the props for fingerprint enabled device and i got the below props which are related to fingerprint

[ro.bootimage.build.fingerprint]: [google/angler/angler:7.1.2/N2G47O/3852959:user/release-keys]

[ro.vendor.build.fingerprint]: [google/angler/angler:7.1.2/N2G47O/3852959:user/release-keys]

[init.svc.fingerprintd]: [running]

And now need to know which is the right property to check

  1. Is Fingerprint option available
  2. Is Fingerprint setting is enabled (i mean atleast one finger added or not)

Solution

  • The first two properties you are listing [ro.bootimage.build.fingerprint] and [ro.vendor.build.fingerprint] are not related to a fingerprint reader device, but to the cryptographic fingerprint of the Android disk image for the boot partition (ro.bootimage) and vendor-specific software partition (ro.vendor).

    The property [init.svc.fingerprintd] tells you the current state (running) of the fingerprint daemon (fingerprintd) service (svc). This service is needed to enroll fingerprints and perform other operations (see https://source.android.com/security/authentication/fingerprint-hal).

    So you need to look elsewhere for a way to check if the fingerprint option is available and set. The FingerprintManager API has a public method hasEnrolledFingerprints() which can be used to determine if there is at least one fingerprint enrolled. You can call this API this from within an app.

    From an adb shell, you might have to call the fingerprintd service directly instead of using the API (Use Android API functions with ADB).