Skip to main content

Module binder

Module binder 

Source
Expand description

NDK binder primitives for querying Android system services.

Uses dlopen on libbinder_ndk.so to avoid hard-linking against a library absent from older NDK toolchains or non-Android targets.

§Transaction code resolution

Resolution order (no subprocess required):

  1. tx_code.txt cache (written by fgw or a previous run).
  2. Parse framework.jar DEX — reads TRANSACTION_* static int fields from IActivityManager$Stub and IProcessObserver$Stub directly.

§Observer mode

ActivityManagerBinder::open_with_observer registers this process as an IProcessObserver with ActivityManager. Callbacks fire when foreground activities change and signal an eventfd that callers can poll via epoll. After the eventfd fires, call get_focused_package to read the new value.

Structs§

ActivityManagerBinder
TxCodes

Functions§

read_tx_cache
resolve_tx_codes
write_tx_cache