I am writing IntelliJ-Plugin to analyze the code of a Java program. Thus, I use Soot to record static analyzes. Each time a user launches an analysis action of my plugin, I accept the current VirtualFilecurrent context as follows:
FileEditorManager manager = FileEditorManager.getInstance(e.getProject());
VirtualFile files[] = manager.getSelectedFiles();
toAnalyse = files[0]; [...]
When I check the contents of this file, all changes are applied. After that, I load the class that I want to analyze in the Site.
String dir = toAnalyse.getParent().getPath() ;
Options.v().setPhaseOption("jb", "use-original-names");
Options.v().set_soot_classpath( System.getProperty("java.home")+";"+ dir);
c = Scene.v().loadClassAndSupport(name);
This works great for me. But now to my problem: If I change sth. in the test instance of my plugin and run the same analysis again, nothing changes.
What have i tried so far?
I set the following options :
Options.v().set_dump_body( Arrays.asList("jb"));
Options.v().set_dump_cfg( Arrays.asList("jb"));
Options.v().set_allow_phantom_refs(true);
Options.v().set_whole_program(true);
I also deleted all classes manually
like this:
Chain<SootClass> classes = Scene.v().getClasses();
Stack<SootClass> stack = new Stack<>();
for(SootClass s : classes)
stack.push(s);
while(!stack.empty())
Scene.v().removeClass(stack.pop());
and started the program again.