Skip to content

Commit 7f46409

Browse files
committed
Rename main class
1 parent 23215b0 commit 7f46409

28 files changed

+223
-223
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<configuration>
4545
<transformers>
4646
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
47-
<mainClass>the.bytecode.club.jda.BytecodeViewer</mainClass>
47+
<mainClass>the.bytecode.club.jda.JDA</mainClass>
4848
</transformer>
4949
</transformers>
5050
</configuration>

src/main/java/the/bytecode/club/jda/CommandLineInput.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public CommandLineInput(String[] args) throws ParseException
3434
static
3535
{
3636
options.addOption(new Option("help", null, false, "prints the help menu."));
37-
options.addOption(new Option("list", null, false, "lists all the available decompilers for JDA " + BytecodeViewer.version + "."));
37+
options.addOption(new Option("list", null, false, "lists all the available decompilers for JDA " + JDA.version + "."));
3838
options.addOption(new Option("decompiler", null, true, "sets the decompiler, procyon by default."));
3939
options.addOption(new Option("i", null, true, "sets the input."));
4040
options.addOption(new Option("o", null, true, "sets the output."));
@@ -166,8 +166,8 @@ else if ((use = Decompiler.getByName(parsed.getOptionValue("decompiler"))) == nu
166166
}
167167

168168
System.out.println("Decompiling " + input.getAbsolutePath() + " with " + use.getName());
169-
BytecodeViewer.openFiles(new File[] { input }, false);
170-
String containerName = BytecodeViewer.files.get(0).name;
169+
JDA.openFiles(new File[] { input }, false);
170+
String containerName = JDA.files.get(0).name;
171171
Thread.sleep(5 * 1000);
172172
if (target.equalsIgnoreCase("all"))
173173
{
@@ -177,8 +177,8 @@ else if ((use = Decompiler.getByName(parsed.getOptionValue("decompiler"))) == nu
177177
{
178178
try
179179
{
180-
ClassNode cn = BytecodeViewer.getClassNode(containerName, target);
181-
byte[] bytes = BytecodeViewer.getClassBytes(containerName, target);
180+
ClassNode cn = JDA.getClassNode(containerName, target);
181+
byte[] bytes = JDA.getClassBytes(containerName, target);
182182
String contents = use.decompileClassNode(cn, bytes);
183183
FileUtils.writeStringToFile(output, contents, "UTF-8");
184184
}
@@ -188,7 +188,7 @@ else if ((use = Decompiler.getByName(parsed.getOptionValue("decompiler"))) == nu
188188
}
189189
}
190190
System.out.println("Finished.");
191-
System.out.println("Java DisAssembler CLI v" + BytecodeViewer.version);
191+
System.out.println("Java DisAssembler CLI v" + JDA.version);
192192
System.exit(0);
193193
}
194194
catch (Exception e)

src/main/java/the/bytecode/club/jda/BytecodeViewer.java renamed to src/main/java/the/bytecode/club/jda/JDA.java

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
import java.util.List;
2323
import java.util.Map;
2424

25-
public class BytecodeViewer
25+
public class JDA
2626
{
27-
2827
/*per version*/
2928
public static final String version = "0.0.1";
3029
public static final boolean previewCopy = false;
@@ -92,11 +91,11 @@ public static void main(String[] args)
9291
Settings.loadGUI();
9392
viewer = new MainViewerGUI();
9493
Boot.boot();
95-
BytecodeViewer.BOOT(args, false);
94+
JDA.BOOT(args, false);
9695
}
9796
else
9897
{
99-
BytecodeViewer.BOOT(args, true);
98+
JDA.BOOT(args, true);
10099
input.executeCommandLine();
101100
}
102101
}
@@ -300,9 +299,9 @@ public static void openFiles(final File[] files, boolean recentFiles)
300299
if (recentFiles)
301300
for (File f : files)
302301
if (f.exists())
303-
BytecodeViewer.addRecentFile(f);
302+
JDA.addRecentFile(f);
304303

305-
BytecodeViewer.viewer.setIcon(true);
304+
JDA.viewer.setIcon(true);
306305
update = true;
307306

308307
Thread t = new Thread()
@@ -360,7 +359,7 @@ public void run()
360359
}
361360
}
362361
container.files = files;
363-
BytecodeViewer.files.add(container);
362+
JDA.files.add(container);
364363
}
365364
else
366365
{
@@ -390,7 +389,7 @@ else if (fn.endsWith(".class"))
390389
FileContainer container = new FileContainer(f);
391390
container.files.put(cn.name + ".class", bytes);
392391
container.add(cn);
393-
BytecodeViewer.files.add(container);
392+
JDA.files.add(container);
394393
}
395394
else
396395
{
@@ -413,7 +412,7 @@ else if (fn.endsWith(".class"))
413412

414413
FileContainer container = new FileContainer(f);
415414
container.files = files;
416-
BytecodeViewer.files.add(container);
415+
JDA.files.add(container);
417416
}
418417
}
419418
}
@@ -425,7 +424,7 @@ else if (fn.endsWith(".class"))
425424
}
426425
finally
427426
{
428-
BytecodeViewer.viewer.setIcon(false);
427+
JDA.viewer.setIcon(false);
429428
if (update)
430429
try
431430
{
@@ -701,7 +700,7 @@ public static void checkHotKey(KeyEvent e)
701700
JFileChooser fc = new JFileChooser();
702701
try
703702
{
704-
fc.setSelectedFile(new File(BytecodeViewer.lastDirectory));
703+
fc.setSelectedFile(new File(JDA.lastDirectory));
705704
}
706705
catch (Exception e2)
707706
{
@@ -731,16 +730,16 @@ public String getDescription()
731730
});
732731
fc.setFileHidingEnabled(false);
733732
fc.setAcceptAllFileFilterUsed(false);
734-
int returnVal = fc.showOpenDialog(BytecodeViewer.viewer);
733+
int returnVal = fc.showOpenDialog(JDA.viewer);
735734

736735
if (returnVal == JFileChooser.APPROVE_OPTION)
737736
{
738-
BytecodeViewer.lastDirectory = fc.getSelectedFile().getAbsolutePath();
737+
JDA.lastDirectory = fc.getSelectedFile().getAbsolutePath();
739738
try
740739
{
741-
BytecodeViewer.viewer.setIcon(true);
742-
BytecodeViewer.openFiles(new File[] { fc.getSelectedFile() }, true);
743-
BytecodeViewer.viewer.setIcon(false);
740+
JDA.viewer.setIcon(true);
741+
JDA.openFiles(new File[] { fc.getSelectedFile() }, true);
742+
JDA.viewer.setIcon(false);
744743
}
745744
catch (Exception e1)
746745
{
@@ -751,7 +750,7 @@ public String getDescription()
751750
else if ((e.getKeyCode() == KeyEvent.VK_N) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0))
752751
{
753752
last = System.currentTimeMillis();
754-
BytecodeViewer.resetWorkSpace(true);
753+
JDA.resetWorkSpace(true);
755754
}
756755
else if ((e.getKeyCode() == KeyEvent.VK_R) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0))
757756
{
@@ -762,9 +761,9 @@ else if ((e.getKeyCode() == KeyEvent.VK_S) && ((e.getModifiers() & KeyEvent.CTRL
762761
{
763762
last = System.currentTimeMillis();
764763

765-
if (BytecodeViewer.getLoadedClasses().isEmpty())
764+
if (JDA.getLoadedClasses().isEmpty())
766765
{
767-
BytecodeViewer.showMessage("First open a class, jar, or zip file.");
766+
JDA.showMessage("First open a class, jar, or zip file.");
768767
return;
769768
}
770769

@@ -801,7 +800,7 @@ public String getDescription()
801800
JOptionPane pane = new JOptionPane("Are you sure you wish to overwrite this existing file?");
802801
Object[] options = new String[] { "Yes", "No" };
803802
pane.setOptions(options);
804-
JDialog dialog = pane.createDialog(BytecodeViewer.viewer, "Java DisAssembler - Overwrite File");
803+
JDialog dialog = pane.createDialog(JDA.viewer, "Java DisAssembler - Overwrite File");
805804
dialog.setVisible(true);
806805
Object obj = pane.getValue();
807806
int result = -1;
@@ -821,14 +820,14 @@ public String getDescription()
821820

822821
final File file2 = file;
823822

824-
BytecodeViewer.viewer.setIcon(true);
823+
JDA.viewer.setIcon(true);
825824
Thread t = new Thread()
826825
{
827826
@Override
828827
public void run()
829828
{
830-
JarUtils.saveAsJar(BytecodeViewer.getLoadedBytes(), file2.getAbsolutePath());
831-
BytecodeViewer.viewer.setIcon(false);
829+
JarUtils.saveAsJar(JDA.getLoadedBytes(), file2.getAbsolutePath());
830+
JDA.viewer.setIcon(false);
832831
}
833832
};
834833
t.start();

src/main/java/the/bytecode/club/jda/JarUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static void put(final File jarFile) throws IOException
6868
}
6969
jis.close();
7070
container.files = files;
71-
BytecodeViewer.files.add(container);
71+
JDA.files.add(container);
7272

7373
}
7474

@@ -239,7 +239,7 @@ public static void saveAsJar(ArrayList<ClassNode> nodeList, String path, String
239239
out.write((manifest.trim() + "\r\n\r\n").getBytes());
240240
out.closeEntry();
241241

242-
for (FileContainer container : BytecodeViewer.files)
242+
for (FileContainer container : JDA.files)
243243
for (Entry<String, byte[]> entry : container.files.entrySet())
244244
{
245245
String filename = entry.getKey();
@@ -341,7 +341,7 @@ public static void saveAsJar(Map<String, byte[]> nodeList, String path)
341341
}
342342
}
343343

344-
for (FileContainer container : BytecodeViewer.files)
344+
for (FileContainer container : JDA.files)
345345
for (Entry<String, byte[]> entry : container.files.entrySet())
346346
{
347347
String filename = entry.getKey();

src/main/java/the/bytecode/club/jda/SecurityMan.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public void stopBlocking()
2424
if (executedClass.equals("CFRDecompiler") ||
2525
executedClass.equals("ProcyonDecompiler") ||
2626
executedClass.equals("FernFlowerDecompiler") ||
27-
executedClass.equals("BytecodeViewer") ||
27+
executedClass.equals("JDA") ||
2828
executedClass.equals("the.bytecode.club.bytecodeviewer.compilers.JavaCompiler"))
2929
{
3030
blocking = false;

src/main/java/the/bytecode/club/jda/Settings.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static void saveGUI()
4444
rootSettings.add(setting.getKey(), setting.getValue().get());
4545
}
4646
}
47-
FileOutputStream out = new FileOutputStream(BytecodeViewer.settingsFile);
47+
FileOutputStream out = new FileOutputStream(JDA.settingsFile);
4848
out.write(settings.toString().getBytes("UTF-8"));
4949
out.close();
5050
}
@@ -61,7 +61,7 @@ public static void loadGUI()
6161
JsonObject settings = new JsonObject();
6262
try
6363
{
64-
settings = JsonObject.readFrom(new FileReader(BytecodeViewer.settingsFile));
64+
settings = JsonObject.readFrom(new FileReader(JDA.settingsFile));
6565
}
6666
catch (ParseException | UnsupportedOperationException e)
6767
{

src/main/java/the/bytecode/club/jda/api/BytecodeViewer.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package the.bytecode.club.jda.api;
22

33
import org.objectweb.asm.tree.ClassNode;
4+
import the.bytecode.club.jda.JDA;
45
import the.bytecode.club.jda.JarUtils;
56
import the.bytecode.club.jda.decompilers.Decompiler;
67

@@ -33,7 +34,7 @@ public class BytecodeViewer
3334
*/
3435
public static ClassNodeLoader getClassNodeLoader()
3536
{
36-
return the.bytecode.club.jda.BytecodeViewer.loader;
37+
return JDA.loader;
3738
}
3839

3940
/**
@@ -59,7 +60,7 @@ public static URLClassLoader getClassLoaderInstance()
5960
@SuppressWarnings("deprecation")
6061
public static List<Class<?>> loadClassesIntoClassLoader(ArrayList<ClassNode> nodeList) throws IOException, ClassNotFoundException
6162
{
62-
File f = new File(the.bytecode.club.jda.BytecodeViewer.tempDir, "loaded_temp.jar");
63+
File f = new File(JDA.tempDir, "loaded_temp.jar");
6364
JarUtils.saveAsJarClassesOnly(nodeList, f.getAbsolutePath());
6465

6566
JarFile jarFile = new JarFile("" + f.getAbsolutePath());
@@ -102,8 +103,8 @@ public static List<Class<?>> loadAllClassesIntoClassLoader() throws ClassNotFoun
102103
*/
103104
public static void createNewClassNodeLoaderInstance()
104105
{
105-
the.bytecode.club.jda.BytecodeViewer.loader.clear();
106-
the.bytecode.club.jda.BytecodeViewer.loader = new ClassNodeLoader();
106+
JDA.loader.clear();
107+
JDA.loader = new ClassNodeLoader();
107108
}
108109

109110
/**
@@ -113,7 +114,7 @@ public static void createNewClassNodeLoaderInstance()
113114
*/
114115
public static void startPlugin(File plugin)
115116
{
116-
the.bytecode.club.jda.BytecodeViewer.startPlugin(plugin);
117+
JDA.startPlugin(plugin);
117118
}
118119

119120
/**
@@ -124,7 +125,7 @@ public static void startPlugin(File plugin)
124125
*/
125126
public static void openFiles(File[] files, boolean recentFiles)
126127
{
127-
the.bytecode.club.jda.BytecodeViewer.openFiles(files, recentFiles);
128+
JDA.openFiles(files, recentFiles);
128129
}
129130

130131
/**
@@ -134,7 +135,7 @@ public static void openFiles(File[] files, boolean recentFiles)
134135
*/
135136
public static ClassNode getCurrentlyOpenedClassNode()
136137
{
137-
return the.bytecode.club.jda.BytecodeViewer.getCurrentlyOpenedClassNode();
138+
return JDA.getCurrentlyOpenedClassNode();
138139
}
139140

140141
/**
@@ -145,7 +146,7 @@ public static ClassNode getCurrentlyOpenedClassNode()
145146
*/
146147
public static ClassNode getClassNode(String containerName, String name)
147148
{
148-
return the.bytecode.club.jda.BytecodeViewer.getClassNode(containerName, name);
149+
return JDA.getClassNode(containerName, name);
149150
}
150151

151152
/**
@@ -155,7 +156,7 @@ public static ClassNode getClassNode(String containerName, String name)
155156
*/
156157
public static ArrayList<ClassNode> getLoadedClasses()
157158
{
158-
return the.bytecode.club.jda.BytecodeViewer.getLoadedClasses();
159+
return JDA.getLoadedClasses();
159160
}
160161

161162
/**
@@ -166,7 +167,7 @@ public static ArrayList<ClassNode> getLoadedClasses()
166167
*/
167168
public static void resetWorkSpace(boolean ask)
168169
{
169-
the.bytecode.club.jda.BytecodeViewer.resetWorkSpace(ask);
170+
JDA.resetWorkSpace(ask);
170171
}
171172

172173
/**
@@ -177,7 +178,7 @@ public static void resetWorkSpace(boolean ask)
177178
*/
178179
public static void setBusy(boolean busy)
179180
{
180-
the.bytecode.club.jda.BytecodeViewer.viewer.setIcon(busy);
181+
JDA.viewer.setIcon(busy);
181182
}
182183

183184
/**
@@ -187,7 +188,7 @@ public static void setBusy(boolean busy)
187188
*/
188189
public static void showMessage(String message)
189190
{
190-
the.bytecode.club.jda.BytecodeViewer.showMessage(message);
191+
JDA.showMessage(message);
191192
}
192193

193194
/**

0 commit comments

Comments
 (0)