public void outAFieldMember(AFieldMember node) { int modifier = 0; Type type = null; String name = null; name = (String) mProductions.removeLast(); type = (Type) mProductions.removeLast(); modifier = processModifiers(node.getModifier()); SootField f = Scene.v().makeSootField(name, type, modifier); mSootClass.addField(f); }
/** * @apilevel internal */ private SootField getSootField_compute(String name, TypeDecl type) { SootField f = Scene.v().makeSootField(name, type.getSootType(), 0); getSootClassDecl().addField(f); return f; }
int modifiers = soot.Modifier.PUBLIC; Type ftype = fr.getType(); sc.addField(Scene.v().makeSootField(fname, ftype, modifiers)); } else {
private void addOuterClassThisRefField(polyglot.types.Type outerType) { soot.Type outerSootType = Util.getSootType(outerType); soot.SootField field = Scene.v().makeSootField("this$0", outerSootType, soot.Modifier.PRIVATE | soot.Modifier.FINAL); sootClass.addField(field); field.addTag(new soot.tagkit.SyntheticTag()); }
private void addFinals(polyglot.types.LocalInstance li, ArrayList<SootField> finalFields) { // add as param for init for (SootMethod meth : sootClass.getMethods()) { if (meth.getName().equals("<init>")) { List<soot.Type> newParams = new ArrayList<soot.Type>(); newParams.addAll(meth.getParameterTypes()); newParams.add(Util.getSootType(li.type())); meth.setParameterTypes(newParams); } } // add field soot.SootField sf = Scene.v().makeSootField("val$" + li.name(), Util.getSootType(li.type()), soot.Modifier.FINAL | soot.Modifier.PRIVATE); sootClass.addField(sf); finalFields.add(sf); sf.addTag(new soot.tagkit.SyntheticTag()); }
private void addCaching() { SootClass method = Scene.v().getSootClass("java.lang.reflect.Method"); method.addField(Scene.v().makeSootField(ALREADY_CHECKED_FIELDNAME, BooleanType.v())); SootClass constructor = Scene.v().getSootClass("java.lang.reflect.Constructor"); constructor.addField(Scene.v().makeSootField(ALREADY_CHECKED_FIELDNAME, BooleanType.v())); SootClass clazz = Scene.v().getSootClass("java.lang.Class"); clazz.addField(Scene.v().makeSootField(ALREADY_CHECKED_FIELDNAME, BooleanType.v())); for (Kind k : Kind.values()) { addCaching(k); } }
SootField f = new SootField("cap" + i, capTypes.get(i), 0); capFields.add(f); tclass.addField(f);
randomClass.addField(newField); constantsToFields.put(constant, newField); addInitializingValue(randomClass, newField, constant);
addToClass.addField(sootField); sootField.addTag(new soot.tagkit.SyntheticTag());
renameField(applicationClass, opaquePredicateField); opaquePredicate1ByClass.put(applicationClass, opaquePredicateField); applicationClass.addField(opaquePredicateField); renameField(applicationClass, opaquePredicateField); opaquePredicate2ByClass.put(applicationClass, opaquePredicateField); applicationClass.addField(opaquePredicateField);
soot.Type sootType = Util.getSootType(field.fieldInstance().type()); soot.SootField sootField = Scene.v().makeSootField(name, sootType, modifiers); sootClass.addField(sootField);
sc.addField(classCacher); classToClassField.put(sc, classCacher);
soot.SootField assertionsDisabledField = Scene.v().makeSootField(fieldName, fieldType, soot.Modifier.STATIC | soot.Modifier.FINAL); sootClass.addField(assertionsDisabledField); assertionsDisabledField.addTag(new soot.tagkit.SyntheticTag()); addToClass.addField(classField); classField.addTag(new soot.tagkit.SyntheticTag());
bclass.addField(field);
Modifier.STATIC | Modifier.PUBLIC); lockNumber++; lockClass.addField(actualLockObject);
Scene.v().getMainClass().addField(globalLockObj[i]);
/** * @ast method * @aspect EmitJimple * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:329 */ public void jimplify1phase2() { String name = name(); soot.Type type = type().getSootType(); int modifiers = sootTypeModifiers(); if (!hostType().getSootClassDecl().declaresFieldByName(name)) { SootField f = Scene.v().makeSootField(name, type, modifiers); hostType().getSootClassDecl().addField(f); if (isStatic() && isFinal() && isConstant() && (type().isPrimitive() || type().isString())) { if (type().isString()) f.addTag(new soot.tagkit.StringConstantValueTag(constant().stringValue())); else if (type().isLong()) f.addTag(new soot.tagkit.LongConstantValueTag(constant().longValue())); else if (type().isDouble()) f.addTag(new soot.tagkit.DoubleConstantValueTag(constant().doubleValue())); else if (type().isFloat()) f.addTag(new soot.tagkit.FloatConstantValueTag(constant().floatValue())); else if (type().isIntegralType()) f.addTag(new soot.tagkit.IntegerConstantValueTag(constant().intValue())); } sootField = f; } else { sootField = hostType().getSootClassDecl().getFieldByName(name); } addAttributes(); }
@Override protected void createAdditionalFields() { super.createAdditionalFields(); // Create a name for a field for the result intent of this component String fieldName = "ipcResultIntent"; int fieldIdx = 0; while (component.declaresFieldByName(fieldName)) fieldName = "ipcResultIntent_" + fieldIdx++; // Create the field itself resultIntentField = Scene.v().makeSootField(fieldName, RefType.v("android.content.Intent"), Modifier.PUBLIC); component.addField(resultIntentField); }
@Override protected void createAdditionalFields() { super.createAdditionalFields(); // Create a name for a field for the intent with which the component is started String fieldName = "ipcIntent"; int fieldIdx = 0; while (component.declaresFieldByName(fieldName)) fieldName = "ipcIntent_" + fieldIdx++; // Create the field itself intentField = Scene.v().makeSootField(fieldName, RefType.v("android.content.Intent"), Modifier.PUBLIC); component.addField(intentField); }