Merge remote-tracking branch 'origin/GP-6014_ryanmkurtz_osgi' into

Ghidra_12.0 (#6455)
This commit is contained in:
Ryan Kurtz 2025-09-23 11:44:35 -04:00
commit cc4a4e5ed2
2 changed files with 33 additions and 2 deletions

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -396,6 +396,7 @@ public class BundleStatusTableModel
columnDescriptor.addVisibleColumn(new BuildSummaryColumn()); columnDescriptor.addVisibleColumn(new BuildSummaryColumn());
columnDescriptor.addHiddenColumn(new OSGiStatusColumn()); columnDescriptor.addHiddenColumn(new OSGiStatusColumn());
columnDescriptor.addHiddenColumn(new BundleTypeColumn()); columnDescriptor.addHiddenColumn(new BundleTypeColumn());
columnDescriptor.addHiddenColumn(new BundleLocationId());
return columnDescriptor; return columnDescriptor;
} }
@ -548,6 +549,27 @@ public class BundleStatusTableModel
} }
} }
private class BundleLocationId extends Column<String> {
BundleLocationId() {
super("Bundle Location ID");
}
@Override
public String getValue(BundleStatus status, Settings settings, List<BundleStatus> data,
ServiceProvider serviceProvider0) throws IllegalArgumentException {
GhidraBundle bundle = bundleHost.getGhidraBundle(status.getFile());
if (bundle != null) {
String id = bundle.getLocationIdentifier();
if (id != null) {
return id;
}
}
return "";
}
}
private class BundleFileRenderer extends AbstractGColumnRenderer<ResourceFile> { private class BundleFileRenderer extends AbstractGColumnRenderer<ResourceFile> {

View file

@ -45,6 +45,8 @@ import aQute.bnd.osgi.Clazz.QUERY;
import generic.io.NullPrintWriter; import generic.io.NullPrintWriter;
import generic.jar.ResourceFile; import generic.jar.ResourceFile;
import ghidra.app.script.*; import ghidra.app.script.*;
import ghidra.framework.Application;
import ghidra.framework.ApplicationProperties;
import ghidra.util.Msg; import ghidra.util.Msg;
import util.CollectionUtils; import util.CollectionUtils;
import utilities.util.FileUtilities; import utilities.util.FileUtilities;
@ -880,6 +882,13 @@ public class GhidraSourceBundle extends GhidraBundle {
analyzer.setProperty("Export-Package", "!*.private.*,!*.internal.*,*"); analyzer.setProperty("Export-Package", "!*.private.*,!*.internal.*,*");
String minJava =
Application.getApplicationProperty(ApplicationProperties.APPLICATION_JAVA_MIN_PROPERTY);
if (minJava != null) {
analyzer.setProperty("Require-Capability",
"osgi.ee;filter:=\"(&(osgi.ee=JavaSE)(version>=%s))\"".formatted(minJava));
}
try { try {
Manifest manifest; Manifest manifest;
try { try {