protected void internalApply() { CGOptions options = new CGOptions(PhaseOptions.v().getPhaseOptions(this)); if (!Scene.v().hasCustomEntryPoints()) { if (!options.implicit_entry()) { Scene.v().setEntryPoints(EntryPoints.v().application()); } if (options.all_reachable()) { List<SootMethod> entryPoints = new ArrayList<SootMethod>(); entryPoints.addAll(EntryPoints.v().all()); entryPoints.addAll(EntryPoints.v().methodsOfApplicationClasses()); Scene.v().setEntryPoints(entryPoints); } } super.internalApply(); ClinitElimTransformer trimmer = new ClinitElimTransformer(); if (options.trim_clinit()) { for (SootClass cl : Scene.v().getClasses(SootClass.BODIES)) { for (SootMethod m : cl.getMethods()) { if (m.isConcrete() && m.hasActiveBody()) { trimmer.transform(m.getActiveBody()); } } } } } }
/** Returns only the application entry points, not including entry points * invoked implicitly by the VM. */ public List<SootMethod> application() { List<SootMethod> ret = new ArrayList<SootMethod>(); if(Scene.v().hasMainClass() || !Scene.v().hasCustomEntryPoints()) addMethod( ret, Scene.v().getMainClass(), sigMain ); for (SootMethod clinit : clinitsOf(Scene.v().getMainClass() )) { ret.add(clinit); } return ret; } /** Returns only the entry points invoked implicitly by the VM. */
/** Returns only the application entry points, not including entry points * invoked implicitly by the VM. */ public List<SootMethod> application() { List<SootMethod> ret = new ArrayList<SootMethod>(); if(Scene.v().hasMainClass() || !Scene.v().hasCustomEntryPoints()) addMethod( ret, Scene.v().getMainClass(), sigMain ); for (SootMethod clinit : clinitsOf(Scene.v().getMainClass() )) { ret.add(clinit); } return ret; } /** Returns only the entry points invoked implicitly by the VM. */
protected void internalApply() { CGOptions options = new CGOptions( PhaseOptions.v().getPhaseOptions(this) ); if(!Scene.v().hasCustomEntryPoints()) { if(!options.implicit_entry()) { Scene.v().setEntryPoints(EntryPoints.v().application()); } if( options.all_reachable() ) { List<SootMethod> entryPoints = new ArrayList<SootMethod>(); entryPoints.addAll( EntryPoints.v().all() ); entryPoints.addAll( EntryPoints.v().methodsOfApplicationClasses() ); Scene.v().setEntryPoints( entryPoints ); } } super.internalApply(); ClinitElimTransformer trimmer = new ClinitElimTransformer(); if( options.trim_clinit() ) { for (SootClass cl : Scene.v().getClasses(SootClass.BODIES)) { for( Iterator mIt = cl.getMethods().iterator(); mIt.hasNext(); ) { final SootMethod m = (SootMethod) mIt.next(); if( m.isConcrete() && m.hasActiveBody() ) { trimmer.transform( m.getActiveBody() ); } } } } } }
protected void internalApply() { CGOptions options = new CGOptions( PhaseOptions.v().getPhaseOptions(this) ); if(!Scene.v().hasCustomEntryPoints()) { if(!options.implicit_entry()) { Scene.v().setEntryPoints(EntryPoints.v().application()); } if( options.all_reachable() ) { List<SootMethod> entryPoints = new ArrayList<SootMethod>(); entryPoints.addAll( EntryPoints.v().all() ); entryPoints.addAll( EntryPoints.v().methodsOfApplicationClasses() ); Scene.v().setEntryPoints( entryPoints ); } } super.internalApply(); ClinitElimTransformer trimmer = new ClinitElimTransformer(); if( options.trim_clinit() ) { for (SootClass cl : Scene.v().getClasses(SootClass.BODIES)) { for( Iterator mIt = cl.getMethods().iterator(); mIt.hasNext(); ) { final SootMethod m = (SootMethod) mIt.next(); if( m.isConcrete() && m.hasActiveBody() ) { trimmer.transform( m.getActiveBody() ); } } } } } }