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

jnorris picture jnorris · Jan 19, 2010 · Viewed 179k times · Source

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

Macarse picture Macarse · Jul 12, 2010

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