Package proguard.classfile.util.inject
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 theCodeInjectorclass.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class proguard.classfile.util.inject.CodeInjector
CodeInjector.ClassMethodPair
-
-
Constructor Summary
Constructors Constructor Description AccumulatedCodeInjector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CodeInjectorat(InjectStrategy injectStrategy)Specify the location in which the invoke instruction should be injected into.voidcommit()Apply the invoke instruction in accordance to the specifications provided via the `.injectInvokeStatic(...)`, `.into(...)` and `.at(...)` methods.CodeInjectorinjectInvokeStatic(Clazz clazz, Method method)Specify the static method to be invoked.CodeInjectorinjectInvokeStatic(Clazz clazz, Method method, InjectedArgument... arguments)Specify the static method to be invoked.CodeInjectorinto(ProgramClass programClass, ProgramMethod programMethod)Specify the method where a static method invocation will be injected into.LocalVariablestore()-
Methods inherited from class proguard.classfile.util.inject.CodeInjector
getArguments, getContent, getInjectStrategy, getResultLocalIndex, getTargets, readyToCommit
-
-
-
-
Method Detail
-
injectInvokeStatic
public CodeInjector injectInvokeStatic(Clazz clazz, Method method)
Description copied from class:CodeInjectorSpecify the static method to be invoked.- Overrides:
injectInvokeStaticin classCodeInjector- 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:CodeInjectorSpecify the static method to be invoked.- Overrides:
injectInvokeStaticin classCodeInjector- 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:CodeInjectorSpecify the method where a static method invocation will be injected into.- Overrides:
intoin classCodeInjector- 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:CodeInjectorSpecify the location in which the invoke instruction should be injected into.- Overrides:
atin classCodeInjector- Parameters:
injectStrategy- The implementation of the InjectStrategy interface which determines the offset to inject the invoke instruction.
-
store
public LocalVariable store()
- Overrides:
storein classCodeInjector
-
commit
public void commit()
Description copied from class:CodeInjectorApply the invoke instruction in accordance to the specifications provided via the `.injectInvokeStatic(...)`, `.into(...)` and `.at(...)` methods.- Overrides:
commitin classCodeInjector
-
-