I want to use Soot to do a static analysis of Java programs, including for example the control flow graph.
The various tutorials say that the "standard way" to use Soot is to create a main method where one adds custom transforms to the Soot pipeline and then call soot.Main.main(...):
public static void main(String[] args) {
PackManager.v().getPack("jtp").add(
new Transform("jtp.gotoinstrumenter", GotoInstrumenter.v()));
soot.Main.main(args);
}
Of course, this has some serious limitations if you want to use Soot in something else than a command line tool. For example, it is unclear to me whether it is even legal to call Soot's main method more than once in a program.
So does anyone know a possibility to use the Soot analysis tools directly through an API that is a bit more sophisticated?