mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
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:
parent
1e39c2ac82
commit
a503ded1fc
5 changed files with 261 additions and 11 deletions
|
@ -83,13 +83,20 @@ public class SystemUtilities {
|
|||
Class<?> myClass = SystemUtilities.class;
|
||||
ClassLoader loader = myClass.getClassLoader();
|
||||
if (loader == null) {
|
||||
// Loaded with the bootstrap class loader...definitely dev mode.
|
||||
// The Eclipse GhidraDevPlugin does this when it's running from dev mode.
|
||||
return true;
|
||||
// Can happen when called from the Eclipse GhidraDev plugin
|
||||
return false;
|
||||
}
|
||||
String name = myClass.getName().replace('.', '/') + ".class";
|
||||
URL url = loader.getResource(name);
|
||||
return !"jar".equals(url.getProtocol());
|
||||
String protocol = loader.getResource(name).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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue