/** Returns true iff the edge e is wanted. */ public boolean want(Edge e) { String tgtSubSignature = e.tgt().getSubSignature(); if (tgtSubSignature.equals("void run()")) { return true; } return false; } }
private void processCallEdges() { while (callEdges.hasNext()) { Edge e = callEdges.next(); MethodPAG amp = MethodPAG.v(pag, e.tgt()); amp.build(); amp.addToPAG(e.tgtCtxt()); pag.addCallTarget(e); } }
public boolean containsMethod(SootMethod sm) { return (edge != null && edge.tgt() == sm) || (next != null && next.containsMethod(sm)); }
public List<SootMethod> find(Unit unit, CallGraph cg, boolean canBeNullList, boolean canBeNative) { List<SootMethod> target = new ArrayList<SootMethod>(); Iterator<Edge> it = cg.edgesOutOf(unit); while (it.hasNext()) { Edge edge = it.next(); SootMethod targetMethod = edge.tgt(); if (targetMethod.isNative() && !canBeNative) { continue; } if (edge.kind() == Kind.CLINIT) { continue; } target.add(targetMethod); } if (target.size() < 1 && !canBeNullList) { throw new RuntimeException("No target method for: " + unit); } return target; } }
private void processNewMethodContext(MethodOrMethodContext momc) { SootMethod m = momc.method(); Iterator<Edge> it = cicg.edgesOutOf(m); while (it.hasNext()) { Edge e = it.next(); cm.addStaticEdge(momc, e.srcUnit(), e.tgt(), e.kind()); } }
/** * Find the specific call edge that is going out from the callsite u and the call target is callee. Without advanced data * structure, we can only sequentially search for the match. Fortunately, the number of outgoing edges for a unit is not * too large. * * @param u * @param callee * @return */ public Edge findEdge(Unit u, SootMethod callee) { Edge e = srcUnitToEdge.get(u); while (e.srcUnit() == u && e.kind() != Kind.INVALID) { if (e.tgt() == callee) { return e; } e = e.nextByUnit(); } return null; }
String tgtMethod = e.tgt().toString(); String tgtClass = e.tgt().getDeclaringClass().toString(); String srcMethod = e.src().toString(); String srcClass = e.src().getDeclaringClass().toString(); && e.tgt().toString().endsWith("boolean equals(java.lang.Object)>")) { return false; if (e.tgt().isSynchronized()) { return false;
for (Iterator<Edge> it = cg.edgesOutOf(callStmt); it.hasNext();) { Edge edge = it.next(); SootMethod m = edge.tgt(); System.out.println("\t-> " + m.getSignature()); S elem;
protected void flowThrough(Object inVal, Object stmt, Object outVal) { FlowSet in = (FlowSet) inVal; FlowSet out = (FlowSet) outVal; Stmt s = (Stmt) stmt; in.copy(out); CallGraph cg = Scene.v().getCallGraph(); Iterator edges = cg.edgesOutOf(s); while (edges.hasNext()) { Edge e = (Edge) edges.next(); if (e.isClinit()) { out.add(e.tgt()); } } }
Iterator edgesIt = callGraph.edgesOutOf(method); while (edgesIt.hasNext()) { SootMethod target = ((Edge) edgesIt.next()).tgt(); if (target.getName().equals("start") || target.getName().equals("run")) { mayHaveStartStmt = true;
SootMethod mm = edge.tgt(); boolean keep = mm.isConcrete() && filter.want(mm); if (verbose) {
protected Object newInitialFlow() { ArraySparseSet set = new ArraySparseSet(); CallGraph cg = Scene.v().getCallGraph(); Iterator mIt = cg.edgesOutOf(g.getBody().getMethod()); while (mIt.hasNext()) { Edge edge = (Edge) mIt.next(); if (edge.isClinit()) { set.add(edge.tgt()); } } return set; } }
while (edgeIt.hasNext()) { Edge edge = (Edge) edgeIt.next(); SootMethod target = edge.tgt();
SootMethod tgt = anyEdge.tgt(); if (!resolvedMethods.contains(tgt) && !anyEdge.kind().isFake()) { p = edgeMapping.get(anyEdge);
while (edges.hasNext()) { Edge e = (Edge) edges.next(); SootMethod sm = e.tgt();
SootMethod m = e.tgt(); s.addTag(new LinkTag("CallGraph: Type: " + e.kind() + " Target Method/Context: " + e.getTgt().toString(), m, m.getDeclaringClass().getName(), "Call Graph"));
protected void internalTransform(Body b, String phaseName, Map options) { ClinitElimAnalysis a = new ClinitElimAnalysis(new BriefUnitGraph(b)); CallGraph cg = Scene.v().getCallGraph(); SootMethod m = b.getMethod(); Iterator edgeIt = cg.edgesOutOf(m); while (edgeIt.hasNext()) { Edge e = (Edge) edgeIt.next(); if (e.srcStmt() == null) { continue; } if (!e.isClinit()) { continue; } FlowSet methods = (FlowSet) a.getFlowBefore(e.srcStmt()); if (methods.contains(e.tgt())) { cg.removeEdge(e); } } } }
SootMethod callingMethod = e.tgt(); CallLocalityContext callingContext = new CallLocalityContext(dfa.getMethodInfoFlowSummary(callingMethod).getNodes());