Search code examples
androidioscordovauuidspoofing

Android/Cordova UUID reliability


I'm developing an Apache Cordova app that relies on the device UUID. A couple questions run through my mind but I unfortunately couldn't seem to find the answer anywhere.

  • Is the obtained device.uuid same for every platform, since I'm planning to release it both for Android and iOS?
  • Is the UUID given by Cordova the same as the OS?
  • Is there any way to change/spoof the OS/Cordova UUID? (this is important for me)

Solution

  • on android it uses android.provider.Settings.Secure.ANDROID_ID

    public static final String ANDROID_ID Added in API level 3

    A 64-bit number (as a hex string) that is randomly generated when the user first sets up the device and should remain constant for the lifetime of the user's device. The value may change if a factory reset is performed on the device.

    Note: When a device has multiple users (available on certain devices running Android 4.2 or higher), each user appears as a completely separate device, so the ANDROID_ID value is unique to each user.

    it can be altered on root devices. http://www.prophethacker.com/2014/08/how-change-your-android-mobile-device-id.html

    On iOS cordova create a random string on the first run, the string is unique for your app only, and might change even on app updates.

    iOS Quirk

    The uuid on iOS is not unique to a device, but varies for each application, for each installation. It changes if you delete and re-install the app, and possibly also when you upgrade iOS, or even upgrade the app per version (apparent in iOS 5.1). The uuid is not a reliable value.

    On iOS you can use my identifier for vendor plugin https://github.com/jcesarmobile/IDFVPlugin

    It uses the native identifier for vendor https://developer.apple.com/library/ios/documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html#//apple_ref/occ/instp/UIDevice/identifierForVendor