chenxiaolong /avbroot
Tool for manipulating and re-signing Android A/B OTAs
★ 991⑂ 82👁 19⑃ 406● 228▤ 76
-1
Daily
991
stars
82
forks
19
watchers
406
prs
228
issues
76
releases
README
avbroot
(This page is also available in: Russian (Русский).)
avbroot is a tool for modifying Android A/B OTA images reproducibly and re-signing them with custom keys. It also includes a collection of subcommands for packing and unpacking numerous Android image formats.
Having a good understanding of how AVB and A/B OTAs work is recommended prior to using avbroot. At the very least, please make sure the warnings and caveats are well-understood to avoid the risk of hard bricking.
Requirements
Only devices that use modern A/B partitioning are supported. This is the case for most non-Samsung devices launched with Android 10 or newer. To check if a device uses this partitioning scheme, open the OTA zip file and check that:
payload.bin exists
META-INF/com/android/metadata (Android 10-11) or META-INF/com/android/metadata.pb (Android 12+) exists
The device must support using a custom public key for the bootloader's root of trust. This is normally done via the fastboot flash avb_custom_key command.
A list of devices known to work can be found in the issue tracker at 299.
Patches
avbroot applies the following patches to the partition images:
The boot or init_boot image, depending on device, is patched to enable root access if requested.
The boot, recovery, or vendor_boot image, depending on device, is patched to replace the OTA signature verification certificates with the custom OTA signing certificate. This allows future patched OTAs to be sideloaded from recovery mode after the bootloader has been locked. It also prevents accidental flashing of the original unpatched OTA.
The system image is also patched to replace the OTA signature verification certificates. This prevents the OS' system updater app from installing an unpatched OTA and also allows the use of custom OTA updater apps.
Warnings and Caveats
Always leave the OEM unlocking checkbox enabled when using a locked bootloader while rooted. This is critically important. Root access allows the boot partition to potentially be overwritten, either accidentally or intentionally, with an image that is not properly signed. In this scenario, if the checkbox is turned off, both the OS and recovery mode will be made unbootable and fastboot flashing unlock will not be allowed. This effectively renders the device _hard bricked_.
Repeat: _ALWAYS leave OEM unlocking enabled if rooted._
Any operation that causes an improperly-signed boot image to be flashed will result in the device being unbootable and unrecoverable without unlocking the bootloader again (and thus, triggering a data wipe). A couple ways an improperly-signed boot image could be flashed include:
The Direct install method for updating Magisk. Magisk updates must be done by repatching the OTA, not via the app.
The Uninstall Magisk feature in Magisk. If root access is no longer needed, Magisk must be removed by repatching the OTA with the --rootless option, not via the app.
If the boot image is eTop issues
#299Supported devices106 comments · 2024-05-31#84Question / ask for help: hard bricked?40 comments · 2023-03-23#623Locked bootloader still allows sideloading unsigned OTA's14 comments · 2026-07-11#622Relocking the bootloader in g52 (CalyxOS) causes an "No OS was found" error9 comments · 2026-07-07#185Things that won't be implemented6 comments · 2023-10-07#598[PSA] Pixel 10 series May 2026 update bootloader anti-rollback0 comments · 2026-05-05
Discussions
#642Custom boot.img/recoveries while bootloader locked?2 comments · 2026-08-14#612Patching APEX modules2 comments · 2026-06-16#600Single boot.img patch with --prepatch for fastboot boot testing (vbmeta already patched)1 comments · 2026-05-13#591avbroot && apatch1 comments · 2026-04-22#589Is there a means to add a postinstall script via unpacking the zip or another method?1 comments · 2026-04-08#582Build custom full OTA package from Fastboot images2 comments · 2026-03-25#581Recommendations for deodexing?1 comments · 2026-03-24#576How to get avb.pem from key generated by avbroot1 comments · 2026-03-06
Latest release
Version 3.39.1 v3.39.1 2026-11-10The changelog can be found at: CHANGELOG.md. --- See README.md for information on how to use avbroot. The downloads are digitally signed. Please consider verifying the digital signatures of the binaries (or building from source) since avbroot is an application with access to your OTA/AVB signing keys.