类 CallGraph
java.lang.Object
proguard.analysis.datastructure.callgraph.CallGraph
Collection of all
Calls in a program, optimized for retrieval of incoming and outgoing
edges for any method in constant time.-
字段概要
字段 -
构造器概要
构造器限定符构造器说明Create an empty call graph.protectedCallGraph(Map<MethodSignature, Set<Call>> incoming, Map<MethodSignature, Set<Call>> outgoing, boolean concurrent) -
方法概要
修饰符和类型方法说明voidAdd aCallto this call graph.voidclear()Clear the call graph references.static CallGraphreconstructCallGraph(ClassPool programClassPool, MethodSignature start, int maxDepth, Set<MethodSignature> stopMethods) Calculate the incoming call graph for a method of interest, showing how it can be reached from a given Set of stop methods, which typically are Android lifecycle methods such as an Activity's onCreate() method:reconstructCallGraph(ClassPool programClassPool, MethodSignature start, Set<MethodSignature> stopMethods) reconstructCallGraph(ClassPool programClassPool, MethodSignature start, Set<MethodSignature> stopMethods, Set<MethodSignature> reachedMethods) Extension ofreconstructCallGraph(ClassPool, MethodSignature, Set)that also collects all reached stop methods.toDot()Produces a DOT graph representation of the given call graph.voidWrites a DOT graph representation of the given call graph.
-
字段详细资料
-
incoming
-
outgoing
-
-
构造器详细资料
-
CallGraph
public CallGraph()Create an empty call graph. -
CallGraph
protected CallGraph(Map<MethodSignature, Set<Call>> incoming, Map<MethodSignature, Set<Call>> outgoing, boolean concurrent)
-
-
方法详细资料
-
concurrentCallGraph
Provides concurrency readyCallGraph, backed byConcurrentHashMaps and byConcurrentSkipListSets. Not needed without multithreading. -
addCall
Add aCallto this call graph.- 参数:
call- The call to be added.
-
clear
public void clear()Clear the call graph references. -
reconstructCallGraph
public Node reconstructCallGraph(ClassPool programClassPool, MethodSignature start, Set<MethodSignature> stopMethods) - 参数:
programClassPool- The currentClassPoolof the program that can be used for mapping. class names to the actualClazz.start- TheMethodSignatureof the method whose incoming call graph should be calculated.stopMethods- Set ofMethodSignatureto stop exploration at, if desired.- 返回:
- A
Nodethat represents the single call graph root, i.e. the start method.
-
reconstructCallGraph
public Node reconstructCallGraph(ClassPool programClassPool, MethodSignature start, int maxDepth, Set<MethodSignature> stopMethods) Calculate the incoming call graph for a method of interest, showing how it can be reached from a given Set of stop methods, which typically are Android lifecycle methods such as an Activity's onCreate() method:We have an inverted tree structure like the following example:
Here,onCreate() <-- predecessor -- proxy() <-- predecessor -- root() onResume() <-- predecessor ----| | unusedMethod() <-- predecessor -------|root()is the method whose call graph is to be calculated, and the graph now shows that it can be reached fromonCreate()viaproxy(), and also directly fromonResume()orunusedMethod().- 参数:
programClassPool- The currentClassPoolof the program that can be used for mapping. class names to the actualClazz.start- TheMethodSignatureof the method whose incoming call graph should be calculated.maxDepth- maximal depth of reconstructedCallGraph.stopMethods- Set of method signatures to stop exploration, for example for entry points.- 返回:
- A
Nodethat represents the single call graph root, i.e. the start method.
-
reconstructCallGraph
public Node reconstructCallGraph(ClassPool programClassPool, MethodSignature start, Set<MethodSignature> stopMethods, Set<MethodSignature> reachedMethods) Extension ofreconstructCallGraph(ClassPool, MethodSignature, Set)that also collects all reached stop methods.- 参数:
programClassPool- The currentClassPoolof the program that can be used for mapping.start- TheMethodSignatureof the method whose incoming call graph should be calculated.stopMethods- A set ofMethodSignatureto stop exploration, e.g. app entry points.reachedMethods- A set that will be filled with all reached stop methods- 返回:
- A
Nodethat represents the single call graph root, i.e. the start method.
-
writeDot
Writes a DOT graph representation of the given call graph.- 抛出:
IOException
-
toDot
Produces a DOT graph representation of the given call graph.
-