package soot.jimple.infoflow.android;

import java.util.LinkedList;
import java.util.List;

import soot.options.Options;

public class JimpleBuilder {
	

	public void buildJimple(String androidjarPath, String apkFileLocation){
		Options.v().set_allow_phantom_refs(true);
		Options.v().set_src_prec(Options.src_prec_apk);
		List<String> list = new LinkedList<String>();
		list.add(apkFileLocation);
		Options.v().set_process_dir(list);
		Options.v().set_android_jars(androidjarPath);
		Options.v().set_output_format(Options.output_format_jimple);
		Options.v().set_output_dir("JimpleOutput");
		
		System.out.println("Generating the Jimple Files");
		soot.Main.v().run(new String[0]);
	}

}

@@ -86,24 +86,70 @@
 il.List;%0D%0A%0D%0A
+import soot.PackManager;%0D%0Aimport soot.Scene;%0D%0A
 import soot.
@@ -650,16 +650,51 @@
 put%22);%0D%0A
+%09%09soot.Main.v().autoSetOptions();%0D%0A
 %09%09%0D%0A%09%09Sy
@@ -749,41 +749,143 @@
 %0D%0A%09%09
-soot.Main.v().run(new String%5B0%5D);
+ Scene.v().loadNecessaryClasses();%0D%0A%09%09 PackManager.v().runPacks();%0D%0A         PackManager.v().writeOutput();%0D%0A         soot.G.reset();%0D%0A
 %0D%0A%09%7D

reset soot after jimple generation