private void loadNecessaryClass(String name) { SootClass c; c = loadClassAndSupport(name); c.setApplicationClass(); }
tclass.setApplicationClass();
s.setApplicationClass(); s.setApplicationClass(); continue; s.setApplicationClass();
RTI = new ReflectionTraceInfo(logFilePath); Scene.v().getSootClass(SootSig.class.getName()).setApplicationClass(); Scene.v().getSootClass(UnexpectedReflectiveCall.class.getName()).setApplicationClass(); Scene.v().getSootClass(IUnexpectedReflectiveCallHandler.class.getName()).setApplicationClass(); Scene.v().getSootClass(DefaultHandler.class.getName()).setApplicationClass(); Scene.v().getSootClass(OpaquePredicate.class.getName()).setApplicationClass(); Scene.v().getSootClass(ReflectiveCalls.class.getName()).setApplicationClass(); reflectiveCallsClass.setApplicationClass();
/** * Load the set of classes that soot needs, including those specified on the command-line. This is the standard way of * initialising the list of classes soot should use. */ public void loadNecessaryClasses() { loadBasicClasses(); for (String name : Options.v().classes()) { loadNecessaryClass(name); } loadDynamicClasses(); if (Options.v().oaat()) { if (Options.v().process_dir().isEmpty()) { throw new IllegalArgumentException("If switch -oaat is used, then also -process-dir must be given."); } } else { for (final String path : Options.v().process_dir()) { for (String cl : SourceLocator.v().getClassesUnder(path)) { SootClass theClass = loadClassAndSupport(cl); if (!theClass.isPhantom) { theClass.setApplicationClass(); } } } } prepareClasses(); setDoneResolving(); }
private soot.SootClass getSpecialInterfaceAnonClass(soot.SootClass addToClass) { // check to see if there is already a special anon class for this // interface if ((InitialResolver.v().specialAnonMap() != null) && (InitialResolver.v().specialAnonMap().containsKey(addToClass))) { return InitialResolver.v().specialAnonMap().get(addToClass); } else { String specialClassName = addToClass.getName() + "$" + InitialResolver.v().getNextAnonNum(); // add class to scene and other maps and lists as needed soot.SootClass specialClass = new soot.SootClass(specialClassName); soot.Scene.v().addClass(specialClass); specialClass.setApplicationClass(); specialClass.addTag(new soot.tagkit.SyntheticTag()); specialClass.setSuperclass(soot.Scene.v().getSootClass("java.lang.Object")); Util.addInnerClassTag(addToClass, specialClass.getName(), addToClass.getName(), null, soot.Modifier.STATIC); Util.addInnerClassTag(specialClass, specialClass.getName(), addToClass.getName(), null, soot.Modifier.STATIC); InitialResolver.v().addNameToAST(specialClassName); references.add(RefType.v(specialClassName)); if (InitialResolver.v().specialAnonMap() == null) { InitialResolver.v().setSpecialAnonMap(new HashMap<SootClass, SootClass>()); } InitialResolver.v().specialAnonMap().put(addToClass, specialClass); return specialClass; } }
/** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:186 */ public void jimplify1phase2() { SootClass sc = getSootClassDecl(); sc.setResolvingLevel(SootClass.DANGLING); sc.setModifiers(sootTypeModifiers()); sc.setApplicationClass(); SourceFileTag st = new soot.tagkit.SourceFileTag(sourceNameWithoutPath()); st.setAbsolutePath(compilationUnit().pathName()); sc.addTag(st); sc.setSuperclass(typeObject().getSootClassDecl()); for(Iterator iter = superinterfacesIterator(); iter.hasNext(); ) { TypeDecl typeDecl = (TypeDecl)iter.next(); if(typeDecl != typeObject() && !sc.implementsInterface(typeDecl.getSootClassDecl().getName())) sc.addInterface(typeDecl.getSootClassDecl()); } if(isNestedType()) sc.setOuterClass(enclosingType().getSootClassDecl()); sc.setResolvingLevel(SootClass.HIERARCHY); super.jimplify1phase2(); sc.setResolvingLevel(SootClass.SIGNATURES); } /**
/** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:163 */ public void jimplify1phase2() { SootClass sc = getSootClassDecl(); sc.setResolvingLevel(SootClass.DANGLING); sc.setModifiers(sootTypeModifiers()); sc.setApplicationClass(); SourceFileTag st = new soot.tagkit.SourceFileTag(sourceNameWithoutPath()); st.setAbsolutePath(compilationUnit().pathName()); sc.addTag(st); if(hasSuperclass()) { sc.setSuperclass(superclass().getSootClassDecl()); } for(Iterator iter = interfacesIterator(); iter.hasNext(); ) { TypeDecl typeDecl = (TypeDecl)iter.next(); if(!sc.implementsInterface(typeDecl.getSootClassDecl().getName())) sc.addInterface(typeDecl.getSootClassDecl()); } if(isNestedType()) sc.setOuterClass(enclosingType().getSootClassDecl()); sc.setResolvingLevel(SootClass.HIERARCHY); super.jimplify1phase2(); sc.setResolvingLevel(SootClass.SIGNATURES); } /**
mediatingClass.setApplicationClass(); mediatingClass.setInScene(true);
private void loadNecessaryClass(String name) { SootClass c; c = loadClassAndSupport(name); c.setApplicationClass(); } /** Load the set of classes that soot needs, including those specified on the
private void loadNecessaryClass(String name) { SootClass c; c = loadClassAndSupport(name); c.setApplicationClass(); } /** Load the set of classes that soot needs, including those specified on the
/** Load the set of classes that soot needs, including those specified on the * command-line. This is the standard way of initialising the list of * classes soot should use. */ public void loadNecessaryClasses() { loadBasicClasses(); Iterator<String> it = Options.v().classes().iterator(); while (it.hasNext()) { String name = (String) it.next(); loadNecessaryClass(name); } loadDynamicClasses(); for( Iterator<String> pathIt = Options.v().process_dir().iterator(); pathIt.hasNext(); ) { final String path = (String) pathIt.next(); for (String cl : SourceLocator.v().getClassesUnder(path)) { loadClassAndSupport(cl).setApplicationClass(); } } prepareClasses(); // RoboVM note: In RoboVM we're never done resolving //setDoneResolving(); }
/** Load the set of classes that soot needs, including those specified on the * command-line. This is the standard way of initialising the list of * classes soot should use. */ public void loadNecessaryClasses() { loadBasicClasses(); Iterator<String> it = Options.v().classes().iterator(); while (it.hasNext()) { String name = (String) it.next(); loadNecessaryClass(name); } loadDynamicClasses(); for( Iterator<String> pathIt = Options.v().process_dir().iterator(); pathIt.hasNext(); ) { final String path = (String) pathIt.next(); for (String cl : SourceLocator.v().getClassesUnder(path)) { loadClassAndSupport(cl).setApplicationClass(); } } prepareClasses(); // RoboVM note: In RoboVM we're never done resolving //setDoneResolving(); }
if( s.isPhantom() ) continue; if(Options.v().app()) { s.setApplicationClass(); s.setApplicationClass(); continue; final String pkg = (String) pkgIt.next(); if ((s.getPackageName()+".").startsWith(pkg)) s.setApplicationClass();
sootClass.setApplicationClass(); Scene.v().loadNecessaryClasses(); for (SootMethod method : sootClass.getMethods()) {
/** * Creates the main method based on the current callback information, injects it * into the Soot scene. * * @param The class name of a component to create a main method containing only * that component, or null to create main method for all components */ private void createMainMethod(SootClass component) { // There is no need to create a main method if we don't want to generate // a callgraph if (config.getSootIntegrationMode() == SootIntegrationMode.UseExistingCallgraph) return; // Always update the entry point creator to reflect the newest set // of callback methods entryPointCreator = createEntryPointCreator(component); SootMethod dummyMainMethod = entryPointCreator.createDummyMain(); Scene.v().setEntryPoints(Collections.singletonList(dummyMainMethod)); if (!dummyMainMethod.getDeclaringClass().isInScene()) Scene.v().addClass(dummyMainMethod.getDeclaringClass()); // addClass() declares the given class as a library class. We need to // fix this. dummyMainMethod.getDeclaringClass().setApplicationClass(); }
createdClass.setApplicationClass(); Local localVal = generateClassConstructor(createdClass, body); if (localVal == null) {
@Override public SootMethod createDummyMain() { // Load the substitution classes if (substituteCallParams) for (String className : substituteClasses) Scene.v().forceResolve(className, SootClass.BODIES).setApplicationClass(); // Create the empty main method createAdditionalFields(); createAdditionalMethods(); createEmptyMainMethod(); body = mainMethod.getActiveBody(); // We provide some helper objects final Body body = mainMethod.getActiveBody(); generator = new LocalGenerator(body); // Make sure that we have an opaque predicate conditionCounter = 0; intCounter = generator.generateLocal(IntType.v()); body.getUnits().add(Jimple.v().newAssignStmt(intCounter, IntConstant.v(conditionCounter))); return createDummyMainInternal(); }
@Override protected void initializeAnalysis(A commandLineArguments) { addSceneTransformer(); Options.v().set_no_bodies_for_excluded(true); Options.v().set_allow_phantom_refs(true); Options.v().set_output_format(Options.output_format_none); Options.v().set_whole_program(true); Options.v().set_soot_classpath( commandLineArguments.getInput() + File.pathSeparator + commandLineArguments.getClasspath()); Options.v().setPhaseOption("cg.spark", "on"); // do not merge variables (causes problems with PointsToSets) Options.v().setPhaseOption("jb.ulp", "off"); // Options.v().setPhaseOption("jb.ne", "off"); Options.v().setPhaseOption("jb.uce", "remove-unreachable-traps:true"); Options.v().setPhaseOption("cg", "trim-clinit:false"); Options.v().set_prepend_classpath(true); Options.v().set_src_prec(Options.src_prec_java); for (String analysisClass : AnalysisParameters.v().getAnalysisClasses()) { SootClass sootClass = Scene.v().loadClassAndSupport(analysisClass); Scene.v().forceResolve(analysisClass, SootClass.BODIES); sootClass.setApplicationClass(); } Scene.v().loadNecessaryClasses(); Scene.v().setMainClassFromOptions(); Scene.v().setEntryPoints(EntryPoints.v().application()); }