1

Edit:

The AndroidManifest.xml file in an APK package is not classic XML (text) but binary XML. This claim is backed by these sources: Infosec, Androguard and output of file -i:

AndroidManifest.xml: application/octet-stream; charset=binary

while a text editor usually requires:

AndroidManifest_new.xml: application/xml; charset=us-ascii 

The conversion to classic XML can be achieved in Linux but it requires Java which as mentioned below I want to avoid.


Earlier:

I'm looking for a text editor that can easily enable me to view AndroidManifest.xml file (e.g. 1,2,3) found in Android packages (APK).

Requirements

  • The software should support (preferred) Slackware 14.1 (Primary OS; with KDE 4.10).

    Alternatively, it should support Linux Mint 17 (based on Ubuntu 14.04; running KDE 4.13).

  • A proof is required that the software can view the said XML file.
  • Strongly prefers GUI over CLI(color coding preferred).
  • Freeware is preferred but no bars on paid or proprietary ones.
  • Shouldn't require WINE.
  • Suggestions for browser extension/addons are also invited.
  • Can be a plugin for a native Linux text editor like Kate, Kwrite, et al.
  • Can be an Android app which can export the said file into a file readable by any text editor. Note that formatting shouldn't be affected in this process (scroll below to know more).

What have I tried so far?

Tried for multiple said XML files:

  • I tried XMLcopyeditor (v1.2.1.2) on Slackware but it doesn't show human readable output for AndroidManifest.xml
  • Kate and SublimeText 2 also shows gibberish for the said XML file.
  • I didn't try any CLI based viewers since I strongly want GUI.
  • Firefox and Chromium throws error in opening said XML file.
  • Conglomerate isn't updated since 2013, and as obvious, didn't compile on Slackware because of requirements for age old libraries.
  • I didn't try KXML Editor since it's hasn't been updated since 2013.
  • XV — XML Viewer has very bad reviews so trying it was out of the question for me.

(Note that if you're certain that your candidate would meet the aforesaid requirements than you may suggest the software irrespective of whether I tried it or not.)

Search results I found?

Following are some questions on SE sites that I found but none worked for me:

What else?

Their seems to be two strong candidates namely Oxygen XML Editor and jEdit.

  • I didn't try former because it's a paid software and I'm not sure whether it would work on said XML file.
  • I didn't install latter because it requires Java Runtime installed which is surely a mess from security perspective.

(Let me know if any of these two contenders can also work for the said XML file.)

An indirect way?

Presently, I'm using an app named Axel on Android which can save the said XML file as a .txt file. I then copy it from device into my system and uses Kate to see the file. However, it affects a lot of formatting which I want to avoid.


Thank you very much for any help you can offer!

  • if Kate and SublimeText 2 also shows gibberish for the said XML file., doesn't it suggest the file might have issues? Did you try catting the file? – Huey Jun 1 '15 at 4:36
  • What encoding are those files? They don't seem to be anything my system recognises, and don't appear to be XML :/ – Elliot Reed Jun 2 '15 at 13:37
  • @ElliotReed Check my edit, you'll see why your/my system doesn't recognize the said XML. – Firelord Jun 2 '15 at 16:09
  • 2
    To Downvoters: Why a downvote? Please cite a reason in the comment. This question IMO shows research efforts, is clear and useful, not to mention I tried to follow quality question guideline of this website. – Firelord Jun 2 '15 at 16:22
1

I didn't install Java Runtime system-wide, but rather confined the extracted content into a directory jre under my Home directory, downloaded AXMLPrinter2.jar (suggested on XDA), and finally created an alias for its usage in .bashrc.

My alias was simple:

AXML='~/Downloads/jre/bin/java -jar ~/Downloads/jre/AXMLPrinter2.jar'

and the usage of this alias on any given binary AndroidManifest.xml file anywhere in the system would be:

AXML <Binary_XML> > <New_XML>

E.g.:

AXML ~/AndroidManifest.xml > AndroidMF.xml

The AndroidMF.xml is now human-readable and can be opened by any XML supported text editor. You can also save the file into a .txt rather than a .xml file. Note that formatting is a lot better than the method I mentioned in my question.

Because Java Runtime is available for most of the Operating Systems there shouldn't be any reason why this (or most relevant parts) answer shouldn't work on your system (exception of alias).

0
+50

I'll jump in with Geany and the extension XML PrettyPrinter. I use Geany for pretty much everything, and the XML PrettyPrinter extension has always worked fine for me.

However, what you appear to be after is not an XML reader, rather a parser for the files as extracted from an APK.

APKTool is a good place to start: http://ibotpeaches.github.io/Apktool/install/

The XML it (or any other tool) generates may not be spot-on, but will at least be more helpful than the raw file by a long way! As for a GUI tool, I'm afraid I am not sure on that one (but as it's a parser you're likely after, that shouldn't be too much of an issue I guess).

  • Thanks! Could you mention the hyperlink for this Geany extension? I would like to see how it would work on said XML file. As for APKTool it needs Java which means I'll only use it if I don't see any more recommendations. – Firelord Jun 2 '15 at 15:18
  • I installed Geany with that extension/plugin but sadly Geany doesn't recognize the encoding. Any more recommendations? – Firelord Jun 2 '15 at 15:41
  • It won't recognise the file unless it's parsed first - the XML from Android's packages isn't a "normal" XML file. – Elliot Reed Jun 2 '15 at 19:50
  • 1
    If you don't want to use Java, there are plenty of others: stackoverflow.com/questions/2097813/… Although JRE isn't really a security issue, and if you are concerned you could run it in a jail or sandbox (or something like Firejail: l3net.wordpress.com/projects/firejail) – Elliot Reed Jun 3 '15 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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