I need a list of all the files stored in a given APK file. I am using the NDK.
Challenges:
- Get the path to the .APK file on the device.
- Iterate through all of the files, recursing through the subdirectories.
I need a list of all the files stored in a given APK file. I am using the NDK.
Challenges:
You should be able to treat the apk file as if they are zip files. Since you're working within NDK, you can try using a C++ library like 7-zip to help you browse through the zip file entries.
For the first part of your question, the path to the .apk on the device, refer to this question (it's on StackOverflow, so I won't bother recopying it).
For the second part your question, unzipping an .apk file on the device, download the source for Terminal IDE (Terminal IDE also works on non-rooted devices). Download its source from the download tab, not the browse source tab (which for some reason doesn't work right now).
It's a huge project mostly in Java (it's not exactly the language you're looking for), but it's well organized and remarkably readable.