public class AsmUtils
extends java.lang.Object
| Constructor and Description |
|---|
AsmUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.reflect.Field |
changeFieldAccess(java.lang.Class<?> clazz,
java.lang.String fieldName)
Changes the access level for the specified field for a class.
|
static java.lang.reflect.Field |
changeFieldAccess(java.lang.Class<?> clazz,
java.lang.String fieldName,
java.lang.String srgName)
Changes the access level for the specified field for a class.
|
static java.lang.reflect.Field |
changeFieldAccess(java.lang.Class<?> clazz,
java.lang.String fieldName,
java.lang.String srgName,
boolean silenced)
Changes the access level for the specified field for a class.
|
static java.lang.reflect.Method |
changeMethodAccess(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.Class<?>... params)
Changes the access level for the specified method for a class.
|
static java.lang.reflect.Method |
changeMethodAccess(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.String params)
Changes the access level for the specified method for a class.
|
static java.lang.reflect.Method |
changeMethodAccess(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.String srgName,
boolean silenced,
java.lang.Class<?>... params)
Changes the access level for the specified method for a class.
|
static java.lang.reflect.Method |
changeMethodAccess(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.String srgName,
java.lang.Class<?>... params)
Changes the access level for the specified method for a class.
|
static java.lang.reflect.Method |
changeMethodAccess(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.String srgName,
java.lang.String params)
Changes the access level for the specified method for a class.
|
static org.objectweb.asm.tree.InsnList |
cloneList(org.objectweb.asm.tree.InsnList list)
Clones a
InsnList. |
static boolean |
fieldInsnEqual(org.objectweb.asm.tree.FieldInsnNode insn1,
org.objectweb.asm.tree.FieldInsnNode insn2)
Checks if two
FieldInsnNode are equals. |
static org.objectweb.asm.tree.AbstractInsnNode |
findInstruction(org.objectweb.asm.tree.MethodNode method,
org.objectweb.asm.tree.InsnList matches)
Finds instruction a specific instruction list inside a method, starting from the begining.
|
static org.objectweb.asm.tree.AbstractInsnNode |
findInstruction(org.objectweb.asm.tree.MethodNode method,
org.objectweb.asm.tree.InsnList matches,
int index)
Finds instruction a specific instruction list inside a method, starting from the specified index.
|
static org.objectweb.asm.tree.MethodNode |
findMethod(org.objectweb.asm.tree.ClassNode clazz,
java.lang.String name)
Finds the method with the given name.
|
static org.objectweb.asm.tree.MethodNode |
findMethod(org.objectweb.asm.tree.ClassNode clazz,
java.lang.String name,
java.lang.String desc)
Finds the method with the given name and method descriptor.
|
static java.lang.String |
getMethodNodeAsString(org.objectweb.asm.tree.MethodNode methodNode)
Gets the
MethodNode as string. |
static boolean |
iincInsnEqual(org.objectweb.asm.tree.IincInsnNode node1,
org.objectweb.asm.tree.IincInsnNode node2)
Checks if two
IincInsnNode are equals. |
static boolean |
insnEqual(org.objectweb.asm.tree.AbstractInsnNode node1,
org.objectweb.asm.tree.AbstractInsnNode node2)
Checks if two
AbstractInsnNode are equals. |
static boolean |
intInsnEqual(org.objectweb.asm.tree.IntInsnNode node1,
org.objectweb.asm.tree.IntInsnNode node2)
Checks if two
IntInsnNode are equals. |
static boolean |
ldcInsnEqual(org.objectweb.asm.tree.LdcInsnNode insn1,
org.objectweb.asm.tree.LdcInsnNode insn2)
Checks if two
LdcInsnNode are equals. |
static boolean |
methodInsnEqual(org.objectweb.asm.tree.MethodInsnNode insn1,
org.objectweb.asm.tree.MethodInsnNode insn2)
Checks if two
MethodInsnNode are equals. |
static boolean |
typeInsnEqual(org.objectweb.asm.tree.TypeInsnNode insn1,
org.objectweb.asm.tree.TypeInsnNode insn2)
Checks if two
TypeInsnNode are equals. |
static boolean |
varInsnEqual(org.objectweb.asm.tree.VarInsnNode insn1,
org.objectweb.asm.tree.VarInsnNode insn2)
Checks if two
VarInsnNode are equals. |
public static org.objectweb.asm.tree.MethodNode findMethod(org.objectweb.asm.tree.ClassNode clazz,
java.lang.String name)
clazz - the classname - the method name to search forpublic static org.objectweb.asm.tree.MethodNode findMethod(org.objectweb.asm.tree.ClassNode clazz,
java.lang.String name,
java.lang.String desc)
clazz - the classname - the method name to search fordesc - the method descriptor to search forType.getMethodDescriptor(org.objectweb.asm.Type, org.objectweb.asm.Type...)public static org.objectweb.asm.tree.AbstractInsnNode findInstruction(org.objectweb.asm.tree.MethodNode method,
org.objectweb.asm.tree.InsnList matches)
method - the methodmatches - the matchespublic static org.objectweb.asm.tree.AbstractInsnNode findInstruction(org.objectweb.asm.tree.MethodNode method,
org.objectweb.asm.tree.InsnList matches,
int index)
method - the methodmatches - the matchesindex - the indexpublic static boolean insnEqual(org.objectweb.asm.tree.AbstractInsnNode node1,
org.objectweb.asm.tree.AbstractInsnNode node2)
AbstractInsnNode are equals.node1 - the node1node2 - the node2public static boolean varInsnEqual(org.objectweb.asm.tree.VarInsnNode insn1,
org.objectweb.asm.tree.VarInsnNode insn2)
VarInsnNode are equals.insn1 - the insn1insn2 - the insn2public static boolean methodInsnEqual(org.objectweb.asm.tree.MethodInsnNode insn1,
org.objectweb.asm.tree.MethodInsnNode insn2)
MethodInsnNode are equals.insn1 - the insn1insn2 - the insn2public static boolean fieldInsnEqual(org.objectweb.asm.tree.FieldInsnNode insn1,
org.objectweb.asm.tree.FieldInsnNode insn2)
FieldInsnNode are equals.insn1 - the insn1insn2 - the insn2public static boolean ldcInsnEqual(org.objectweb.asm.tree.LdcInsnNode insn1,
org.objectweb.asm.tree.LdcInsnNode insn2)
LdcInsnNode are equals.insn1 - the insn1insn2 - the insn2public static boolean typeInsnEqual(org.objectweb.asm.tree.TypeInsnNode insn1,
org.objectweb.asm.tree.TypeInsnNode insn2)
TypeInsnNode are equals.insn1 - the insn1insn2 - the insn2public static boolean iincInsnEqual(org.objectweb.asm.tree.IincInsnNode node1,
org.objectweb.asm.tree.IincInsnNode node2)
IincInsnNode are equals.node1 - the node1node2 - the node2public static boolean intInsnEqual(org.objectweb.asm.tree.IntInsnNode node1,
org.objectweb.asm.tree.IntInsnNode node2)
IntInsnNode are equals.node1 - the node1node2 - the node2public static java.lang.String getMethodNodeAsString(org.objectweb.asm.tree.MethodNode methodNode)
MethodNode as string.methodNode - the method nodepublic static org.objectweb.asm.tree.InsnList cloneList(org.objectweb.asm.tree.InsnList list)
InsnList.list - the listpublic static java.lang.reflect.Field changeFieldAccess(java.lang.Class<?> clazz,
java.lang.String fieldName)
clazz - the clazzfieldName - the field namepublic static java.lang.reflect.Field changeFieldAccess(java.lang.Class<?> clazz,
java.lang.String fieldName,
java.lang.String srgName)
clazz - the clazzfieldName - the field namesrgName - the srg namepublic static java.lang.reflect.Field changeFieldAccess(java.lang.Class<?> clazz,
java.lang.String fieldName,
java.lang.String srgName,
boolean silenced)
clazz - the clazzfieldName - the field namesrgName - the srg namesilenced - the silencedpublic static java.lang.reflect.Method changeMethodAccess(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.String params)
clazz - the clazzmethodName - the method nameparams - the paramspublic static java.lang.reflect.Method changeMethodAccess(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.String srgName,
java.lang.String params)
clazz - the clazzmethodName - the method namesrgName - the srg nameparams - the paramspublic static java.lang.reflect.Method changeMethodAccess(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.Class<?>... params)
clazz - the clazzmethodName - the field namepublic static java.lang.reflect.Method changeMethodAccess(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.String srgName,
java.lang.Class<?>... params)
clazz - the clazzmethodName - the method namesrgName - the srg nameparams - the paramspublic static java.lang.reflect.Method changeMethodAccess(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.String srgName,
boolean silenced,
java.lang.Class<?>... params)
clazz - the clazzmethodName - the field namesrgName - the srg namesilenced - the silencedparams - the params