Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

java - How to get Settings.Secure.ANDROID_ID value without code?

So I am basically making a business to business android application, and to prevent other people from using my app I decided to use the android secure ID, which I used this code to get:

String androidId = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);

I was just wondering if there is any way for the client to get that ID themselves before download the app? Can it be found in the settings somewhere or is that not possible?

I tried to read a lot of articles online about this but couldn't find anything useful, thanks!


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

1 Reply

0 votes
by (71.8m points)

Maybe this answer will be of some help to you, https://android.stackexchange.com/questions/35659/where-can-i-find-the-android-id-on-my-device. The topmost answer says the following

You can do this via adb. Does not require root

shell@android:/ $ content query --uri content://settings/secure --projection value --where "name='android_id'"              


Row: 0 value=<your ID in hexadecimal>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...