Hovatek
  • Private Support
  • Blog
  • Home
Login Register Ask Question Hello There, Guest!
Login
Username:
Password: Lost Password?
 

OR

       

Hovatek is hiring: Application is open to residents of Lagos, Nigeria only! Click Here To Apply
Telegram Channel: Join the discussions @ t.me/Hovatek


  1. Hovatek Forum
  2. DEVELOPMENT
  3. Android
Pages (5): 1 2 3 4 5 Next »
 
Thread Rating:
  • 2 Vote(s) - 4.5 Average

Thread Modes

[Tutorial] How to disable dm-verity or Android Verified Boot (AVB)

X3non
Hovatek Representative
Posts: 18,430
Threads: 550
Joined: Jul 2014
Reputation: 326
#1

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

  1. Launch Hxd hex editor tool
  2. Drag and drop your boot.img onto hxd hex editor window
  3. Click Search > Replace
  4. 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

  5. Click "Replace all"
  6. You can confirm if all traces of "verify" has been removed, click Search > find > Text-string
    Code:
    search for : verify

  7. Click Search all, and you should get a prompt "Can't find verify", click OK
  8. Click File > save
  9. The original unmodified file will be saved as boot.img.bak while the new modified file will be saved as boot.img
  10. 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

  1. Copy the stock boot.img of your device to your phone's internal storage or SD card
  2. On your phone, launch magisk manager app
  3. If you're not using the latest version, you'll have to update the app first before proceeding
  4. Click "Advanced settings" > Untick the checkbox beside "Preserve AVB 2.0/dm-verity"
  5. Select Install > Install > Patch Boot Image File >
  6. 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
  7. Magisk Manager should begin downloading the magisk zip file used for patching
  8. Once download is complete, MagiskManager will automatically patch the file and store it under SDcard/Download/magisk_patched.img[.tar]
  9. 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

  1. Copy the vbmeta.img into your adb and fastboot folder
  2. 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

  3. 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


(This post was last modified: 26-12-2020, 08:08 PM by hovatek.)
Find
Reply
ikasemota
Junior Member
*
Posts: 36
Threads: 2
Joined: Apr 2017
Reputation: 0
#2

29-04-2020, 02:21 PM
Do I need to unlock the bootloader before I could proceed on method #3?
(This post was last modified: 29-04-2020, 02:24 PM by ikasemota.)
Find
Reply
X3non
Hovatek Representative
Posts: 18,430
Threads: 550
Joined: Jul 2014
Reputation: 326
#3

30-04-2020, 01:00 AM
(29-04-2020, 02:21 PM)ikasemota Wrote:  Do I need to unlock the bootloader before I could proceed on method #3?

yes
Find
Reply
Mitchie Boom
Enthusiastic Member
Posts: 10
Threads: 2
Joined: Mar 2020
Reputation: 0
#4

07-05-2020, 05:43 PM
Hi I successfully ported a TWRP from my stock recovery however when I'm going to flash an image there was no system partitions and other partitions, what should I do?
Find
Reply
X3non
Hovatek Representative
Posts: 18,430
Threads: 550
Joined: Jul 2014
Reputation: 326
#5

08-05-2020, 12:00 PM
(07-05-2020, 05:43 PM)Mitchie Boom Wrote:  Hi I successfully ported a TWRP from my stock recovery however when I'm going to flash an image there was no system partitions and other partitions, what should I do?

already replied to @ https://forum.hovatek.com/thread-21839-p...#pid192649
(This post was last modified: 08-05-2020, 12:07 PM by X3non.)
Find
Reply
desexiet
Experienced Member
***
Posts: 86
Threads: 10
Joined: Oct 2016
Reputation: 0
#6

11-05-2020, 01:33 AM
(07-05-2020, 05:43 PM)Mitchie Boom Wrote:  Hi I successfully ported a TWRP from my stock recovery however when I'm going to flash an image there was no system partitions and other partitions, what should I do?

Were you able to install the ported TWRP successfully?
Find
Reply
mainframe
Newbie
Posts: 2
Threads: 0
Joined: Mar 2020
Reputation: 0
#7

30-05-2020, 12:28 PM
Hi,

I was following your instructions of creating a custom vbmeta with all the keys (boot key modified) and this guide to flash a patched boot
img, but i am stuck on flashing anything with fastboot. No matter if it is original or patched, it is always stuck like this:

Rewriting vbmeta struct at offset: 0
Sending 'vbmeta' (1024 KB)                        OKAY [  0.043s]
Writing 'vbmeta'                                                                                                       

I would appreciate any thoughts on my conundrum.

/edit: The bootloader is unlocked (also by following a hovatek guide with the modified fastboot)
(This post was last modified: 30-05-2020, 01:02 PM by mainframe.)
Find
Reply
X3non
Hovatek Representative
Posts: 18,430
Threads: 550
Joined: Jul 2014
Reputation: 326
#8

30-05-2020, 10:48 PM
(30-05-2020, 12:28 PM)mainframe Wrote:  Hi,

I was following your instructions of creating a custom vbmeta with all the keys (boot key modified) and this guide to flash a patched boot
img, but i am stuck on flashing anything with fastboot. No matter if it is original or patched, it is always stuck like this:

Rewriting vbmeta struct at offset: 0
Sending 'vbmeta' (1024 KB)                        OKAY [  0.043s]
Writing 'vbmeta'                                                                                                       

I would appreciate any thoughts on my conundrum.

/edit: The bootloader is unlocked (also by following a hovatek guide with the modified fastboot)

did you try using the fastboot binary used while unlocking bootloader?
if you still have problems then create a new thread for this issue..click the "ask question" button at the top
Find
Reply
ikasemota
Junior Member
*
Posts: 36
Threads: 2
Joined: Apr 2017
Reputation: 0
#9

24-06-2020, 10:38 AM
Please I read somewhere that it is also possible to flash an image file with SP flash tool without unlocking the bootloader. How true is that?
Find
Reply
X3non
Hovatek Representative
Posts: 18,430
Threads: 550
Joined: Jul 2014
Reputation: 326
#10

25-06-2020, 10:16 AM
(24-06-2020, 10:38 AM)ikasemota Wrote:  Please I read somewhere that it is also possible to flash an image file with SP flash tool without unlocking the bootloader. How true is that?

true (if the device in question allows flashing custom images ie non-verified or -sign images using spft) but you should also note that on recent android versions the chances are you'll brick the phone if you flash custom images without unlocking bootloader as a locked bootloader will always attempt to verify the integrity of OS before booting
(This post was last modified: 25-06-2020, 10:18 AM by X3non.)
Find
Reply
« Next Oldest | Next Newest »

Share

Share Tweet Share Share Pin
Pages (5): 1 2 3 4 5 Next »


Possibly Related Threads…
Thread / Author Replies Views Last Post
dm verity error: Android system is corrupted
Alpamayo
8
127
Last Post by X3non
19-01-2021, 08:38 PM
Verified boot
kelvinchinedu
1
92
Last Post by X3non
07-01-2021, 09:50 AM
Disabling dm-verity causes device to bootloop into Fastboot (Infinix Hot 9 Play)
vvion
7
361
Last Post by hovatek
28-12-2020, 07:17 AM
DM Verity error
Tony475
7
812
Last Post by hovatek
23-09-2020, 07:02 AM
[Tutorial] How to disable dm-verity or Android Verified Boot (AVB) - Why?
jc.internet.stuff
1
757
Last Post by X3non
24-06-2020, 01:10 PM

  • View a Printable Version


Users browsing this thread: 1 Guest(s)
  1. Hovatek Forum
  2. DEVELOPMENT
  3. Android

About

The Hovatek Forum is a free Tech. Support Forum. We provide solutions to all your device related problems and questions. We'll love to have you participate in discussions here whether you're a Newbie or Experienced.

         

Forum Team

Powered By MyBB. Crafted by EreeCorp.




Linear Mode
Threaded Mode