



Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Prepara i tuoi esami
Studia grazie alle numerose risorse presenti su Docsity
Prepara i tuoi esami con i documenti condivisi da studenti come te su Docsity
Trova i documenti specifici per gli esami della tua università
Preparati con lezioni e prove svolte basate sui programmi universitari!
Rispondi a reali domande d’esame e scopri la tua preparazione
Riassumi i tuoi documenti, fagli domande, convertili in quiz e mappe concettuali
Studia con prove svolte, tesine e consigli utili
Togliti ogni dubbio leggendo le risposte alle domande fatte da altri studenti come te
Esplora i documenti più scaricati per gli argomenti di studio più popolari
Ottieni i punti per scaricare
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
GOOGLE PLAY ACHIEVEMENT GUIDE VERY EASY TO DO JUST OYU NEED ROOT AND SQLITE
Tipologia: Dispense
Caricato il 01/12/2020
4
(1)2 documenti
1 / 5
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!




root) It turns out that all of the Google Play achievement data resides in a sqlite database stored in /data/data/com.google.android.gms/databases/games_1234abcd.db. (The name of your db file will be different--you may have multiple versions of this file for each Google account that lives on your device.) There are several important tables in this SQLite db file:
make sure you are signed in with your Google play account. Check achievements list. Turn off wifi. Continue to play game and get an achievement. Confirm that the achievement is listed in the achievements list. Still with no internet connectivity, use SQLite Editor (or use sqlite directly--see Step 1 below) to look at the contents of the achievement_pending_ops table. Make a note of your external_player_id---this number is the same for all games, so you just need to determine it once. The tricky part of spoofing achievement_pending_ops entries is that you need a valid context_client_id from the table client_contexts for each pending_op row entry. This context_client_id seems to be created when an app syncs with Play services to obtain the list of achievements that the user has obtained. Once that transaction has occurred, then the table client_contexts will have a row that will show the appropriate context_client_id. But, you have to match up the game with the appropriate entry in the list of games in "games" and "game_instances" tables. Note that the name of the game is sometimes different between different tables, and you may need to fix that. Once you (1) have identified your db file and (2) have recently played the game that you want to "hack", you're ready to follow these general steps: Step 1: Pull the tables from your phone to your computer for analysis. Connect to your device via adb from your computer (via USB or over the air). Issue these commands from your computer's shell/command prompt. Code: adb shell su sqlite3 -header -csv /data/data/com.google.android.gms/databases/games_1234abcd.db "select * from achievement_definitions" > /sdcard/achievement_definitions.csv sqlite3 -header -csv /data/data/com.google.android.gms/databases/games_1234abcd.db "select * from achievement_instances" > /sdcard/achievement_instances.csv sqlite3 -header -csv /data/data/com.google.android.gms/databases/games_1234abcd.db "select * from achievement_pending_ops" > /sdcard/achievement_pending_ops.csv sqlite3 -header -csv /data/data/com.google.android.gms/databases/games_1234abcd.db "select * from client_contexts" > /sdcard/client_contexts.csv sqlite3 -header -csv /data/data/com.google.android.gms/databases/games_1234abcd.db "select _id, external_game_id, display_name from games" > /sdcard/games.csv sqlite3 -header -csv /data/data/com.google.android.gms/databases/games_1234abcd.db "select * from game_instances" > /sdcard/game_instances.csv exit exit adb pull /sdcard/achievement_definitions.csv adb pull /sdcard/achievement_instances.csv adb pull /sdcard/achievement_pending_ops.csv adb pull /sdcard/client_contexts.csv adb pull /sdcard/games.csv adb pull /sdcard/game_instances.csv adb shell rm -f /sdcard/achievement_definitions.csv adb shell rm -f /sdcard/achievement_instances.csv
for a few achievements, it's probably not worth the effort to do something similar. Step 3. Turn off wifi. Create new row(s) in your achievement_pending_ops table. Turn off internet connectivity so that Google Play services won't start syncing until you're ready for it to do so. Example: (Replace games_1234abcd.db with your own db filename below.) Code: adb shell su sqlite3 /data/data/com.google.android.gms/databases/games_1234abcd.db INSERT INTO achievement_pending_ops values('1','100','CgkIqLeu8pkYEAIQFA','0','0','','','831584443304',' 00000'); INSERT INTO achievement_pending_ops values('2','99','CgkI2MbIkbgNEAIQBg','1','0','62','','461745824600',' 000000'); .exit These two INSERT lines add two new rows to the achievement_pending_ops table with the fields listed in order. The first example above is for a non-incremental type achievement, and the second is for an incremental achievement. If you mess up and need to erase the rows in the achievement_pending_ops table, issue this sqlite3 command: Code: DELETE FROM achievement_pending_ops; Step 4: Initiate sync. Verify that it worked. Do a dance. Restore internet connectivity on your device. To force a sync, open the Google Play Games app on your device, then touch your profile, then wait for the sync to occur. Sometimes a reboot is needed. Sync is complete when you can see all of the new achievements showing up under each game in the Google Play Games app. It will take a while for the sync to occur. In my experience, you'll first see the XP points added to your profile. Then you'll see the achievements marked as obtained when you browse to the appropriate game in the Google Play Games app. Then finally, you'll see the achievements in the long list under your user profile. Once the achievements are synced, they should then show up in the achievement_instances table as having state = 0 and they'll be marked as achieved in your game. At this point, you can launch some other games so as to trigger rows in the client_contexts table. Then repeat steps 1-4. Note #1: Some games have their own achievement systems apart from the centralized Google Play services system. What I've described here has nothing to do with the former, and only has to do with the latter. Note #2: Some games don't have a button to show Google Play achievements so it can be tricky to get these games to show up in the client_contexts table. In some cases, you can force an entry in the client_contexts table by playing the game to get at least one
achievement. Once the banner notification for the achievement shows up, tap it and tap on "view all achievements"--this should be enough to get a row in the client_contexts table to appear.