Files
FridaBox/tools/build_frida_agents.py
T
Mahdi Karzari 5140bfc6a7 feat: deliver first successful FridaBox MVP
Integrate Frida Gadget into BlackBox guest startup, add the host workflow and controller tooling, and validate the complete sample hook flow on ARM64 Android 16.
2026-07-20 04:25:08 +03:30

40 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""Build Frida 17 Java agents with the explicitly pinned Java bridge."""
from __future__ import annotations
import os
import pathlib
import subprocess
import sys
ROOT = pathlib.Path(__file__).resolve().parents[1]
SCRIPTS = ROOT / "scripts"
OUTPUT = SCRIPTS / "dist"
ENTRIES = ("registry-probe.js", "guest-bootstrap.js", "sample-hook.js")
def compiler_path() -> pathlib.Path:
name = "frida-compile.cmd" if os.name == "nt" else "frida-compile"
path = ROOT / "node_modules" / ".bin" / name
if not path.is_file():
raise SystemExit("Install pinned agent dependencies first: npm ci")
return path
def main() -> int:
compiler = compiler_path()
OUTPUT.mkdir(parents=True, exist_ok=True)
for name in ENTRIES:
subprocess.run(
[str(compiler), str(SCRIPTS / name), "-o", str(OUTPUT / name), "-S", "-c"],
cwd=ROOT,
check=True,
)
print("Built Frida agents: " + ", ".join(str(OUTPUT / name) for name in ENTRIES))
return 0
if __name__ == "__main__":
raise SystemExit(main())