Skip to main content

Module worker_asset

Module worker_asset 

Source
Expand description

Embed the worker .java in the binary and extract it to a per-user script dir at boot, keyed by content hash so the extracted copy always matches the compiled binary (spec §12). Only the thin-slice extraction primitive; the §6 extraction-integrity hardening (0700/0600, ownership, symlink guards) is layered in a later milestone.

Constants§

WORKER_JAVA
The worker GhidraScript, embedded at compile time (version-locked to this binary).
WORKER_SCRIPT_NAME
The worker script’s filename. Ghidra requires a GhidraScript’s filename to match its public class name, so this is not a free choice — and it is a const rather than three string literals because config.rs hands it to the launcher while extract_worker writes the file. Those two disagreeing produces a worker that is on disk under one name and looked for under another, which surfaces as an unexplained boot timeout.

Functions§

extract_worker
Extract the worker script into script_dir, creating the dir if needed and rewriting the file only when its content hash differs from the embedded source. Returns the script path.
hash 🔒