1

I am using the following library for fingerprint detection as its the latest one provided by google.

implementation 'androidx.biometric:biometric:1.0.0-alpha04'

I have referred the following article for implementation. Here we are not passing any crypto object like in FingerprintManager which is deprecated. A similar question was asked where in "KeyPermanentlyInvalidatedException" can be helpful to detect fingerprint changes, but we are not necessarily creating any cipher in the latest library.

How to detect if any new fingerprint was added using the latest andoridx library?

abhishek maharajpet
  • 482
  • 1
  • 4
  • 18
  • _"Here we are not passing any crypto object"_ But you can. `BiometricPrompt` has two different `authenticate` methods; one that takes a `CryptoObject` and one that doesn't. Even without it you can still check for `KeyPermanentlyInvalidatedException`. All you need to do is initialize a `Cipher` using the key. You don't even have to start an authentication to do that. Also, note that you can't (as far as I know) detect when a fingerprint was removed, unless it was the last remaining fingerprint enrolled on the device. – Michael Jul 05 '19 at 08:28
  • Any solution??? – kgandroid Sep 14 '20 at 06:54

1 Answers1

0

Here we are not passing any crypto object like in FingerprintManager which is deprecated.

---> While showing the biometric prompt, we can pass cryptoObject as the second parameter.

How to detect if any new fingerprint was added using the latest andoridx library?

---> Furthermore, we need to use setInvalidatedByBiometricEnrollment(true) while generating key and the key gets invalidated on any new biometric enrollment. An exception is thrown when you try to use the same key. In this situation, you can reset the biometric app settings inside your app and start the process of enabling biometrics again.

abhishek maharajpet
  • 482
  • 1
  • 4
  • 18
  • Is this really the solution to the problem you described in your question? If not (e.g. this is just more details on your problem) please edit the question to add the info. – Yunnosch Jul 09 '20 at 13:10
  • Basically the question had two parts, I have modified the answer to suit better – abhishek maharajpet Jul 09 '20 at 13:24