7

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.

E. Sundin
  • 4,103
  • 21
  • 30
  • Related: [Where is the “android_id” stored and when does it change?](https://android.stackexchange.com/a/219757/218526) – Irfan Latif Nov 24 '20 at 11:41

1 Answers1

2

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.

Alex Lipov
  • 13,503
  • 5
  • 64
  • 87