dimanche 3 février 2013

Keeping Google Play device entry over firmware flashes: Android ID

Edit: *DOES NOT WORK* Useless. The device is still duplicate... perhaps /data/misc/radio/imei.conf needs to be copied too?

To keep the same device entry in Google Play after a firmware flash, you must keep the "Android ID" intact.

This key is a unique identifier used by Google Play to address your device.
After each firmware flash, this unique identifier is re-generated by default, and this leads to a new device entry in Google Play (I have around 20 duplicate entries in my Play account->Parameters).

This Android ID is stored in the system database, and it is easy to change it.
First, you have to retrieve the Android ID you want to keep over the firmware flashes:
adb shell
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
SELECT * FROM secure WHERE name = 'android_id';
.quit

The "SELECT" command will display the Android id, like this:
34|android_id|123456789abcdef0

After a firmware flash, you just have to update this Android ID. Do that at early stage (before installing Google Applications for example), so that all applications will take into account the updated ID:
adb shell
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
UPDATE secure SET value = '<your preferred ID>' WHERE name = 'android_id';
.quit

With <your preferred ID> the one you got initially with the SELECT command (i.e. 123456789abcdef0 in my example).
Just reboot to be sure that any running application gets the new ID.

Source: http://forum.xda-developers.com/showthread.php?p=37218521

Aucun commentaire:

Enregistrer un commentaire