Bugjaeger

Android ID is a 64-bit number that some Android apps use for device identification purposes. It is expressed as a hexadecimal string and on my emulator it looks like this

45cd78366d92d01f

Changing Android ID From Your Computer via ADB

Android ID can be changed with the help of ADB through the following command

adb shell settings secure put android_id [my_new_android_id]


Changing Android ID From Another Android Device - with Bugjaeger App

I've ported ADB to Android and wrapped some of its features into my mobile app's UI - Bugjaeger. Once you've connected your target Android device through USB OTG cable, enabled developer settings, and authorized the device, you should do the following

  • switch to Commands tab
  • tap on the add custom command button at the top of the screen inside of the action bar
  • type in the shell command for changing Android ID
    settings secure put android_id [my_new_android_id]

    Note that this time I did not prefix the command with adb shell as it is automatically assumed that custom commands should run on shell.

  • save the command with your custom title
  • tap the Play/Exec button in the list next to your new custom shell command

Changes on Android Oreo

Since Android Oreo (API level 26), Android ID now became scoped additionally by app's signing key (not only by user and device - check the official docs for more info). That means that the above shell command won't automatically change Android ID for all installed apps. Looking through AOSP sources I've found that Android IDs(SSAID) are now stored in a separate settings_ssaid.xml file located somewhere in /data/system/users/[uid]/. On the emulator the file had the following content

<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<settings version="-1">
  <setting id="0" name="userkey" value="5B1D118B4A22B3019F0CD674A186946CEC366CC0CACA63A4948DB3D7449D5DE3" package="android" defaultValue="5B1D118B4A22B3019F0CD674A186946CEC366CC0CACA63A4948DB3D7449D5DE3" defaultSysSet="true" tag="null" />
  <setting id="1" name="10071" value="4cbef15d765f26d2" package="com.google.android.gm" defaultValue="4cbef15d765f26d2" defaultSysSet="false" tag="null" />
  <setting id="2" name="10072" value="ac154e5059c11bb4" package="com.google.android.videos" defaultValue="ac154e5059c11bb4" defaultSysSet="false" tag="null" />
  <setting id="3" name="10085" value="test" package="eu.sisik.androididtest" defaultValue="testdefault" defaultSysSet="false" tag="null" />
</settings>

Changing the value attribute for a particular package changes the Android ID. However, this requires root. I didn't find a way how to change this through ADB without root yet :/

Next Post

Add a comment

Comments

thanks
Written on Fri, 22 Nov 2019 10:15:58 by wkorker