Class TypeSearch
java.lang.Object
jadx.core.dex.visitors.typeinference.TypeSearch
Slow and memory consuming multi-variable type search algorithm.
Used only if fast type propagation is failed for some variables.
Stages description: - find all possible candidate types within bounds - build dynamic constraint list for every variable - run search by checking all candidates
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final org.slf4j.Loggerprivate final MethodNodeprivate static final intprivate final TypeSearchStateprivate final TypeCompareprivate final TypeUpdateprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanaddCandidateType(Set<ITypeBound> bounds, Set<ArgType> collectedTypes, ArgType candidateType) private voidaddCandidateTypes(Set<ITypeBound> bounds, Set<ArgType> collectedTypes, Collection<ArgType> candidateTypes) private voidaddConstraint(TypeSearchVarInfo varInfo, ITypeConstraint constraint) private voidaddUsageTypeCandidates(SSAVar ssaVar, Set<ITypeBound> bounds, Set<ArgType> candidateTypes) private booleanprivate voidcollectConstraints(SSAVar var) expandUnknownType(ArgType type) private voidfillTypeCandidates(SSAVar ssaVar) private booleanfullCheck(List<TypeSearchVarInfo> vars) getNarrowTypes(ArgType type) getWiderTypes(ArgType type) private @Nullable ITypeConstraintprivate @Nullable ITypeConstraintmakeMoveConstraint(InsnNode insn, RegisterArg arg) private ITypeConstraintmakePhiConstraint(InsnNode insn, RegisterArg arg) private booleanbooleanrun()private booleansearch(List<TypeSearchVarInfo> vars) private boolean
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
VARS_PROCESS_LIMIT
private static final int VARS_PROCESS_LIMIT- See Also:
-
CANDIDATES_COUNT_LIMIT
private static final int CANDIDATES_COUNT_LIMIT- See Also:
-
SEARCH_ITERATION_LIMIT
private static final int SEARCH_ITERATION_LIMIT- See Also:
-
mth
-
state
-
typeCompare
-
typeUpdate
-
-
Constructor Details
-
TypeSearch
-
-
Method Details
-
run
public boolean run() -
applyResolvedVars
private boolean applyResolvedVars() -
search
-
resolveIndependentVariables
-
fullCheck
-
singleCheck
-
fillTypeCandidates
-
addUsageTypeCandidates
private void addUsageTypeCandidates(SSAVar ssaVar, Set<ITypeBound> bounds, Set<ArgType> candidateTypes) -
addCandidateTypes
private void addCandidateTypes(Set<ITypeBound> bounds, Set<ArgType> collectedTypes, Collection<ArgType> candidateTypes) -
addCandidateType
private boolean addCandidateType(Set<ITypeBound> bounds, Set<ArgType> collectedTypes, ArgType candidateType) -
getWiderTypes
-
getNarrowTypes
-
expandUnknownType
-
collectConstraints
-
addConstraint
-
makeConstraint
-
makeMoveConstraint
-
makePhiConstraint
-