Commit graph

2 commits

Author SHA1 Message Date
okhsunrog
8f5197d2e7 codegen: don't emit the hook registry into lsposed/native
lsposed/native is the uniffi diagnostic-probe library, not a protocol
participant — it consumes iface_lists (VPN-name matching) but never the
hook registry / config masks. Drop it from the hook-ids codegen targets;
the registry goes only to the actual protocol parsers: kmod/KPM (C),
Zygisk (Rust), and the app + system_server hook (Kotlin) per §1.4.
2026-06-28 03:37:16 +03:00
okhsunrog
e85f7cb401 codegen: hook-id registry (protocol §5 single source of truth)
data/hooks.toml is the global hook id space + status error codes shared by
the control/stats protocol: bit N of a config mask == hook id N == the id in
a stats line. scripts/codegen-hooks.py renders the matching id enums,
per-backend 'own' masks, and error codes for every language that touches the
protocol (kmod/KPM C, zygisk Rust, lsposed-native Rust, app Kotlin), so the
numbering can never diverge between backends. Wired into the CI drift-check
beside the iface-list codegen.

The script runs under uv (PEP 723, '#!/usr/bin/env -S uv run' so plain
./scripts/codegen-hooks.py works), matching the repo's other tooling; no
external deps. Generated outputs are rustfmt- and ktlint-clean by
construction. Registry is append-only: ids are permanent so old stats keep
meaning and old readers skip unknown ids.
2026-06-28 02:21:28 +03:00