GP-873: Fixed a bug that prevented GhidraDev projects from recognizing

extensions
installed in the user's home Extension directory
This commit is contained in:
Ryan Kurtz 2021-04-22 08:55:08 -04:00
parent 1e39c2ac82
commit a503ded1fc
5 changed files with 261 additions and 11 deletions

View file

@ -83,13 +83,20 @@ public class SystemUtilities {
Class<?> myClass = SystemUtilities.class; Class<?> myClass = SystemUtilities.class;
ClassLoader loader = myClass.getClassLoader(); ClassLoader loader = myClass.getClassLoader();
if (loader == null) { if (loader == null) {
// Loaded with the bootstrap class loader...definitely dev mode. // Can happen when called from the Eclipse GhidraDev plugin
// The Eclipse GhidraDevPlugin does this when it's running from dev mode. return false;
return true;
} }
String name = myClass.getName().replace('.', '/') + ".class"; String name = myClass.getName().replace('.', '/') + ".class";
URL url = loader.getResource(name); String protocol = loader.getResource(name).getProtocol();
return !"jar".equals(url.getProtocol()); switch(protocol) {
case "file": // Source repository mode (class files)
return true;
case "jar": // Release mode (jar files)
case "bundleresource": // Eclipse GhidraDev mode
return false;
default: // Unexpected protocol...assume a development mode
return true;
}
} }
/** /**

View file

@ -2,7 +2,7 @@
<feature <feature
id="ghidra.ghidradev" id="ghidra.ghidradev"
label="GhidraDev" label="GhidraDev"
version="2.1.2.qualifier" version="2.1.3.qualifier"
provider-name="Ghidra"> provider-name="Ghidra">
<description> <description>

File diff suppressed because one or more lines are too long

View file

@ -19,7 +19,7 @@
<h1>GhidraDev README</h1> <h1>GhidraDev README</h1>
<p>GhidraDev provides support for developing and debugging Ghidra scripts and modules in Eclipse. <p>GhidraDev provides support for developing and debugging Ghidra scripts and modules in Eclipse.
</p> </p>
<p>The information provided in this document is effective as of GhidraDev 2.1.1 and is subject to <p>The information provided in this document is effective as of GhidraDev 2.1.3 and is subject to
change with future releases.</p> change with future releases.</p>
<ul> <ul>
@ -53,6 +53,8 @@ change with future releases.</p>
</ul> </ul>
<h2><a name="ChangeHistory"></a>Change History</h2> <h2><a name="ChangeHistory"></a>Change History</h2>
<p><u><b>2.1.3</b>:</u> Fixed a bug that prevented Ghidra projects from recognizing extensions
installed in the user's <i>~/.ghidra/.ghidra_&lt;version&gt;/Extensions</i> directory.</p>
<p><u><b>2.1.2</b>:</u> Fixed exception that occurred when creating a new Ghidra scripting project <p><u><b>2.1.2</b>:</u> Fixed exception that occurred when creating a new Ghidra scripting project
if a <i>~/ghidra_scripts</i> directory does not exist.</p> if a <i>~/ghidra_scripts</i> directory does not exist.</p>
<p><u><b>2.1.1</b>:</u> <p><u><b>2.1.1</b>:</u>

View file

@ -3,7 +3,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: GhidraDev Bundle-Name: GhidraDev
Bundle-SymbolicName: ghidra.ghidradev;singleton:=true Bundle-SymbolicName: ghidra.ghidradev;singleton:=true
Bundle-Version: 2.1.2.qualifier Bundle-Version: 2.1.3.qualifier
Bundle-Activator: ghidradev.Activator Bundle-Activator: ghidradev.Activator
Require-Bundle: org.eclipse.ant.core;bundle-version="3.5.200", Require-Bundle: org.eclipse.ant.core;bundle-version="3.5.200",
org.eclipse.buildship.core;bundle-version="3.0.0", org.eclipse.buildship.core;bundle-version="3.0.0",