Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by lloydg · Jun 29, 2015 at 12:38 PM · androidiphoneservice

How can I get a Persistent Unique Hardware ID?

Hi,

I wan't to get a Persistent Unique Hardware ID that I will use to encrypt (probably RC4) my game data that I save to disk.

In short I want to encrypt and device lock my save data (serialized) but I need this ID to be persistent (after say an update to their phone) so they don't lose there save data.

Another reason I need this is if I have an in app purchase to remove ads, I want to then be able to save this to disk so I remember it in case the app is offline next time it runs, but I don't want this saved file to be able to then just be copied to anyone and have it work to disable ads (for free).

Does anyone know a way I can get this ID / generate it?

Looking mainly for Android and iOS.

Cheers!

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image meat5000 ♦ · Jun 29, 2015 at 12:38 PM 0
Share

Capture device IDs.

http://stackoverflow.com/questions/2785485/is-there-a-unique-android-device-id

You can also bind it to a particular connection by incorporating the mac address but this can be cloned.

avatar image lloydg · Jun 29, 2015 at 01:40 PM 0
Share

I just found SystemInfo.deviceUniqueIdentifier, does anyone know how persistent / reliable this is?

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by sansol · Jun 29, 2015 at 03:58 PM

just an idea:

any reason not to use http://docs.unity3d.com/ScriptReference/SystemInfo-deviceUniqueIdentifier.html ?

although for encrypting you could maybe combine such with your own string (e.g.: "thisappisgreat" or something), so you make it a little harder to decrypt that file.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image lloydg · Jun 30, 2015 at 08:30 AM 0
Share

Yeah I will use this I am thinking, do we know how persistent it is? If they upgrade the version of android on their phone will this ID stay the same?

so are you saying encrypt it with a password that is like salted with the uniqueIdentifier?

avatar image sansol · Jun 30, 2015 at 08:43 AM 0
Share

i don't know if the id will be persistent after an upgrade of the android version, but by reading the documentation i would say yes. in the documentation: "It is guaranteed to be unique for every device"

as for the encryption, i was suggesting you to not just use the device id for encryption, since that is very easy to obtain. just by adding a fix string hardcoded and combining it to the device id you got a better key for encryption (since someone will need to both get the device id and also find out your fixed string to decrypt).

avatar image
0

Answer by AurimasBlazulionis · Jun 30, 2015 at 08:38 AM

Your point of encrypting in app purchases will not really protect from not paying for them. If you use Application.PersistentDataPath then non-root user won't be able to access files. If a guy has root and doesn't want to pay for in app purchases, then 90% chance he will use an app like freedom to trick your app into buying your ad free version. So encryption is not really an option, just a lot of work for you. To really prevent these things you have to have a server hosted which checks if he has paid. Anyways, if you are on Android and offline, you will not get ads, even if you get, dev won't get a single penny for them

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AurimasBlazulionis · Jun 30, 2015 at 08:42 AM 0
Share

If you still want encryption you can use I$$anonymous$$EI on Android: http://answers.unity3d.com/questions/655928/imei-android-1.html

avatar image lloydg · Jun 30, 2015 at 09:06 AM 0
Share

Hi, thanks, yeah I realised that the ads wont work offline anyway, so no point remember while they are offline if they have purchased the add removal, but I also would use the encryption to make it harder for people to skip levels.

I don't think it will be too hard to implement as I already have implemented it. But it might be more of a pain of people losing their level progression if the ID changes.

If people remove the ads for free, its not the end of the world, if it gets to that point, I would be happy with the number of downloads I got :)

avatar image WaxerPL · Jul 01, 2015 at 12:28 PM 0
Share

TheDiamondPLay can you answer on my question under your post abou RPC saving data? :) It's very important for me

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How to make an Android/iPhone background service? 1 Answer

easiest way to do pinch zoom? 5 Answers

Skin mesh model merge (iPhone and android) 2 Answers

Saving game question. 1 Answer

Need to Put buttons on Iphone/Android game 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges