Class SpecificOffset

java.lang.Object
proguard.classfile.util.inject.location.SpecificOffset
All Implemented Interfaces:
InjectStrategy

public class SpecificOffset extends Object implements InjectStrategy
  • Constructor Details

    • SpecificOffset

      public SpecificOffset(int targetOffset, boolean shouldInjectBefore)
  • Method Details

    • getSingleInjectionLocation

      public InjectStrategy.InjectLocation getSingleInjectionLocation(ProgramClass targetClass, ProgramMethod targetMethod)
      Description copied from interface: InjectStrategy
      Determine one location (i.e. offset) suitable for injecting a method invocation.
      Specified by:
      getSingleInjectionLocation in interface InjectStrategy
      Parameters:
      targetClass - The class holding the method in which a method invocation will be injected.
      targetMethod - The target method to have a method invocation injected into.
      Returns:
      An InjectLocation instance indicating an offset suitable for injection and whether the injection shall happen before or after the offset.
    • getAllSuitableInjectionLocation

      public InjectStrategy.InjectLocation[] getAllSuitableInjectionLocation(ProgramClass targetClass, ProgramMethod targetMethod)
      Description copied from interface: InjectStrategy
      Determine all locations (i.e., offsets) suitable for injecting a method invocation.
      Specified by:
      getAllSuitableInjectionLocation in interface InjectStrategy
      Parameters:
      targetClass - The class holding the method in which a method invocation will be injected.
      targetMethod - The target method to have a method invocation injected into.
      Returns:
      An array of InjectLocation instances indicating offsets suitable for injection and whether the injection shall take place before or after each offset.