ajalt / reprint

A unified fingerprint library for android.
Apache License 2.0
469 stars 88 forks source link

Also Use USE_BIOMETRIC Permission #43

Closed peterbetos closed 5 years ago

peterbetos commented 5 years ago

Can you transform the library to also utilize androidx.biometric:biometric?

ajalt commented 5 years ago

I'm not clear on your request. Can you provide more details on what you want?

peterbetos commented 5 years ago

I meant USE_FINGERPRINT permission was already deprecated starting on Android Pie. Can we also have the library USE_BIOMETRIC as well for Android Pie compatibility?

kenshin171 commented 5 years ago

Technically, reprint 3.3.1 can also be used on android Pie, the question should be to swap out FingerprintCompatManager api to BiometricPrompt api from the androidx BiometricPrompt library from Google. This library should provide support for android devices which utilises any form of biometric authentication not only fingerprint.

However it is currently in alpha, alpha-03 to be exact, as shown here https://developer.android.com/jetpack/androidx/releases/biometrics#1.0.0-alpha03 and here in maven https://mvnrepository.com/artifact/androidx.biometric/biometric/.

Perhaps a branch in preparation for use of this new biometricprompt library?

This library also is aa appCompat library as it supports api level 14 onwards.

ajalt commented 5 years ago

This library doesn't use FingerprintManagerCompat any more, due to bugs in it's implementation. So I probably won't use the androidx library either. I don't see a reason not to add the USE_BIOMETRIC in addition to USE_FINGERPRINT, however.

kenshin171 commented 5 years ago

Ah my apologies I meant FingerprintManager not FingerprintManagerCompat. As stated in https://developer.android.com/reference/android/hardware/fingerprint/FingerprintManager it's deprecated in API 28 in favour of androidx biometricPrompt api

benwicks commented 5 years ago

I started a PR with this change but I closed it because it would require devices with Pie to use a hacky workaround to determine if a fingerprint is registered. This may cause even more compatibility issues. I'll keep the branch around if anyone wants to look into it more.

ajalt commented 5 years ago

Echoing @benwicks comment, it looks like using BiometricPrompt has no advantages currently (since it just forwards calls to FingerprintManager), and does have some drawbacks (the workaround). So I'm going to keep using FingerprintManager for now, but we can revisit this when future versions of Android come out.

Thanks again to @benwicks for working on this!