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

Search This thread

repey6

Senior Member

Zackptg5

Recognized Developer
Sep 18, 2014
4,148
7,005
zackptg5.com
Google Pixel 4a
Google Pixel 5a
Just an update here guys. Theoretically, flashing order shouldn't matter other than rom first. The exception here is of course if you flash a kernel or some mod that would enable force encrypt.
That being said, I've been flashing around a bit and I found that the best order for me has been: rom, gapps, dmverity-fec remover, magisk 16.7 (1671) - I copied the file in this zip to /cache prior to flash magisk.
If anyone was having trouble, this is worth a shot :)

You can always flash a custom kernel after booting or before this dmverity-fec remover zip if you use it.
 

Attachments

  • magisk.zip
    163 bytes · Views: 452

Mervingio

Senior Member
Mar 28, 2011
3,917
944
Elysium
OnePlus 7 Pro
All right @Zackptg5 I’m a little lost here so what of the two zip I really need to flash?

This: https://xdaforums.com/showpost.php?p=77153231&postcount=23

Or this the one in the OP: https://xdaforums.com/attachment.php?attachmentid=4551401&d=1531795101

And if I understand correctly the flash steps are follow?

1 Rom (custom or stock)
2 gapps (not apply to stock roms)
3 dmverity (is this your zip right)
4 magisk
5 then the 500 moded zips that people flash and then phone bootloped or explode (joke but seriously for few guys)

Let me know
 

Zackptg5

Recognized Developer
Sep 18, 2014
4,148
7,005
zackptg5.com
Google Pixel 4a
Google Pixel 5a
All right @Zackptg5 I’m a little lost here so what of the two zip I really need to flash?

This: https://xdaforums.com/showpost.php?p=77153231&postcount=23

Or this the one in the OP: https://xdaforums.com/attachment.php?attachmentid=4551401&d=1531795101

And if I understand correctly the flash steps are follow?

1 Rom (custom or stock)
2 gapps (not apply to stock roms)
3 dmverity (is this your zip right)
4 magisk
5 then the 500 moded zips that people flash and then phone bootloped or explode (joke but seriously for few guys)

Let me know
The magisk zip isn't a flashable zip, it just contains the .magisk file.
1. So extract that .magisk file from the zip, copy it to /cache
2. Flash rom
3. Flash gapps if applicable
4. Flash dmverity from the OP
5. Flash magisk
6. Then mods if you're a risk taker ;)

You bring up a good point though. I'll add the .magisk file thing to the dmverity zip so you won't have to worry about it in the future. So the next version will have that (can't tell you when I'll release it though, I've been pretty busy lately)
 

Mervingio

Senior Member
Mar 28, 2011
3,917
944
Elysium
OnePlus 7 Pro
The magisk zip isn't a flashable zip, it just contains the .magisk file.
1. So extract that .magisk file from the zip, copy it to /cache
2. Flash rom
3. Flash gapps if applicable
4. Flash dmverity from the OP
5. Flash magisk
6. Then mods if you're a risk taker ;)

You bring up a good point though. I'll add the .magisk file thing to the dmverity zip so you won't have to worry about it in the future. So the next version will have that (can't tell you when I'll release it though, I've been pretty busy lately)

Take your time my friend :good:
and thanks for your work :cool:
 

Zackptg5

Recognized Developer
Sep 18, 2014
4,148
7,005
zackptg5.com
Google Pixel 4a
Google Pixel 5a
@Mervingio and everyone else:

Updated this zip to v1.1. Changelog:
  • Added magisk.apk back for bootsigning purposes only (doesn't get installed or anything)
  • Updated stuff to magisk 16.7 (1671)
  • Added creation/modification of .magisk and .supersu files with verity and FEC disabled. Also set the supersu fec remover to false as well just in case it could mess with things. This will remove any existing .magisk files and create one at /cache. It'll modify /data/.supersu if it exists, otherwise it'll create it
 

Mervingio

Senior Member
Mar 28, 2011
3,917
944
Elysium
OnePlus 7 Pro
@Mervingio and everyone else:

Updated this zip to v1.1. Changelog:
  • Added magisk.apk back for bootsigning purposes only (doesn't get installed or anything)
  • Updated stuff to magisk 16.7 (1671)
  • Added creation/modification of .magisk and .supersu files with verity and FEC disabled. Also set the supersu fec remover to false as well just in case it could mess with things. This will remove any existing .magisk files and create one at /cache. It'll modify /data/.supersu if it exists, otherwise it'll create it
Sweet Thanks Zach [emoji41]

Sent from my ONEPLUS A5010 using Tapatalk
 

chooks06

Senior Member
Jan 12, 2015
1,096
375
singapore
@Mervingio and everyone else:

Updated this zip to v1.1. Changelog:
Added magisk.apk back for bootsigning purposes only (doesn't get installed or anything)
Added creation/modification of .magisk and .supersu files with verity and FEC disabled. Also set the supersu fec remover to false as well just in case it could mess with things. This will remove any existing .magisk files and create one at /cache. It'll modify /data/.supersu if it exists, otherwise it'll create it
Good day mate!

Just a nooby layman question (I'm new to Magisk}..

To get the new zip on board, can just just flash it via TWRP with the device already running previous version?

I just had a fun time - flashed this updated version, then installed a module via Magisk (first time). On reboot, SIM not detected cause I lost both IMEIs.

No biggie - had a TWRP backup so was back in business in 15 min.

Because I did two different things consecutively, I can't figure out what went by wrong where (my bad).

So I just want to eliminate this first after which I'll back up to this state. Then I'll probably start to learn about the Unity thingy.

Thanks for the awesome work.

Cheers!

Choo ks
 

Zackptg5

Recognized Developer
Sep 18, 2014
4,148
7,005
zackptg5.com
Google Pixel 4a
Google Pixel 5a
Good day mate!

Just a nooby layman question (I'm new to Magisk}..

To get the new zip on board, can just just flash it via TWRP with the device already running previous version?

I just had a fun time - flashed this updated version, then installed a module via Magisk (first time). On reboot, SIM not detected cause I lost both IMEIs.

No biggie - had a TWRP backup so was back in business in 15 min.

Because I did two different things consecutively, I can't figure out what went by wrong where (my bad).

So I just want to eliminate this first after which I'll back up to this state. Then I'll probably start to learn about the Unity thingy.

Thanks for the awesome work.

Cheers!

Choo ks

You can but there's no point. This needs to be flashed after any rom flashes (both dirty and clean). You can flash it and reflash it as many times as you want and it shouldn't effect anything (I've done it just to see what happened and all was fine).
I've never heard of the IMEI thing before so I'd doubt it would be related to this. Just out of curiosity, what magisk module did you flash and what device do you have?


On another note, I reuploaded v1.1 with magisk 16.7 binaries :)
 

chooks06

Senior Member
Jan 12, 2015
1,096
375
singapore
You can but there's no point. This needs to be flashed after any rom flashes (both dirty and clean). You can flash it and reflash it as many times as you want and it shouldn't effect anything (I've done it just to see what happened and all was fine).
I've never heard of the IMEI thing before so I'd doubt it would be related to this. Just out of curiosity, what magisk module did you flash and what device do you have?


On another note, I reuploaded v1.1 with magisk 16.7 binaries :)

I am using the 16.7 binaries. Actually I had some issues, had soft bricks a few times, so had to go all the way back to flashing stock ROM then root again.

When I decided to try Magisk, it was after I found your post and the dm-verity removal. It was just a few hours before I saw your latest version update info..lol

By then I did a TWRP backup and decided to try (albeit wrongly doing 2 different things consecutively) just flashing your new version.

Am still on a learning curve so deepest apologies if any convenience caused.

Just trying to figure out where how and why I went wrong.:p
 

Zackptg5

Recognized Developer
Sep 18, 2014
4,148
7,005
zackptg5.com
Google Pixel 4a
Google Pixel 5a
I am using the 16.7 binaries. Actually I had some issues, had soft bricks a few times, so had to go all the way back to flashing stock ROM then root again.

When I decided to try Magisk, it was after I found your post and the dm-verity removal. It was just a few hours before I saw your latest version update info..lol

By then I did a TWRP backup and decided to try (albeit wrongly doing 2 different things consecutively) just flashing your new version.

Am still on a learning curve so deepest apologies if any convenience caused.

Just trying to figure out where how and why I went wrong.:p
Well if you've already booted and not encrypted, you're good to go. If you're encrypted, you'll need to wipe everything (including internal storage so back up your stuff to your PC first). Then flash rom, gapps, custom kernel (if applicable), this zip, then magisk (if you want). You're using magisk 16.7 (1671) right?
 

chooks06

Senior Member
Jan 12, 2015
1,096
375
singapore
Well if you've already booted and not encrypted, you're good to go. If you're encrypted, you'll need to wipe everything (including internal storage so back up your stuff to your PC first). Then flash rom, gapps, custom kernel (if applicable), this zip, then magisk (if you want). You're using magisk 16.7 (1671) right?
Good to go ... In fact recovered using TWRP backup twice. If it comes to the crunch will go back to ground zero. Thanks!

Edit.. Yes, I'm on 1671
 
Last edited:
  • Like
Reactions: Zackptg5

DEVILOPS 007

Senior Member
May 24, 2016
3,866
1,668
Colchester
@Zackptg5 Hi man, I'm on treskmod for op5t and for some reason when flashing this my phone shows the splash screen then reboots to recovery. I have no idea why but seems to be the same problem @bdwilk had and maybe still has. Treskmod is based on Omni and includes 5.1.3 firmware I think and includes the open gapps package from their sources on GitHub if that helps.
 
  • Like
Reactions: bdwilk

Zackptg5

Recognized Developer
Sep 18, 2014
4,148
7,005
zackptg5.com
Google Pixel 4a
Google Pixel 5a
@Zackptg5 Hi man, I'm on treskmod for op5t and for some reason when flashing this my phone shows the splash screen then reboots to recovery. I have no idea why but seems to be the same problem @bdwilk had and maybe still has. Treskmod is based on Omni and includes 5.1.3 firmware I think and includes the open gapps package from their sources on GitHub if that helps.
Have you flashed anything else and in what order? Can you post recovery.log post flashing?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 322
    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