1010import the .bytecode .club .bytecodeviewer .BytecodeViewer ;
1111import the .bytecode .club .bytecodeviewer .api .Plugin ;
1212import the .bytecode .club .bytecodeviewer .api .PluginConsole ;
13+ import the .bytecode .club .bytecodeviewer .gui .components .MultipleChoiceDialogue ;
1314
1415import static the .bytecode .club .bytecodeviewer .Constants .*;
1516
3839 * @author Righteous
3940 */
4041
41- public class ZStringArrayDecrypter extends Plugin {
42-
42+ public class ZStringArrayDecrypter extends Plugin
43+ {
4344 PluginConsole gui = new PluginConsole ("ZStringArray Decrypter" );
4445 StringBuilder out = new StringBuilder ();
4546
4647 @ Override
47- public void execute (ArrayList <ClassNode > classNodeList ) {
48- JOptionPane pane = new JOptionPane (
48+ public void execute (ArrayList <ClassNode > classNodeList )
49+ {
50+ MultipleChoiceDialogue dialogue = new MultipleChoiceDialogue ("Bytecode Viewer - WARNING" ,
4951 "WARNING: This will load the classes into the JVM and execute the initialize function"
50- + nl + "for each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE."
51- );
52- Object [] options = new String []{"Continue" , "Cancel" };
53- pane .setOptions (options );
54- JDialog dialog = pane .createDialog (BytecodeViewer .viewer ,
55- "Bytecode Viewer - WARNING" );
56- dialog .setVisible (true );
57- Object obj = pane .getValue ();
58- int result = -1 ;
59- for (int k = 0 ; k < options .length ; k ++)
60- if (options [k ].equals (obj ))
61- result = k ;
52+ + nl + "for each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE." ,
53+ new String []{"Continue" , "Cancel" });
6254
63- if (result == 0 ) {
55+ if (dialogue .promptChoice () == 0 )
56+ {
6457 boolean needsWarning = false ;
6558 for (Class <?> debug :
66- Objects .requireNonNull (the .bytecode .club .bytecodeviewer .api .BytecodeViewer .loadClassesIntoClassLoader ())) {
67- try {
59+ Objects .requireNonNull (the .bytecode .club .bytecodeviewer .api .BytecodeViewer .loadClassesIntoClassLoader ()))
60+ {
61+ try
62+ {
6863 Field [] fields = debug .getDeclaredFields ();
69- for (Field field : fields ) {
70- if (field .getName ().equals ("z" )) {
64+ for (Field field : fields )
65+ {
66+ if (field .getName ().equals ("z" ))
67+ {
7168 out .append (debug .getName ()).append (":" ).append (nl );
7269 field .setAccessible (true );
73- if (field .get (null ) != null && field .get (null ) instanceof String [] && Modifier .isStatic (field .getModifiers ()) && Modifier .isFinal (field .getModifiers ())) {
70+ if (field .get (null ) != null && field .get (null ) instanceof String []
71+ && Modifier .isStatic (field .getModifiers ()) && Modifier .isFinal (field .getModifiers ()))
72+ {
7473 String [] fieldVal = (String []) field .get (null );
75- for (int i = 0 ; i < fieldVal .length ; i ++) {
74+ for (int i = 0 ; i < fieldVal .length ; i ++)
7675 out .append (" z[" ).append (i ).append ("] = " ).append (fieldVal [i ]).append (nl );
77- }
7876 }
7977 }
8078 }
81- } catch (NoClassDefFoundError | Exception e ) {
79+ }
80+ catch (NoClassDefFoundError | Exception e )
81+ {
8282 System .err .println ("Failed loading class " + debug .getName ());
8383 e .printStackTrace ();
8484 needsWarning = true ;
8585 }
8686 }
8787
88- if (needsWarning ) {
88+ if (needsWarning )
89+ {
8990 BytecodeViewer .showMessage ("Some classes failed to decrypt, if you'd like to decrypt all of them"
9091 + nl + "makes sure you include ALL the libraries it requires." );
9192 }
@@ -94,4 +95,4 @@ public void execute(ArrayList<ClassNode> classNodeList) {
9495 gui .setVisible (true );
9596 }
9697 }
97- }
98+ }
0 commit comments