question

halolen54 avatar image
halolen54 asked

Different System.deviceuniqueidentifier on same android device.

Hi, when i building apk with unity, giving me A deviceID and i uploading apk to store, then i downloading it on android device and this time giving me to B deviceID not to A deviceID. Uploading different version of apk always giving me B deviceID same with normal build apk.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JayZuo avatar image
JayZuo answered

It seems you are using SystemInfo.deviceUniqueIdentifier to get the device Id. If so, then this is a Unity question, I'd suggest you ask on Unity Community to get help and discuss solutions with experienced Unity users.

Besides, as a quick search, on Android, SystemInfo.deviceUniqueIdentifier always returns the md5 of ANDROID_ID. (See https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID). And in this document, it says that Values of ANDROID_ID are 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.

So it's possible that the value changed because the store version uses a different APK signing key than your debug version.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

halolen54 avatar image halolen54 commented ·

Thank you for your quick answer @JayZuo. I'll try to use natively to get device id then.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.