1

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.
Michael Labbé
  • 12,017
  • 4
  • 27
  • 36

2 Answers2

1

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.

XiaoChuan Yu
  • 3,951
  • 1
  • 32
  • 44
0

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.

Community
  • 1
  • 1
Stephan Branczyk
  • 9,363
  • 2
  • 33
  • 49