It’s alive!
June 23, 2009Alive I tell you, Alive! baksmali lives!
baksmali is the companion disassembler to smali, the dex assembler that I released recently. I’ve released a new version of smali as well, with a number of improvements/fixes. This is the v0.91 release of both tools.
As you might imagine, baksmali is able to disassemble a dex file into a set of text files, one for each class, containing the methods, field, annotations, debug info and dalvik bytecode for that class.
And then smali can munch on those text files and assemble them into shiny new classes.dex file, which you can repackage back into an apk/jar/zip file and throw on your android-based phone.
And most importantly, you can make magic happen when you make changes between the 2 steps.
Both tools are released as executable jar files. You can invoke them and get the usage information with
java -jar smali-0.91.jar
java -jar baksmali-0.91.jar
Unfortunately, the current incarnation of the tools are somewhat porcine. If you try to assemble/disassemble a large dex file and get an out-of-memory type error, try running with -Xmx512m, which increases the max java heap size to 512MB
java -Xmx512m -jar smali-0.91.jar [options]
java -Xmx512m -jar baksmali-0.91.jar [options]
The main project page for smali/baksmali is http://smali.googlecode.com
Tags: smali baksmali
June 23rd, 2009 at 3:37 am
I’m no programmer, but I understand enough to know what “make magic happen” means. Bravo, sir. You are one of the community’s most valuable… perhaps I should send another donation. Thanks for all your work!
Reply
June 23rd, 2009 at 4:02 am
Very cool, if you digg it: http://digg.com/programming/Android_Dex_Assember_Disassembler_Released
Reply
June 23rd, 2009 at 6:03 am
I wonder if “make magic happen” means “remove copy protection”?
Hmm.
Now where is my copy of MacNosy?
Reply
June 23rd, 2009 at 12:12 pm
“make magic happen” means “know more”
hacking for money is bad
hacking for knowledge is good.make us different from other people.make us better….
Reply
jf Reply:
June 23rd, 2009 at 10:26 pm
Who said anything about making money?
Reply
June 24th, 2009 at 12:04 am
In a word: awesome.
Reply
jf Reply:
June 24th, 2009 at 2:01 am
Thanks for the comment Dan! And many thanks for the great docs
Reply
June 24th, 2009 at 7:31 pm
Very impressive work, I only hope to meet such high standards of excellence and dedication to something one day.
Thanks for everything.
Reply
June 26th, 2009 at 1:12 pm
Outstanding work! Thank you so much for your contribution to the Android community.
Reply
June 27th, 2009 at 5:02 am
I know your lovely new App. has already been put to work by some other programmers in porting HTC Music app. Im sure this is only the beggining……….I really dont think we can thank you enough for your creative work
So in short….Gr8 work mate ! and Thanks !
Reply
June 27th, 2009 at 8:14 am
I would like to see someone apply this to HTC ExchangeSync. I would work on it myself, but I know I don’t have the programming “chops.”
Great work, sir! You seem to ALWAYS be on the bleeding edge of development.
Reply
June 28th, 2009 at 6:29 am
How i Can build an apk after dissasemble and editing it? I conly can launch with dalvikvm -cp ?
thx
Reply
jf Reply:
June 28th, 2009 at 2:42 pm
Using the “dalvikvm -cp” method is only for command-line java applications. For android applications, you need to replace the classes.dex file in the apk with the new one that smali outputs, and then resign the apk.
Reply
June 30th, 2009 at 10:11 am
Err, methinks “make magic happen” could mean things like enable multi-touch in Google Maps.
Reply