• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Deprecated] Universal DM-Verity, ForceEncrypt, Disk Quota Disabler [11/2/2020]

Search This thread

enricojacko

Member
May 16, 2007
49
2
Milano (MI)
Hi. I have a Xiaomi Mi 10T Pro.
I followed your instructions and everything went fine, now I have an unencrypted Evolution X Custom ROM. Anyway, as soon as I set any protection (PIN, Fingerprint, etc.) to lock my screen and/or use Google Pay with MagiskHide (it is mandatory to setup a PIN), the device apply encryption.
Is there any way to prevent encryption and keep it decrypted even if I need to use a PIN and/or Fingerprint?
Thanks a lot.
 

Techguy777

Senior Member
Hi. I have a Xiaomi Mi 10T Pro.
I followed your instructions and everything went fine, now I have an unencrypted Evolution X Custom ROM. Anyway, as soon as I set any protection (PIN, Fingerprint, etc.) to lock my screen and/or use Google Pay with MagiskHide (it is mandatory to setup a PIN), the device apply encryption.
Is there any way to prevent encryption and keep it decrypted even if I need to use a PIN and/or Fingerprint?
Thanks a lot.
Are you sure it's encrypting your device? Ive never seen that before normally it allows you to set a pin without encryption. Does it take a few minutes and say encrypting?
 

enricojacko

Member
May 16, 2007
49
2
Milano (MI)
Are you sure it's encrypting your device? Ive never seen that before normally it allows you to set a pin without encryption. Does it take a few minutes and say encrypting?
Unfortunately yes... it happened again just few days ago.
I strictly followed instructions to wipe, flash EvolutionX for my Mi 10T Pro, fomat data, flashed DM-Verity zip, flash Magisk then format data again (just to be sure before first boot.
Everything was unencrypted for few days but, as soon as I was forced to setup a lock screen to use Google Pay, I chose the basic 4-digit PIN (no fingerprint, no face unlock) and my device was immediately encrypted. In fact, as soon as I rebooted to recovery, my TWRP asked for password to access phone data.
Is there any way to prevent encryption forever? Thanks a lot.
 

Techguy777

Senior Member
Unfortunately yes... it happened again just few days ago.
I strictly followed instructions to wipe, flash EvolutionX for my Mi 10T Pro, fomat data, flashed DM-Verity zip, flash Magisk then format data again (just to be sure before first boot.
Everything was unencrypted for few days but, as soon as I was forced to setup a lock screen to use Google Pay, I chose the basic 4-digit PIN (no fingerprint, no face unlock) and my device was immediately encrypted. In fact, as soon as I rebooted to recovery, my TWRP asked for password to access phone data.
Is there any way to prevent encryption forever? Thanks a lot.
I would think a custom kernel or just evolution x rom without the dm verity zip because it should have forced encryption shut off already. You might be turning it on by flashing the dm verity zip when you don't need to
 

hkdoublecat

Member
Jul 13, 2011
47
8
Not so sure if should apply this, so.....

#1 I flash rom and lose my access and all internal storage unwritable. Then #2 I apply adb command restorecon+chown+chmod to make the storage writable again. However,

#3 Some batch of old photos become unreadable, I suppose it is because they are now unencrypted for me. And sound DM-Verity could be my answer to make those files live again?

Much appreciate if someone who familiar would clear my mist.
 
  • Like
Reactions: SigmaPhi001

SigmaPhi001

Member
Aug 21, 2021
8
2
Not so sure if should apply this, so.....

#1 I flash rom and lose my access and all internal storage unwritable. Then #2 I apply adb command restorecon+chown+chmod to make the storage writable again. However,

#3 Some batch of old photos become unreadable, I suppose it is because they are now unencrypted for me. And sound DM-Verity could be my answer to make those files live again?

Much appreciate if someone who familiar would clear my mist.
I was able to successfully decrypt by sideloading dm-verity forceencrypt.zip but I was having the same issue with the system being unwriteable and I kept getting the message that there wasn't enough space to install apps or nethunter so I just ended up going with the nethunter lite version. I was wondering exactly what you did because I wasn't able to find a solution to this problem. Thanks in advance :)
 

hkdoublecat

Member
Jul 13, 2011
47
8
I was able to successfully decrypt by sideloading dm-verity forceencrypt.zip but I was having the same issue with the system being unwriteable and I kept getting the message that there wasn't enough space to install apps or nethunter so I just ended up going with the nethunter lite version. I was wondering exactly what you did because I wasn't able to find a solution to this problem. Thanks in advance :)
I input adb command in recovery mode:

chown -R media_rw:media_rw /data/media/
find /data/media/ -type d -exec chmod 775 {} ';'
find /data/media/ -type f -exec chmod 664 {} ';'
restorecon -FR /data/media/

as instructed here
 
  • Like
Reactions: SigmaPhi001

SigmaPhi001

Member
Aug 21, 2021
8
2
I input adb command in recovery mode:

chown -R media_rw:media_rw /data/media/
find /data/media/ -type d -exec chmod 775 {} ';'
find /data/media/ -type f -exec chmod 664 {} ';'
restorecon -FR /data/media/

as instructed here
Im restoring to factory and Im going to try this. Thanks a lot for sharing this, I've been searching for days for a solution so I really appreciate this.

Update: I just followed the instructions on that thread and now everything is resolved. Thank you very much for that advice, I really appreciate you pointing me in the right direction. :)
 
Last edited:

sieger007

Senior Member
Jul 4, 2008
254
20
Dublin
I am on a rooted android 10 phone ( magisk) . I restored stock recovery. No Luck incremental OTA's keep failing. I then restored stock Boot after removing magisk . Still got veriification error. My BL is unlocked. What does it take to get my OTA zip file working.... do I flash dm verify force encrypt . Why does it refuse. Should BL be locked as well
 

aIecxs

Senior Member
Feb 17, 2016
1,135
344
gitlab.com
As already stated this zip does modifications in /vendor/etc/fstab.qcom and the only way to undo is restore the backup which you have created before you flashed this zip
 

Blue_Monk

Member
Mar 29, 2008
29
0
OnePlus 5T
OnePlus 6
HI there. I'm having some trouble with installing this. Log below.
Steps:
-installed TWRP -> Format Data -> reboot to recovery
-ADB load zip ->TWRP install zip -> error "Unable to decrypt FBE" and the stuff below.
No magisk or anything. Just twrp and this zip.
OnePlus 9 Pro OOS11.2.9.9

Code:
Installing zip file '/sdcard/Disable_Dm-Verity_ForceEncrypt_11.02.2020.zip'
I:Update binary zip
Verifying package compatibility...
Package doesn't contain compatibility.zip entry
I:Extracting updater binary 'META-INF/com/google/android/update-binary'
I:Zip does not contain SELinux file_contexts file in its root.

Archive:  /sdcard/Disable_Dm-Verity_ForceEncrypt_11.02.2020.zip
  inflating: tools/arm/magiskpolicy
  inflating: tools/avb/verity.x509.pem
  inflating: tools/x86/futility
  inflating: META-INF/com/google/android/updater-script
  inflating: META-INF/com/google/android/update-binary
  inflating: tools/util_functions.sh
  inflating: tools/chromeos/kernel.keyblock
  inflating: tools/arm/futility
  inflating: README.md
  inflating: tools/chromeos/kernel_data_key.vbprivk
  inflating: tools/ak3-core.sh
  inflating: tools/arm/magiskboot
  inflating: anykernel.sh
  inflating: tools/boot_signer-dexed.jar
  inflating: tools/arm/keycheck
  inflating: tools/x86/magiskboot
  inflating: tools/x86/busybox
  inflating: tools/x86/keycheck
  inflating: tools/arm/busybox
  inflating: banner
  inflating: tools/x86/magiskpolicy
  inflating: tools/avb/verity.pk8
"*************************************************"
"* DmVerity,ForceEncrypt, and DiscQuota Disabler *"
"*                 By: Zackptg5                  *"
"*         Heavily based on the work of:         *"
"*            TopJohnWu and Jcadduono            *"
"*************************************************"



AnyKernel3 by osm0sis @ xda-developers


Installing...
/dev/block/by-name/boot_b

- Chosen/Default Arguments:
   Keep ForceEncrypt: false
   Keep Dm-Verity: false
   Keep Disc Quota: true

- Detecting Root Method...
   No Magisk or SuperSu detected!
- Unpacking boot img...
192+0 records in
192+0 records out
201326592 bytes (192.0MB) copied, 0.211559 seconds, 907.5MB/s
Parsing boot image: [/tmp/anykernel/boot.img]
HEADER_VER      [0]
KERNEL_SZ       [43962880]
RAMDISK_SZ      [369099097]
SECOND_SZ       [0]
EXTRA_SZ        [3]
PAGESIZE        [0]
NAME            []
CMDLINE         []
CHECKSUM        [0000000000000000000000000000000000000000000000000000000000000000]
Floating point exception
- Creating .magisk and .supersu files...
- Patching fstabs:
   /vendor/etc/fstab.qcom
sed: can't create temp file '/vendor/etc/fstab.qcom2EQI4K': Read-only file system
sed: can't create temp file '/vendor/etc/fstab.qcomWbnVBw': Read-only file system
   /vendor/etc/fstab_nodata.qcom
sed: can't create temp file '/vendor/etc/fstab_nodata.qcomKofqWI': Read-only file system
sed: can't create temp file '/vendor/etc/fstab_nodata.qcomChTQvG': Read-only file system
- Repacking boot img...
Parsing boot image: [/tmp/anykernel/boot.img]
HEADER_VER      [0]
KERNEL_SZ       [43962880]
RAMDISK_SZ      [369099097]
SECOND_SZ       [0]
EXTRA_SZ        [3]
PAGESIZE        [0]
NAME            []
CMDLINE         []
CHECKSUM        [0000000000000000000000000000000000000000000000000000000000000000]
Floating point exception

Repacking image failed. Aborting...
Updater process ended with ERROR: 1
I:Install took 6 second(s).
Error installing zip file '/sdcard/Disable_Dm-Verity_ForceEncrypt_11.02.2020.zip'
Updating partition details...
I:checking for twrp app
I:Data backup size is 0MB, free: 223987MB.
...done
I:Set page: 'flash_done'
I:operation_end - status=1
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:Set page: 'advanced'
I:Set page: 'copylog'
I:Set page: 'action_page'
I:operation_start: 'Copy Log'
I:Copied file /tmp/recovery.log to /data/media/recovery.log
 

sieger007

Senior Member
Jul 4, 2008
254
20
Dublin
HI there. I'm having some trouble with installing this. Log below.
Steps:
-installed TWRP -> Format Data -> reboot to recovery
-ADB load zip ->TWRP install zip -> error "Unable to decrypt FBE" and the stuff below.
No magisk or anything. Just twrp and this zip.
OnePlus 9 Pro OOS11.2.9.9

Code:
Installing zip file '/sdcard/Disable_Dm-Verity_ForceEncrypt_11.02.2020.zip'
I:Update binary zip
Verifying package compatibility...
Package doesn't contain compatibility.zip entry
I:Extracting updater binary 'META-INF/com/google/android/update-binary'
I:Zip does not contain SELinux file_contexts file in its root.

Archive:  /sdcard/Disable_Dm-Verity_ForceEncrypt_11.02.2020.zip
  inflating: tools/arm/magiskpolicy
  inflating: tools/avb/verity.x509.pem
  inflating: tools/x86/futility
  inflating: META-INF/com/google/android/updater-script
  inflating: META-INF/com/google/android/update-binary
  inflating: tools/util_functions.sh
  inflating: tools/chromeos/kernel.keyblock
  inflating: tools/arm/futility
  inflating: README.md
  inflating: tools/chromeos/kernel_data_key.vbprivk
  inflating: tools/ak3-core.sh
  inflating: tools/arm/magiskboot
  inflating: anykernel.sh
  inflating: tools/boot_signer-dexed.jar
  inflating: tools/arm/keycheck
  inflating: tools/x86/magiskboot
  inflating: tools/x86/busybox
  inflating: tools/x86/keycheck
  inflating: tools/arm/busybox
  inflating: banner
  inflating: tools/x86/magiskpolicy
  inflating: tools/avb/verity.pk8
"*************************************************"
"* DmVerity,ForceEncrypt, and DiscQuota Disabler *"
"*                 By: Zackptg5                  *"
"*         Heavily based on the work of:         *"
"*            TopJohnWu and Jcadduono            *"
"*************************************************"



AnyKernel3 by osm0sis @ xda-developers


Installing...
/dev/block/by-name/boot_b

- Chosen/Default Arguments:
   Keep ForceEncrypt: false
   Keep Dm-Verity: false
   Keep Disc Quota: true

- Detecting Root Method...
   No Magisk or SuperSu detected!
- Unpacking boot img...
192+0 records in
192+0 records out
201326592 bytes (192.0MB) copied, 0.211559 seconds, 907.5MB/s
Parsing boot image: [/tmp/anykernel/boot.img]
HEADER_VER      [0]
KERNEL_SZ       [43962880]
RAMDISK_SZ      [369099097]
SECOND_SZ       [0]
EXTRA_SZ        [3]
PAGESIZE        [0]
NAME            []
CMDLINE         []
CHECKSUM        [0000000000000000000000000000000000000000000000000000000000000000]
Floating point exception
- Creating .magisk and .supersu files...
- Patching fstabs:
   /vendor/etc/fstab.qcom
sed: can't create temp file '/vendor/etc/fstab.qcom2EQI4K': Read-only file system
sed: can't create temp file '/vendor/etc/fstab.qcomWbnVBw': Read-only file system
   /vendor/etc/fstab_nodata.qcom
sed: can't create temp file '/vendor/etc/fstab_nodata.qcomKofqWI': Read-only file system
sed: can't create temp file '/vendor/etc/fstab_nodata.qcomChTQvG': Read-only file system
- Repacking boot img...
Parsing boot image: [/tmp/anykernel/boot.img]
HEADER_VER      [0]
KERNEL_SZ       [43962880]
RAMDISK_SZ      [369099097]
SECOND_SZ       [0]
EXTRA_SZ        [3]
PAGESIZE        [0]
NAME            []
CMDLINE         []
CHECKSUM        [0000000000000000000000000000000000000000000000000000000000000000]
Floating point exception

Repacking image failed. Aborting...
Updater process ended with ERROR: 1
I:Install took 6 second(s).
Error installing zip file '/sdcard/Disable_Dm-Verity_ForceEncrypt_11.02.2020.zip'
Updating partition details...
I:checking for twrp app
I:Data backup size is 0MB, free: 223987MB.
...done
I:Set page: 'flash_done'
I:operation_end - status=1
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:Set page: 'advanced'
I:Set page: 'copylog'
I:Set page: 'action_page'
I:operation_start: 'Copy Log'
I:Copied file /tmp/recovery.log to /data/media/recovery.log
it may be having dynamic partitioning that is even after attempting decrypting it will automatically encrypt
 
  • Like
Reactions: aIecxs

Blue_Monk

Member
Mar 29, 2008
29
0
OnePlus 5T
OnePlus 6
I'm at a loss tbh.
I did a full wipe with MSM tool last night and installed twrp and magisk. funny thing is I forgot to flash vbmeta and the phone boots and works.
I'll give it another shot today
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    So this may not come as a surprise to many of you but the situation hasn't changed here. I don't have any devices with fully functional TWRP and don't see that happening in the near future. I also no longer have a desire to disable encryption/verity on my devices so I won't be updating this mod anymore.
    Anyone who wants to fork and update/modify is completely free to do so :)
  • 285
    Hi all!

    For the past couple of months, I've been looking into making a more universal solution to disable dm-verity and forceencrypt. Needing to take different zips, modify them for different devices, and then cross your fingers when you switch between custom and stock roms simply wasn't good enough for me. After lots of searching around, failed attempts, and some guidance by @Xennet, @osm0sis, and @nathanchance (thank you all for your help), I finally got a working solution. Ironically, it was under my nose the whole time.

    @topjohnwu figured much of this out a while ago with his magiskboot binary - just modify the fstabs. Magiskboot only works for fstabs in the ramdisk though and dm-verity and forceencrypt are only disabled under certain conditions (when you create a .magisk file with the variables set to false and place it in the proper location). So I made an installker with AK3 by @osm0sis and used a combination of sed patches by @jcadduono in addition to others I found for fstabs not in the ramdisk, modified magiskboot with some extra entries I found need to be removed on some devices, and added some stuff of my own like the creation of .magisk and .supersu files in the right location with the proper contents.

    The end result: a zip that will remove dm-verity and/or forceencrypt from all fstabs on your device
    It can also remove disk quota if you choose. This may be needed if you have an older twrp and/or want to downgrade to Nougat. More info here: https://source.android.com/devices/storage/faster-stats

    Instructions:
    The zipname tells the installer what to do. Here are the current options:
    • Add 'enfec' or en'forceencrypt' to zipname to keep forceencrypt enabled if present
    • Add 'fec' or 'forceencrypt' to zipname to disable forceencrypt (zipname already has this so remove these if you want to keep it enabled)
    • Add 'quota' to zipname to disable disc quota
    Note that verity is always disabled - it has to be for any modifications with this mod

    If you're currently encrypted:
    1. BACKUP YOUR INTERNAL STORAGE TO YOUR PC
    2. Format data (this is NOT the same as Wipe data) (In TWRP: Wipe -> Format Data)
    3. Reboot back into recovery
    4. Follow the directions below for when you're not encrypted

    If you're not encrypted: flash all of your stuff, then FLASH THIS ZIP LAST

    Some extra details for Slot devices:
    1. Flash ROM
    2. Flash TWRP Installer Zip
    3. Reboot into TWRP
    4. Flash everything else
    5. Flash this zip

    Only difference here is the twrp zip and the recovery reboot, main principle is the same - FLASH THIS ZIP LAST

    Troubleshooting:
    • Take a recovery log after flashing this zip (thanks to @aIecxs for the imgs):
      recovery_log.png
    • If the zip isn't patching any fstabs that it should be, then it's possible that the previous zip(s) didn't unmount system and/or vendor properly. Either unmount them in twrp, or just reboot back into recovery and flash this zip again

    Compatibility: Any android device

    Source: https://github.com/Zackptg5/Disable_Dm-Verity_ForceEncrypt

    Download
    17
    Hey everyone! It's been a while thanks to life and such but I have a test build out that I'll make the next release if all goes well. Let me know if it works for you, I'm especially interested in system as root devices.

    I completely revamped the zip to now use AK3 by @osm0sis and have a modified version of magiskboot in it that'll do some extra stuff for ramdisk patching :)
    16
    Merry Christmas everybody! Posted another build - lots of bug fixes - think I got everything ironed out. Here's the changelog:
    • Added vol key selection method for adb sideloading
    • Fixed dtbo patching bugs
    • Fixed magiskboot bug
    • Ignore twrp fstabs if installed in boot img (system as root devices)
    • Add x86 chromeos support
    • Fix apex mounting
    • Misc bug fixes/improvements
    13
    Updated the zip!
    Changelog:
    - Update ak3
    - Always disable verity - required for any other options
    - Added keep encryption option to zip
    - Added new verity flags
    12
    Updated zip! Fixes problem where kernel fstabs weren't being patched. Thanks to lastsaskatchewanpirate @ github for the fix