Android OS Forum banner
1 - 11 of 11 Posts

·
Village Idiot
Joined
·
71 Posts
One APKTOOL To Rule Them ALL!!
For those of you out there hacking away at apks, you may have run into a bit of a speedbump when decompiling some ICS apks. The particular error I am addressing is the one that looks like
Code:
I: Baksmaling...<br />
Exception in thread "main" java.lang.RuntimeException: bad magic value: 64 65 78 0a 30 33 36 00<br />
	at org.jf.dexlib.DexFile.<init>(DexFile.java:377)<br />
	at org.jf.dexlib.DexFile.<init>(DexFile.java:274)<br />
	at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:44)<br />
	at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)<br />
	at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)<br />
	at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)<br />
	at brut.apktool.Main.cmdDecode(Main.java:128)<br />
	at brut.apktool.Main.main(Main.java:65)
If you search google using the right terms you may find an alternate apktool that will decompile these apks without any problem. The only issue is that it will only work with those apks that have that odd magic number value. Since apktool is open source I decided to grab it and modify it to work with regular apks and the ones that have the different magic number value. Rather than keep it all to myself I have come here to share it with the Rootz community.

I am only providing the .jar since that is all you need to replace in order to make use of it. The link for the download is right here. So download it, place it where your existing apktool.jar is and ave at it!

DISCLAIMER: This is in no way associated with the original apktool. If you have apktool related issues please visit http://code.google.com/p/android-apktool/.
 

·
Android Addict
Joined
·
933 Posts
So will this help with the contacts apk compiling but force closing when you do an xml edit? ?

Sent from my DROID BIONIC using Tapatalk 2
 

·
Developer
Joined
·
111 Posts
I can see this thread turning into a support thread for apktool. Maybe it should be labeled patch instead of tool.

So will this help with the contacts apk compiling but force closing when you do an xml edit? ?

Sent from my DROID BIONIC using Tapatalk 2
I believe he said it fixes the magic number error only.
 

·
Android Addict
Joined
·
933 Posts
I can see this thread turning into a support thread for apktool. Maybe it should be labeled patch instead of tool.

I believe he said it fixes the magic number error only.
Yeah I was just being hopeful. A good question though.

Sent from my DROID BIONIC using Tapatalk 2
 

·
Registered
Joined
·
292 Posts
not work for me...
decompile fine but i've errors when recompile
i've tried with framework-res.apk
I know you get errors with this tool. What you can do is to go to your sdk tools or platform tools (I can remember which folder) and copy aapt from that folder and paste it to the folder that you stored your apktool.jar ( usually on usr/local/bin -linux-)
ubuntu 12.04

Inviato dal mio Galaxy Nexus
Sent from my Galaxy Nexus using Tapatalk 2
 

·
Registered
Joined
·
33 Posts
thank you but not work...
change apktool.jar in usr/local/bin
change aapt with the aapt of platform tool....i have the same error...
 
1 - 11 of 11 Posts
Top