mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-05 03:20:46 -05:00
Add RecoveryGptProcessor, a WholeFilePatcher for GPT disk images such as Aluminium OS recovery_image.bin. The input is processed in a single sequential pass: all data is copied to the output until init_boot_a is reached, which is extracted for the standard Magisk boot image patch. After the patched init_boot_a is written, the rest of the input is copied. vendor_boot_b is always patched to disable data wipe and AVB hash verification whenever it is encountered. Subclasses can override onInitBoot and onVendorBoot to customize how these images are handled. The vendor_boot patching logic is implemented in app_functions.sh as patch_al_vendor_boot, so it is also available without root access. PatchFileClassifier now detects GPT images as RecoveryGpt, both raw and within recovery zips. MagiskInstaller generalizes whole file processing over WholeFilePatcher, which is now Closeable to release resources when patching is aborted before finish. Add testRecoveryGptProcessor in AppTest, which streams and inflates the recovery image from a remote zip, verifies the checksums of init_boot_a and vendor_boot_b without patching, and verifies the output is identical to the input with streaming checksums. Assisted-by: Claude Opus 5.5