mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
Merge remote-tracking branch 'origin/patch'
Conflicts: Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/help/ProcessorListPlugin.java Ghidra/Framework/Gui/src/main/java/ghidra/util/HTMLUtilities.java
This commit is contained in:
commit
80d1031d01
50 changed files with 713 additions and 388 deletions
|
@ -23,11 +23,11 @@ import java.util.*;
|
|||
import generic.jar.ResourceFile;
|
||||
import ghidra.framework.ApplicationProperties;
|
||||
import ghidra.framework.GModule;
|
||||
import utility.application.ApplicationLayout;
|
||||
import ghidra.util.Msg;
|
||||
import utility.module.ModuleUtilities;
|
||||
|
||||
/**
|
||||
* The Ghidra jar application layout defines the customizable elements of the Ghidra application's
|
||||
* The Ghidra jar application layout defines the customizable elements of the Ghidra application's
|
||||
* directory structure when running in "single jar mode."
|
||||
*/
|
||||
public class GhidraJarApplicationLayout extends GhidraApplicationLayout {
|
||||
|
@ -51,7 +51,11 @@ public class GhidraJarApplicationLayout extends GhidraApplicationLayout {
|
|||
protected Collection<ResourceFile> findGhidraApplicationRootDirs() {
|
||||
List<ResourceFile> dirs = new ArrayList<>();
|
||||
String appPropPath = "/_Root/Ghidra/" + ApplicationProperties.PROPERTY_FILE;
|
||||
URL appPropUrl = ApplicationLayout.class.getResource(appPropPath);
|
||||
URL appPropUrl = getClass().getResource(appPropPath);
|
||||
if (appPropUrl == null) {
|
||||
throw new IllegalStateException(
|
||||
"The Ghidra Jar must have an application.properties file at " + appPropPath);
|
||||
}
|
||||
ResourceFile rootDir = fromUrl(appPropUrl).getParentFile();
|
||||
dirs.add(rootDir);
|
||||
return dirs;
|
||||
|
@ -79,7 +83,12 @@ public class GhidraJarApplicationLayout extends GhidraApplicationLayout {
|
|||
|
||||
@Override
|
||||
protected List<ResourceFile> findExtensionInstallationDirectories() {
|
||||
URL extensionInstallUrl = ApplicationLayout.class.getResource("/_Root/Ghidra/Extensions");
|
||||
String path = "/_Root/Ghidra/Extensions";
|
||||
URL extensionInstallUrl = getClass().getResource(path);
|
||||
if (extensionInstallUrl == null) {
|
||||
Msg.debug(this, "No Extensions dir found at " + path);
|
||||
return List.of();
|
||||
}
|
||||
ResourceFile extensionInstallDir = fromUrl(extensionInstallUrl);
|
||||
return Collections.singletonList(extensionInstallDir);
|
||||
}
|
||||
|
@ -94,7 +103,7 @@ public class GhidraJarApplicationLayout extends GhidraApplicationLayout {
|
|||
String urlString = url.toExternalForm();
|
||||
try {
|
||||
// Decode the URL to replace things like %20 with real spaces.
|
||||
// Note: can't use URLDecoder.decode(String, Charset) because Utility must be
|
||||
// Note: can't use URLDecoder.decode(String, Charset) because Utility must be
|
||||
// Java 1.8 compatible.
|
||||
urlString = URLDecoder.decode(urlString, "UTF-8");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue