fingerprintjs / fingerprintjs-android

Swiss army knife for identifying and fingerprinting Android devices. MIT license, no restrictions on usage in production.
https://fingerprint.com/github/
MIT License
586 stars 84 forks source link

deviceId vs fingerprint using Android 10+ #27

Closed javdromero closed 3 years ago

javdromero commented 3 years ago

Hi there, I wonder what's if your recomendations had changed using android 10 or 11, I'm trying to get an unique id that doesn't change despise if the app is reinstalled, if the network changed or usign randomize mac (i don't think it applies but just in case). From your readme, fingerprinter.getDeviceId()seems like the best option, i've read the documentation: Which one should I use? but I still wonder if this has been tested on the newest android versions.

The second question is: deviceIdResult.getDeviceId() alwasys returns a value? Is there a chance it returns null or empty?

Alexey-Verkhovsky commented 3 years ago

Hi!

The recommendations are up to date :) Everything is tested on a set of API levels, including the highest and the lowest.

What about the best option at the moment - try to use deviceIdResult.deviceId. It always returns a not null value, which is guaranteed by Kotlin. In the worst-case scenario (if a system is tweaked or corrupted with root-level frameworks) - it returns the empty string.

It doesn't change after reinstalling, and only factory reset can change it under normal circumstances.

If the circumstances are not normal (again, if a system is tweaked with root-level frameworks), this method is not very reliable, and the result can be tampered. This is actively used by fraudsters. In this case fingerprinterResult.fingerprint can help, because it's much harder to tamper its result, but identification accuracy can be lower.

So start with deviceIdResult.deviceId. And if you struggle with fraud, account takeover/sharing, fingerprinterResult.fingerprint can help you.

javdromero commented 3 years ago

Thanks for your reply, everything is working perfectly.