v1.1 setTitle中添加try-catch
This commit is contained in:
		@ -204,7 +204,6 @@ public class MWindow extends Frame {
 | 
				
			|||||||
        File directory = null;
 | 
					        File directory = null;
 | 
				
			||||||
        JFileChooser fileChooser = new JFileChooser();
 | 
					        JFileChooser fileChooser = new JFileChooser();
 | 
				
			||||||
        fileChooser.setDialogTitle("Choose Jetbrains path");
 | 
					        fileChooser.setDialogTitle("Choose Jetbrains path");
 | 
				
			||||||
//        fileChooser.setCurrentDirectory(new File("d:\\software\\jetbrains"));
 | 
					 | 
				
			||||||
        fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
 | 
					        fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
 | 
				
			||||||
        int option = fileChooser.showOpenDialog(this);
 | 
					        int option = fileChooser.showOpenDialog(this);
 | 
				
			||||||
        if (option == JFileChooser.APPROVE_OPTION) {
 | 
					        if (option == JFileChooser.APPROVE_OPTION) {
 | 
				
			||||||
 | 
				
			|||||||
@ -115,13 +115,19 @@ public class ModifyDialogWrapperPeerImpl {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        setTitleMethod.insertBefore("{ System.out.println(\"即将打开窗口-->\"+$1);" +
 | 
					        setTitleMethod.insertBefore("{ System.out.println(\"即将打开窗口-->\"+$1);" +
 | 
				
			||||||
                "boolean isLicenseWindow = false;" +
 | 
					                "boolean isLicenseWindow = false;" +
 | 
				
			||||||
                "if($1.indexOf(\"许可证\")>-1) {isLicenseWindow=true; this.dispose();}" +
 | 
					                "try {\n"+
 | 
				
			||||||
                "if($1.indexOf(\"Licenses\")>-1) {isLicenseWindow=true; this.dispose();}" +
 | 
					                "   if($1.indexOf(\"许可证\")>-1) {isLicenseWindow=true; this.dispose();}\n" +
 | 
				
			||||||
                "if(isLicenseWindow)System.out.println(\"发现激活窗口,即将关闭\");" +
 | 
					                "   if($1.indexOf(\"Licenses\")>-1) {isLicenseWindow=true; this.dispose();}\n" +
 | 
				
			||||||
                "Exception e = new Exception(\"↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓\");\n" +
 | 
					                "   if(isLicenseWindow) System.out.println(\"发现激活窗口,即将关闭\");\n" +
 | 
				
			||||||
                "System.out.println(\"调用栈信息-->\");" +
 | 
					                "   Exception e = new Exception(\"↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓\");\n" +
 | 
				
			||||||
                "e.printStackTrace();" +
 | 
					                "   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());
 | 
					        logList.add("[#] Modifying class: " + ctClass.getName());
 | 
				
			||||||
        ctClass.writeFile(middlePath);
 | 
					        ctClass.writeFile(middlePath);
 | 
				
			||||||
        ctClass.detach();
 | 
					        ctClass.detach();
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user