public void toString(UnitPrinter up) { if (!supressDeclaringClass) { up.type(fieldRef.declaringClass().getType()); up.literal("."); } up.fieldRef(fieldRef); }
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(); }
private synchronized void ensureClassHasBodies(SootClass cl) { assert Scene.v().hasFastHierarchy(); if (cl.resolvingLevel() < SootClass.BODIES) { Scene.v().forceResolve(cl.getName(), SootClass.BODIES); Scene.v().getOrMakeFastHierarchy(); } assert Scene.v().hasFastHierarchy(); }
private void loadBooleanValue(PatchingChain<Unit> units, SootField f, Unit insert) { units.insertBefore(Baf.v().newStaticGetInst(f.makeRef()), insert); if (f.getType() instanceof RefType) { SootMethod boolInit = ((RefType) f.getType()).getSootClass().getMethod("boolean booleanValue()"); units.insertBefore(Baf.v().newVirtualInvokeInst(boolInit.makeRef()), insert); } }
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); } }
/** * Returns true if the given method is visible to client code. */ private static boolean visible(SootMethod mPrime) { SootClass cPrime = mPrime.getDeclaringClass(); return (cPrime.isPublic() || cPrime.isProtected() || (!cPrime.isPrivate() && !ASSUME_PACKAGES_SEALED)) && (mPrime.isPublic() || mPrime.isProtected() || (!mPrime.isPrivate() && !ASSUME_PACKAGES_SEALED)); } }
public void toString(UnitPrinter up) { up.startUnitBox(this); up.unitRef(unit, isBranchTarget()); up.endUnitBox(this); } }
protected void addToResolveWorklist(Type type, int level) { // We go from Type -> SootClass directly, since RefType.getSootClass // calls makeClassRef anyway if (type instanceof RefType) { addToResolveWorklist(((RefType) type).getSootClass(), level); } else if (type instanceof ArrayType) { addToResolveWorklist(((ArrayType) type).baseType, level); } // Other types ignored }
@Override public List<Value> load(SootMethod m) throws Exception { return m.getActiveBody().getParameterRefs(); } });
/** * Retrieves the active hierarchy */ public Hierarchy getActiveHierarchy() { if (!hasActiveHierarchy()) { // throw new RuntimeException("no active Hierarchy present for // scene"); setActiveHierarchy(new Hierarchy()); } return activeHierarchy; }
public static AnySubType v(RefType base) { if (base.getAnySubType() == null) { synchronized (base) { if (base.getAnySubType() == null) { base.setAnySubType(new AnySubType(base)); } } } return base.getAnySubType(); }
private Map<String, String> mapForPhase(String phaseName) { HasPhaseOptions phase = getPM().getPhase(phaseName); if (phase == null) { return null; } return mapForPhase(phase); }
/** * Convenience method returning true if this method is private. */ @Override public boolean isPrivate() { return Modifier.isPrivate(this.getModifiers()); }
/** * Convenience method returning true if this method is final. */ public boolean isFinal() { return Modifier.isFinal(this.getModifiers()); }
/** * Convenience method returning true if this class is static. */ public boolean isStatic() { return Modifier.isStatic(this.getModifiers()); }