Package proguard.analysis
Class CallResolver.Builder
java.lang.Object
proguard.analysis.CallResolver.Builder
- Enclosing class:
- CallResolver
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder(ClassPool programClassPool, ClassPool libraryClassPool, CallGraph callGraph, CallHandler... visitors) -
Method Summary
Modifier and TypeMethodDescriptionbuild()setArrayValueFactory(ValueFactory arrayValueFactory) setClearCallValuesAfterVisit(boolean clearCallValuesAfterVisit) If true,Call.clearValues()will be called afterCallHandler.handleCall(Call, TracedStack, TracedVariables).setEvaluateAllCode(boolean evaluateAllCode) setExecutingInvocationUnitBuilder(ExecutingInvocationUnit.Builder executingInvocationUnitBuilder) setIgnoreExceptions(boolean ignoreExceptions) If false, exceptions will be taken into account during control flow analysis.setIncludeSubClasses(boolean includeSubClasses) If true, virtual calls on class fields, parameters and return values of other methods will take all possible subclasses into account.setMaxPartialEvaluations(int maxPartialEvaluations) setShouldAnalyzeNextCodeAttribute(Supplier<Boolean> shouldAnalyzeNextCodeAttribute) If returns true, the next code attribute will be analyzed.setSkipIncompleteCalls(boolean skipIncompleteCalls) If true, any discovered call that would return true forCall.hasIncompleteTarget()will be discarded and not be forwarded toCallHandler.handleCall(Call, TracedStack, TracedVariables).setUseDominatorAnalysis(boolean useDominatorAnalysis) If true, a dominator analysis is carried out using theDominatorCalculatorfor each method, in order to be able to fill theCall.controlFlowDependentflag.useSelectiveParameterReconstruction(Set<MethodSignature> interestingMethods, Set<Predicate<Call>> interestingCallPredicates) When used allows parameter reconstruction based on thePartialEvaluatorto only be executed for the calls that match (1) theinterestingMethodssignatures OR (2) theinterestingCallPredicates.
-
Constructor Details
-
Builder
public Builder(ClassPool programClassPool, ClassPool libraryClassPool, CallGraph callGraph, CallHandler... visitors)
-
-
Method Details
-
setClearCallValuesAfterVisit
If true,Call.clearValues()will be called afterCallHandler.handleCall(Call, TracedStack, TracedVariables). This makes it possible to analyze arguments and the return value of calls while still adding them to aCallGraphafterward, as call graph analysis itself usually only requires the call locations and their targets, not the arguments or return value. -
setUseDominatorAnalysis
If true, a dominator analysis is carried out using theDominatorCalculatorfor each method, in order to be able to fill theCall.controlFlowDependentflag. -
setEvaluateAllCode
-
setIncludeSubClasses
If true, virtual calls on class fields, parameters and return values of other methods will take all possible subclasses into account.This is necessary for a more complete call graph, because the runtime type of these objects is not controlled by the current method. E.g. a method that declares its return type to be of type A might also return an object of type B in case B extends A. The same is true for class fields and parameters, so in order to really find all potential calls, this circumstance needs to be modeled. For objects of declared type
Objectthis will be skipped, as the fact that every single Java class is a subclass of object would lead to an immense blow-up of the call graph. -
setMaxPartialEvaluations
-
setShouldAnalyzeNextCodeAttribute
public CallResolver.Builder setShouldAnalyzeNextCodeAttribute(Supplier<Boolean> shouldAnalyzeNextCodeAttribute) If returns true, the next code attribute will be analyzed. Otherwise, the code attribute will be skipped. -
setSkipIncompleteCalls
If true, any discovered call that would return true forCall.hasIncompleteTarget()will be discarded and not be forwarded toCallHandler.handleCall(Call, TracedStack, TracedVariables). -
setArrayValueFactory
- Parameters:
arrayValueFactory- should be set either withDetailedArrayValueFactoryorArrayReferenceValueFactory- Returns:
CallResolver.Builderobject
-
setIgnoreExceptions
If false, exceptions will be taken into account during control flow analysis. -
useSelectiveParameterReconstruction
public CallResolver.Builder useSelectiveParameterReconstruction(Set<MethodSignature> interestingMethods, Set<Predicate<Call>> interestingCallPredicates) When used allows parameter reconstruction based on thePartialEvaluatorto only be executed for the calls that match (1) theinterestingMethodssignatures OR (2) theinterestingCallPredicates. -
setExecutingInvocationUnitBuilder
public CallResolver.Builder setExecutingInvocationUnitBuilder(ExecutingInvocationUnit.Builder executingInvocationUnitBuilder) - Parameters:
executingInvocationUnitBuilder- a builder for the invocation unit used for particular value analysis.- Returns:
CallResolver.Builderobject
-
build
-