jnorris jnorris - 9 days ago 5
Android Question

How to parse the AndroidManifest.xml file inside an .apk package

This file appears to be in a binary XML format. What is this format and how can it be parsed programmatically (as opposed to using the aapt dump tool in the SDK)?

This binary format is not discussed in the documentation here.

Note: I want to access this information from outside the Android environment, preferably from Java.

Answer

Use android-apktool

There is an application that reads apk files and decodes XMLs to nearly original form.

Usage:

apktool d Gmail.apk && cat Gmail/AndroidManifest.xml

Check android-apktool for more information