Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get app specific ANDROID_ID on Android Oreo?

As stated here Oreo has unique ANDROID_ID's for each app which makes the previous command for getting the id not working as I'd like.

adb shell settings get secure android_id

How can I now, on Oreo, get the android id as seen by a specific app?

Root & non-root solutions are welcomed.

like image 413
E. Sundin Avatar asked Oct 30 '17 00:10

E. Sundin


1 Answers

adb doesn't support retrieving an app-specific ANDROID_ID at this time, because app-specific ANDROID_IDs are being written into a separate file (settings_ssaid.xml, while adb allows to access only values from system, secure or global tables). However, on emulator or on a rooted device this can be easily achieved:

# switch into a root mode and open a shell
$ adb root
$ adb shell
$ pm list users
Users:
    UserInfo{0:Owner:13} running
    UserInfo{10:New user:10} running
# let's find all the app-specific ANDROID_IDs for user 0
$ cd /data/system/users/0
$ cat settings_ssaid.xml  
<settings version="-1">
  <setting id="0" name="userkey" value="E4FC4CFF14039F5AD44AD63F70007F85FDBBE1FF9BCB9FF5331B3FD33E057461" package="android" defaultValue="E4FC4CFF14039F5AD44AD63F70007F85FDBBE1FF9BCB9FF5331B3FD33E057461" defaultSysSet="true" tag="null" />
  <setting id="4" name="10072" value="9d5f269e42d4ca76" package="info.osom.ssaid" defaultValue="9d5f269e42d4ca76" defaultSysSet="false" tag="null" />
</settings>

In this example, I have one application with package name info.osom.ssaid, whose ANDROID_ID value is 9d5f269e42d4ca76.

like image 75
Alex Lipov Avatar answered Oct 30 '22 17:10

Alex Lipov