infinum / Android-Goldfinger

Android library to simplify Biometric authentication implementation.
Apache License 2.0
653 stars 73 forks source link

How to find out if user has enrolled new fingerprint? #49

Closed Morteza-Rastgoo closed 4 years ago

domagojkorman commented 4 years ago

Hi,

there is no API to find out if the user has new fingerprint. If the user enrolled new fingerprint and you try to decrypt the data, fingerprint initialization will fail and you will receive https://github.com/infinum/Android-Goldfinger/blob/master/core/src/main/java/co/infinum/goldfinger/InitializationException.java#L3

Also read this - https://stackoverflow.com/a/44926774/3920456 The reason why this does not exist is that it makes no sense as you would have to know when the user enrolled new fingerprint. The best we can do is throw an error.

If Goldfinger#decrypt fails to initialize, you know that something went terribly wrong and that you should invalidate user's fingerprints.

Version 2.0 is in progress so we plan to handle this better with clear error if Key really is invalidated.