|
18 | 18 | import java.io.InputStreamReader;
|
19 | 19 | import java.io.OutputStream;
|
20 | 20 | import java.io.PrintStream;
|
| 21 | +import java.lang.reflect.InvocationTargetException; |
21 | 22 | import java.net.URL;
|
22 | 23 | import java.net.URLClassLoader;
|
23 | 24 | import java.util.ArrayList;
|
|
33 | 34 |
|
34 | 35 | public class DeobfuscatorFrame
|
35 | 36 | {
|
36 |
| - private static final String VERSION = "2.0-BETA"; |
| 37 | + private static final String VERSION = "2.0"; |
37 | 38 |
|
38 | 39 | /**
|
39 | 40 | * New - Latest API
|
@@ -592,13 +593,44 @@ public void run()
|
592 | 593 | invoke(configuration, libraries);
|
593 | 594 | Object deobfuscator =
|
594 | 595 | loadClasses[0].getDeclaredConstructor(loadClasses[1]).newInstance(configuration);
|
595 |
| - loadClasses[0].getDeclaredMethod("start").invoke(deobfuscator); |
| 596 | + try |
| 597 | + { |
| 598 | + loadClasses[0].getDeclaredMethod("start").invoke(deobfuscator); |
| 599 | + }catch(InvocationTargetException e) |
| 600 | + { |
| 601 | + if(e.getTargetException().getClass().getName(). |
| 602 | + equals("com.javadeobfuscator.deobfuscator.exceptions.NoClassInPathException")) |
| 603 | + { |
| 604 | + for(int i = 0; i < 5; i++) |
| 605 | + System.out.println(); |
| 606 | + System.out.println("** DO NOT OPEN AN ISSUE ON GITHUB **"); |
| 607 | + System.out.println("Could not locate a class file."); |
| 608 | + System.out.println("Have you added the necessary files to the -path argument?"); |
| 609 | + System.out.println("The error was:"); |
| 610 | + }else if(e.getTargetException().getClass().getName(). |
| 611 | + equals("com.javadeobfuscator.deobfuscator.exceptions.PreventableStackOverflowError")) |
| 612 | + { |
| 613 | + for(int i = 0; i < 5; i++) |
| 614 | + System.out.println(); |
| 615 | + System.out.println("** DO NOT OPEN AN ISSUE ON GITHUB **"); |
| 616 | + System.out.println("A StackOverflowError occurred during deobfuscation, but it is preventable"); |
| 617 | + System.out.println("Try increasing your stack size using the -Xss flag"); |
| 618 | + System.out.println("The error was:"); |
| 619 | + }else |
| 620 | + { |
| 621 | + for(int i = 0; i < 5; i++) |
| 622 | + System.out.println(); |
| 623 | + System.out.println("Deobfuscation failed. Please open a ticket on GitHub and provide the following error:"); |
| 624 | + } |
| 625 | + e.getTargetException().printStackTrace(); |
| 626 | + } |
596 | 627 | }catch(Exception e)
|
597 | 628 | {
|
598 | 629 | e.printStackTrace();
|
599 | 630 | }
|
600 | 631 | }
|
601 | 632 | });
|
| 633 | + thread.setContextClassLoader(loader); |
602 | 634 | thread.start();
|
603 | 635 | newFrame.addWindowListener(new WindowAdapter()
|
604 | 636 | {
|
|
0 commit comments