Class CentralityState

java.lang.Object
jadx.core.dex.visitors.finaly.CentralityState

public final class CentralityState extends Object
A centrality state is an object which helps track how instructions can be skipped. When looking for a finally, one of the things we have to do is make sure that instructions are not part of the return and are actually part of the "finally" block. This object helps keep track of registers, instructions etc to see if instructions can be skipped.
  • Field Details

    • allowableOutputArguments

      private final Set<RegisterArg> allowableOutputArguments
    • sameInstructionsStrategy

      private final SameInstructionsStrategy sameInstructionsStrategy
    • allowsCentral

      private boolean allowsCentral
    • allowsNonStartingNode

      private boolean allowsNonStartingNode
  • Constructor Details

    • CentralityState

      public CentralityState(SameInstructionsStrategy sameInstructionsStrategy, boolean allowsNonStartingNode)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getSameInstructionsStrategy

      public SameInstructionsStrategy getSameInstructionsStrategy()
    • getAllowsCentral

      public boolean getAllowsCentral()
    • setAllowsCentral

      public void setAllowsCentral(boolean allowsCentral)
    • getAllowsNonStartingNode

      public boolean getAllowsNonStartingNode()
    • setAllowsNonStartingNode

      public void setAllowsNonStartingNode(boolean allowsNonStartingNode)
    • addAllowableOutput

      public void addAllowableOutput(RegisterArg allowableOutput)
    • addAllowableOutputs

      public void addAllowableOutputs(Collection<RegisterArg> allowableOutputs)
    • addAllowableOutputs

      public void addAllowableOutputs(InsnNode allowableOutputInsn)
      Adds all inputs register arguments from an instruction as allowable output arguments.
      Parameters:
      allowableOutputInsn - The instruction to retrieve the list of inputs from.
    • hasAllowableOutput

      public boolean hasAllowableOutput(InsnNode insn)
    • hasAllowableInputs

      public boolean hasAllowableInputs(InsnNode insn)
    • duplicate

      public CentralityState duplicate()
    • getAllowableOutputArguments

      public Set<RegisterArg> getAllowableOutputArguments()