package main;

import analyzer.level1.BodyAnalyzer;
import soot.PackManager;
import soot.Scene;
import soot.Transform;
import utils.logging.L1Logger;
import utils.parser.ArgumentParser;

import java.io.IOException;
import java.util.logging.Level;

/**
 * @author Regina Koenig
 * @version 0.6
 */
public class Main {

	private static Level LOGGER_LEVEL;

	private static ArgumentParser argparser;


	public static void main(String[] args) {
		execute(args);
	}

	/**
     * Method which configures and executes soot.Main.
     * @param args This arguments are delivered by Main.main.
     */
	private static void execute(String[] args) {
    	
		argparser = new ArgumentParser(args);
    	
		LOGGER_LEVEL = argparser.getLoggerLevel();
		String[] sootOptions = argparser.getSootOptions();
    	
		try {
			System.out.println("Logger Init1");
			L1Logger.setup(LOGGER_LEVEL);
		} catch (IOException e) {
			e.printStackTrace();
		}
    	
		Scene.v().setSootClassPath(Scene.v().getSootClassPath()
				+ ":.:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar:/"
				+ "usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar");
		Scene.v().addBasicClass("analyzer.level2.HandleStmt");
		Scene.v().addBasicClass("analyzer.level2.SecurityLevel");

        
		BodyAnalyzer banalyzer = new BodyAnalyzer();
        

		PackManager.v()
        	.getPack("jtp").add(new Transform("jtp.analyzer", banalyzer)); 

        	   

		soot.Main.main(sootOptions);

	}
}

@@ -180,16 +180,37 @@
 arser;%0A%0A
+import java.io.File;%0A
 import j
@@ -948,190 +948,430 @@
 %09%09%7D%0A
-    %09%0A%09%09Scene.v().setSootClassPath(Scene.v().getSootClassPath()%0A%09%09%09%09+ %22:.:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar:/%22%0A%09%09%09%09+ %22usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar%22
+%09%09%0A%09%09String javaHome = System.getProperty(%22java.home%22);%0A%09%09if (javaHome == null) %7B%0A%09%09    throw new IllegalStateException(%22System property %60java.home' is undefined%22);%0A%09%09%7D%0A    %09%0A%09%09// TODO: specify the standard library classpath as a command line argument%0A%09%09Scene.v().setSootClassPath(Scene.v().getSootClassPath()%0A%09%09%09%09+ %22:.:%22%0A%09%09%09%09+ new File(javaHome, %22lib/jce.jar%22).toString()%0A%09%09%09%09+ new File(javaHome, %22lib/rt.jar%22).toString()
 );%0A%09

Make soot's classpath more portable