Search code examples
androidandroid-fingerprint-api

How to Identify Fingerprint is add/edit/deleted from the android device


I am working on the fingerprint authentication for android app. In which I have done with the authentication related part. Now I am doing the research to identify weather the user has added a new fingerprint, edit or delete the fingerprint from the device. But i didn't find any resource which helps me to identify this.

So, if anyone can help me how to identify this, it will be very helpful to me.


Solution

  • KeyPermanentlyInvalidatedException would be thrown when the SecretKey is used, if a new fingerprint is added or all the fingerprints are removed after the key was created. But from what I've seen, only a bunch of Samsung devices actually throw this exception. So it probably is not reliable enough if you want to know any change in the enrolled fingerprints across all devices.

    If you're concerned about the security side of things, check out the setInvalidatedByBiometricEnrollment method which is available on N and above.