public boolean setPhaseOption(String phase, String option) { return PhaseOptions.v().processPhaseOptions(phase, option); }
/** * Returns a ShimpleBody constructed from b, using default phase options. **/ public ShimpleBody newBody(Body b) { Map<String, String> options = PhaseOptions.v().getPhaseOptions(PHASE); return new ShimpleBody(b, options); }
/** Returns a BafBody constructed from b. */ public BafBody newBody(JimpleBody b, String phase) { Map<String, String> options = PhaseOptions.v().getPhaseOptions(phase); return new BafBody(b, options); } }
/** * Returns an empty ShimpleBody associated with method m, using default phase options. **/ public ShimpleBody newBody(SootMethod m) { Map<String, String> options = PhaseOptions.v().getPhaseOptions(PHASE); return new ShimpleBody(m, options); }
public PackManager(Singletons.Global g) { PhaseOptions.v().setPackManager(this); init(); }
public void insertAfter(Transform t, String phaseName) { PhaseOptions.v().getPM().notifyAddPack(); for (Transform tr : opts) { if (tr.getPhaseName().equals(phaseName)) { opts.insertAfter(t, tr); return; } } throw new RuntimeException("phase " + phaseName + " not found!"); }
public void insertBefore(Transform t, String phaseName) { PhaseOptions.v().getPM().notifyAddPack(); for (Transform tr : opts) { if (tr.getPhaseName().equals(phaseName)) { opts.insertBefore(t, tr); return; } } throw new RuntimeException("phase " + phaseName + " not found!"); }
public final void apply() { Map<String, String> options = PhaseOptions.v().getPhaseOptions(this); if (!PhaseOptions.getBoolean(options, "enabled")) { return; } internalApply(); }
public final void apply(Body b) { Map<String, String> options = PhaseOptions.v().getPhaseOptions(this); if (!PhaseOptions.getBoolean(options, "enabled")) { return; } internalApply(b); }
protected void internalApply(Body b) { applyPhaseOptions((JimpleBody) b, PhaseOptions.v().getPhaseOptions(getPhaseName())); } }
protected void internalApply(Body b) { applyPhaseOptions((JimpleBody) b, PhaseOptions.v().getPhaseOptions(getPhaseName())); } }
public void add(Transform t) { if (!t.getPhaseName().startsWith(getPhaseName() + ".")) { throw new RuntimeException("Transforms in pack '" + getPhaseName() + "' must have a phase name " + "that starts with '" + getPhaseName() + ".'."); } PhaseOptions.v().getPM().notifyAddPack(); if (get(t.getPhaseName()) != null) { throw new RuntimeException("Phase " + t.getPhaseName() + " already " + "in pack"); } opts.add(t); }
AllocNode(PAG pag, Object newExpr, Type t, SootMethod m) { super(pag, t); this.method = m; if (t instanceof RefType) { RefType rt = (RefType) t; if (rt.getSootClass().isAbstract()) { boolean usesReflectionLog = new CGOptions(PhaseOptions.v().getPhaseOptions("cg")).reflection_log() != null; if (!usesReflectionLog) { throw new RuntimeException("Attempt to create allocnode with abstract type " + t); } } } this.newExpr = newExpr; if (newExpr instanceof ContextVarNode) { throw new RuntimeException(); } pag.getAllocNodeNumberer().add(this); }
public OnFlyCallGraphBuilder(ContextManager cm, ReachableMethods rm) { this.cm = cm; this.rm = rm; worklist = rm.listener(); options = new CGOptions(PhaseOptions.v().getPhaseOptions("cg")); if (!options.verbose()) { logger.debug("" + "[Call Graph] For information on where the call graph may be incomplete," + "use the verbose option to the cg phase."); } if (options.reflection_log() == null || options.reflection_log().length() == 0) { if (options.types_for_invoke() && new SparkOptions(PhaseOptions.v().getPhaseOptions("cg.spark")).enabled()) { reflectionModel = new TypeBasedReflectionModel(); } else { reflectionModel = new DefaultReflectionModel(); } } else { reflectionModel = new TraceBasedReflectionModel(); } this.fh = Scene.v().getOrMakeFastHierarchy(); }
public void apply() { Map<String, String> options = PhaseOptions.v().getPhaseOptions(phaseName); if (PhaseOptions.getBoolean(options, "enabled")) { if (Options.v().verbose()) { logger.debug("" + "Applying phase " + phaseName + " to the scene."); } } if (DEBUG) { PhaseDumper.v().dumpBefore(getPhaseName()); } ((SceneTransformer) t).transform(phaseName, options); if (DEBUG) { PhaseDumper.v().dumpAfter(getPhaseName()); } }
public void apply(Body b) { Map<String, String> options = PhaseOptions.v().getPhaseOptions(phaseName); if (PhaseOptions.getBoolean(options, "enabled")) { if (Options.v().verbose()) { logger.debug("" + "Applying phase " + phaseName + " to " + b.getMethod() + "."); } } if (DEBUG) { PhaseDumper.v().dumpBefore(b, getPhaseName()); } ((BodyTransformer) t).transform(b, phaseName, options); if (DEBUG) { PhaseDumper.v().dumpAfter(b, getPhaseName()); } }
public void autoSetOptions() { // when no-bodies-for-excluded is enabled, also enable phantom refs if (Options.v().no_bodies_for_excluded()) { Options.v().set_allow_phantom_refs(true); } // when reflection log is enabled, also enable phantom refs CGOptions cgOptions = new CGOptions(PhaseOptions.v().getPhaseOptions("cg")); String log = cgOptions.reflection_log(); if ((log != null) && (log.length() > 0)) { Options.v().set_allow_phantom_refs(true); } // if phantom refs enabled, ignore wrong staticness in type assigner if (Options.v().allow_phantom_refs()) { Options.v().set_wrong_staticness(Options.wrong_staticness_fix); } } }
public void handleNewAnalysis(Transform t, Body b) { // here save current phase name and only send if actual data flow analysis exists if (PhaseOptions.getBoolean(PhaseOptions.v().getPhaseOptions(t.getPhaseName()), "enabled")) { String name = t.getPhaseName() + " for method: " + b.getMethod().getName(); currentPhaseName(name); currentPhaseEnabled(true); doneCurrent(false); } else { currentPhaseEnabled(false); setInteractThisAnalysis(false); } }
public TypeConstants(Singletons.Global g) { int jdkver = new CGOptions(PhaseOptions.v().getPhaseOptions("cg")).jdkver();