How wsa-installer/twrp-for-wsa works
TWRP for WSA injects recovery files into a WSA initrd, then uses a boot-time dispatcher and a persistent flag to choose between recovery and normal Android. The principal workflow is documented in the README; the sampled Python excerpts show initrd management, WSA detection, ADB, and GUI components, but omit much of the CLI wiring. The boot branch is directly supported by init.c. The graph therefore leaves uncertain Python call links out.
Main entry points: twrp.py InitrdManager · init.c Boot dispatcher · info.json info.json flags
Components 17
Initrd Patching
- InitrdManager
src/twrp.py - CPIO operations
src/twrp.py - Original initrd backup
src/twrp.py
Boot Selection
- Boot dispatcher
init.c - info.json flags
info.json
WSA Management
- CLI application
src/twrp.py - WSA detection
src/twrp.py - Recovery GUI
src/twrp.py
Recovery Access
- TWRP recovery
- ADBManager
src/twrp.py
Other components
- Operator
- WSA installation
- TWRP archive
- WSA kernel
- Android init
- ADB client
- ADB recovery device
Connections 17
- Operator → CLI application: runs commands
- CLI application → WSA detection: checks WSA
- CLI application → InitrdManager: requests injection
- TWRP archive → InitrdManager: provides patch files
- InitrdManager → CPIO operations: patches archive
- CPIO operations → WSA installation: rewrites initrd
- InitrdManager → Original initrd backup: preserves original
- CLI application → InitrdManager: sets boot flag
- InitrdManager → info.json flags: updates flag
- WSA kernel → Boot dispatcher: starts init
- Boot dispatcher → info.json flags: reads flag
- Boot dispatcher → TWRP recovery: executes recovery
- Boot dispatcher → Android init: executes normal init
- ADB client → ADBManager: issues commands
- ADBManager → ADB recovery device: runs ADB commands
- TWRP recovery → ADB recovery device: exposes recovery
- CLI application → Recovery GUI: launches interface