1

I need to read the AndroidManifest.xml file of a uploaded .apk file into a web portal which I'm constructing right now with spring/JSP. I have used apktool and able to decompile the apk file. I want to clarify the correct way of doing this, best practice.

5
  • 3
    what do you mean "read apk file AndroidManifest.xml"? Just unzip apk and you'll see the manifest file. Jun 3, 2013 at 6:56
  • 1
    @elf_zwölf, that's not enough, the XML will have been compiled into a binary format during packaging.
    – Vlad
    Jun 3, 2013 at 6:59
  • Ask the developer of the application for the source code, or download it if it's open source.
    – Simon
    Jun 3, 2013 at 7:01
  • 1
    A good Java tool for doing this - android-apk-parser: github.com/joakime/android-apk-parser
    – NumberFour
    Sep 3, 2013 at 7:57

1 Answer 1

8

If you don't want the original XML file back, but rather just want to grab some information out of it, use this:

$ aapt dump xmltree <apk> AndroidManifest.xml

The format is pretty regular, so you should be able to programmatically parse it if necessary.

In any case, before you do, make sure you have permission from the author of the .apk (e.g. by having them grant you that permission before they upload the file) to read the information you need.

2
  • I'm not encouraging reverse engineering, what I assume the OP wants is a way to display the application title, version and/or icon on his portal.
    – Vlad
    Jun 3, 2013 at 7:04
  • The question suggests that the IP owner uploads the .apk to the portal themselves. The cleanest solution the OP has is to add a licensing term for using the portal, along the lines of 'we need to read the .apk file in order to display relevant information to the users'. In any case, it's not different from what Windows Explorer does to display program titles and versions for instance.
    – Vlad
    Jun 3, 2013 at 7:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.