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
551 stars 77 forks source link

FIngerprint not unique across 2 apps #78

Closed omkar-tenkale closed 1 year ago

omkar-tenkale commented 1 year ago

I have 2 apps with different package names communicating with the same server, They are reporting different fingerprints when this library is used

Is the fingerprint also depends on app information and not just system info?

Alexey-Verkhovsky commented 1 year ago

Hello! What is the type of fingerprint you are using and what is the device? There are three types of fingerprints and three device IDs.

For your case GSF ID and Stable fingerprint will be stable across all apps. All others may change when package name changes.

You may extract them using this code:


        val fingerprinter = FingerprinterFactory.create(this)

        fingerprinter.getFingerprint(version = Fingerprinter.Version.V_5, stabilityLevel = StabilityLevel.STABLE) { fingerprint ->
            val stableFingerprint = fingerprint
        }

        fingerprinter.getDeviceId(version = Fingerprinter.Version.V_5) { result ->
            val deviceId = result.gsfId
        }

Hope this helps!

omkar-tenkale commented 1 year ago

I'm using this

FingerprinterFactory.getInstance(context, Configuration(version = 4))
                        .getFingerprint { fingerprintResult ->
                            process(fingerprintResult.fingerprint)
                        }

Seems like I need to go with this as I want a unique deviceId across all apps without bothering about security


 fingerprinter.getFingerprint(version = Fingerprinter.Version.V_5, stabilityLevel = StabilityLevel.STABLE) { fingerprint ->
      val stableFingerprint = fingerprint
}
Alexey-Verkhovsky commented 1 year ago

From what I see I think the following code is the best option for you:

        val fingerprinter = FingerprinterFactory.create(this)

        fingerprinter.getDeviceId(version = Fingerprinter.Version.V_5) { result ->
            val deviceId = result.gsfId
        }

GSF ID is unique and stable across all apps. It may be tampered though, and it doesn't work with non-google devices (e.g. Huawei). If you want to cover all the cases – consider using PRO version.

omkar-tenkale commented 1 year ago

Ok thanks!