Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
663 views
in Technique[技术] by (71.8m points)

how to reach android device unique id?

I'm building an android app about something.
I want that my app cannot be copied.

in WINDOWS I can do like this:

  1. get cpu id from this cmd line:

    wmic cpu get processorid 
    
  2. encrypt this code and save it into database

  3. every time software opened it will checks the cpu code and the code in database. so when software copied to another PC it will say:
    encrypted code and your cpu code does not match.

I was searching for this command in android and OOPS, there isn't any thing that work 100%.
really I don't need to use only this way(get device ID and save it and..) and if you know another way to do this work(I want that my app cannot be copied) say that.

maybe it is good to say my idea that isn't completed:
create a form for buy this app with unique username in my site.
after a user bought this app it will be download for him.
every time that user want's to open the app it connect to server and see if user is available app will work for him and make his user unavailable for next time that it will be opened in another device (NOPE.I can't do this because it isn't a different between tow android device and I haven't a unique ID);else it can not be worked.

UPD1: can this works?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You should generate your own uuid.

Google's blog post says IMEI, mac address, serial number, ANDROID_ID, all of them has a problem.

Use java.util.UUID instead.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...