Go Back   Android Forums > Android Development > Application Development
Application Development Dev Lounge for the Coder Folks
Gamers - Check out our new sister sites!
Nintendo Wii U!    |    OUYA - $99 Android System!

test: Reply
 
LinkBack Thread Tools
Old December 5th, 2012, 12:56 AM   #1 (permalink)
Linux Guru
Thread Author (OP)
 
Sepero's Avatar
 
Join Date: Aug 2010
Posts: 692
 
Device(s): LG Motion 4G . Pirates are people who attack ships. People who share software are good neighbors.
Carrier: MetroPCS

Thanks: 555
Thanked 402 Times in 170 Posts
Default [GUIDE]Disassemble/Assemble smali code on your Android device

I inquired irc #smali about disassembling/assembling apk's directly on an Android device. I decided to post this because I'm not familiar enough with the terminology to know exactly what JesusFreke is saying. But maybe someone can put it to good use.

Quote:
<Sepero> Hi :)
<Sepero> I was just wonderig if there was convenient way I could install the disassembler/assembler on my android device.
<DAGr8> sepero not a bad request
<DAGr8> but what woudl be the use of this ?
<DAGr8> make mods straight fromthe phone ?
<DAGr8> assembling some jars takes some ressources
<DAGr8> depending on your phone it could be way to long to do
<JesusFreke> you can do it, but yeah. memory is an issue :)
<JesusFreke> baksmali is doable. smali is questionable for larger apks
<JesusFreke> This should be improved quite a bit with the rewrite of dexlib that I'm doing
<JesusFreke> but that's still likely a month or two out
<JesusFreke> If you want to try it, just dx the baksmali or smali jar, and then stick the classes.dex back into the original jar. alternately, add the classes.dex to a new zip file, and add the smali.properties or baksmali.properties from the original baksmali or smali.jar
<JesusFreke> then, on the device
<JesusFreke> dalivkvm -cp /sdcard/baksmali.jar org.jf.baksmali.main
<JesusFreke> if you're running on a newer device (I think maybe ICS+), and don't have root access, you may need to create a dalvik-cache dir somewhere, and specify the ANDROID_DATA env variable
<JesusFreke> i.e.
<JesusFreke> mkdir /sdcard/dalvik-cache
<JesusFreke> ANDROID_DATA=/sdcard dalvikvm -cp /sdcard/baksmali.jar org.jf.baksmali.main
<Sepero> Does "dx the baksmali or smali jar" mean to turn it into an .dex file?
<JesusFreke> yes.
<JesusFreke> dx is the tool in the android sdk that converts java class files into a dex file
<JesusFreke> dx --dex --output=classes.dex baksmali.jar

Sepero is offline  
Last edited by Sepero; December 6th, 2012 at 09:31 AM.
Reply With Quote
Sponsors
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:35 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.