Skip to content

Instantly share code, notes, and snippets.

@halfvector
Created July 16, 2014 17:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save halfvector/840a945c081e5112c6d6 to your computer and use it in GitHub Desktop.
Save halfvector/840a945c081e5112c6d6 to your computer and use it in GitHub Desktop.
update device's android_id
# prerequisites: rooted device, adb, sqlite installed locally
# works beautifully on glass
# android-ids are hexadecimal [0-9a-f]
# install sqlite3 locally to modify the db
sudo apt-get install -y sqlite3
# make sure we have a device connected
adb devices
# grab db from android device
adb pull /data/data/com.android.providers.settings/databases/settings.db
# update name
sqlite3 settings.db "update secure set value='decaf1' where name='android_id'"
# verify
sqlite3 settings.db 'select * from secure' | fgrep android_id
# push db back to android device
adb push settings.db /data/data/com.android.providers.settings/databases/settings.db
# reboot device
adb reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment