use of the.bytecode.club.bytecodeviewer.obfuscators.mapping.data.MappingData in project bytecode-viewer by Konloch.
the class RenameMethods method obfuscate.
@Override
public void obfuscate() {
int stringLength = getStringLength();
System.out.println("Obfuscating method names...");
for (ClassNode c : BytecodeViewer.getLoadedClasses()) {
methodLoop: for (Object o : c.methods.toArray()) {
MethodNode m = (MethodNode) o;
/* As we dont want to rename native dll methods */
if ((m.access & Opcodes.ACC_NATIVE) != 0)
continue methodLoop;
if (m.access != Opcodes.ACC_ABSTRACT && m.access != Opcodes.ACC_ABSTRACT + Opcodes.ACC_STATIC && m.access != Opcodes.ACC_ABSTRACT + Opcodes.ACC_STATIC + Opcodes.ACC_PUBLIC && m.access != Opcodes.ACC_ABSTRACT + Opcodes.ACC_STATIC + Opcodes.ACC_PRIVATE && m.access != Opcodes.ACC_ABSTRACT + Opcodes.ACC_STATIC + Opcodes.ACC_PROTECTED && m.access != Opcodes.ACC_ABSTRACT + Opcodes.ACC_PUBLIC && m.access != Opcodes.ACC_ABSTRACT + Opcodes.ACC_PRIVATE && m.access != Opcodes.ACC_ABSTRACT + Opcodes.ACC_PROTECTED) {
if (!m.name.equals("main") && !m.name.equals("<init>") && !m.name.equals("<clinit>")) {
String newName = generateUniqueName(stringLength);
BytecodeViewer.refactorer.getHooks().addMethod(new MethodMappingData(c.name, new MappingData(m.name, newName), m.desc));
/*ASMUtil_OLD.renameMethodNode(c.name, m.name, m.desc,
null, newName, null);*/
}
}
}
}
System.out.println("Obfuscated method names.");
}
use of the.bytecode.club.bytecodeviewer.obfuscators.mapping.data.MappingData in project bytecode-viewer by Konloch.
the class RenameFields method obfuscate.
@Override
public void obfuscate() {
int stringLength = getStringLength();
System.out.println("Obfuscating fields names...");
for (ClassNode c : BytecodeViewer.getLoadedClasses()) {
for (Object o : c.fields.toArray()) {
FieldNode f = (FieldNode) o;
String newName = generateUniqueName(stringLength);
BytecodeViewer.refactorer.getHooks().addField(new FieldMappingData(c.name, new MappingData(f.name, newName), f.desc));
/*ASMUtil_OLD.renameFieldNode(c.name, f.name, f.desc, null, newName, null);
f.name = newName;*/
}
}
System.out.println("Obfuscated field names.");
}
Aggregations