diff --git a/src/main/java/top/zunmx/MWindow.java b/src/main/java/top/zunmx/MWindow.java index 7f6c29f..991b4c6 100644 --- a/src/main/java/top/zunmx/MWindow.java +++ b/src/main/java/top/zunmx/MWindow.java @@ -204,7 +204,6 @@ public class MWindow extends Frame { File directory = null; JFileChooser fileChooser = new JFileChooser(); fileChooser.setDialogTitle("Choose Jetbrains path"); -// fileChooser.setCurrentDirectory(new File("d:\\software\\jetbrains")); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int option = fileChooser.showOpenDialog(this); if (option == JFileChooser.APPROVE_OPTION) { diff --git a/src/main/java/top/zunmx/ModifyDialogWrapperPeerImpl.java b/src/main/java/top/zunmx/ModifyDialogWrapperPeerImpl.java index 73b669d..6a1327f 100644 --- a/src/main/java/top/zunmx/ModifyDialogWrapperPeerImpl.java +++ b/src/main/java/top/zunmx/ModifyDialogWrapperPeerImpl.java @@ -115,13 +115,19 @@ public class ModifyDialogWrapperPeerImpl { } setTitleMethod.insertBefore("{ System.out.println(\"即将打开窗口-->\"+$1);" + "boolean isLicenseWindow = false;" + - "if($1.indexOf(\"许可证\")>-1) {isLicenseWindow=true; this.dispose();}" + - "if($1.indexOf(\"Licenses\")>-1) {isLicenseWindow=true; this.dispose();}" + - "if(isLicenseWindow)System.out.println(\"发现激活窗口,即将关闭\");" + - "Exception e = new Exception(\"↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓\");\n" + - "System.out.println(\"调用栈信息-->\");" + - "e.printStackTrace();" + - " }"); // 注入的代码 + "try {\n"+ + " if($1.indexOf(\"许可证\")>-1) {isLicenseWindow=true; this.dispose();}\n" + + " if($1.indexOf(\"Licenses\")>-1) {isLicenseWindow=true; this.dispose();}\n" + + " if(isLicenseWindow) System.out.println(\"发现激活窗口,即将关闭\");\n" + + " Exception e = new Exception(\"↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓\");\n" + + " System.out.println(\"调用栈信息-->\");\n" + + " e.printStackTrace();\n" + + " }\n" + + "catch (Exception ex) {\n" + + " System.out.println(\"出现错误-->\");\n" + + " ex.printStackTrace();\n" + + " }" + + "}"); // 注入的代码 logList.add("[#] Modifying class: " + ctClass.getName()); ctClass.writeFile(middlePath); ctClass.detach();