You can compile java classes using a regular java compiler, and then use the Android dx utility to convert the compiled .class files to a dex file. And then run baksmali in the dex file to create smali files.
For example, let's say you have the following code in a java file called "HelloWorld.java":
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } }
To convert it to smali:
javac HelloWorld.java dx --dex --output=classes.dex HelloWorld.class baksmali classes.dex
source share