Skip to content

Viewing XML files from .apk archives

Unfortunately files stored in the .apk archives of android application packages are in binary. This is a problem for those people (I know there’s at least a few out there) that are trying to read the XML files in these app archives. My XML Viewer app can’t convert these back into ordinary text which is why if you try to open an XML file out of an apk with it, it will give an error trying to parse it.

For now a solution is to extract the XML files using an archive utility and then using a tool such as AXMLPrinter2 to convert the files back to ordinary text. You can then read them using XML viewer.

I know this isn’t ideal but at the moment there’s not enough support for this feature to integrate it into the app (it would require a lot of testing).

There is a good reason for all this – you are not really supposed to reverse engineer apk files. Google themselves provide a tool for doing so, but they state quite clearly that this is not for piracy purposes, only for examining apks for which you are licensed to do so. This makes me even less inclined to build such a feature into my app.

I think the best approach of all if you’re looking to examine an XML file from an Android application is to find the source online if it is an open source app, which you can of course do on your Android device and use XML Viewer to view the files. If its not open source then its questionable as to whether you should really be trying to do this in the first place.

Leave a Reply