From 1014eb099c7fc8c5625b0a37d256873fd2726eab Mon Sep 17 00:00:00 2001 From: Ryan Kurtz Date: Fri, 24 Jul 2026 08:49:59 -0400 Subject: [PATCH] GP-0: Make the setting of the Linux application name in Ghidra.java publicly accessible for PyGhidra to use (#8362) --- .../Utility/src/main/java/ghidra/Ghidra.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Ghidra/Framework/Utility/src/main/java/ghidra/Ghidra.java b/Ghidra/Framework/Utility/src/main/java/ghidra/Ghidra.java index 9b9bc35e9b..2f8cfd39d9 100644 --- a/Ghidra/Framework/Utility/src/main/java/ghidra/Ghidra.java +++ b/Ghidra/Framework/Utility/src/main/java/ghidra/Ghidra.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -37,11 +37,19 @@ public class Ghidra { * details on what went wrong. */ public static void main(String[] args) throws Exception { - - // Poke the Taskbar class in order to set the Linux application name to this class's - // fully qualified class name (with . replaced by -). If we don't do this here, the next - // time it gets done is in a new thread, which results in the application name being set to - // "java-lang-thread". + setLinuxApplicationName(); + GhidraLauncher.launch(args); + } + + /** + * Poke the {@link Taskbar} class in order to set the Linux application name to this class's + * fully qualified class name (with . replaced by -). If we don't do this here, the next + * time it gets done is in a new thread, which results in the application name being set to + * "java-lang-thread". + *

+ * This method should be publicly accessible so other tools can access it (i.e., PyGhidra) + */ + public static void setLinuxApplicationName() { try { Taskbar.isTaskbarSupported(); } @@ -49,8 +57,5 @@ public class Ghidra { // This can happen if we are running in a headless environment. We don't need to // worry about setting the application name in this case. } - - // Forward args to GhidraLauncher, which will perform the launch - GhidraLauncher.launch(args); } }