[Q] Can't Run Smali/Baksmali From Tools Folder

brandontowey

Senior Member
Mar 10, 2009
220
90
48
This isn't a huge deal but it's a pain to change directories back and forth in the command prompt. I've copied the smali/baksmali to the tools folder in the SDK directory but whenever I try to run a command like this:

java -jar smali.jar -o xxx/ classes.dex

I get "java not a recognized external or internal command, operable program or batch file"

I can run either one if I do it from the Java/bin folder. Any ideas?
 

brandontowey

Senior Member
Mar 10, 2009
220
90
48
Thanks. Checked out the link and I forgot to mention in my OP that I added c:\android\tools\ to the PATH under system variables. Didn't work. I'll check to make sure I entered it correctly.

EDIT* Think I got it, I had to copy the java.exe from the c:\programs files\java\jdk\bin directory into the c:\android\tools directory.
 
Last edited:

JesusFreke

Inactive Recognized Developer
Oct 23, 2008
736
54
0
Dallas
Bzzzzt. Wrong answer :)

Try reading up on the PATH environment variable some more. I could try to explain it to you, but honestly, I couldn't do any better than google could.
 

brandontowey

Senior Member
Mar 10, 2009
220
90
48
Bzzzzt. Wrong answer :)

Try reading up on the PATH environment variable some more. I could try to explain it to you, but honestly, I couldn't do any better than google could.
I'll Google PATH but it seems to have worked. I ran smali and baksmali from the tools directory and it worked fine. Is it possible it performed the operations incorrectly? I am having trouble with the transparent notification backround. I edited the services.jar to allow transparency but it's not taking.
 

brandontowey

Senior Member
Mar 10, 2009
220
90
48
It works, but it's totally the wrong way to do it. You shouldn't be copying java.exe manually
Ok, now I think I really got it. It seems I deleted the c:\windows\system32 from the PATH. I added it back, removed Java from the tools folder and ran java -jar baksmali.jar services.jar and it decompiled it fine. Thanks for the help.