Development [DEV][EOL] Vbmeta Patcher, Devinfo Patcher, and Boot Image Tool

Search This thread

capntrips

Senior Member
Aug 29, 2020
212
401
OnePlus 6T
Google Pixel 6
Vbmeta app gives me unexpected format
The Unexpected Format exception is thrown when the app encounters a missing magic header or avbtool version number in one of the vbmeta slots. My guess is one of your vbmeta partitions is corrupted. I suppose the app could be reworked to allow it to work with any good partitions and to ignore the bad ones, but I'm unlikely to put in the work, given the app is basically obsolete, with the latest version of Magisk (23016) working with stock vbmeta partitions.
 

Nightf0x_007

Senior Member
Nov 5, 2012
675
73
The Unexpected Format exception is thrown when the app encounters a missing magic header or avbtool version number in one of the vbmeta slots. My guess is one of your vbmeta partitions is corrupted. I suppose the app could be reworked to allow it to work with any good partitions and to ignore the bad ones, but I'm unlikely to put in the work, given the app is basically obsolete, with recent versions of Magisk working with stock vbmeta partitions.
Yes there is something wrong with my phone as i have corrupted device warning when rebooting i feel its because of dm-verity/verification
Is there anyway to fix this vbmeta problems/disabling dm, without wiping my device
TIA
 

capntrips

Senior Member
Aug 29, 2020
212
401
OnePlus 6T
Google Pixel 6
Yes there is something wrong with my phone as i have corrupted device warning when rebooting i feel its because of dm-verity/verification
Is there anyway to fix this vbmeta problems/disabling dm, without wiping my device
TIA
With Magisk 23016, you no longer need to the disable flags. I would suggest using the Android Flash Tool to install latest stock for your device. As long as you don't check the box for it, it won't wipe your data. Also, don't check the disable flags, or it may bootloop then ask you to factory reset, though you can still recover from that state using the flash tool.
 

Nightf0x_007

Senior Member
Nov 5, 2012
675
73
With Magisk 23016, you no longer need to the disable flags. I would suggest using the Android Flash Tool to install latest stock for your device. As long as you don't check the box for it, it won't wipe your data. Also, don't check the disable flags, or it may bootloop then ask you to factory reset, though you can still recover from that state using the flash tool.
Should i completely uninstall magisk or restore images before reflashing latest stock via android flash tool?
 

capntrips

Senior Member
Aug 29, 2020
212
401
OnePlus 6T
Google Pixel 6
Canary 23017 is released
I'm assuming the procedure now is to uninstall @capntrips build and install Official canary, then do a direct install?
Looks good to me. I probably had something left over from testing, but I had to hide my build in the app, first, as I was getting a compatibility error while trying to install official, even after uninstalling my build and rebooting.
 
  • Like
Reactions: mac796 and shoey63

capntrips

Senior Member
Aug 29, 2020
212
401
OnePlus 6T
Google Pixel 6
I've never been through the uninstall magisk process before. "Complete uninstall" doesn't force a reboot or anything does it? Just Uninstall Magisk > Take OTA > Install to Inactive > Reboot?
Unless you're running into startup issues with a module, there's likely no need to do a Complete Uninstall. Restore Images will revert your boot partition to stock, so you're able to take the OTA.
 
Last edited:

capntrips

Senior Member
Aug 29, 2020
212
401
OnePlus 6T
Google Pixel 6
Seeing all the issues people are having in the guide threads, I just wanted to note that I used canary build 24102 to take the February OTA on a Pixel 6 and a Pixel 5a, both without issue.

In the worst case, you'll have to fallback to the full factory image, if something goes wrong.
 

mac796

Senior Member
Aug 20, 2014
1,357
472
Long Beach
Seeing all the issues people are having in the guide threads, I just wanted to note that I used canary build 24102 to take the February OTA on a Pixel 6 and a Pixel 5a, both without issue.

In the worst case, you'll have to fallback to the full factory image, if something goes wrong.
I'm wondering if my problem was running a custom kernel. Updating it often, maybe when I restored images it restored to last update. I'm not sure just guessing. But if it fails all I had to do was run the Android flash tool with no wipe.
 

capntrips

Senior Member
Aug 29, 2020
212
401
OnePlus 6T
Google Pixel 6
I tried to update to L12 Beta this way. It booted straight to fastboot afterwards. Had to force it to loop 3 times to get it to swap to the other slot and back to previous working Feb update.
Anyone else?

Does Magisk work with Android 12L at all, currently? A quick Google search and a search of the Magisk Github turned up basically nothing.

Edit: It looks like the source code won't be available until public release, for whatever that's worth.

I'm wondering if my problem was running a custom kernel. Updating it often, maybe when I restored images it restored to last update. I'm not sure just guessing. But if it fails all I had to do was run the Android flash tool with no wipe.

Did you get an Installation Failed error in System Update? If so, that could certainly be your issue. If not, it's unlikely, since update_engine checks the hash (of part of) your boot partition during the update, and it will fail if it is different.

Magisk should only backup the stock boot image, and it should pass the original stock image's hash through multiple flashes. I don't know anything about the kernel installation process, so that could potentially be the weak link.
 
Last edited:
Does Magisk work with Android 12L at all, currently? A quick Google search and a search of the Magisk Github turned up basically nothing.

Edit: It looks like the source code won't be available until public release, for whatever that's worth.



Did you get an Installation Failed error in System Update? If so, that could certainly be your issue. If not, it's unlikely, since update_engine checks the hash (of part of) your boot partition during the update, and it will fail if it is different.

Magisk should only backup the stock boot image, and it should pass the original stock image's hash through multiple flashes. I don't know anything about the kernel installation process, so that could potentially be the weak link.
I read in the thread here that root and modules were working:
 
  • Like
Reactions: capntrips

mkhcb

Senior Member
Nov 2, 2012
314
321
With Magisk 23016, you no longer need to the disable flags. I would suggest using the Android Flash Tool to install latest stock for your device. As long as you don't check the box for it, it won't wipe your data. Also, don't check the disable flags, or it may bootloop then ask you to factory reset, though you can still recover from that state using the flash tool.
So say I have magisk 24102 on the December update and I want the easiest way to update with root (and not lose my data). How would I do it? Can I system update?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Have you tried updating your phone over the air with the new Magisk v25?
    Yes, I installed the June update OTA via System Update after updating to 25001, and it worked without an issue. I have rebooted a few times since, and I never lost root.
  • 29
    The original purpose of these three apps was to help deal with the changes in Android 12 when taking an OTA. Most of the functionality has been superseded by the newest builds of Magisk.

    Vbmeta Patcher is still useful when migrating from Magisk builds before 23016, and Boot Image Tool can still be used for downloading backups of newly installed boot images or restoring missing backups for Magisk.

    I'll leave the links and descriptions below, but future development of these apps is unlikely.

    Vbmeta Patcher screenshot
    Devinfo Patcher screenshot
    Boot Image Tool screenshot


    Vbmeta Patcher is an Android app that toggles the disable flags of the vbmeta partitions.

    Devinfo Patcher is an Android app that marks the inactive slot as successful on devices with a valid devinfo partition.

    Boot Image Tool is an Android app that helps juggle boot images for OTAs.
    1. Uninstall -> Restore Images in the Magisk app.
    2. Take the OTA in System Update. Do NOT reboot.
    3. Install -> Install to Inactive Slot in the Magisk app.
    4. Reboot (NOT in System Update).

    Latest Updates

    2022-05-01 Boot Image Tool v1.0.0-alpha03
    2021-11-19 Devinfo Patcher v1.0.0-alpha02
    2021-11-19 Vbmeta Patcher v1.0.0-alpha04
    10
    I made a new build of Magisk that will detect the vbmeta partition, set KEEPVBMETAFLAGS, and AVBv2 sign the boot image after patching. This allows you to root without patching vbmeta or wiping data.

    It also has the updated bootctl binary, so you can flash to the inactive slot after an OTA.

    I updated the related pull request, but it will remain in draft status until it is compatible with all of the possible algorithm types.

    The steps to take an OTA with this will be:
    1. Restore Images in the Magisk app.
    2. Take the OTA in System Update. Do NOT reboot.
    3. Install Magisk to the Inactive Slot in the Magisk app.
    4. Reboot (NOT in System Update).
    If you're taking the OTA on with vbmeta patched with disable flags, you'll have to restore vbmeta in Vbmeta Patcher, first. After that, vbmeta will remain stock.

    Edit: I pulled the build, patching vbmeta is not required since 23016.
    8
    Devinfo Patcher has been released. See the OP for usage details.

    Until there is movement on the Magisk end, you'll have to use my builds of Magisk to enable flashing to the inactive slot.

    As I noted previously, I would rather not maintain ongoing builds of Magisk, so depending on what, if anything, ends up in Magisk in the near future, I may make an all-in-one tool. In that case, I imagine I'll stop developing the individual apps, but I'll leave up the final builds of each, if that happens.
    8
    I made a new build of Magisk that will patch and restore the vbmeta partition on Magisk install and uninstall. It also includes the bootctl binary from the previous release. I made a draft pull request (closed in favor of #5018) to start the process of getting this into mainline.

    Once all of the backups are in place, the steps to take an OTA with this will be:
    1. Restore Images in the Magisk app (which will also restore the stock vbmeta partition from backup).
    2. Take the OTA in System Update. Do NOT reboot.
    3. (optional, but recommended) Direct Install Magisk in the Magisk App (which will also patch and backup the vbmeta partition in the active slot).
    4. Install Magisk to the Inactive Slot in the Magisk App (which will also patch and backup the vbmeta partition in the inactive slot, mark the inactive slot as active, and mark it as successful during the first boot).
    5. Reboot (NOT in System Update).
    The first time you restore images, you'll have to restore vbmeta in Vbmeta Patcher. After that, Magisk will keep backups of the stock images.

    Note: This is now obsolete. Recent builds no longer a need to patch the vbmeta partition.
    6
    Any address to donate to?
    I look at it as my contribution back to the community. If you really want to make a monetary contribution, I suggest Code.org or EFF.