[Soot-list] Create Java Files with Soot (Newbie question)

Alessio Gambi gambi at st.cs.uni-saarland.de
Mon Dec 19 03:40:12 EST 2016


Dear SOOTers,

I am considering to use Soot to automatically create Java classes, JUnit 4 Test cases in particular. 
However, I got stuck somewhere in the process.

With Soot, I can create the test  classes (as per the tutorial) and annotate the test methods (and eventually provide their body).
For the ones that are not familiar with JUnit 4, a standard test case is a  pojo class  whose test methods are public void and are annotated with a specific annotation  (i.e., @Test).
Once I created the class file, I decompile it to get the Java file.

Note: 
	By using Soot with '-f dava' as command line options, I was not able to re-create “the correct” java files. In fact, the resulting java files miss the method annotation.
	I loaded the generated classes and used reflection to check that annotations are actually there, and they are.
	So now I am using another open-source decompiler for this job

Now what I want to ask the experts is:
	Is there a more effective way to create those java classes? Basically, can I directly output the Java classes from the SootClass without generating first the .class and then decompile it?

Many thanks

Best

— Alessio

Alessio Gambi, Ph.D.
gambi at st.cs.uni-saarland.de





More information about the Soot-list mailing list