Search Unity

SystemInfo.deviceUniqueIdentifier / Android 6.0

Discussion in 'Android' started by DominiqueT, Nov 10, 2015.

  1. DominiqueT

    DominiqueT

    Joined:
    Mar 27, 2014
    Posts:
    49
    Hi

    We see a big issue on Android 6.0, the function SystemInfo.deviceUniqueIdentifier return

    cd9e459ea708a948d5c2f5a6ca8838cf (== md5(00000000000000000000000000000000))

    We see this on Nexus 7 ... so all our players loose their account and share the same one.

    Have you any idea to solve this?
     
    BMRG14 likes this.
  2. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    For now you need to make sure your AndroidManifest.xml has targetSdkVersion < 23.
     
  3. DominiqueT

    DominiqueT

    Joined:
    Mar 27, 2014
    Posts:
    49
    I can't do that. We use FB SDK and
    • The Target Android API is now 23

    A patch will come?
     
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    The latest Facebook SDK for Unity version (7.2.2) forces you to use targetSdk=23 ....
     
    DominiqueT likes this.
  5. DominiqueT

    DominiqueT

    Joined:
    Mar 27, 2014
    Posts:
    49
    Even with TargetSDKVersion < 23, on Nexus with Android 6.0, we got cd9e459ea708a948d5c2f5a6ca8838cf as identifier!
     
    MrEsquire likes this.
  6. nbaris

    nbaris

    Joined:
    Jan 13, 2015
    Posts:
    27
    Do you have a goal for which Unity version will make it safe to set targetSdkVersion 23? Any chance for a patch release before 5.3.0 resolving Android 6 issues?
     
  7. DominiqueT

    DominiqueT

    Joined:
    Mar 27, 2014
    Posts:
    49
    Any news?
     
  8. et_cloudcade

    et_cloudcade

    Joined:
    Jul 8, 2014
    Posts:
    8
    Any news on this ? google ask us to use 23, we need this fix asap
     
  9. Anyone reported a bug and can share the bug number?
     
  10. SweetPowder

    SweetPowder

    Joined:
    Jun 17, 2015
    Posts:
    1
    in ANDROID 6.0

    if android.permission.WRITE_EXTERNAL_STORAGE defines in AndroidManifest,
    SystemInfo.deviceUniqueIdentifier == cd9e459ea708a948d5c2f5a6ca8838cf (md5(00000000000000000000000000000000)

    after android.permission.WRITE_EXTERNAL_STORAGE removed,
    SystemInfo.deviceUniqueIdentifier works fines.


    please fix it ~~~
     
  11. DominiqueT

    DominiqueT

    Joined:
    Mar 27, 2014
    Posts:
    49
  12. DominiqueT

    DominiqueT

    Joined:
    Mar 27, 2014
    Posts:
    49
    Email received this night:

    Hey,

    Thanks for reporting the issue.

    We have fixed this and problem will not appear in the Unity 5.4 release.
    If you are able to reproduce it on the Unity 5.4, please respond to this email.

    We highly appreciate your contribution. If you have further questions, feel free to contact us.

    Regards,
    Karolis
    Unity QA Team
     
  13. DominiqueT

    DominiqueT

    Joined:
    Mar 27, 2014
    Posts:
    49

    Me: Will others deviceUniqueIdentifier (no buggy ones) change on unity 5.4?

    Unity Team: Unfortunately, yes. There is a forum post about that: http://forum.unity3d.com/threads/unique-identifier-details.353256/

    Me: This topic doesn't display any change between 5.2 and 5.4 for deviceUniqueIdentifier.

    Unity Team: It will change again from 5.3 to 5.4. Will update forum post and might write a blog post about it.
     
    MrEsquire likes this.
  14. alchemyincarnate

    alchemyincarnate

    Joined:
    Feb 25, 2014
    Posts:
    10
    Hello

    Is there any way to quick fix this on 4.x versions?

    Thanks
     
  15. et_cloudcade

    et_cloudcade

    Joined:
    Jul 8, 2014
    Posts:
    8
  16. BenouKat

    BenouKat

    Joined:
    Feb 29, 2012
    Posts:
    222
    Hi,

    I post because I'm in heavy trouble regarding this issue I didn't know about. One of the guy of the QA of my game reports that he lost all this progress by updating the game. I check its deviceUniqueIdenfier before and after the update.

    Before : Unity 5.2 => deviceUniqueIdentifier is normal
    After : Unity 5.3 => I got cd9e459ea708a948d5c2f5a6ca8838cf in deviceUniqueIdentifier.

    He's on Nexus 9, Android 6.0.1

    Our targetSdkVersion is < 23 (I think it's 21)

    Is this normal ? What can I do to retrieve the old identifier like in Unity 5.2 ? Is there any workaround ?
    More important : What should I do to prevent the "cd9e459ea708a948d5c2f5a6ca8838cf" to happen ? Something I can do right now ?

    This is a major issue and of course it happens 3 weeks before launch so if someone can help me I would really appreciate, I'm a bit crying right now. :D
     
    Last edited: Mar 9, 2016
  17. Nolex

    Nolex

    Joined:
    Dec 10, 2010
    Posts:
    116
    Nexus 2013 7`
    Android 5.1.1

    Unity 5.3.0 and Unity 5.3.4:
    Wi-Fi Connection ON: deviceUniqueIdentifier is normal.
    Wi-Fi Connection OFF: deviceUniqueIdentifier = cd9e459ea708a948d5c2f5a6ca8838cf (always!!)

    How to fix??

    Best,
    Nolex.
     
  18. BenouKat

    BenouKat

    Joined:
    Feb 29, 2012
    Posts:
    222
    Hi Nolex,

    I faced the same issue and use this code to face it : http://forum.unity3d.com/threads/unique-identifier-details.353256/

    I was able to get the old correct ID if the variable returns the null one (cd9 etc...), by using this method with "oldmethod = true" as a parameter.

    But as said previously, it's going to change again on Unity 5.4. What we have done for our user is to register the key the got (if not null) at their first launch, and we always use this key.
    Problem is : If the user unistall the app, he might lose the key saved, but it's the only solution we got for now.

    Regards,
     
  19. protostarDean

    protostarDean

    Joined:
    Jun 26, 2014
    Posts:
    7
    Wow, this seems super dodgy.
     
  20. mrm83

    mrm83

    Joined:
    Nov 29, 2014
    Posts:
    345
    So is there a fix for this yet?

    I am using this to ban users, but I can't use it if they are Android6 because they are all the same!
     
  21. Nolex

    Nolex

    Joined:
    Dec 10, 2010
    Posts:
    116
    Not fix.

    SystemInfo.deviceUniqueIdentifier is not good choice for your task.
    Use facebook/google play/game center services for user authentication.
     
  22. mrm83

    mrm83

    Joined:
    Nov 29, 2014
    Posts:
    345
    Not everyone uses those platforms. I need something that is unique per device without extra authentication.
     
  23. JDubbY

    JDubbY

    Joined:
    Aug 1, 2013
    Posts:
    5
    Anyone have a fix for this? To me this is a critical issue. We were always under the assumption that deviceUniqueIdentifier would be consistent on the same device. Is there any sort of workaround?

    If the user is running Android 6+ and they deny the make phone calls permission, it seems like deviceUniqueIdentifier changes which is really jacked.

    My question is what happens if you add:

    <meta-data android:name=“unityplayer.SkipPermissionsDialog” android:value=“true” />

    to the android manifest? Does this make Unity assume that all the permissions are granted or denied? It seems like using this makes them denied which then results in a different uniqueIdentitifer. This defeats the whole purpose of having a deviceUniqueIdentifier in the first place.

    Any workarounds to this mess?

    thanks.

    Jay
     
  24. Nolex

    Nolex

    Joined:
    Dec 10, 2010
    Posts:
    116
    No fix. You can use the GAID (Google's Advertising Identifier).
    I think this is a good alternative.
     
  25. JDubbY

    JDubbY

    Joined:
    Aug 1, 2013
    Posts:
    5
    Wow that's horrible. Will this issue migrate its way onto IOS at some point also?
     
  26. Aqua-reality

    Aqua-reality

    Joined:
    Jan 17, 2017
    Posts:
    1
    When inserting a USB flash drive in Windows, SystemInfo.deviceUniqueIdentifier changes!