Skip to content

Commit

Permalink
fix duplicate clinit names on subsequent obfuscation
Browse files Browse the repository at this point in the history
  • Loading branch information
radioegor146 committed May 31, 2022
1 parent 1635473 commit ecc205d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class ClInitSpecialMethodProcessor implements SpecialMethodProcessor {

@Override
public String preProcess(MethodContext context) {
String name = "native_special_clinit" + context.methodIndex;
String name = String.format("%s_special_clinit%d", context.obfuscator.getNativeDir(), context.methodIndex);
if (!Util.getFlag(context.clazz.access, Opcodes.ACC_INTERFACE)) {
context.proxyMethod = new MethodNode(Opcodes.ASM7,
Opcodes.ACC_NATIVE | Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC | Opcodes.ACC_SYNTHETIC,
Expand Down Expand Up @@ -38,7 +38,7 @@ public void postProcess(MethodContext context) {
context.nativeMethod.name, context.nativeMethod.desc, false));
} else {
instructions.add(new MethodInsnNode(Opcodes.INVOKESTATIC, context.clazz.name,
"native_special_clinit" + context.methodIndex, context.method.desc, false));
String.format("%s_special_clinit%d", context.obfuscator.getNativeDir(), context.methodIndex), context.method.desc, false));
}

instructions.add(new InsnNode(Opcodes.RETURN));
Expand Down

0 comments on commit ecc205d

Please sign in to comment.