Class FirstBlock
- java.lang.Object
-
- proguard.classfile.util.inject.location.FirstBlock
-
- All Implemented Interfaces:
InjectStrategy
public class FirstBlock extends java.lang.Object implements InjectStrategy
An implementation of the InjectStrategy interface to find the earliest location suitable for injecting method invocation instructions.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface proguard.classfile.util.inject.location.InjectStrategy
InjectStrategy.InjectLocation
-
-
Constructor Summary
Constructors Constructor Description FirstBlock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InjectStrategy.InjectLocation[]
getAllSuitableInjectionLocation(ProgramClass targetClass, ProgramMethod targetMethod)
Find the first offset to inject a method invocation.InjectStrategy.InjectLocation
getSingleInjectionLocation(ProgramClass targetClass, ProgramMethod targetMethod)
Find the first offset to inject a method invocation.
-
-
-
Method Detail
-
getSingleInjectionLocation
public InjectStrategy.InjectLocation getSingleInjectionLocation(ProgramClass targetClass, ProgramMethod targetMethod)
Find the first offset to inject a method invocation. If the target method is a constructor, the offset is right after the `invokespecial` to the constructor of the current class or its super class.- Specified by:
getSingleInjectionLocation
in interfaceInjectStrategy
- Parameters:
targetClass
- The class holding the method in which a method invocation shall be injected into.targetMethod
- the target method to have a method invocation injected into.- Returns:
- An InjectLocation instance indicating the first offset suitable for injection.
-
getAllSuitableInjectionLocation
public InjectStrategy.InjectLocation[] getAllSuitableInjectionLocation(ProgramClass targetClass, ProgramMethod targetMethod)
Find the first offset to inject a method invocation. If the target method is a constructor, the offset is right after the `invokespecial` to the constructor of the current class or its super class.- Specified by:
getAllSuitableInjectionLocation
in interfaceInjectStrategy
- Parameters:
targetClass
- The class holding the method in which a method invocation shall be injected into.targetMethod
- the target method to have a method invocation injected into.- Returns:
- An array of one InjectLocation instance indicating the first offset suitable for injection.
-
-