fix(ghidra): derive installation admission from Java property semantics

This commit is contained in:
morluto
2026-10-13 13:39:48 +08:00
parent 1f7f808c4f
commit 2187e16f14
10 changed files with 408 additions and 52 deletions
+14 -6
View File
@@ -641,14 +641,20 @@ const versionCheck = (
properties: GhidraApplicationProperties | undefined,
): GhidraInstallationCheck => {
const raw = properties?.providerVersion;
const parseError = properties?.parseError;
return installationCheck({
name: "version",
passed: ghidraReleaseAccepted(raw),
passed: parseError == null && ghidraReleaseAccepted(raw),
code:
ghidraReleaseCompatibility(raw).status === "unsupported"
? "unsupported_version"
: "version_unresolved",
detail: ghidraVersionDetail(raw),
parseError != null
? "version_unresolved"
: ghidraReleaseCompatibility(raw).status === "unsupported"
? "unsupported_version"
: "version_unresolved",
detail:
parseError == null
? ghidraVersionDetail(raw)
: `application.properties could not be parsed: ${parseError}`,
remediation: `Install a Ghidra ${ghidraReleaseLine()} release (verified with ${SUPPORTED_GHIDRA_VERSION}), or update REA for another Ghidra line.`,
});
};
@@ -701,7 +707,9 @@ const javaRemediation = (
const systemGhidraInstallationHost = (): GhidraInstallationHost => ({
readText(path) {
try {
return readFileSync(path, "utf8");
// Ghidra loads this file with Properties.load(InputStream), which maps
// bytes as ISO-8859-1 rather than decoding UTF-8.
return readFileSync(path).toString("latin1");
} catch (cause: unknown) {
// best-effort cleanup: optional install probing; unreadable means unknown.
void cause;