/** * Makes a new fast hierarchy is none is active, and returns the active fast hierarchy. */ public FastHierarchy getOrMakeFastHierarchy() { if (!hasFastHierarchy()) { setFastHierarchy(new FastHierarchy()); } return getFastHierarchy(); }
/** Adds to the set all pairs (l,type) where type is any supertype of t. */ public void localMustBeSubtypeOf(Local l, RefType t) { FastHierarchy fh = Scene.v().getFastHierarchy(); for (Type type : types) { RefType supertype = (RefType) type; if (fh.canStoreType(t, supertype)) { set(indexOf(l, supertype)); } } }
Stmt stmt = (Stmt) u; InvokeExpr ie = stmt.getInvokeExpr(); FastHierarchy fastHierarchy = Scene.v().getFastHierarchy();
/** * Returns true if this method itself is visible to the client and overwriteable or if the same holds for any of the * methods in the library that overwrite the argument method. * * @see #clientOverwriteable(SootMethod) */ private static boolean clientOverwriteableOverwrites(SootMethod m) { if (clientOverwriteable(m)) { return true; } SootClass c = m.getDeclaringClass(); // TODO could use PTA and call graph to filter subclasses further for (SootClass cPrime : Scene.v().getFastHierarchy().getSubclassesOf(c)) { SootMethod mPrime = cPrime.getMethodUnsafe(m.getSubSignature()); if (mPrime != null) { if (clientOverwriteable(mPrime)) { return true; } } } return false; }
/** Makes a new fast hierarchy is none is active, and returns the active * fast hierarchy. */ public FastHierarchy getOrMakeFastHierarchy() { if(!hasFastHierarchy() ) { setFastHierarchy( new FastHierarchy() ); } return getFastHierarchy(); } /**
/** Makes a new fast hierarchy is none is active, and returns the active * fast hierarchy. */ public FastHierarchy getOrMakeFastHierarchy() { if(!hasFastHierarchy() ) { setFastHierarchy( new FastHierarchy() ); } return getFastHierarchy(); } /**
/** Adds to the set all pairs (l,type) where type is any supertype of t. */ public void localMustBeSubtypeOf( Local l, RefType t ) { FastHierarchy fh = Scene.v().getFastHierarchy(); for (Type type : types) { RefType supertype = (RefType) type; if( fh.canStoreType( t, supertype ) ) { set( indexOf( l, supertype ) ); } } }
/** Adds to the set all pairs (l,type) where type is any supertype of t. */ public void localMustBeSubtypeOf( Local l, RefType t ) { FastHierarchy fh = Scene.v().getFastHierarchy(); for (Type type : types) { RefType supertype = (RefType) type; if( fh.canStoreType( t, supertype ) ) { set( indexOf( l, supertype ) ); } } }
/** * Creates an empty layout control that corresponds to the given class * @param layoutClass * The layout class in Android that implements the control * @return The newly created layout control */ protected AndroidLayoutControl createLayoutControl(SootClass layoutClass) { if (scEditText != null && Scene.v().getFastHierarchy().canStoreType(layoutClass.getType(), scEditText.getType())) return new EditTextControl(layoutClass); else return new GenericLayoutControl(layoutClass); }
else if (tp1 instanceof PrimType && tp2 instanceof PrimType) return tp1; // arbitrary choice else if (Scene.v().getFastHierarchy().canStoreType(tp2, tp1)) return tp2; else if (Scene.v().getFastHierarchy().canStoreType(tp1, tp2)) return tp1; else {
/** * Checks for errors inside this data flow summary */ public void validate() { source().validate(methodSig); sink().validate(methodSig); // Make sure that the types of gap base objects and incoming flows are // cast-compatible if (sink().getType() == SourceSinkType.GapBaseObject && sink().getGap() != null) { String sinkType = SootMethodRepresentationParser.v().parseSootMethodString(sink().getGap().getSignature()) .getClassName(); Type t1 = RefType.v(sink().getBaseType()); Type t2 = RefType.v(sinkType); if (!Scene.v().getFastHierarchy().canStoreType(t1, t2) // cast-up, // i.e. // Object to // String && !Scene.v().getFastHierarchy().canStoreType(t2, t1)) // cast-down, // i.e. // String // to // Object throw new RuntimeException("Target type of gap base flow is invalid"); } }
isFragmentTransaction = scFragmentTransaction != null && Scene.v().getFastHierarchy() .canStoreType(iinvExpr.getBase().getType(), scFragmentTransaction.getType()); isFragmentTransaction |= scSupportFragmentTransaction != null && Scene.v().getFastHierarchy() .canStoreType(iinvExpr.getBase().getType(), scSupportFragmentTransaction.getType()); isAddTransaction = stmt.getInvokeExpr().getMethod().getName().equals("add") && Scene.v().getFastHierarchy().canStoreType(rt, scFragment.getType()); addFragment |= scSupportFragment != null && Scene.v().getFastHierarchy() .canStoreType(rt, scSupportFragment.getType()); if (addFragment)
if (Scene.v().getFastHierarchy().isSubclass(originalComponent, calleeClass)) { SootClass targetClass = e.getTgt().method().getDeclaringClass(); return targetClass == originalComponent || Scene.v().getFastHierarchy().isSubclass(targetClass, originalComponent); if (Scene.v().getFastHierarchy().canStoreType(e.tgt().getDeclaringClass().getType(), RefType.v("java.lang.Runnable"))) return false;
return; final FastHierarchy fastHierarchy = Scene.v().getFastHierarchy(); final RefType contextType = scContext.getType(); for (Unit u : method.getActiveBody().getUnits()) {