From a00d48ee7b50a4705fe531513359a21b88e87d04 Mon Sep 17 00:00:00 2001 From: im-frizzy Date: Sat, 28 Feb 2015 22:19:51 -0600 Subject: [PATCH] Added checking for main-classes --- src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java | 2 ++ .../bytecodeviewer/obfuscators/rename/RenameClasses.java | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java b/src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java index de61a71d..c8838913 100644 --- a/src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java +++ b/src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java @@ -14,6 +14,7 @@ import java.net.URI; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map.Entry; import javax.swing.JDialog; @@ -120,6 +121,7 @@ public class BytecodeViewer { /* ASM Re-mapping Constants */ public static Refactorer refactorer = new Refactorer(); + public static List main_classes = new ArrayList<>(); /* ASM Re-mapping Constants */ /** diff --git a/src/the/bytecode/club/bytecodeviewer/obfuscators/rename/RenameClasses.java b/src/the/bytecode/club/bytecodeviewer/obfuscators/rename/RenameClasses.java index 1e17f6e7..e9addb00 100644 --- a/src/the/bytecode/club/bytecodeviewer/obfuscators/rename/RenameClasses.java +++ b/src/the/bytecode/club/bytecodeviewer/obfuscators/rename/RenameClasses.java @@ -27,6 +27,12 @@ public class RenameClasses extends JavaObfuscator { System.out.println("Obfuscating class names..."); classLoop: for (ClassNode c : BytecodeViewer.getLoadedClasses()) { + /** As we dont want to rename classes the user specified as main-classes */ + for (String name : BytecodeViewer.main_classes) { + if (name.equals(c.name)) + continue classLoop; + } + /** As we dont want to rename classes that contain native dll methods */ for (Object o : c.methods) { MethodNode m = (MethodNode) o;