Files
oxmc f6176009b1 Add recovery_ui and recovery_toolkit scaffolding (first draft, not build-tested)
Stages TWRP's GUI engine and standalone tooling as PawletOS-owned modules
instead of a bootable/recovery fork, per the plugin-architecture finding in
NOTES-ota-recovery-ab.md: stock recovery_main.cpp already dlopen()s
librecovery_ui_ext.so and dlsym()s make_device() from it at runtime, so the
UI layer doesn't require touching stock bootable/recovery at all. Confirmed
via source grep that recovery.cpp/install.cpp have zero references into the
partition manager/backup engine/GUI code and vice versa.

recovery_ui/: TWRP's gui/, minuitwrp/, libpixelflinger/ (copied verbatim,
GPL-3.0), plus a new device/ providing PawletTwrpUI (a ScreenRecoveryUI
subclass) and make_device() — written from scratch against stock's
RecoveryUI/ScreenRecoveryUI virtual-method contract, since TWRP's own fork
never ships a make_device() (every real TWRP device provides its own, and
no reference device tree was available to copy from). Top-level Android.bp
defines librecovery_ui_pawlet_twrp, the module TARGET_RECOVERY_UI_LIB should
point at. gui/Android.bp and minuitwrp/Android.bp had their include_dirs
rewritten for the new paths.

recovery_toolkit/: partition manager, backup engine (tar/digest/adbbu/apex),
filesystem/format support (exfat/dosfstools/gpt/fuse/mtp/crypto), scripting
(openrecoveryscript/orscmd/twrpinstall), shared helpers. Source only, no
Android.bp yet for any of it.

Known gap blocking recovery_ui from actually linking: gui/'s libguitwrp
depends on libaosprecovery, built from recovery_toolkit/helpers/twrp.cpp via
a Go Soong plugin (libaosprecovery_defaults.go) not yet ported. Neither repo
has been build-tested — no local AOSP build environment available in this
workspace. See each directory's README.md for a precise done/not-done
breakdown.
2026-07-11 16:34:35 -07:00
..

recovery_toolkit

TWRP's partition manager, backup engine, filesystem/format support, and scripting/automation tooling — the "standalone additive" bucket from the TWRP-vs-stock-recovery diff (confirmed via source grep: zero references either direction between this code and recovery.cpp/install/install.cpp, so none of it requires forking stock bootable/recovery). See the main workspace's NOTES-ota-recovery-ab.md for the full investigation.

Source copied verbatim from TeamWin's android_bootable_recovery (android-14.1), the only living copy found (Google removed the equivalent functionality's siblings — applypatch/updater/edify — from stock AOSP in 2024; see external_update_binary).

Status: source staged, no build files yet

This is source-only. None of these directories have an Android.bp yet. That's real remaining work, not cleanup — each of these historically had its module definition scattered inside TWRP's single top-level bootable/recovery/Android.bp, not self-contained per-directory the way applypatch/updater/edify were, so each needs a new Android.bp written from scratch, not just copied and path-fixed.

Layout

  • partitionmanager/partition.cpp, partitionmanager.cpp, partitions.hpp, BasePartition.cpp.
  • backup/twrpTar.*, tarWrite.*, twrpDigestDriver.*, twrpAdbBuFifo.*, twrpApex.*, infomanager.*, plus libtar/, twrpDigest/, adbbu/, twrpTarMain/ (each of those four already has its own directory structure from upstream, not yet inspected for existing build files).
  • Filesystem/format support: exfat/, dosfstools/, libblkid/, simg2img/, minzip/, openaes/, gpt/, fuse/ (+ fuse.h), mtp/, crypto/.
  • scripting/ (openrecoveryscript.*) + orscmd/ + twrpinstall/ — TWRP's scripting/automation interface. twrpinstall/ is referenced by recovery_ui/gui/Android.bp's include_dirs already (this module needs to exist before recovery_ui can build).
  • helpers/ — shared utilities (find_file.*, exclude.*, fixContexts.*, mounts.c, startupArgs.*, progresstracking.*, kernel_module_loader.*, abx-functions.hpp, twrp-functions.*, twrp.cpp), plus libcrecovery/, libmincrypt/, attr/.

Known gap shared with recovery_ui

helpers/twrp.cpp needs to build into libaosprecovery — TWRP builds this via a custom Go Soong plugin (libaosprecovery_defaults.go, not yet copied/ported) that recovery_ui/gui's libguitwrp depends on as a shared_libs entry. recovery_ui won't link until this exists.

Priority if picking up this work

twrpinstall/ and helpers/ (for libaosprecovery) block recovery_ui from building at all — do those first. partitionmanager/ and backup/ are the actual user-facing value (what makes this "TWRP" rather than just a GUI skin) and are next. Filesystem/format support modules (exfat/dosfstools/etc.) can come last — they're each independent and only needed for the specific formats they support.

License

GPL-3.0 (TeamWin) — same situation as recovery_ui, full license text not yet added to this repo.