Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 10 support #33

Open
manelds opened this issue Jan 16, 2020 · 1 comment
Open

Android 10 support #33

manelds opened this issue Jan 16, 2020 · 1 comment

Comments

@manelds
Copy link

manelds commented Jan 16, 2020

Hi,

I'm trying to get the serial of a device with Android 10 and it returns "unknown". With older versions of Android, works fine.

I found this link about the new Android version:
https://developer.android.com/about/versions/10/privacy/changes

Has someone the same problem?

Many thanks.

@manelds manelds closed this as completed Jan 16, 2020
@manelds manelds reopened this Jan 16, 2020
@mcendon
Copy link

mcendon commented Feb 5, 2020

Hi,
This is my little contribution.

As I see, in this class https://github.com/Paldom/UniqueDeviceID/blob/master/src/android/UniqueDeviceID.java the deviceId is calculated by this formula (line 77):

uuid = androidID + deviceID + simID;

Since deviceID and simID is not longer supported in Android 10, you only have the androidID to identify the device (as i know, the Android ID is generated by the OS and is unique) and the device ID returned by the plugin will have this structure:

00000000-0000-0000-XXXX-XXXXXXXXXXXX

where XXXX-XXXXXXXXXXXX is the Android ID

In our app we need to mantain compatibity with Android 9 devices and older who are being updated to android 10, so, from the older "complete" device id (containing androidID + deviceID + simID) we take only the first part (androidID) and compare it against the deviceID generated in android 10 for example:

o4ca5327-cd5c-3a0f-3345-181008441738 (old uniqueDeviceID, containing simID and deviceID)

00000000-0000-0000-o4ca-5327cd5c3a0f ("new" Android 10 uniqueDeviceID, containing only Android ID)

We just compare the o4ca-5327cd5c3a0f part to identify the device

I hope it help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants