Merge pull request #24 from im-frizzy/master
Added auto main class checking (main() and Applet.init())
This commit is contained in:
commit
90241eb232
2 changed files with 6 additions and 7 deletions
|
@ -121,7 +121,6 @@ public class BytecodeViewer {
|
|||
|
||||
/* ASM Re-mapping Constants */
|
||||
public static Refactorer refactorer = new Refactorer();
|
||||
public static List<String> main_classes = new ArrayList<>();
|
||||
/* ASM Re-mapping Constants */
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,15 +27,15 @@ 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;
|
||||
|
||||
/** As we dont want to rename any main-classes */
|
||||
if (m.name.equals("main") && m.desc.equals("([Ljava/lang/String;)V")
|
||||
|| m.name.equals("init") && c.superName.equals("java/applet/Applet"))
|
||||
continue classLoop;
|
||||
|
||||
/* As we dont want to rename native dll methods */
|
||||
if ((m.access & Opcodes.ACC_NATIVE) != 0)
|
||||
continue classLoop;
|
||||
|
|
Loading…
Reference in a new issue