DM Verity, OPT Encrypt, and Force Encryption Disabler for Xiaomi Devices

DM Verity, OPT Encrypt, and Force Encryption Disabler for Xiaomi Devices 1

You may call it as a tweak, a hack, or a mod but the underlying concept of using one of these files is to avoid bootloop after flashing a custom recovery and gaining root with Magisk. Enter dm-verity disabler tool! Many Mi Fans also call it the “Lazy Flasher“. This file is basically a universal mod to hack boot image with dm-verity enabled. You may end up in a bootloop state or with a broken device if you flashed TWRP and granted it to allow system modification.

In a normal situation, you will have to install a kernel that has dm-verity disabled in the fstab and hence you can bypass the dm-verity’s boot prevention. Instead of installing a custom kernel through baking a custom boot image, this LazyFlasher or Universal DM-Verity Disabler will save your time much by dynamically modify ramdisks and inject kernel binaries into the current boot image. It takes away the pain of building a custom boot image. Many thanks for its developers for that.

The explanation above may sound geeky. Novice users can simply understand following logic: flashing TWRP and swiping to allow system modification on many recent MIUI devices will trigger a security mechanism that prevents the device to boot properly. Therefore, some good developers have managed to create a hack to fix the situation. This helps many novice users from “cooking” a custom boot image.

There are two popular hacks with similar abilities out there: LazyFlasher and Universal DM-Verity Disabler.


Developed by jcadduono, a member of XDA forum, Lazy Flasher has gained its name in many Mi Fans around the globe. It easy-to-remember name helps it gain its popularity. This hack supports many devices powered with arm (armv7), arm64 (aarch64), x86 (i386), x86_64 (amd64), mips, and mips64 CPU architectures including those produced by Qualcomm and MediaTek.

The only downside is its incompatibility with TWRP built based on Android 4.3 or earlier. Check all of its features out below:

  • ChromeOS support (ChromeOS test-key signing and recognition)
  • MediaTek device support (MTK headers)
  • SELinux policy injection support via sepolicy-inject
  • Includes an optional bbe tool for applying binary patches
  • Supports dtb.img replacement (place it in the root folder named “dtb.img”)
  • Scans fstab and partition locations for the boot partition optionally allows a preset location
  • Supports Gzip, LZ4, Bzip2, and LZO ramdisks. Support for LZMA and XZ is a work in progress
  • Supports arm (armv7), arm64 (aarch64), x86 (i386), x86_64 (amd64), mips, and mips64 architectures
  • Intelligently installs kernel modules by copying the previous layout of /system/lib/modules and creating symlinks
  • A process that executes a sorted list of scripts for making the desired modifications (separate from the framework)
  • Example scripts to disable dm-verity or forced encryption during the install process (010-no-force-encrypt, 015-no-dm-verity)
  • Handily unpacks, decompresses, applies changes, compresses, and repacks boot images quickly and safely
  • Creates modprobe supported /lib/modules aliases if kernel modules are included in the installer (030-kernel-modules)
  • Installs new files to the ramdisk and sets their permissions automatically based on file type from ramdisk-patch (020-patch-ramdisk)
  • Unnecessary architectures and tools can be removed to save space
  • Many useful functions and variables included in the patch.d environment to simplify modification/patching scripts (patch.d-env)

Download LazyFlasher

No Verity Opt Encrypt: The minimal version of the LazyFlasher framework.

File name :
Version 5.1 | 12870 downloads | Size: 1 MB
File name :
Version 6.0 | 15675 downloads | Size: 657 KB

No Verity Force Encrypt: The full LazyFlasher framework.

File name :
Version 5.1 | 2994 downloads | Size: 1 MB
File name :
Version 6.0 | 13542 downloads | Size: 657 KB

Universal DM Verity Disabler

It works the similar way as Lazyflasher. This hack is more like a universal solution to disable dm-verity and force-encrypt Android security mechanism. The Magisk installer does not modify the fstab files in the ramdisk. However, dm-verity and forceencrypt are disabled under certain conditions, even after flashing Magisk.

ALSO READ:  Download Reface App Mod APK

The developer Zackptg5, a senior member of XDA, has managed to create two variants of his universal solution: the minimal and the advanced version. The minimal version bypasses DM-Verity and disables it. The later one adds additional functionality which is to disable force encryption.

The version that only removes dm-verity is very useful if you want to keep encryption but need to disable dm_verity in the stock kernel. This is usually when your device is running MIUI Android 8.1 with Treble enabled.


The minimal version:

File name :
Version 09.02.2018 | 9080 downloads | Size: 4 MB

The advanced version:

File name :
Version 09.02.2018 | 9541 downloads | Size: 4 MB
File name :
Version 08.18.2019 | 6211 downloads | Size: 3 MB

The Latest version:

File name :
Version 12.27.2019 | 17033 downloads | Size: 3 MB

You have to flash this zip file after anything else that modifies your boot image (like a custom kernel). However, you have to make sure that you flash it before Magisk. The main reason behind this condition is that the Universal DM Verity Disabler creates the files that tell Magisk to not encrypt.

Credits and thanks belong to the developers: jcadduono and Zackptg5.

Read also: Mi Flash Tool: Portable and Standalone Installer.

About DM-Verity

How dm-verity works? According to the Android official page, this security mechanism works by using a cryptographic hash and a public key.

The public key is included on the boot partition, which must be verified externally by the device manufacturer. That key is used to verify the signature for that hash and confirm the device’s system partition is protected and unchanged… Because the hash values are stored in a tree of pages, only the top-level “root” hash must be trusted to verify the rest of the tree. The ability to modify any of the blocks would be equivalent to breaking the cryptographic hash… dm-verity protection lives in the kernel. So if rooting software compromises the system before the kernel comes up, it will retain that access.

In a short terminology, dm-verity is one technology used by Android to perform a verified boot. Introduced back in Android 4.4, Android’s verified boot implementation is based on the dm-verity device-mapper block integrity checking target. Hence, the dm-verity is a block integrity checking target. The main purpose of dm-verity is to guarantee the integrity of a device volume against corruption or malicious attacks (source: kynetics).


11 thoughts on “DM Verity, OPT Encrypt, and Force Encryption Disabler for Xiaomi Devices”

  1. I had gotten stuck trying to install lazy flasher on redmi note 5 pro Oreo after installing the latest TWRP (twrp-3.3.0-0-whyred.img). I think the latest version has issues with lazyflasher. This article came as a lifesaver to me. Didnt even know about Universal dm verity disabler. Thanks a ton. You are doing a marvelous job, really.

  2. Hey I wanted to ask. I am on Poco F1 and want to install rom
    And I don’t want root access.
    Which should I use?

    Should I only disable DM verity?

  3. Ulrich Birkelbach

    Hi there,
    thank you very much for the dm-verity post here.
    But how do I flash the dm-verity disabler? By fastboot or adb?
    When I install twrp on my MI9 everything is already encrypted.
    So I can´t use twrp to flash it.

    Thanks a lot for explaining.

  4. Thanks also for this information. Very clearly explained and well organised resources. Lazyflasher didn’t work for me with a Redmi 3S Prime. I tried many versions but each resulted in Error 1. Eventually tried the Universal Dm-Verity disabler which worked as described! Thank you!

Leave a Reply

Your email address will not be published.