Skip to content

Commit a00d48e

Browse files
author
im-frizzy
committed
Added checking for main-classes
1 parent d461110 commit a00d48e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import java.net.URL;
1515
import java.util.ArrayList;
1616
import java.util.HashMap;
17+
import java.util.List;
1718
import java.util.Map.Entry;
1819

1920
import javax.swing.JDialog;
@@ -120,6 +121,7 @@ public class BytecodeViewer {
120121

121122
/* ASM Re-mapping Constants */
122123
public static Refactorer refactorer = new Refactorer();
124+
public static List<String> main_classes = new ArrayList<>();
123125
/* ASM Re-mapping Constants */
124126

125127
/**

src/the/bytecode/club/bytecodeviewer/obfuscators/rename/RenameClasses.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ public void obfuscate() {
2727
System.out.println("Obfuscating class names...");
2828
classLoop: for (ClassNode c : BytecodeViewer.getLoadedClasses()) {
2929

30+
/** As we dont want to rename classes the user specified as main-classes */
31+
for (String name : BytecodeViewer.main_classes) {
32+
if (name.equals(c.name))
33+
continue classLoop;
34+
}
35+
3036
/** As we dont want to rename classes that contain native dll methods */
3137
for (Object o : c.methods) {
3238
MethodNode m = (MethodNode) o;

0 commit comments

Comments
 (0)