Added Thread Titles

This commit is contained in:
Konloch 2021-07-01 02:48:10 -07:00
parent 373fc38ad2
commit 007955b2ba
14 changed files with 37 additions and 34 deletions

View file

@ -121,7 +121,7 @@ public class BytecodeViewer
/** /**
* The version checker thread * The version checker thread
*/ */
private static final Thread versionChecker = new Thread(new VersionChecker()); private static final Thread versionChecker = new Thread(new VersionChecker(), "Version Checker");
/** /**
* Pings back to bytecodeviewer.com to be added into the total running statistics * Pings back to bytecodeviewer.com to be added into the total running statistics
@ -132,7 +132,7 @@ public class BytecodeViewer
} catch (Exception e) { } catch (Exception e) {
Configuration.pingback = false; Configuration.pingback = false;
} }
}); }, "Pingback");
/** /**
* Downloads & installs the krakatau & enjarify zips * Downloads & installs the krakatau & enjarify zips
@ -152,12 +152,12 @@ public class BytecodeViewer
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
}); }, "Install Fat-Jar");
/** /**
* Used to check incase booting failed for some reason, this kicks in as a fail safe * Used to check incase booting failed for some reason, this kicks in as a fail safe
*/ */
private static final Thread bootCheck = new Thread(new BootCheck()); private static final Thread bootCheck = new Thread(new BootCheck(), "Boot Check");
/** /**
* Main startup * Main startup
@ -221,7 +221,7 @@ public class BytecodeViewer
proc.destroy(); proc.destroy();
SettingsSerializer.saveSettings(); SettingsSerializer.saveSettings();
cleanup(); cleanup();
})); }, "Shutdown Hook"));
viewer.calledAfterLoad(); viewer.calledAfterLoad();
Settings.resetRecentFilesMenu(); Settings.resetRecentFilesMenu();
@ -533,7 +533,7 @@ public class BytecodeViewer
BytecodeViewer.viewer.updateBusyStatus(true); BytecodeViewer.viewer.updateBusyStatus(true);
Configuration.needsReDump = true; Configuration.needsReDump = true;
Thread t = new Thread(new ImportResource(files)); Thread t = new Thread(new ImportResource(files), "Import Resource");
t.start(); t.start();
} }
@ -594,7 +594,7 @@ public class BytecodeViewer
*/ */
public static void cleanupAsync() public static void cleanupAsync()
{ {
Thread cleanupThread = new Thread(BytecodeViewer::cleanup); Thread cleanupThread = new Thread(BytecodeViewer::cleanup, "Cleanup");
cleanupThread.start(); cleanupThread.start();
} }
@ -656,7 +656,7 @@ public class BytecodeViewer
BytecodeViewer.resetWorkSpace(true); BytecodeViewer.resetWorkSpace(true);
} else if ((e.getKeyCode() == KeyEvent.VK_T) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0)) { } else if ((e.getKeyCode() == KeyEvent.VK_T) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0)) {
Configuration.lastHotKeyExecuted = System.currentTimeMillis(); Configuration.lastHotKeyExecuted = System.currentTimeMillis();
Thread t = new Thread(() -> BytecodeViewer.compile(true)); Thread t = new Thread(() -> BytecodeViewer.compile(true), "Compile");
t.start(); t.start();
} else if ((e.getKeyCode() == KeyEvent.VK_R) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0)) { } else if ((e.getKeyCode() == KeyEvent.VK_R) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0)) {
Configuration.lastHotKeyExecuted = System.currentTimeMillis(); Configuration.lastHotKeyExecuted = System.currentTimeMillis();
@ -673,7 +673,8 @@ public class BytecodeViewer
return; return;
} }
Thread t = new Thread(() -> { Thread resourceExport = new Thread(() ->
{
if (viewer.compileOnSave.isSelected() && !BytecodeViewer.compile(false)) if (viewer.compileOnSave.isSelected() && !BytecodeViewer.compile(false))
return; return;
@ -705,16 +706,18 @@ public class BytecodeViewer
final File file2 = file; final File file2 = file;
BytecodeViewer.viewer.updateBusyStatus(true); BytecodeViewer.viewer.updateBusyStatus(true);
Thread t1 = new Thread(() -> { Thread jarExport = new Thread(() -> {
JarUtils.saveAsJar(BytecodeViewer.getLoadedClasses(), JarUtils.saveAsJar(BytecodeViewer.getLoadedClasses(),
file2.getAbsolutePath()); file2.getAbsolutePath());
BytecodeViewer.viewer.updateBusyStatus(false); BytecodeViewer.viewer.updateBusyStatus(false);
}); }, "Jar Export");
t1.start(); jarExport.start();
} }
}); }, "Resource Export");
t.start(); resourceExport.start();
} else if ((e.getKeyCode() == KeyEvent.VK_W) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0)) { }
else if ((e.getKeyCode() == KeyEvent.VK_W) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0))
{
Configuration.lastHotKeyExecuted = System.currentTimeMillis(); Configuration.lastHotKeyExecuted = System.currentTimeMillis();
if (viewer.workPane.getCurrentViewer() != null) if (viewer.workPane.getCurrentViewer() != null)
viewer.workPane.tabs.remove(viewer.workPane.getCurrentViewer()); viewer.workPane.tabs.remove(viewer.workPane.getCurrentViewer());

View file

@ -42,7 +42,7 @@ public class SettingsSerializer
public static void saveSettingsAsync() public static void saveSettingsAsync()
{ {
Thread saveThread = new Thread(()-> saveSettings()); Thread saveThread = new Thread(SettingsSerializer::saveSettings, "Save Settings");
saveThread.start(); saveThread.start();
} }

View file

@ -106,7 +106,7 @@ public class JavaCompiler extends InternalCompiler
System.out.println("Force killing javac process, assuming it's gotten stuck"); System.out.println("Force killing javac process, assuming it's gotten stuck");
process.destroyForcibly().destroy(); process.destroyForcibly().destroy();
} }
}); }, "Javac Fail-Safe");
failSafe.start(); failSafe.start();
int exitValue = process.waitFor(); int exitValue = process.waitFor();

View file

@ -791,7 +791,7 @@ public class MainViewerGUI extends JFrame
public void compileOnNewThread() public void compileOnNewThread()
{ {
Thread t = new Thread(() -> BytecodeViewer.compile(true)); Thread t = new Thread(() -> BytecodeViewer.compile(true), "Compile");
t.start(); t.start();
} }

View file

@ -65,7 +65,7 @@ public class ExportJar extends JFrame
{ {
JarUtils.saveAsJar(BytecodeViewer.getLoadedClasses(), jarPath, manifest.getText()); JarUtils.saveAsJar(BytecodeViewer.getLoadedClasses(), jarPath, manifest.getText());
BytecodeViewer.viewer.updateBusyStatus(false); BytecodeViewer.viewer.updateBusyStatus(false);
}); }, "Jar Export");
t.start(); t.start();
dispose(); dispose();
}); });

View file

@ -140,7 +140,7 @@ public class WorkPaneMainComponent extends VisibleComponent
refreshClass = new JButton("Refresh"); refreshClass = new JButton("Refresh");
refreshClass.addActionListener((event)->{ refreshClass.addActionListener((event)->{
Thread t = new Thread(() -> new WorkPaneRefresh(event).run()); Thread t = new Thread(() -> new WorkPaneRefresh(event).run(), "Refresh");
t.start(); t.start();
}); });

View file

@ -181,7 +181,7 @@ public class ClassViewer extends ResourceViewer
resourceViewPanel2.updateThread.startNewThread(); resourceViewPanel2.updateThread.startNewThread();
if (resourceViewPanel3.decompilerViewIndex > 0) if (resourceViewPanel3.decompilerViewIndex > 0)
resourceViewPanel3.updateThread.startNewThread(); resourceViewPanel3.updateThread.startNewThread();
}); }, "ClassViewer Temp Dump");
t.start(); t.start();
if (isPanel1Editable() || isPanel2Editable() || isPanel3Editable()) if (isPanel1Editable() || isPanel2Editable() || isPanel3Editable())

View file

@ -64,7 +64,7 @@ public abstract class PaneUpdaterThread implements Runnable
public void startNewThread() public void startNewThread()
{ {
thread = new Thread(this); thread = new Thread(this, "Pane Update");
thread.start(); thread.start();
} }

View file

@ -186,7 +186,7 @@ public class ResourceDecompiling
BytecodeViewer.viewer.updateBusyStatus(false); BytecodeViewer.viewer.updateBusyStatus(false);
} }
} }
}); }, "Decompile Thread");
decompileThread.start(); decompileThread.start();
} }
@ -412,7 +412,7 @@ public class ResourceDecompiling
BytecodeViewer.viewer.updateBusyStatus(false); BytecodeViewer.viewer.updateBusyStatus(false);
} }
} }
}); }, "Decompile Thread");
decompileThread.start(); decompileThread.start();
} }
} }

View file

@ -113,12 +113,12 @@ public class APKExport implements Exporter
{ {
APKTool.buildAPK(new File(input), file2, finalContainer); APKTool.buildAPK(new File(input), file2, finalContainer);
BytecodeViewer.viewer.updateBusyStatus(false); BytecodeViewer.viewer.updateBusyStatus(false);
}); }, "Process APK");
buildAPKThread.start(); buildAPKThread.start();
}); }, "Jar Export");
saveThread.start(); saveThread.start();
} }
}); }, "Resource Export");
exportThread.start(); exportThread.start();
} }
} }

View file

@ -77,12 +77,12 @@ public class DexExport implements Exporter
Dex2Jar.saveAsDex(new File(input), outputPath); Dex2Jar.saveAsDex(new File(input), outputPath);
BytecodeViewer.viewer.updateBusyStatus(false); BytecodeViewer.viewer.updateBusyStatus(false);
}); }, "Process DEX");
saveAsDex.start(); saveAsDex.start();
}); }, "Jar Export");
saveAsJar.start(); saveAsJar.start();
} }
}); }, "Resource Export");
exportThread.start(); exportThread.start();
} }
} }

View file

@ -61,7 +61,7 @@ public class RunnableJarExporter implements Exporter
new ExportJar(path).setVisible(true); new ExportJar(path).setVisible(true);
} }
}); }, "Runnable Jar Export");
exportThread.start(); exportThread.start();
} }
} }

View file

@ -65,10 +65,10 @@ public class ZipExport implements Exporter
{ {
JarUtils.saveAsJar(BytecodeViewer.getLoadedClasses(), file2.getAbsolutePath()); JarUtils.saveAsJar(BytecodeViewer.getLoadedClasses(), file2.getAbsolutePath());
BytecodeViewer.viewer.updateBusyStatus(false); BytecodeViewer.viewer.updateBusyStatus(false);
}); }, "Jar Export");
saveThread.start(); saveThread.start();
} }
}); }, "Resource Export");
exportThread.start(); exportThread.start();
} }
} }

View file

@ -197,7 +197,7 @@ public class VersionChecker implements Runnable
new ExceptionUI(e); new ExceptionUI(e);
} }
}); }, "Downloader");
downloadThread.start(); downloadThread.start();
} }
} }