Class RegisterFormatter

java.lang.Object
org.jf.baksmali.Adaptors.RegisterFormatter

public class RegisterFormatter extends Object
This class contains the logic used for formatting registers
  • Field Details

    • options

      @Nonnull public final BaksmaliOptions options
    • registerCount

      public final int registerCount
    • parameterRegisterCount

      public final int parameterRegisterCount
  • Constructor Details

    • RegisterFormatter

      public RegisterFormatter(@Nonnull BaksmaliOptions options, int registerCount, int parameterRegisterCount)
  • Method Details

    • writeRegisterRange

      public void writeRegisterRange(BaksmaliWriter writer, int startRegister, int lastRegister) throws IOException
      Write out the register range value used by Format3rc. If baksmali.noParameterRegisters is true, it will always output the registers in the v format. But if false, then it will check if *both* registers are parameter registers, and if so, use the p format for both. If only the last register is a parameter register, it will use the v format for both, otherwise it would be confusing to have something like {v20 .. p1}
      Parameters:
      writer - the BaksmaliWriter to write to
      startRegister - the first register in the range
      lastRegister - the last register in the range
      Throws:
      IOException
    • writeTo

      public void writeTo(BaksmaliWriter writer, int register) throws IOException
      Writes a register with the appropriate format. If baksmali.noParameterRegisters is true, then it will always output a register in the v format. If false, then it determines if the register is a parameter register, and if so, formats it in the p format instead.
      Parameters:
      writer - the BaksmaliWriter to write to
      register - the register number
      Throws:
      IOException