HexForge Gateway
HexForge Gateway is an AI-assisted reverse-engineering workspace API. It currently ships a deep
Android toolchain (jadx, apktool, apksigner, adb, frida, ghidra, triage, verify-claims, filesystem,
MT Manager's APK MCP, AI providers) and streams updates over WebSocket. Every external tool is a
replaceable backend behind one capability contract, so the same workspace, graph and evidence
pipeline extends to new targets and toolchains — on a phone (Termux + MT Manager), a normal PC or a
VPS — no cloud required.
What makes it different
HexForge treats every external tool as a replaceable backend behind one
capability contract — if jadx disappears tomorrow, java.decompile
keeps working through another adapter. On top of the raw tooling sits an
evidence pipeline: a typed knowledge graph of classes, packages and
secret candidates merged by derived ids so re-analysis never duplicates;
findings that carry a claim, a confidence and evidence citing real
artifacts; and a verifier that re-checks every citation against the
files on disk, exportable as JSON / Markdown / SARIF. Secret scanning is
redaction by design — fingerprints and previews, never the value
itself. And the whole thing is local-first: the full pipeline runs on an
Android phone via Termux, a PC, or a VPS, with no cloud dependency.
Getting started
One command, no clone:
curl -fsSL https://raw.githubusercontent.com/boy-offi9-inc/hexforge-gateway/main/docker-compose.yml -o docker-compose.yml && docker compose up -d
This pulls the published runtime image (Gateway + pinned jadx/apktool/APKiD/frida/Ghidra), binds 127.0.0.1:8080 only — turn auth on (AUTH_ENABLED + API_KEYS) before exposing the port beyond localhost, see docs/SAFETY.md.
Or from source:
npm install
cp .env.example .env
npm run dev
The Gateway starts on http://localhost:8080 and prints a banner with your
workspaces and copy-pasteable commands. GET / returns the same as JSON —
the quickest way to see what's here.
Skills pack
Ready-to-use skills drive whole workflows from any
skill-capable agent CLI (Claude Code and friends): full APK triage with
verified findings, the decode → patch → rebuild → sign chain, and MCP
server registration for Claude Desktop/Code/Cursor.
cp -r skills/hexforge-apk-triage ~/.claude/skills/
HexForge also speaks MCP as a server
(docs/MCP_SERVER.md), so its agents register as
native tools in any MCP client — and the repo ships a
smithery.yaml for one-click install on
Smithery.
How it fits together
HexForge Gateway
├── Clients hf CLI · MCP clients (Claude / Cursor) · REST / WS
├── API layer Fastify routes · opt-in auth · Event Bus
├── Engines Job Engine (retry + timeout) · Workflow Engine (parallel + resume)
├── MCP agents jadx · apktool · apksigner · apkid · triage · verify-claims
│ apkmcp · ghidra · filesystem · adb · frida · ai
├── Backend tools jadx · apktool · apksigner · apkid · adb · frida on PATH
│ MT Manager's APK MCP service · 9 AI providers
└── Evidence layer Artifacts (typed + provenance) · Knowledge graph
(typed entities + edges) · Findings (claim + evidence) · Verifier
A request enters through the API layer, becomes a task, and the task
orchestrator hands it to the agent that provides the requested capability.
Agents talk to real backend tools; every finished task's output is recorded
as an artifact with tool-version provenance; artifacts feed the knowledge
graph and findings; findings get re-verified on demand. Modules communicate
through the Event Bus, not direct calls.
Core endpoints
Request/response shapes are in the linked docs:
GET / — live cheat sheet · GET /health — service + config status
POST /workspaces / GET /workspaces[/:id] / PUT /workspaces/by-name/:name (idempotent get-or-create)
POST /workspaces/:id/tasks — dispatch to an MCP agent, fire-and-forget; poll or watch /ws (AGENTS)
POST /workspaces/:id/jobs / /workflows / /knowledge (ARCHITECTURE)
GET /workspaces/:id/inbox — APKs dropped into APK_INBOX_DIR, if configured, and auto-claimed into this workspace (INBOX)
POST|GET /workspaces/:id/chat (AI)
GET /plugins (PLUGINS)
GET /capabilities — what the Gateway can do and which agents provide it (AGENTS)
GET /workspaces/:id/artifacts / GET /artifacts/:id — directories and files finished tasks produced, with the run that made them (ARCHITECTURE)
POST|GET /workspaces/:id/findings (filter by status or a cited entityId), GET|PATCH /findings/:id, GET /findings/:id/verification — claims with evidence checked against real artifacts and graph entities, and re-checked against the cited files (ARCHITECTURE)
GET /workspaces/:id/report?format=json|markdown|sarif — a findings report with each piece of evidence re-checked (ARCHITECTURE)
POST|GET /workspaces/:id/graph/entities, GET /graph/entities/:id, POST|GET /workspaces/:id/graph/edges — typed entities and relationships observed about the target (ARCHITECTURE)
POST /workspaces/:id/traffic-captures — record a JSONL/HAR capture (mitmproxy export, collector) as a traffic-capture artifact (parse-validated, path-contained); the graph indexes it into traffic events (ARCHITECTURE)
GET /graph/entities/:id/traverse?relation=&direction=&depth= — graph questions, not just listing: who calls this class, what does this method access, which hooks observed it, up to 3 hops (SAFETY)
WS /ws — real-time task:update, job:update, workflow:update, knowledge:entry_created, workspace:status_changed for every workspace
WS /ws/workspaces/:id — same events, filtered to one workspace
Safety
What the Gateway can touch, what it never stores (secret values, captured
credential data, hook arguments), the tool annotations a client can gate on,
and what to enforce for unattended agent runs: docs/SAFETY.md.
Secret intelligence
scan-secrets runs a 24-detector registry (cloud keys, tokens, JWTs, private
keys, webhook URLs, high-entropy shapes) and scores every hit into a
redacted candidate — detector, confidence from entropy / context keywords
/ placeholder shapes, SHA-256 fingerprint for dedupe. The secret value itself
is never stored, not in the result, not in the artifact, not in the graph.
Candidates land in the knowledge graph as typed entities. (AGENTS)
Triage front door
One fingerprint-first assessment before paying for a full decompile: APKiD
packer/compiler fingerprints, manifest analysis (permissions, exported
components), native library inventory per ABI, and Kotlin name recovery —
R8/ProGuard-renamed classes keep their original names in @kotlin.Metadata,
so obfuscated classes get recovered statically. (AGENTS)
Dynamic instrumentation
Frida without a terminal attached: a versioned module store (draft a
trace script, test it, promote it to an immutable semver version with run
provenance), streaming sessions whose events land line by line in a
JSONL log you poll incrementally — restart-safe, workspace-scoped — and
gadget injection, which embeds frida-gadget into a decoded APK so a
stock, non-root device gets full instrumentation from the normal
build → sign → install chain. (AGENTS)
Stack
Node.js 22+ / TypeScript, Fastify (+ @fastify/websocket), Zod. Storage is
local files by default; Supabase (STORAGE_BACKEND=supabase) or any Postgres
- Neon included (
STORAGE_BACKEND=postgres + DATABASE_URL) is opt-in. Auth
is an opt-in API key check, off by default (AUTH_ENABLED=false). npm test
runs the Vitest unit suite (700+ tests, no live instance needed);
scripts/smoke-test.sh covers end-to-end happy paths against a running
Gateway — see tests/README.md for the split.
Documentation
| Doc |
Covers |
docs/SETUP.md |
Requirements, auth, storage backend, running on PC and Android/Termux |
docs/ARCHITECTURE.md |
Event Bus, Job Engine, Workflow Engine, Knowledge Engine |
docs/AGENTS.md |
Every MCP agent — operations and examples |
docs/APK_MODIFICATION.md |
Decode, patch, rebuild, sign and install an APK — step by step |
docs/EVIDENCE.md |
From a task's output to a finding with evidence, and checking it — step by step |
docs/AI.md |
The AI provider layer (9 built-in providers, custom providers file), the ai agent, Terminal chat |
docs/MCP_SERVER.md |
Registering HexForge's agents as native tools in Claude Desktop/Code/Cursor |
skills/README.md |
The skills pack — ready-to-use workflow skills for Claude Code and compatible CLIs |
docs/PLUGINS.md |
The Plugin System — contract, loader, reference plugins |
docs/CLI.md |
The hf CLI (scripts/hf.sh) and scripts/smoke-test.sh |
docs/MT_MANAGER.md |
MT Manager's APK MCP setup, with screenshots and troubleshooting |
docs/PROJECT_STRUCTURE.md |
Repo layout and how the pieces talk |
docs/ROADMAP.md |
What's done and what's still open |
Contributing
Run npm run typecheck && npm run build && ./scripts/smoke-test.sh before a
PR — see CONTRIBUTING.md. Issues and PRs welcome.