From 36c7b3501ed96f37b6ed382f496db72d80dd5ca5 Mon Sep 17 00:00:00 2001 From: Florian Magin Date: Thu, 21 May 2026 12:45:58 +0200 Subject: [PATCH] Update to Ghidra 12.1 --- .github/workflows/build.yml | 2 ++ .github/workflows/release.yml | 2 ++ build.gradle | 16 ++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e48e98..4718640 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,8 @@ jobs: fail-fast: false matrix: include: + - ghidra: "12.1" + java: "21" - ghidra: "12.0.4" java: "21" - ghidra: "12.0.3" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9c8c47..9ec4531 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,8 @@ jobs: fail-fast: false matrix: include: + - ghidra: "12.1" + java: "21" - ghidra: "12.0.4" java: "21" - ghidra: "12.0.3" diff --git a/build.gradle b/build.gradle index 68ddccc..5a6054b 100644 --- a/build.gradle +++ b/build.gradle @@ -80,6 +80,22 @@ test { jvmArgs '--add-exports=java.desktop/sun.awt=ALL-UNNAMED' // systemProperty 'java.awt.headless', 'true' systemProperty "ghidra.test.property.batch.mode", 'true' + + // Ghidra 12.1+ installs a serial filter factory during application initialization. The JVM + // only allows this if no ObjectInputStream has been constructed yet, but Gradle's test + // worker creates one for IPC before our tests run. Pre-installing the factory via system + // property avoids the IllegalStateException. The class only exists on 12.1+, so only set + // it when the installation actually has it. + def filterFactoryClass = 'ghidra.framework.remote.GhidraSerialFilterFactory' + def hasFilterFactory = fileTree(dir: "$ghidraInstallDir/Ghidra/Framework/FileSystem/lib", + include: '*.jar').any { jar -> + new java.util.zip.ZipFile(jar).withCloseable { zf -> + zf.getEntry(filterFactoryClass.replace('.', '/') + '.class') != null + } + } + if (hasFilterFactory) { + systemProperty 'jdk.serialFilterFactory', filterFactoryClass + } } // Exclude additional files from the built extension // Ex: buildExtension.exclude '.idea/**'