17-03-2020, 10:29 PM
This is a quick guide showing how to disable dm_verity or Android Verified Boot (AVB). Disabling dm-verity / AVB is only important if you intend to flash custom images such as patched boot, custom recoveries or even custom roms onto your device
See the video below or @ https://youtu.be/Oa6ZCb-61B0
Method 1 - Manually patching boot.img using hex editor
Requirements
- Stock boot.img for your phone model (its best its for your Build Number / Variant ) . You can extract from the stock rom / firmware of your device (you may check our firmware collection) OR backup from your device using any method at the forum e.g Wwr_Mtk, Miracle Box, CM2, Nck Box Pro etc
- Hxd hex editor ; download @ https://mh-nexus.de/en/hxd/
- Install adb and fastboot
Follow the steps below to patch boot.img manually to remove dm_verity
- Launch Hxd hex editor tool
- Drag and drop your boot.img onto hxd hex editor window
- Click Search > Replace
- In the Replace windows, Click Hex-values tab and input the following below
Code:search for : 2C 76 65 72 69 66 79
replace with : 00 00 00 00 00 00 00
- Click "Replace all"
- You can confirm if all traces of "verify" has been removed, click Search > find > Text-string
Code:search for : verify
- Click Search all, and you should get a prompt "Can't find verify", click OK
- Click File > save
- The original unmodified file will be saved as boot.img.bak while the new modified file will be saved as boot.img
- You can now flash the newly patched boot.img using fastboot to remove dm_verity from your device
Code:adb devices
adb reboot-bootloader
fastboot devices
fastboot flash boot boot.img
Method 2 - Patching boot.img using magisk manager
Requirements
- Stock boot.img for your phone model (its best its for your Build Number / Variant ) . You can extract from the stock rom / firmware of your device (you may check our firmware collection) OR backup from your device using any method at the forum e.g Wwr_Mtk, Miracle Box, CM2, Nck Box Pro etc
- Download Latest Magisk Manager apk @ https://github.com/topjohnwu/Magisk/releases
- Active internet connection on your Android device
- Install adb and fastboot
Follow the steps below to patch boot.img using magisk manager to remove dm_verity
- Copy the stock boot.img of your device to your phone's internal storage or SD card
- On your phone, launch magisk manager app
- If you're not using the latest version, you'll have to update the app first before proceeding
- Click "Advanced settings" > Untick the checkbox beside "Preserve AVB 2.0/dm-verity"
- Select Install > Install > Patch Boot Image File >
- Navigate to the location of the stock boot.img you copied earlier on, then Select it. Note that if you are using a samsung device then you should select the firmware of your device in .tar format instead of boot.img
- Magisk Manager should begin downloading the magisk zip file used for patching
- Once download is complete, MagiskManager will automatically patch the file and store it under SDcard/Download/magisk_patched.img[.tar]
- You can now flash the magisk_patched boot using fastboot to remove dm_verity from your device
Code:adb devices
adb reboot-bootloader
fastboot devices
fastboot flash boot magisk_patched.img
Method 3 - Flashing vbmeta
Requirements
- Device with /vbmeta partition
- Download empty vbmeta.img @ [ Login / Register to download free] if your device doesn't require a signed vbmeta or generate a custom signed vbmeta if it does
- Install adb and fastboot
Follow the steps below to flash vbmeta.img to remove dm_verity
- Copy the vbmeta.img into your adb and fastboot folder
- You can now flash the vbmeta.img using fastboot to remove dm_verity from your device
Code:adb devices
adb reboot-bootloader
fastboot devices
fastboot flash vbmeta vbmeta.img
- If the command above doesn't work for you, then you can try either of these commands below
Code:fastboot --disable-verity flash vbmeta vbmeta.img
fastboot --disable-verification flash vbmeta vbmeta.img
Important Notice
- If your device runs on android 9 (pie) and has a vbmeta partition then you must use method 3 as other methods won't work for your device
- If your device runs on android 8.x (oreo), then you can try either method 1 or 2
- If magisk patched boot (which also includes root) bootloops your device then you can try method 1 instead then use a custom recovery to attempt flashing supersu zip to get root
- If you've tried method 1 and there's nothing been replaced then you should use method 2 and let magisk do the patching