mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 12:00:04 +02:00
clean up OSGi state reporting and help page
This commit is contained in:
parent
fbd564caca
commit
a3320ef3ab
3 changed files with 24 additions and 17 deletions
|
@ -162,8 +162,16 @@
|
||||||
<li> <span style="font-weight:bold;color:#009900">active</span> - the bundle is built and classes within
|
<li> <span style="font-weight:bold;color:#009900">active</span> - the bundle is built and classes within
|
||||||
can be loaded
|
can be loaded
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
|
||||||
<p>The normally hidden column "OSGi State" is also available.</p>
|
<p>The normally hidden column "OSGi State" is also available. In addition to the Bundle
|
||||||
|
state, this column will report</p>
|
||||||
|
<ul style="padding-left:8em">
|
||||||
|
<li> (DISABLED) - if the bundle is disabled
|
||||||
|
<li> (ENABLED) - if the bundle is enabled, but the bundle manager has no handle to it.
|
||||||
|
If this state persists, there is likely an internal error
|
||||||
|
<li> (UNINSTALLED) - if the bundle is enabled, but the framework has released its handle.
|
||||||
|
This is typical for an inactive bundle
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<h2><a name="AddBundles"/><a name="RemoveBundles"/>Adding and removing bundles from the manager</h2>
|
<h2><a name="AddBundles"/><a name="RemoveBundles"/>Adding and removing bundles from the manager</h2>
|
||||||
|
|
|
@ -193,14 +193,14 @@ public class BundleHost {
|
||||||
public Collection<GhidraBundle> add(List<ResourceFile> bundleFiles, boolean enabled,
|
public Collection<GhidraBundle> add(List<ResourceFile> bundleFiles, boolean enabled,
|
||||||
boolean systemBundle) {
|
boolean systemBundle) {
|
||||||
Map<ResourceFile, GhidraBundle> newBundleMap = bundleFiles.stream()
|
Map<ResourceFile, GhidraBundle> newBundleMap = bundleFiles.stream()
|
||||||
.collect(Collectors.toUnmodifiableMap(Function.identity(),
|
.collect(Collectors.toUnmodifiableMap(Function.identity(),
|
||||||
bundleFile -> createGhidraBundle(BundleHost.this, bundleFile, enabled,
|
bundleFile -> createGhidraBundle(BundleHost.this, bundleFile, enabled,
|
||||||
systemBundle)));
|
systemBundle)));
|
||||||
fileToBundleMap.putAll(newBundleMap);
|
fileToBundleMap.putAll(newBundleMap);
|
||||||
bundleLocationToBundleMap.putAll(newBundleMap.values()
|
bundleLocationToBundleMap.putAll(newBundleMap.values()
|
||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.toUnmodifiableMap(GhidraBundle::getLocationIdentifier,
|
.collect(Collectors.toUnmodifiableMap(GhidraBundle::getLocationIdentifier,
|
||||||
Function.identity())));
|
Function.identity())));
|
||||||
Collection<GhidraBundle> newBundles = newBundleMap.values();
|
Collection<GhidraBundle> newBundles = newBundleMap.values();
|
||||||
fireBundlesAdded(newBundles);
|
fireBundlesAdded(newBundles);
|
||||||
return newBundles;
|
return newBundles;
|
||||||
|
@ -482,7 +482,7 @@ public class BundleHost {
|
||||||
}
|
}
|
||||||
|
|
||||||
frameworkBundleContext
|
frameworkBundleContext
|
||||||
.addBundleListener(new MyBundleListener(frameworkBundleContext.getBundle()));
|
.addBundleListener(new MyBundleListener(frameworkBundleContext.getBundle()));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
felixFramework.start();
|
felixFramework.start();
|
||||||
|
@ -659,8 +659,8 @@ public class BundleHost {
|
||||||
monitor.setMaximum(bundlesRemaining.size());
|
monitor.setMaximum(bundlesRemaining.size());
|
||||||
while (!bundlesRemaining.isEmpty() && !monitor.isCancelled()) {
|
while (!bundlesRemaining.isEmpty() && !monitor.isCancelled()) {
|
||||||
List<GhidraBundle> resolvableBundles = bundlesRemaining.stream()
|
List<GhidraBundle> resolvableBundles = bundlesRemaining.stream()
|
||||||
.filter(bundle -> canResolveAll(bundle.getAllRequirements()))
|
.filter(bundle -> canResolveAll(bundle.getAllRequirements()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (resolvableBundles.isEmpty()) {
|
if (resolvableBundles.isEmpty()) {
|
||||||
// final round, try everything we couldn't resolve to generate errors
|
// final round, try everything we couldn't resolve to generate errors
|
||||||
resolvableBundles = bundlesRemaining;
|
resolvableBundles = bundlesRemaining;
|
||||||
|
@ -881,7 +881,8 @@ public class BundleHost {
|
||||||
String.format("not a GhidraBundle: %s\n", osgiBundle.getLocation()));
|
String.format("not a GhidraBundle: %s\n", osgiBundle.getLocation()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BundleEvent.UNINSTALLED:
|
// force "inactive" updates for all other states
|
||||||
|
default:
|
||||||
bundle = bundleLocationToBundleMap.get(osgiBundle.getLocation());
|
bundle = bundleLocationToBundleMap.get(osgiBundle.getLocation());
|
||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
fireBundleActivationChange(bundle, false);
|
fireBundleActivationChange(bundle, false);
|
||||||
|
@ -891,8 +892,6 @@ public class BundleHost {
|
||||||
String.format("not a GhidraBundle: %s\n", osgiBundle.getLocation()));
|
String.format("not a GhidraBundle: %s\n", osgiBundle.getLocation()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -411,7 +411,7 @@ public class BundleStatusTableModel
|
||||||
public String getValue(BundleStatus status, Settings settings, List<BundleStatus> data,
|
public String getValue(BundleStatus status, Settings settings, List<BundleStatus> data,
|
||||||
ServiceProvider serviceProvider0) throws IllegalArgumentException {
|
ServiceProvider serviceProvider0) throws IllegalArgumentException {
|
||||||
if (!status.isEnabled()) {
|
if (!status.isEnabled()) {
|
||||||
return "(disabled)";
|
return "(DISABLED)";
|
||||||
}
|
}
|
||||||
GhidraBundle bundle = bundleHost.getExistingGhidraBundle(status.getFile());
|
GhidraBundle bundle = bundleHost.getExistingGhidraBundle(status.getFile());
|
||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
|
@ -419,9 +419,9 @@ public class BundleStatusTableModel
|
||||||
if (osgiBundle != null) {
|
if (osgiBundle != null) {
|
||||||
return OSGiUtils.getStateString(osgiBundle);
|
return OSGiUtils.getStateString(osgiBundle);
|
||||||
}
|
}
|
||||||
return "uninstalled";
|
return "(UNINSTALLED)";
|
||||||
}
|
}
|
||||||
return "(enabled)";
|
return "(ENABLED)";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue