private boolean isCallToSuper(SpecialInvokeExpr sie) { SootClass classWithInvokation = sie.getMethod().getDeclaringClass(); SootClass currentClass = stmtV.getBelongingClass(); while (currentClass != null) { currentClass = currentClass.getSuperclassUnsafe(); if (currentClass != null) { if (currentClass == classWithInvokation) { return true; } // If we're dealing with phantom classes, we might not actually // arrive at java.lang.Object. In this case, we should not fail // the check if (currentClass.isPhantom() && !currentClass.getName().equals("java.lang.Object")) { return true; } } } return false; // we arrived at java.lang.Object and did not find a // declaration }
SootClass superclass = sClass.getSuperclassUnsafe(); if (superclass != null && !sClass.getName().equals("java.lang.Object")) { TypeNode parent = hierarchy.typeNode(RefType.v(sClass.getSuperclass().getName()));
public void reResolveHierarchy(SootClass sc, int level) { // Bring superclasses to hierarchy SootClass superClass = sc.getSuperclassUnsafe(); if (superClass != null) { addToResolveWorklist(superClass, level); } SootClass outerClass = sc.getOuterClassUnsafe(); if (outerClass != null) { addToResolveWorklist(outerClass, level); } for (SootClass iface : sc.getInterfaces()) { addToResolveWorklist(iface, level); } }
SootClass superClass = concreteType.getSuperclassUnsafe(); if (superClass == null) { if (concreteType.isPhantom()) {
sc = sc.getSuperclassUnsafe();
/** * Given an object of actual type C (o = new C()), returns the method which will be called on an o.f() invocation. */ public SootMethod resolveConcreteDispatch(SootClass concreteType, SootMethod m) { concreteType.checkLevel(SootClass.HIERARCHY); if (concreteType.isInterface()) { throw new RuntimeException("A concrete type cannot be an interface: " + concreteType); } String methodSig = m.getSubSignature(); while (true) { SootMethod method = concreteType.getMethodUnsafe(methodSig); if (method != null) { if (isVisible(concreteType, m)) { if (method.isAbstract()) { throw new RuntimeException("Error: Method call resolves to abstract method!"); } return method; } } concreteType = concreteType.getSuperclassUnsafe(); if (concreteType == null) { break; } } // When there is no proper dispatch found, we simply return null to let // the caller decide what to do return null; // throw new RuntimeException("could not resolve concrete // dispatch!\nType: "+concreteType+"\nMethod: "+m); }
sootClass = sootClass.getSuperclassUnsafe(); if (sootClass == null) { sootClass = javalangObject; sootClass = sootClass.getSuperclassUnsafe(); if (sootClass == null) { sootClass = javalangObject;
return phantomMethod; selectedClass = selectedClass.getSuperclassUnsafe(); selectedClass = selectedClass.getSuperclassUnsafe();
SootClass csuperClass = sc.getSuperclassUnsafe(); if (csuperClass != null) { superClass = slashify(csuperClass.getName());
RefType baseType = (RefType) type.baseType; SootClass sClass = baseType.getSootClass(); SootClass superClass = sClass.getSuperclassUnsafe(); if (superClass != null && !superClass.getName().equals("java.lang.Object")) { TypeNode parent = hierarchy.typeNode(ArrayType.v(RefType.v(sClass.getSuperclass().getName()), type.numDimensions));
public SootMethod resolveNonSpecial(RefType t, NumberedString subSig, boolean appOnly) { SmallNumberedMap<SootMethod> vtbl = typeToVtbl.get(t); if (vtbl == null) { typeToVtbl.put(t, vtbl = new SmallNumberedMap<SootMethod>()); } SootMethod ret = vtbl.get(subSig); if (ret != null) { return ret; } SootClass cls = t.getSootClass(); if (appOnly && cls.isLibraryClass()) { return null; } SootMethod m = cls.getMethodUnsafe(subSig); if (m != null) { if (!m.isAbstract()) { ret = m; } } else { SootClass c = cls.getSuperclassUnsafe(); if (c != null) { ret = resolveNonSpecial(c.getType(), subSig); } } vtbl.put(subSig, ret); return ret; }
SootClass superClass = cl.getSuperclassUnsafe(); if (superClass != null) { classToSubclasses.put(superClass, cl);
addInEdge(pag.nodeFactory().caseCanonicalPath(), nodeFactory.caseRet()); cl = cl.getSuperclassUnsafe();
@Override public Collection<SootClass> load(SootClass sc) throws Exception { Set<SootClass> set = new HashSet<SootClass>(sc.getInterfaceCount()); for (SootClass i : sc.getInterfaces()) { set.add(i); set.addAll(interfacesOf.getUnchecked(i)); } SootClass superClass = sc.getSuperclassUnsafe(); if (superClass != null) set.addAll(interfacesOf.getUnchecked(superClass)); return set; }
private SootMethod getMethodFromHierarchyEx(SootClass c, String methodSignature) { SootMethod m = c.getMethodUnsafe(methodSignature); if (m != null) return m; SootClass superClass = c.getSuperclassUnsafe(); if (superClass != null) return getMethodFromHierarchyEx(superClass, methodSignature); return null; }
public Set<SootClass> getAllHandlers() { if (null == handlerImpls) { handlerImpls = new HashSet<SootClass>(); SootClass handler = Scene.v().getSootClass("android.os.Handler"); for (Iterator<SootClass> iter = Scene.v().getApplicationClasses().snapshotIterator(); iter.hasNext();) { SootClass sootClass = iter.next(); SootClass tmpClass = sootClass.getSuperclassUnsafe(); while (sootClass != null) { if (sootClass.getName().equals(handler.getName())) { handlerImpls.add(tmpClass); break; } sootClass = sootClass.getSuperclassUnsafe(); } } } return handlerImpls; } }
SootClass curClass = sc.getSuperclassUnsafe(); while (curClass != null) { if (!curClass.isConcrete() || curClass.isLibraryClass()) doneMethods.add(sm.getSubSignature()); curClass = curClass.getSuperclassUnsafe();
SootClass superClass = sootClass.getSuperclassUnsafe(); if (superClass != null) analyzeClassInterfaceCallbacks(baseClass, superClass, lifecycleElement);
break; SootClass sclass = currentClass.getSuperclassUnsafe(); if (sclass == null) { logger.error(String.format("Callback method %s not found in class %s", methodName,