private void complexity() { if (!method.jmethod.getDeclaringClass().isApplicationClass()) { return;
public List<SootClass> getThreadClassList() { if (optionThreaded) { if (self == null) { return null; // not run... do nothing } // Wait until finished logger.debug("[mhp] waiting for thread to finish"); try { self.join(); } catch (InterruptedException ie) { return null; } } if (threadList == null) { return null; } List<SootClass> threadClasses = new ArrayList<SootClass>(); int size = threadList.size(); for (int i = 0; i < size; i++) { AbstractRuntimeThread thread = threadList.get(i); Iterator<Object> threadRunMethodIt = thread.getRunMethods().iterator(); while (threadRunMethodIt.hasNext()) { SootClass threadClass = ((SootMethod) threadRunMethodIt.next()).getDeclaringClass(); // what about subclasses??? if (!threadClasses.contains(threadClass) && threadClass.isApplicationClass()) { threadClasses.add(threadClass); } } } return threadClasses; }
/** * Modifies code so that an access to <code>target</code> is legal from code in <code>container</code>. */ public static boolean ensureAccess(SootMethod container, SootClass target, String options) { boolean accessors = options.equals("accessors"); boolean allowChanges = !(options.equals("none")); boolean safeChangesOnly = !(options.equals("unsafe")); if (isAccessLegal(container, target)) { return true; } if (!allowChanges && !accessors) { return false; } if (safeChangesOnly && !accessors) { throw new RuntimeException("Not implemented yet!"); } if (accessors) { return false; } if (target.isApplicationClass()) { target.setModifiers(target.getModifiers() | Modifier.PUBLIC); return true; } else { return false; } }
SootMethod runMethod = (SootMethod) meth; if (runMethod.getDeclaringClass().isApplicationClass() && !isObjectLocalToContext(localOrRef, sm, runMethod)) { if (printDebug) { logger.debug(" THREAD-SHARED (simpledfa " + ClassInfoFlowAnalysis.methodCount + " smartdfa "
public void precompute() { for (AbstractRuntimeThread thread : threads) { for (Object item : thread.getRunMethods()) { SootMethod runMethod = (SootMethod) item; if (runMethod.getDeclaringClass().isApplicationClass()) { getClassLocalObjectsAnalysis(runMethod.getDeclaringClass()); } } } }
if (sm.isConcrete() && sm.getDeclaringClass().isApplicationClass()) { if (!chain.contains(sm)) { chain.add(sm); if (target.isConcrete() && target.getDeclaringClass().isApplicationClass()) { succsList.add(target); if (!chain.contains(target)) {
private void constantForName(String cls, SootMethod src, Stmt srcUnit) { if (cls.length() > 0 && cls.charAt(0) == '[') { if (cls.length() > 1 && cls.charAt(1) == 'L' && cls.charAt(cls.length() - 1) == ';') { cls = cls.substring(2, cls.length() - 1); constantForName(cls, src, srcUnit); } } else { if (!Scene.v().containsClass(cls)) { if (options.verbose()) { logger.warn("Class " + cls + " is" + " a dynamic class, and you did not specify" + " it as such; graph will be incomplete!"); } } else { SootClass sootcls = Scene.v().getSootClass(cls); if (!sootcls.isPhantomClass()) { if (!sootcls.isApplicationClass()) { sootcls.setLibraryClass(); } for (SootMethod clinit : EntryPoints.v().clinitsOf(sootcls)) { addEdge(src, srcUnit, clinit, Kind.CLINIT); } } } } }
if (target.getDeclaringClass().isApplicationClass()) { if (accessors) { return true;
if (!sootcls.isApplicationClass() && !sootcls.isPhantom()) { sootcls.setLibraryClass();
Chain<SootClass> getContainingChain(SootClass c) { if (c.isApplicationClass()) { return getApplicationClasses(); } else if (c.isLibraryClass()) { return getLibraryClasses(); } else if (c.isPhantomClass()) { return getPhantomClasses(); } return null; }
if (superclass.isApplicationClass()) { externalMethods.addAll(uf.getExtMethods(superclass)); if (superclass.isApplicationClass()) { externalFields.addAll(uf.getExtFields(superclass));
for (Iterator edgesIt = Scene.v().getCallGraph().edgesOutOf(containingMethod); edgesIt.hasNext();) { Edge e = (Edge) edgesIt.next(); if (!e.src().getDeclaringClass().isApplicationClass() || e.srcStmt() == null) { continue;
/** Makes this class an application class. */ public void setApplicationClass() { if (isApplicationClass()) { return; } Chain<SootClass> c = Scene.v().getContainingChain(this); if (c != null) { c.remove(this); } Scene.v().getApplicationClasses().add(this); isPhantom = false; }
protected boolean parameterIsLocal(SootMethod method, EquivalentValue parameterRef, boolean includePrimitiveDataFlowIfAvailable) { if (dfa.printDebug() && method.getDeclaringClass().isApplicationClass()) { logger.debug(" Checking PARAM " + parameterRef + " for " + method); if (dfa.printDebug() && method.getDeclaringClass().isApplicationClass()) { logger.debug(" PARAM is local (primitive)"); Stmt s = (Stmt) extCall.getO2(); if (s.getInvokeExpr().getMethodRef().resolve() == method) { if (dfa.printDebug() && method.getDeclaringClass().isApplicationClass()) { logger.debug(" PARAM is shared (external access)"); if (dfa.printDebug() && method.getDeclaringClass().isApplicationClass()) { logger.debug(" PARAM is shared (internal propagation)"); if (dfa.printDebug() && method.getDeclaringClass().isApplicationClass()) { logger.debug(" PARAM is shared (internal propagation)"); if (dfa.printDebug() && method.getDeclaringClass().isApplicationClass()) { logger.debug(" PARAM is local SO FAR (internal propagation)");
public void processReachables() { while (true) { if (!worklist.hasNext()) { rm.update(); if (!worklist.hasNext()) { break; } } MethodOrMethodContext momc = worklist.next(); SootMethod m = momc.method(); if (appOnly && !m.getDeclaringClass().isApplicationClass()) { continue; } if (analyzedMethods.add(m)) { processNewMethod(m); } processNewMethodContext(momc); } }
if (!target.getDeclaringClass().isApplicationClass() || !target.isConcrete()) { continue;
public void removeClass(SootClass c) { if (!c.isInScene()) { throw new RuntimeException(); } classes.remove(c); if (c.isLibraryClass()) { libraryClasses.remove(c); } else if (c.isPhantomClass()) { phantomClasses.remove(c); } else if (c.isApplicationClass()) { applicationClasses.remove(c); } c.getType().setSootClass(null); c.setInScene(false); modifyHierarchy(); }
= getMethodInfoFlowSummary(target, context.getDeclaringClass().isApplicationClass()); if (ret == null) { ret = ifs;
continue; if (s.isApplicationClass() && isExcluded(s)) { s.setLibraryClass(); s.setApplicationClass(); if (s.isApplicationClass()) {
if (runMethod.getDeclaringClass().isApplicationClass() && !isObjectLocalToContext(sharedValue, containingMethod, runMethod)) {