Search in sources :

Example 1 with ReflectiveCallsInliner

use of soot.jimple.toolkits.reflection.ReflectiveCallsInliner in project soot by Sable.

the class ReflInliner method main.

public static void main(String[] args) {
    PackManager.v().getPack("wjpp").add(new Transform("wjpp.inlineReflCalls", new ReflectiveCallsInliner()));
    Scene.v().addBasicClass(Object.class.getName());
    Scene.v().addBasicClass(SootSig.class.getName(), SootClass.BODIES);
    Scene.v().addBasicClass(UnexpectedReflectiveCall.class.getName(), SootClass.BODIES);
    Scene.v().addBasicClass(IUnexpectedReflectiveCallHandler.class.getName(), SootClass.BODIES);
    Scene.v().addBasicClass(DefaultHandler.class.getName(), SootClass.BODIES);
    Scene.v().addBasicClass(OpaquePredicate.class.getName(), SootClass.BODIES);
    Scene.v().addBasicClass(ReflectiveCalls.class.getName(), SootClass.BODIES);
    ArrayList<String> argList = new ArrayList<String>(Arrays.asList(args));
    argList.add("-w");
    argList.add("-p");
    argList.add("cg");
    argList.add("enabled:false");
    argList.add("-app");
    Options.v().set_keep_line_number(true);
    logger.debug("TamiFlex Booster Version " + ReflInliner.class.getPackage().getImplementationVersion());
    try {
        soot.Main.main(argList.toArray(new String[0]));
    } catch (CompilationDeathException e) {
        logger.debug("\nERROR: " + e.getMessage() + "\n");
        logger.debug("The command-line options are described at:\n" + "http://www.sable.mcgill.ca/soot/tutorial/usage/index.html");
        if (Options.v().verbose()) {
            throw e;
        } else {
            logger.debug("Use -verbose to see stack trace.");
        }
        usage();
    }
}
Also used : ArrayList(java.util.ArrayList) CompilationDeathException(soot.CompilationDeathException) ReflectiveCallsInliner(soot.jimple.toolkits.reflection.ReflectiveCallsInliner) UnexpectedReflectiveCall(soot.rtlib.tamiflex.UnexpectedReflectiveCall) DefaultHandler(soot.rtlib.tamiflex.DefaultHandler) SootSig(soot.rtlib.tamiflex.SootSig) OpaquePredicate(soot.rtlib.tamiflex.OpaquePredicate) Transform(soot.Transform) ReflectiveCalls(soot.rtlib.tamiflex.ReflectiveCalls) IUnexpectedReflectiveCallHandler(soot.rtlib.tamiflex.IUnexpectedReflectiveCallHandler)

Aggregations

ArrayList (java.util.ArrayList)1 CompilationDeathException (soot.CompilationDeathException)1 Transform (soot.Transform)1 ReflectiveCallsInliner (soot.jimple.toolkits.reflection.ReflectiveCallsInliner)1 DefaultHandler (soot.rtlib.tamiflex.DefaultHandler)1 IUnexpectedReflectiveCallHandler (soot.rtlib.tamiflex.IUnexpectedReflectiveCallHandler)1 OpaquePredicate (soot.rtlib.tamiflex.OpaquePredicate)1 ReflectiveCalls (soot.rtlib.tamiflex.ReflectiveCalls)1 SootSig (soot.rtlib.tamiflex.SootSig)1 UnexpectedReflectiveCall (soot.rtlib.tamiflex.UnexpectedReflectiveCall)1