chenxiaolong /avbroot

Tool for manipulating and re-signing Android A/B OTAs

★ 991⑂ 82👁 19⑃ 406● 228▤ 76
RustGPL-3.0Created 2022-06-25
下载:Version 3.39.1Version-3.39.1 ↓3.39.12026-11-10
-1
日增长
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 e

Top issues

Discussions

Latest release

Version 3.39.1 v3.39.1 2026-11-10
The 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.

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON