mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-03 00:37:55 +00:00
Merge branch 'master' of github.com:Parabot/Parabot
This commit is contained in:
@@ -140,5 +140,17 @@ public class ASMUtils implements Opcodes {
|
||||
node.access = node.access | Opcodes.ACC_PUBLIC;
|
||||
}
|
||||
}
|
||||
|
||||
public static void makePublic(FieldNode node) {
|
||||
if (!Modifier.isPublic(node.access)) {
|
||||
if (Modifier.isPrivate(node.access)) {
|
||||
node.access = node.access & (~Opcodes.ACC_PRIVATE);
|
||||
}
|
||||
if (Modifier.isProtected(node.access)) {
|
||||
node.access = node.access & (~Opcodes.ACC_PROTECTED);
|
||||
}
|
||||
node.access = node.access | Opcodes.ACC_PUBLIC;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -129,16 +129,7 @@ public class AddGetterAdapter implements Opcodes, Injectable {
|
||||
method.visitVarInsn(ALOAD, 0);
|
||||
}
|
||||
if(staticField) {
|
||||
if (!Modifier.isPublic(fieldNode.access)) {
|
||||
if (Modifier.isPrivate(fieldNode.access)) {
|
||||
fieldNode.access = fieldNode.access & (~ACC_PRIVATE);
|
||||
}
|
||||
if (Modifier.isProtected(fieldNode.access)) {
|
||||
fieldNode.access = fieldNode.access & (~ACC_PROTECTED);
|
||||
}
|
||||
fieldNode.access = fieldNode.access | ACC_PUBLIC;
|
||||
//mn.access = mn.access | ACC_SYNCHRONIZED;
|
||||
}
|
||||
ASMUtils.makePublic(fieldNode);
|
||||
}
|
||||
method.visitFieldInsn(staticField ? GETSTATIC : GETFIELD,
|
||||
fieldLocation.name, fieldNode.name, fieldNode.desc);
|
||||
|
||||
Reference in New Issue
Block a user