Can't decompile my APK file. "Could not decode XML"

805 views
Skip to first unread message

John Doe

unread,
Feb 27, 2013, 2:51:04 AM2/27/13
to apk...@googlegroups.com
I compile an HTML5 game of mine from cocookjs.
they gave me two versions of the game -

A debug self signed version
A release unsigned version

I signed and aligned the release version and then I tried to install it in the emulator. The emulator gave me INSTALL_FAILED_CONTAINER_ERROR
I tried the adb install -s option too, but even then it throwed up the same damn error.

So I need to change the permission of storage preference to AUTO in AndroidManifest.XML as said here: Change the android:installLocation field

Now I need to extract the AndroidManifest.xml file from the APK, do the required change, recompile it, and try to run it again.
To get that, I looked up APKTools, downloaded the two files, ran this

apktool d thegame.apk df_folder

Here's the execution trace:


C:\Users\xxxx\Desktop\android stuff\apktool1.5.2>apktool d thegame.apk gamedecompiled
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode XML
        at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:134)
        at brut.androlib.res.decoder.XmlPullStreamDecoder.decodeManifest(XmlPullStreamDecoder.java:144)
        at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecoder.java:131)
        at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:218)
        at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:115)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
        at brut.apktool.Main.cmdDecode(Main.java:146)
        at brut.apktool.Main.main(Main.java:77)
Caused by: org.xmlpull.v1.XmlPullParserException: caused by: org.xmlpull.v1.XmlPullParserException: resource not found: /META-INF/services/org.xmlpull.v1.XmlPullParserFactory make sure that parser implementing XmlPull API is available
        at org.xmlpull.v1.XmlPullParserFactory.newInstance(XmlPullParserFactory.java:294)
        at org.xmlpull.v1.XmlPullParserFactory.newInstance(XmlPullParserFactory.java:259)
        at org.xmlpull.v1.wrapper.XmlPullWrapperFactory.<init>(XmlPullWrapperFactory.java:52)
        at org.xmlpull.v1.wrapper.XmlPullWrapperFactory.newInstance(XmlPullWrapperFactory.java:29)
        at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:48)
        ... 7 more

Ryszard Wiśniewski

unread,
Feb 27, 2013, 3:03:09 AM2/27/13
to apk...@googlegroups.com
Hi,

I guess you meant CocoonJS. It doesn't make much sense to build application, then decompile it, modify and build back. I don't know CocoonJS, but I'm pretty sure you can modify AndroidManifest.xml file in your project. Just look for it in your sources - it should be there.

shlomo abuisak

unread,
Feb 28, 2013, 3:54:57 PM2/28/13
to apk...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages