I was playing a game that had hidden achievements and wanted to find the conditions necessary to unlock these achievements. To do this, I've tried to get the source code of the game, to find the achievement trigger. The PC version of the game seems to have been written in C++, making the decompiled code near unreadable. So, I got the APK for the android version of the game, and managed to convert the classes.dex file into a jar, which I have now decompiled into readable code. The problem is, there was no code for the classes I was looking for. I don't think any of the code I've seen even relates to the sort of game features I want, having more to do with file and asset management than player control, stat records, NPC behavior, or events. I asked a question about this on a different Stack Exchange site, but have since done a bit more research. It seems that, when the APK is installed onto a device, it requires an internet connection, in order to download all of the other files necessary for the game to run. Is there a way I can gain access to these files? I'm pretty sure that they are in the persistent internal storage directory for this app.
Best way to access app internal (persistent) storage directory is a rooted device. Once you have root permissions you can access the app internal directory which is located in
On an unrooted device you don not have direct access to the app internal (persistent) storage directory.
If the app allows backup (most aps do not) via
adb backup <packagename> then you can get indirect access to the app internal storage directory:
- Make sure debugging is enabled on phone and Android SDK/adb is installed on your PC and the phone is connected via USB to the PC
- On the connected PC execute
adb backup <packagename>this will backup all app data to an encrypted
- If the created
backup.abfile has a size of 0 bytes then backup is disallowed for the selected app
- If the
backup.abfile has a size greater 0 you should be able to decrypt and convert it to to a TAR archive using Android Backup Extractor (abe)
- Extract the created tar file and you should have all data stored by the app in it's internal storage.