mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 12:00:04 +02:00
GP-3315 - Updated plugin restoring to verify the requested package
exists
This commit is contained in:
parent
528c0a8b94
commit
f30c53aafc
2 changed files with 25 additions and 0 deletions
|
@ -199,6 +199,12 @@ public class PluginClassManager {
|
||||||
includedClasses.add(excludedClassName);
|
includedClasses.add(excludedClassName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!PluginPackage.exists(packageName)) {
|
||||||
|
Msg.warn(this, "Unable to find plugin pacakge '" + packageName +
|
||||||
|
"' while restoring plugins from xml");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
PluginPackage pluginPackage = PluginPackage.getPluginPackage(packageName);
|
PluginPackage pluginPackage = PluginPackage.getPluginPackage(packageName);
|
||||||
List<PluginDescription> pluginDescriptionList = packageMap.get(pluginPackage);
|
List<PluginDescription> pluginDescriptionList = packageMap.get(pluginPackage);
|
||||||
if (pluginDescriptionList == null) {
|
if (pluginDescriptionList == null) {
|
||||||
|
|
|
@ -35,6 +35,25 @@ public abstract class PluginPackage implements ExtensionPoint, Comparable<Plugin
|
||||||
|
|
||||||
private static Map<String, PluginPackage> packageMap;
|
private static Map<String, PluginPackage> packageMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the system has found a plugin package for the given name
|
||||||
|
* @param packageName the package name
|
||||||
|
* @return true if the system has found a plugin package for the given name
|
||||||
|
*/
|
||||||
|
public static boolean exists(String packageName) {
|
||||||
|
if (packageMap == null) {
|
||||||
|
packageMap = createPackageMap();
|
||||||
|
}
|
||||||
|
PluginPackage pluginPackage = packageMap.get(packageName.toLowerCase());
|
||||||
|
return pluginPackage != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the existing plugin package with the given name. If no package exists, then the
|
||||||
|
* {@link MiscellaneousPluginPackage} will be returned.
|
||||||
|
* @param packageName the package name
|
||||||
|
* @return the package
|
||||||
|
*/
|
||||||
public static PluginPackage getPluginPackage(String packageName) {
|
public static PluginPackage getPluginPackage(String packageName) {
|
||||||
if (packageMap == null) {
|
if (packageMap == null) {
|
||||||
packageMap = createPackageMap();
|
packageMap = createPackageMap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue