Search in sources :

Example 1 with FieldMappingData

use of the.bytecode.club.bytecodeviewer.obfuscators.mapping.data.FieldMappingData 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.");
}
Also used : FieldMappingData(the.bytecode.club.bytecodeviewer.obfuscators.mapping.data.FieldMappingData) ClassNode(org.objectweb.asm.tree.ClassNode) FieldNode(org.objectweb.asm.tree.FieldNode) MappingData(the.bytecode.club.bytecodeviewer.obfuscators.mapping.data.MappingData) FieldMappingData(the.bytecode.club.bytecodeviewer.obfuscators.mapping.data.FieldMappingData)

Aggregations

ClassNode (org.objectweb.asm.tree.ClassNode)1 FieldNode (org.objectweb.asm.tree.FieldNode)1 FieldMappingData (the.bytecode.club.bytecodeviewer.obfuscators.mapping.data.FieldMappingData)1 MappingData (the.bytecode.club.bytecodeviewer.obfuscators.mapping.data.MappingData)1