Closed GoogleCodeExporter closed 9 years ago
Just use dx on the smali.jar or baksmali.jar, and you can run the resulting dex
file on a device, using something like terminal emulator.
See
http://stackoverflow.com/questions/10199863/how-to-execute-the-dex-file-in-andro
id-with-command for an example of how to run a command-line utility on the
device
Original comment by jesusfreke@jesusfreke.com
on 26 May 2014 at 11:15
How would you modify, say, the framework.jar this way though?
Original comment by nazo...@gmail.com
on 27 May 2014 at 1:26
There would be no difference from the way you would do it from your desktop
machine. Run baksmali, edit the generated files using <android text editor of
choice>, reassemble with smali, and replace framework.jar, assuming you have
root access of course.
Original comment by jesusfreke@jesusfreke.com
on 28 May 2014 at 12:17
Thanks. I still hold to the recommendation that some sort of actual Android
version would be really nice though.
Original comment by nazo...@gmail.com
on 28 May 2014 at 2:55
I tried that and it doesn't work. Javac requires "annotation processing" and I
have no clue what that means to manually do it. My guess is its methodology
has changed at some point in the two years since the post linked to above was
written.
Original comment by nazo...@gmail.com
on 1 Jun 2014 at 4:08
Nope, it still works.
Original comment by jesusfreke@jesusfreke.com
on 1 Jun 2014 at 4:27
D:\Android\sdk\sdk\build-tools>"C:\Program Files\Java\jdk1.8.0_05\bin\javac.exe"
Smali.jar
error: Class names, 'Smali.jar', are only accepted if annotation processing is e
xplicitly requested
1 error
From the help I see that you can specify -proc:only to tell it to do this
annotation processing whatever that is, but this is the result then:
D:\Android\sdk\sdk\build-tools>"C:\Program Files\Java\jdk1.8.0_05\bin\javac.exe"
-proc:only Smali.jar
warning: Annotation processing without compilation requested but no processors w
ere found.
error: Class names, 'Smali.jar', are only accepted if annotation processing is e
xplicitly requested
1 error
1 warning
I have no clue how to specify processors for it or for that matter if this is
even the right way to do this.
Original comment by nazo...@gmail.com
on 1 Jun 2014 at 4:32
javac is the java compiler. It takes java source code and produces java class
files. It has no idea what to do with a jar file. (hint: a jar file is just a
collection of .class files.. you can skip the javac step)
Original comment by jesusfreke@jesusfreke.com
on 1 Jun 2014 at 8:42
I could have sworn I tried dx first and it gave me an error, but, well, it
worked this time, so I guess not. However, the dalvikvm command requires a
classname -- what do I give it?
Original comment by nazo...@gmail.com
on 1 Jun 2014 at 2:50
It should be org.jf.baksmali.main and org.jf.smali.main
Original comment by jesusfreke@jesusfreke.com
on 1 Jun 2014 at 7:27
Original issue reported on code.google.com by
nazo...@gmail.com
on 26 May 2014 at 9:23