Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -925,10 +925,9 @@ public BoxPlot getNameScoreForMatch(GhidraFunctionMatch functionMatch) {

}

public static final String PORTAL_FUNCTIONS = "function/";

public void openFunctionInPortal(TypedApiInterface.FunctionID functionID) {
openPortal(PORTAL_FUNCTIONS, String.valueOf(functionID.value()));
var details = api.getFunctionDetails(functionID);
openPortal("analyses", String.format("%s?fn=%s", details.analysisId().id(), functionID.value()));
}

public void openCollectionInPortal(Collection collection) {
Expand All @@ -951,13 +950,7 @@ public void openPortalFor(ProgramWithID programWithID) {
}

public void openPortalFor(TypedApiInterface.AnalysisID analysisID) {
var binaryID = getBinaryIDFromAnalysisID(analysisID);
// The URL expects the old binary ID in the path, and then the analysis ID in the query
// if the binary ID is valid, it takes precedence,
// and we have to provide _something_ for the overall URL to be valid, but we can just pass a placeholder value
openPortal("analyses", String.format("%s?analysis-id=%s",
binaryID.map(BinaryID::value).orElse(-1),
analysisID.id()));
openPortal("analyses", String.valueOf(analysisID.id()));
}

public void openPortal(String... subPath) {
Expand Down
Loading