Apps like Titanium Backup made it easy for us to restore Android ID, but because of changes in Android 6.0 Marshmallow update, the app no longer helps in restoring Android ID of the device prior to new ROM or firmware flash. To fix this, you have to restore the Android ID all by yourself now, manually. But it isn’t hard, as you’ll see.
Android ID is changed when you flash a new ROM, but you may want it back as it’s used by banking and similar high-security demanding apps to make sure it’s the same devices where you had logged in before.
When such apps don’t find the same Android ID as that stored in app’s cache, it would ask you to register again. And if you are a pro user, many of your apps may be relying on Android ID.
Luckily for us, user piit79 over at XDA found a trick to find the previous Android ID of the device and use it to restore, replacing the new Android ID you got after flashing the Marshmallow update, or any other ROM based on 6.0 for that matter.
How to
Step 1. Make sure your device is running Android 6.0. (For pre 9.0, using Titanium backup app will do the trick.) And, look here in case you want to root Android 6.0 update.
Step 2. Also make sure you have proper drivers installed, including ADB and Fastboot driver.
Step 3. Now, connect your device to PC, and make sure ADB is working alright. Open a command window on PC and run the command below to verify ADB. You should get a serial no. with device written after it.
adb devices
Step 4. On command window, enter the following command to get previous Android ID on your device.
adb shell content query --uri content://settings/secure --where "name=\'android_id\'"
You will get a result like this.
Step 5. Copy your Android ID. Or simply write it down carefully if you can’t copy on command window.
For me Android ID is 66afb59f014dae26
Step 6. Now, delete current Android ID using the follow command.
adb shell content delete --uri content://settings/secure --where "name=\'android_id\'"
Step 7. Lastly, insert your previous Android ID that you found above into database.
adb shell content insert --uri content://settings/secure --bind name:s:android_id --bind value:s:<new_android_id>
In my case, the above command will be:
adb shell content insert --uri content://settings/secure --bind name:s:android_id --bind value:s:66afb59f014dae26
The Android ID you enter above has to be your previous Android ID, one that you want to restore. Don’t forget to remove the < and > around Android ID.
Done. That’s it.
Reboot your device, and open Titanium backup now, or any other banking app, and it should recognize old Android ID now, and shouldn’t ask you to re-login.
Via piit79