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.

user2181533
  • 21
  • 1
  • 2

1 Answers1

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.

Vlad
  • 18,195
  • 4
  • 41
  • 71
  • 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 03 '13 at 07: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 03 '13 at 07:11