You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by no...@apache.org on 2021/09/23 17:55:42 UTC

[cordova-plugin-device] branch master updated: docs: Update information about device.uuid for Android (#138)

This is an automated email from the ASF dual-hosted git repository.

normanbreau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-device.git


The following commit(s) were added to refs/heads/master by this push:
     new dbe1616  docs: Update information about device.uuid for Android (#138)
dbe1616 is described below

commit dbe1616395df4b54d2a7d37fba658f916c395b28
Author: Shashank Agrawal <sh...@wizpanda.com>
AuthorDate: Thu Sep 23 23:25:38 2021 +0530

    docs: Update information about device.uuid for Android (#138)
    
    The behaviour of `device.uuid` has been changed since Android 8.0 https://developer.android.com/about/versions/oreo/android-8.0-changes#privacy-all
---
 README.md | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 91612e0..ec31fee 100644
--- a/README.md
+++ b/README.md
@@ -148,7 +148,6 @@ The details of how a UUID is generated are determined by the device manufacturer
 
 ```js
 // Android: Returns a random 64-bit integer (as a string, again!)
-//          The integer is generated on the device's first boot
 //
 // BlackBerry: Returns the PIN number of the device
 //             This is a nine-digit unique integer (as a string, though!)
@@ -162,6 +161,22 @@ The details of how a UUID is generated are determined by the device manufacturer
 var deviceID = device.uuid;
 ```
 
+### Android Quirk
+
+The `uuid` on Android is a 64-bit integer (expressed as a hexadecimal string). The behaviour of this `uuid` is different on two different OS versions-
+
+**For < Android 8.0 (API level 26)**
+
+In versions of the platform lower than Android 8.0, the `uuid` is randomly generated when the user first sets up the device and should remain constant for the lifetime of the user's device.
+
+**For Android 8.0 or higher**
+
+The above behaviour was changed in Android 8.0. Read it in detail [here](https://developer.android.com/about/versions/oreo/android-8.0-changes#privacy-all).
+
+On Android 8.0 and higher versions, the `uuid` will be unique to each combination of app-signing key, user, and device. The value is scoped by signing key and user. The value may change if a factory reset is performed on the device or if an APK signing key changes.
+
+Read more here https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID.
+
 ### iOS Quirk
 
 The `uuid` on iOS uses the identifierForVendor property. It is unique to the device across the same vendor, but will be different for different vendors and will change if all apps from the vendor are deleted and then reinstalled.

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org