I´m working on an application (developed with .NET Framework) that manages Android Application packages (apk) and the program has to read the ApplicationManifest.xml that resides inside the apk. Extracting the Manifest file from the apk is no problem, because I can use standard zip tools to extract all files from an apk.
But reading the ApplicationManifest is not possible. I expected that it contains raw XML data, but it’s somehow encrypted or encoded.
Is there a way using the BCL of the .NET Framework to read the XML data from the ApplicationManifest? Or is there a library for the .NET Framework to read the ApplicationManifest?
I would not recommend using the mentioned apktool, as it is not safe for automated decoding – I used to use it for the same reason as you did, but it failed in some cases.
There are some tools like axml2xml that are specialized in Android encoded XML files or other tools like Android Asset Packaging Tool (aapt). You can also code a decoder on your own.
axml2xml is not perfect, so I would recommend running aapt (included in Android SDK) on your apk, as it print a lot of information you can parse:
aapt l -a <your.apk>If you want to implement code to parse the Manifest yourself, have a look at ribo‘s community wiki entry:
In conclusion, I would recommend parsing the
aaptoutput (you could bundle it with your application).