public SootClass makeSootClass(String name, int modifiers) { return new SootClass(name, modifiers); }
public SootClass makeSootClass(String name) { return new SootClass(name); }
RefType type = (new SootClass("DavaSuperHandler")).getType(); args.add(type);
SootClass c = new SootClass(className); c.isPhantom = true; addClassSilent(c);
private SootMethodRef makeMethodRef(String methodName, ArrayList args) { // make MethodRef for methodName SootMethod method = Scene.v().makeSootMethod(methodName, args, RefType.v("java.lang.Object")); // set the declaring class of new method to be the DavaSuperHandler // class method.setDeclaringClass(new SootClass("DavaSuperHandler")); return method.makeRef(); }
RefType type = (new SootClass("DavaSuperHandler")).getType();
SootClass sootClass = new SootClass("DavaSuperHandler");
RefType type = (new SootClass("DavaSuperHandler")).getType();
tempMethod.setDeclaringClass(new SootClass("java.lang.Boolean")); tempMethod.setDeclaringClass(new SootClass("java.lang.Byte")); tempMethod.setDeclaringClass(new SootClass("java.lang.Character")); tempMethod.setDeclaringClass(new SootClass("java.lang.Double")); tempMethod.setDeclaringClass(new SootClass("java.lang.Float")); tempMethod.setDeclaringClass(new SootClass("java.lang.Integer")); tempMethod.setDeclaringClass(new SootClass("java.lang.Long")); tempMethod.setDeclaringClass(new SootClass("java.lang.Short"));
/** * Returns a (possibly not yet resolved) SootClass to be used in references to a class. If/when the class is resolved, it * will be resolved into this SootClass. */ public SootClass makeClassRef(String className) { if (Scene.v().containsClass(className)) { return Scene.v().getSootClass(className); } SootClass newClass; newClass = new SootClass(className); newClass.setResolvingLevel(SootClass.DANGLING); Scene.v().addClass(newClass); return newClass; }
className = "soot.dummy.lambda" + uniqSupply(); SootClass tclass = new SootClass(className); tclass.setModifiers(Modifier.PUBLIC | Modifier.FINAL); tclass.setSuperclass(Scene.v().getObjectType().getSootClass());
public MonitorConverter(Singletons.Global g) { SootClass davaMonitor = new SootClass("soot.dava.toolkits.base.DavaMonitor.DavaMonitor", Modifier.PUBLIC); davaMonitor.setSuperclass(Scene.v().loadClassAndSupport("java.lang.Object")); LinkedList objectSingleton = new LinkedList(); objectSingleton.add(RefType.v("java.lang.Object")); v = Scene.v().makeSootMethod("v", new LinkedList(), RefType.v("soot.dava.toolkits.base.DavaMonitor.DavaMonitor"), Modifier.PUBLIC | Modifier.STATIC); enter = Scene.v().makeSootMethod("enter", objectSingleton, VoidType.v(), Modifier.PUBLIC | Modifier.SYNCHRONIZED); exit = Scene.v().makeSootMethod("exit", objectSingleton, VoidType.v(), Modifier.PUBLIC | Modifier.SYNCHRONIZED); davaMonitor.addMethod(v); davaMonitor.addMethod(enter); davaMonitor.addMethod(exit); Scene.v().addClass(davaMonitor); }
private void createSootPreInitMethod() { // get a unique name for the method String uniqueName = getUniqueName(); // NOTICE WE ARE DEFINING ARGS AS SAME AS THE ORIGINAL METHOD newSootPreInitMethod = Scene.v().makeSootMethod(uniqueName, argsOneTypes, (new SootClass("DavaSuperHandler")).getType()); // set the declaring class of new method to be the originalSootClass newSootPreInitMethod.setDeclaringClass(originalSootClass); // set method to private and static newSootPreInitMethod.setModifiers(soot.Modifier.PRIVATE | soot.Modifier.STATIC); // initalize a new DavaBody, notice this causes all DavaBody vars to be // null newPreInitDavaBody = Dava.v().newBody(newSootPreInitMethod); // setting params is really important if you want the args to have // proper names in the new method newPreInitDavaBody.set_ParamMap(originalPMap); // set as activeBody newSootPreInitMethod.setActiveBody(newPreInitDavaBody); }
mSootClass = new SootClass(className); mSootClass.setResolvingLevel(SootClass.BODIES); } else {
mSootClass = new SootClass(className); mSootClass.setResolvingLevel(SootClass.SIGNATURES); } else {
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; } }
/** * @apilevel internal */ private SootClass sootClass_compute() { if(!Scene.v().isIncrementalBuild()) { return refined_EmitJimpleRefinements_ClassDecl_sootClass(); } if(Scene.v().containsClass(jvmName())) { Scene.v().removeClass(Scene.v().getSootClass(jvmName())); } SootClass sc = null; if(options().verbose()) System.out.println("Creating from source " + jvmName()); sc = new SootClass(jvmName()); sc.setResolvingLevel(SootClass.DANGLING); Scene.v().addClass(sc); return sc; } /**
if(options().verbose()) System.out.println("Creating from source " + jvmName()); sc = new SootClass(jvmName()); sc.setResolvingLevel(SootClass.DANGLING); Scene.v().addClass(sc);
Scene.v().getSootClass(ReflectiveCalls.class.getName()).setApplicationClass(); reflectiveCallsClass = new SootClass("soot.rtlib.tamiflex.ReflectiveCallsWrapper", Modifier.PUBLIC); Scene.v().addClass(reflectiveCallsClass); reflectiveCallsClass.setApplicationClass();
SootClass mediatingClass = new SootClass(fullName, sc.getModifiers() & (~Modifier.FINAL)); Main.IntermediateAppClasses.add(mediatingClass); mediatingClass.setSuperclass(originalSuperclass);