Class AccumulatedCodeInjector

java.lang.Object
proguard.classfile.util.inject.CodeInjector
proguard.classfile.util.inject.AccumulatedCodeInjector

public class AccumulatedCodeInjector extends CodeInjector
This utility class allows for injecting multiple static method invocations in multiple target methods. It allows the repeated use of the API methods defined in the CodeInjector class.
  • Constructor Details

    • AccumulatedCodeInjector

      public AccumulatedCodeInjector()
    • AccumulatedCodeInjector

      public AccumulatedCodeInjector(CodeAttributeEditor editor)
  • Method Details

    • injectInvokeStatic

      public CodeInjector injectInvokeStatic(Clazz clazz, Method method)
      Description copied from class: CodeInjector
      Specify the static method to be invoked.
      Overrides:
      injectInvokeStatic in class CodeInjector
      Parameters:
      clazz - The class containing the static method to be invoked.
      method - The method to be invoked.
    • injectInvokeStatic

      public CodeInjector injectInvokeStatic(Clazz clazz, Method method, InjectedArgument... arguments)
      Description copied from class: CodeInjector
      Specify the static method to be invoked.
      Overrides:
      injectInvokeStatic in class CodeInjector
      Parameters:
      clazz - The class containing the static method to be invoked.
      method - The method to be invoked.
      arguments - A list of arguments to be passed to the method to be invoked.
    • into

      public CodeInjector into(ProgramClass programClass, ProgramMethod programMethod)
      Description copied from class: CodeInjector
      Specify the method where a static method invocation will be injected into.
      Overrides:
      into in class CodeInjector
      Parameters:
      programClass - The program class that has the method where a static method invocation will be injected into.
      programMethod - The method where a static method invocation will be injected into.
    • at

      public CodeInjector at(InjectStrategy injectStrategy)
      Description copied from class: CodeInjector
      Specify the location in which the invoke instruction should be injected into.
      Overrides:
      at in class CodeInjector
      Parameters:
      injectStrategy - The implementation of the InjectStrategy interface which determines the offset to inject the invoke instruction.
    • store

      public LocalVariable store()
      Overrides:
      store in class CodeInjector
    • commit

      public void commit()
      Description copied from class: CodeInjector
      Apply the invoke instruction in accordance to the specifications provided via the `.injectInvokeStatic(...)`, `.into(...)` and `.at(...)` methods.
      Overrides:
      commit in class CodeInjector