Class TraverserActivePathState
java.lang.Object
jadx.core.dex.visitors.finaly.traverser.state.TraverserActivePathState
A state used by the traverser controller. For two given branches, the "finally" branch and the
"candidate" branch whilst determining similar instructions and blocks, the active path state
contains information regarding the current matched instructions and blocks, as well as the
current state of both the finally and candidate path being explored.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classTracks the comparison state of a given block.private static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TraverserActivePathState.BlockCompletionMonitorMapprivate final GlobalTraverserSourceStateprivate final AtomicReference<TraverserState> private final TraverserGlobalCommonStateprivate final TraverserActivePathState.BlockCompletionMonitorMapprivate final GlobalTraverserSourceStateprivate final AtomicReference<TraverserState> -
Constructor Summary
ConstructorsModifierConstructorDescriptionTraverserActivePathState(MethodNode mth, SameInstructionsStrategy sameInstructionsStrategy, BlockNode finallyBlockTerminus, BlockNode candidateBlockTerminus, List<BlockNode> finallyBlocks, List<BlockNode> candidateBlocks) Creates a new instance of a traversal active path.privateTraverserActivePathState(Set<Pair<InsnNode>> matchedInsns, TraverserActivePathState.BlockCompletionMonitorMap finallyCompletionMonitor, TraverserActivePathState.BlockCompletionMonitorMap candidateCompletionMonitor, TraverserGlobalCommonState commonGlobalState, GlobalTraverserSourceState finallyGlobalState, GlobalTraverserSourceState candidateGlobalState) Creates a new instance of a traversal active path. -
Method Summary
Modifier and TypeMethodDescriptionfinal TraverserActivePathStatefinal TraverserStatefinal AtomicReference<TraverserState> final TraverserStatefinal AtomicReference<TraverserState> getGlobalStateFor(TraverserState state) final @Nullable AtomicReference<TraverserState> final voidmergeWith(List<TraverserActivePathState> otherStates) static TraverserActivePathStateproduceFromFactories(TraverserActivePathState previousTraverserState, TraverserStateFactory<?> finallyStateProducer, TraverserStateFactory<?> candidateStateProducer) Produces a shallow clone of theTraverserActivePathState.final voidregisterWithBlockInfo(TraverserBlockInfo info, int numberMatched)
-
Field Details
-
finallyStateRef
-
candidateStateRef
-
finallyGlobalState
-
candidateGlobalState
-
commonGlobalState
-
matchedInsns
-
finallyCompletionMonitor
-
candidateCompletionMonitor
-
-
Constructor Details
-
TraverserActivePathState
public TraverserActivePathState(MethodNode mth, SameInstructionsStrategy sameInstructionsStrategy, BlockNode finallyBlockTerminus, BlockNode candidateBlockTerminus, List<BlockNode> finallyBlocks, List<BlockNode> candidateBlocks) Creates a new instance of a traversal active path. This constructor is used to create a new path to be used by the traverser controller to begin a new traversal. -
TraverserActivePathState
private TraverserActivePathState(Set<Pair<InsnNode>> matchedInsns, TraverserActivePathState.BlockCompletionMonitorMap finallyCompletionMonitor, TraverserActivePathState.BlockCompletionMonitorMap candidateCompletionMonitor, TraverserGlobalCommonState commonGlobalState, GlobalTraverserSourceState finallyGlobalState, GlobalTraverserSourceState candidateGlobalState) Creates a new instance of a traversal active path. This constructor is used to duplicate a state between a previous traverser controller and is a liaison for initialising non-null final fields for theproduceFromFactories(jadx.core.dex.visitors.finaly.traverser.state.TraverserActivePathState, jadx.core.dex.visitors.finaly.traverser.factory.TraverserStateFactory<?>, jadx.core.dex.visitors.finaly.traverser.factory.TraverserStateFactory<?>)function.
-
-
Method Details
-
produceFromFactories
public static TraverserActivePathState produceFromFactories(TraverserActivePathState previousTraverserState, TraverserStateFactory<?> finallyStateProducer, TraverserStateFactory<?> candidateStateProducer) Produces a shallow clone of theTraverserActivePathState. Since this is a shallow clone, it should only be used for a singular branch. If a branch is used and this needs to be duplicated, be sure to use the deep clone duplication on the previousTraverserActivePathStatebefore invoking this method on it.- Parameters:
previousTraverserState- The previous active path state to create a shallow clone of.finallyStateProducer- The factory responsible for producing the new finally state to be held by the resulting active path state.candidateStateProducer- The factory responsible for producing the new candidate state to be held by the resulting active path state.- Returns:
- The cloned active path state.
-
duplicate
-
getFinallyState
-
getCandidateState
-
getFinallyStateRef
-
getCandidateStateRef
-
getMatchedInsns
-
getReferenceForState
@Nullable public final @Nullable AtomicReference<TraverserState> getReferenceForState(TraverserState state) -
getGlobalStateFor
-
getFinallyGlobalState
-
getCandidateGlobalState
-
getGlobalCommonState
-
mergeWith
-
registerWithBlockInfo
-
getAllFullyMatchedFinallyBlocks
-
getAllFullyMatchedCandidateBlocks
-
getAllFullyMatchedBlocks
private Set<BlockNode> getAllFullyMatchedBlocks(TraverserActivePathState.BlockCompletionMonitorMap monitorMap)
-