[FIX][DM-Verity][Oneplus3/3T]DM-Verity/Force Encryption Patched Boot Image - OnePlus 3T Guides, News, & Discussion

I am creating this thread keeping in my mind the several posts in various threads mentioning that they have accidentally triggered the DM-Verity flag and have an annoying message during startup or due to force encryption in the boot image the phone went back to encrypted state after flashing a new Stock Oxygen OS zip file in TWRP recovery.
So I decided to start a thread where I will post the links to the OFFICIAL BOOT IMAGES of Oxygen OS ROMs for both OnePlus3 and OnePlus3T which have been patched to disable the DM-Verity Flag and to disable the Force encryption that is present in the Stock Oxygen OS ROM.
NB: This thread is only for Nougat Based OOS ROMs. For disabling Dm-Verity and force Encryption in PIE OOS ROMs refer to my thread here: https://forum.xda-developers.com/oneplus-3t/how-to/dm-verity-disable-oxygen-os-t3922324. For Disabling DM-Verity in Oreo Based OOS ROMs visit my thread here: https://forum.xda-developers.com/oneplus-3t/how-to/disable-dm-verity-force-encryption-op3t-t3688748
THIS IS FOR BOTH ONEPLUS 3 and 3T and read the instructions carefully and apply the file specific for your model
Disclaimer: I am not responsible for any damage to your phone by using this...
Nothing has been changed....
It is 100% stock boot image except that the DM-Verity Flag and Force Encryption has been patched...
Links:
For ONEPLUS 3T
STABLE OOS Boot Images
Patched Boot Image Stable OOS 4.5.1
http://www.mediafire.com/file/vm2k81s3pregdiv/boot-patched-4.5.1-OP3T.img
Patched Boot Image Stable OOS 4.5.0
http://www.mediafire.com/file/m8e3nu4ak4u1zkz/boot-patched-4.5.0-OP3T.img
Patched Boot Image Stable OOS 4.1.7
http://www.mediafire.com/file/g5rk4284lzyvqnu/boot-patched-4.1.7-OP3T.img
Patched Boot Image Stable OOS 4.1.6
[url]http://www.mediafire.com/file/j3802c259gea6f2/boot-patched-4.1.6-OP3T.img[/URL]
Patched Boot Image Stable OOS 4.1.5
[url]http://www.mediafire.com/file/78ej52gmthok212/boot-patched-OOS4.1.5.img[/URL]
BETA OOS Boot Images
Patched Boot Image OOS Beta 15
http://www.mediafire.com/file/a436larx3ddx00l/boot-patched-Beta15-OP3T.img
Patched Boot Image OOS Beta 14
http://www.mediafire.com/file/brlvdth86lxi0yl/boot-patched-Beta14-OP3T.img
Patched Boot Image OOS Beta 13
http://www.mediafire.com/file/2clnhl0x4vu8bu8/boot-patched-Beta13-OP3T.img
Patched Boot Image OOS Beta 12
http://www.mediafire.com/file/2214mr1adpdwlx4/boot-patched-Beta12-OP3T.img
Patched Boot Image OOS Beta 11
http://www.mediafire.com/file/hywcwmv0a993ah5/boot-patched-Beta11-OP3T.img
Patched Boot Image OOS Beta 10
http://www.mediafire.com/file/n7nu0wj266e8fhh/boot-patched-Beta10-OP3T.img
Patched Boot Image OOS Beta 9
[url]http://www.mediafire.com/file/5lkp6fi33u9lkpt/boot-patched-Beta9-OP3T.img[/URL]
Patched Boot Image OOS Beta 8
[url]http://www.mediafire.com/file/4d5zrpff4jakjgk/boot-patched-OOS_Beta_8.img[/URL]
For OnePlus 3
STABLE OOS Boot Images
Patched Boot Image Stable OOS 4.5.1
http://www.mediafire.com/file/srdurw9pg4f614f/boot-patched-4.5.1-OP3.img
Patched Boot Image Stable OOS 4.5.0
http://www.mediafire.com/file/nrbuddj0652bf4u/boot-patched-4.5.0-OP3.img
Patched Boot Image Stable OOS 4.1.7
http://www.mediafire.com/file/2cb3jrqckb4suxw/boot-patched-4.1.7-OP3.img
Patched Boot Image Stable OOS 4.1.6
[url]http://www.mediafire.com/file/ytax9vfa9lyhd6d/boot-patched-4.1.6-OP3.img[/URL]
BETA OOS Boot Images
Patched Boot Image OOS Beta 24
http://www.mediafire.com/file/8fcbeiduhiewc9v/boot-patched-Beta24-OP3.img
Patched Boot Image OOS Beta 23
http://www.mediafire.com/file/9i3snrmmsinczct/boot-patched-Beta23-OP3.img
Patched Boot Image OOS Beta 22
http://www.mediafire.com/file/bauq66z2s6o2k1q/boot-patched-Beta22-OP3.img
Patched Boot Image OOS Beta 21
http://www.mediafire.com/file/r31feak94y3cm5z/boot-patched-Beta21-OP3.img
Patched Boot Image OOS Beta 20
http://www.mediafire.com/file/5h32hzw5ot1gbba/boot-patched-Beta20-OP3.img
Patched Boot Image OOS Beta 19
http://www.mediafire.com/file/y6446j7sxiw9jwx/boot-patched-Beta19-OP3.img
Patched Boot Image OOS Beta 18
http://www.mediafire.com/file/zfsji9mjjds7a6n/boot-patched-Beta18-OP3.img
Patched Boot Image OOS Beta 17
[url]http://www.mediafire.com/file/mrqhkq7igt7x4na/boot-patched-Beta17-OP3.img[/URL]
USAGE FOR STOCK OOS:
# Flash the downloaded boot-patched.img file corresponding to the Model and OOS version in TWRP immediately after flashing the Stock ROM zip in TWRP before doing anything (even before restarting or applying any patches, root, kernels, etc.)
# Restart back to TWRP Recovery.
# Done.
# Now do whatever you want like usual.. Flash root, kernel, mods or anything as usual
# You dont have to worry about triggering DM-Verity or Getting Force Encrypted again...
VERY IMPORTANT: FOR PEOPLE WHO HAVE ALREADY TRIGGERED DM-VERITY ON THEIR OOS OR CUSTOM ROM AND NEEDS TO GET RID OF THE DM-VERITY MESSAGE PERMANENTLY, READ MY POST 2. AFTER GETTING RID OF DM-VERITY BY FOLLOWING THE STEPS IN POST 2, NEXT TIME ONWARDS WHILE UPDATING YOUR OOS OR CUSTOM ROM FOLLOW THE INSTRUCTIONS IN THIS OP TO KEEP YOUR OOS AND PHONE FREE FROM THE TROUBLE OF DM-VERITY AND FORCE ENCRYPTION...
FAQs:
Q: Is the boot.img file altered in anyway?
A: As mentioned above its 100% stock boot image except that the DM-Verity Flag and Force Encryption has been patched...
Q: My phone is already encrypted, will I lose encryption?
A: No. It only disables force encryption. That means if you have already disabled encryption in your phone it will prevent the phone from getting encrypted when you flash a stock OOS ROM..
Q: I happen to lose TWRP and revert to stock recovery every time I update OOS, I happen to lose data/apps accidentally while updating OOS after I lose TWRP ...Can this be corrected by using this method?
A: Definitely. Follow the steps correctly. Each time while updating the OOS, after flashing the Full OOS ROM.zip, immediately flash the patched boot.img of the corresponding OOS given in this thread and then restart back to TWRP recovery. Done. You will never lose TWRP again..
Q: I am Rooting my phone using Magisk/Supersu then why do i need this?
A: Its optional.. If you are rooting phone using Magisk/Supersu it patches the stock boot.img. But in case you have problems flashing Magisk/Supersu after flashing the STOCK ROM zip this can come in handy or as an insurance policy just flash this patched boot.img before doing anything. But is very helpful to those people out there who doesn't root their phone but has unlocked their phone or installed TWRP for other purposes..
Q: How to flash the patched boot.img in TWRP?
A: Default flash option is for zip files in TWRP. Select the flash image option in TWRP. Then select the downloaded patched boot.img file and among from the partition option (boot, recovery and system) select the boot option and then flash it.
Q: Can I use it for CUSTOM ROMs? / What to do while updating CUSTOM ROMs?
A: For hassle free and the best results whenever you update CUSTOM ROMs always do it this way...
The below steps are for CUSTOM ROMs only. (For STOCK ROMs follow the main step mentioned above in the section USAGE)...
1.Go to TWRP
2.Flash the required firmware zip file
3.Flash the corresponding patched boot IMG
4.Flash the ROM whether LINEAGE, RR, ASOP, etc.
5.Flash gapps
6.Flash root (magisk /su)
7.Flash kernel
8.At last Reboot...
There will not be any problem ever...
You can reboot after step 5
Steps 6,7 are optional
Q: What is "-Xn" seen after the OOS Version in the settings menu?
A: That's just my signature -Xn that I had put there to make sure that you have correctly done the procedure and the boot image that is currently in use is my patched boot image and to ensure you that you are 100% safe from DM verity and forced encryption..
Hope you find it useful...
Will update as newer OOS versions come....
HIT THANKS IF I HELPED YOU. IT DOESN'T COST YOU ANYTHING, BUT IT MEANS A LOT TO ME...

THIS IS FOR PEOPLE WHO HAVE TRIGGERED DM-VERITY AND NEEDS TO GET RID OF THE DM-VERITY MESSAGE PERMANENTLY ON OOS OR OPEN BETA OR CUSTOM ROM. CONFIRMED WORKING EVEN IN THE LATEST OOS 4.5.1/BETA Nougat Roms...
THIS IS FOR ONEPLUS 3T AND FOR ONEPLUS 3 but be careful in using the correct files corresponding to the OOS version and your MODEL
FOLLOW THE STEPS EXACTLY AND 100% THE DM-VERITY MESSAGE WILL BE GONE WITHOUT ANY DATA LOSS OR ANY OTHER HARM!!!
Prerequisite : Install ADB for windows from here: [url]https://forum.xda-developers.com/showthread.php?t=2588979[/URL]
1)
Download 4.0.2 Firmware for Oneplus 3T from here: [url]http://www.mediafire.com/file/cx568em66025p5b/4.0.2_firmware_OnePlus_3T.zip[/URL]
Download 4.0.2 Firmware for Oneplus 3 from here: [url]http://www.mediafire.com/file/8tt5x4xxy4m488t/4.0.2_firmware_OnePlus3.zip[/URL]
2) Flash the downloaded 4.0.2 firmware OnePlus 3.zip or 4.0.2 firmware OnePlus 3T.zip file in TWRP.
3) DONT REBOOT TO SYSTEM. REBOOT TO BOOTLOADER FROM OPTION IN TWRP.
4) Connect your phone to the pc
5) Press windows button + X
6) Open Command prompt
7) Type "fastboot oem disable_dm_verity" without quotes and press enter
8) Type "fastboot oem enable_dm_verity" without quotes and press enter
9) DONT REBOOT TO SYSTEM. REBOOT TO TWRP RECOVERY.
10)
In case of Oneplus3T, Flash the required firmware files for Stable or Open Beta OOS corresponding to your current OOS (current OOS is the version of OOS which you are using now on your phone) in TWRP from this post: https://forum.xda-developers.com/oneplus-3t/how-to/firmware-beta-10-t3631166(Courtesy: @kamilmirza)
In case of Oneplus3, Flash the required firmware files for Stable or Open Beta OOS corresponding to your current OOS (current OOS is the version of OOS which you are using now on your phone) in TWRP from this post: [url]https://forum.xda-developers.com/oneplus-3/how-to/radio-modem-collection-flashable-zips-t3468628[/URL] (Courtesy: @jamal2367)
11) DONT REBOOT!!!!
10) VERY IMPORTANT: WITHOUT REBOOTING, Flash the downloaded boot-patched.img file corresponding to the OOS version and phone model(either stable or beta) in TWRP from post 1...
11) Reboot..The DM-verity message is gone forever...
VERY IMPORTANT: If you are attempting this method on a a CUSTOM ROM then after Step 10 flash the full CUSTOM ROM zip file + latest gapps again without doing any sort of wipes in TWRP immediately and then only reboot....
Enjoy!!!
FAQs...
Q: Will I lose any data after I do these steps?
A: Never. There will be no data loss or any untoward effects of the procedure. Your data and phone will be in the exact same state as it was a before except for the fact that the damn dirty Dm-Verity message will be gone forever!!!
Q: Will this work on CUSTOM ROMs?
A: Of course. It has been tested to be perfectly working on even CUSTOM ROMs. Just follow the instructions in this post carefully where specific steps for CUSTOM ROMs are mentioned.
HIT THANKS IF I HELPED YOU. IT DOESN'T COST YOU ANYTHING, BUT IT MEANS A LOT TO ME...

Thanks mate..... You made my day..... Working perfectly.

Nice to see this thread on the day of release of oos 4.1.5 itself.

Deleted..

So well explained and working perfectly
One if the most detail step by step explanation
Thanks dev.

Hi,
I have already done the second method on 4.1.4 but without reflashing the firmware so will I have to do it again when Install 4.1.5?

MohamedRaafat said:
Hi,
I have already done the second method on 4.1.4 but without reflashing the firmware so will I have to do it again when Install 4.1.5?
Click to expand...
Click to collapse
Do the second method only if you trigger DM Verity while installing 4.1.5
To be sure you don't trigger DM Verity while installing 4.1.5 follow the instructions in the OP...

Hi,
would it be too bold to ask if something similar could be prepared also for OP3?
I have exactly the same problem with DM-Verity triggered on my OP3. I have seen several guides how to get rid of it but they are sometimes contradictory and the whole process seems to be a bit overwhelming.
This solution seems to be the cleanest of all I have seen but I am not so lucky to own OP3T.
Would you be so kind to prepare this also for us, OP3 owners, if possible?
Of course, there can be many valid reason why not and I can perfectly understand that. But I decided to ask, just in case...

prorokrak said:
Hi,
would it be too bold to ask if something similar could be prepared also for OP3?
I have exactly the same problem with DM-Verity triggered on my OP3. I have seen several guides how to get rid of it but they are sometimes contradictory and the whole process seems to be a bit overwhelming.
This solution seems to be the cleanest of all I have seen but I am not so lucky to own OP3T.
Would you be so kind to prepare this also for us, OP3 owners, if possible?
Of course, there can be many valid reason why not and I can perfectly understand that. But I decided to ask, just in case...
Click to expand...
Click to collapse
I have been thinking about it for the past few days...
Anyways I thought as no one asked they were not interested in getting the patched boot images for op3...
Ok.. they have released OOS 4.1.6..
So will push the links for the patched boot images for both op3 and op3T tomorrow after I test and get hands on the flashable ROMs.

The OP has been updated to accomodate both ONEPLUS 3T and ONEPLUS 3
Now this thread can be used for both models and will be updated as new OOS version come..
Enjoy!!!

NEW UPDATE RELEASED!!!
Links in OP...
Oxygen OOS 4.1.6 patched boot images for ONEPLUS 3T and ONEPLUS 3...

Thenks for this!

sparky vicky said:
How did you flashed the bootimg? through twrp? it's asking for 3 options like boot, recovery,system? im confused
Click to expand...
Click to collapse
Just flash the patched boot.img and select boot in the twrp option..
It's the boot image so boot option...

Xennet said:
Just flash the patched boot.img and select boot in the twrp option..
It's the boot image so boot option...
Click to expand...
Click to collapse
Yes i choose boot but still the warning showing on boot

sparky vicky said:
Yes i choose boot but still the warning showing on boot
Click to expand...
Click to collapse
Which phone are you using op3 or 3t..
Did you flash 4.0.2 zip and type the commands
Tell the steps you did.
Which is the warning being shown?
DM Verity warning or the the phone is unlocked warning??

Im on OP3T, OOS 4.1.6

sparky vicky said:
Im on OP3T, OOS 4.1.6
Click to expand...
Click to collapse
Which is the warning being shown and explain the steps you did

Xennet said:
Which phone are you using op3 or 3t..
Did you flash 4.0.2 zip and type the commands
Tell the steps you did.
Which is the warning being shown?
DM Verity warning or the the phone is unlocked warning??
Click to expand...
Click to collapse
Dm verity warning showing and asusal the unlocked warning also. Im on 3T with OOS 4.1.6. I need to flash 4.0.2 zip before this? Those are not mentioned in OP?
---------- Post added at 05:28 PM ---------- Previous post was at 05:26 PM ----------
Xennet said:
Which is the warning being shown and explain the steps you did
Click to expand...
Click to collapse
Flashed 4.1.6 with twrp at same time without reboot flashed bootpatch and rebooted to system and still the dm verity showung
Did i collapsed the procedure?:silly:

sparky vicky said:
Dm verity warning showing and asusal the unlocked warning also. Im on 3T with OOS 4.1.6. I need to flash 4.0.2 zip before this? Those are not mentioned in OP?
Click to expand...
Click to collapse
Mate do read the second post in the OP...
For getting rid of the DM-Verity message..
The first OP post is only for those who have no DM Verity warning on their phone..
If you already have DM Verity warning on your phone you have to follow the second post..it is clearly mentioned in the OP.. AND WRITTEN IN BOLD LETTERS..
Once you get rid of the DM Verity warning from next time onwards you have to follow only the instructions in the first OP post..

Related

OP2 cannot upgrade from Oxygen OS 2.2.1/Cannot flash TWRP versions newer than 3.0.2-0

So.... Pokemon Go has a lot to answer for......
I have run into a really strange problem when trying to install an OTA on my *unrooted* Oneplus 2. I have been trying to fix this for days but I have completely run out of ideas.
I originally had a working stock Oxygen 3 (Marshmallow) rom with TWRP recovery on my device (not sure of the version). The device was rooted and apart from not being able to install OTAs, I was fairly happy with the setup. Then along came the Pokemon GO update that banned rooted devices. Ok, "big deal" I thought. I was quite content playing Ingress instead (a far better game by the way that doesn't rely on a "pay to win" structure). I really wasn't too worried but then I found out about "systemless root" and "Magisk". I thought that if I installed this correctly I could still play a bit of Pokemon GO when I wanted to and could toggle a root button in Magisk Manager to install OTAs when they became available.
This is where the problems started.
I followed a guide on how to unroot and install Magisk and "Phh's Superuser". The problem was that the Phh Superuser was being denied permissions for Magisk Manager, there were no pop up notifications prompting me to give it access, just toast notifications. I couldn't for the life of me figure out how to give it permission so the "enable root" slider button kept sliding back, not allowing root. This is when I used SuperSU ver 2.76 (Magisk version) and it seemed to work fine. I now had a stock Marshmallow rom with TWRP and Magisk Manager all working exactly how they should be. I could toggle root and play Pokemon GO, then return to a rooted state when I needed to.
"Awesome, mission accomplished." I thought. Now I just need to toggle root off, download the latest OTA and install it through Flashfire.
First I made a complete nandroid backup (as I've done with other devices many times before) through TWRP. I even copied the backup folder to my PC in case something went wrong.
Well, this is when the nightmare started.
The first mistake I made was to use Flashfire when it clearly stated that Oneplus devices were currently untested. Not sure if it was a big issue or not, but it was a mistake none the less. The second mistake I made was to not stop the stock recovery being replaced when prompted before the reboot. I assumed (and it even states in the app) that the custom recovery should be reverted back to the stock recovery when attempting to apply OTA updates.
So I went ahead and rebooted, waiting for the OTA to install. I'm fairly sure from memory that it went into the stock recovery, flashed the OTA and restarted.
This is when the phone soft bricked.
"Oh well, that is why I made the backup." I thought.
I reflashed TWRP in fastboot mode and attempted to restore my backup. No dice, the phone was still soft bricked.
(And by "soft bricked" and "boot looping" I mean the Oneplus logo was in the middle of the screen, "Powered by Android" was at the bottom and the two blue LEDs for the buttons either side of the fingerprint scanner/home button remained on. This for me was the tell tale sign of the soft brick because these two light go off after a few seconds after rebooting usually.
So from here I have tried EVERYTHING. All I really want now is a working stock (rooted) Marshmallow rom with TWRP. I have downloaded many different full rom zips and attempted to flash them through TWRP with no success, I have returned to stock recovery and tried flashing signed roms with no success, I've even tried flashing the official CM13 rom for Oneplus 2 (with the correct GAPPs and kernel) through TWRP with no luck.
But here is where it gets interesting......
There are a few things that are really weird...
1. I have always been able to get into Fastboot mode and ADB and Fastboot commands "work".
* Operations succeed but don't stick (for example trying to flash TWRP versions 3.0.2-1 and 3.0.2-2 through Fastboot mode result in no recovery being there at all.
2. I can flash TWRP recovery though Fastboot mode but ONLY VERSIONS 3.0.2-0 and lower. I can also successfully flash the stock recovery.
3. I can flash OxygenOS 2.2.1 but NOT ANY VERSION RELEASED AFTER THAT. Doing so results in the soft brick "bootloop" I mentioned earlier.
4. Attempting to flash the official CM13 rom for Oneplus 2 doesn't work either. Originally I got the error 7 message, but after editing "Updater-script" in the rom and re-zipping, the process seemed to work fine in TWRP but the reboot gave me... you guessed it... a softbrick.
I have flashed custom roms on a few different devices before so I'm not a COMPLETE newbie when it comes to this stuff, but I am by no means a developer or even anything close to one. I have bricked this phone in the past (long story, involved getting it without an invite and it being shipped to me with spyware on it) but I used a guide very similar to this and it worked a treat.
www(dot)androidbrick(dot)com/unbrick-oneplus-one-two-3-qualcomm-hs-usb-qdloader-9008
So, thinking that this process would format all partitions and start me from scatch I tried it. It worked fine but I was still unable to upgrade from Oxygen OS 2.2.1 or install TWRP versions 3.0.2-1 or 3.0.2-2.
I have tried all sorts of things. I have wiped, flashed and wiped again. Factory resets, dirty flashes, clean flashes.... everything. All sorts of different sources for the TWRP images and Oxygen roms... nothing seems to work.
It's just so weird considering it's not a hard brick... just a soft brick.
So I really need my phone so I am sitting on this current build because it is the only one that works.
Here are some details of the current build I am using. (using CPU-Z app)
Model: Oneplus 2 (ONE A2001)
Android version: 5.1.1
Oxygen OS version: 2.2.1
Bootloader: Unknown
Build ID: ONE A2001_14_160226
Java VM: ART 2.1.0
OpenGL ES: 3.1
Kernel Architecture: aarch64
Kernel version: 3.10.49-perf+ (56)
Root access: Yes
Super user app: SuperSU Free v2.46 (Chainfire)
OEM unlocking: Enabled
USB debugging: Enabled
And these are some of the ZIPs and IMGs that refuse to be flashed to my device.
TWRP-3.0.2-1-oneplus2
TWRP-3.0.2-2-oneplus2
Grarak's TWRP recovery IMG for Oneplus2 (modified to install CM13) according to this guide:
missingtricks(dot)net/oneplus-2-official-cyanogenmod-13
cm-13.0-20160924-NIGHTLY-oneplus2
OnePlus2Oxygen_14_OTA_019_all_1606041303_bd42fc5cc5cc4ab2
And also my TWRP backup named 2016-09-16--09-44-09
I am really at a loss as to what to do next. ANY help ANYONE could give me would be greatly appreciated. I have been all over the net looking for ways around this bt have had no luck.
As I've said, I'm not a huge tech head, but I'm not a newbie either. The only thing I can think of is that somehow one of the partitions (maybe boot? ) may have been corrupted somehow when messing around with systemless root. But I don't know how considering it's "systemless". If anyone knows how to check for corrupted partitions on the Oneplus 2 please let me know and I'll try it. Maybe formatting these partitions might help (????), but I don't want to permanently brick my phone.
But I don't know how I've got this particular build working if one of the partitions has been corrupted. And the corrupted partition thing is just a guess.....
Please, anyone, someone point me in the right direction. Again, any and all feddback is welcomed and would be very much appreciated.
This is all Pikachu's fault.
Kamakiriash said:
A very long post...
Click to expand...
Click to collapse
The normal way too update from OOS 2 to OOS 3 is:
Flash the OOS 3 signed flashable zip via TWRP to update the bootloader and firmware
Flash TWRP 3.0.2-2 via your current TWRP's recovery image flashing option
Reboot recovery via TWRP so that you now have a recovery that's compatible with the new bootloader
Wipe data, cache & dalvik-cache (but not internal storage)
Flash the OOS 3 signed flashable zip again to update the system
Flash one of the modified SuperSU zips if you want root
Reboot system
All the files you need are in post #1 of this thread.
Thank you so much Spannaa!
I was clearly missing a vital step here and let it be a lesson to anyone else in this situation....
As Spannaa said......
1. Flash the OOS 3 signed flashable zip via TWRP to update the bootloader and firmware
2. Flash TWRP 3.0.2-2 via your current TWRP's recovery image flashing option
3. Reboot recovery via TWRP SO THAT YOU NOW HAVE A RECOVERY THAT'S COMPATIBLE WITH THE NEW BOOTLOADER!
4. Wipe data, cache & dalvik-cache (but not internal storage)
5. Flash the OOS 3 signed flashable zip AGAIN to update the system.
Again, thankyou Spanna for your quick and accurate response.
The order in which you flash zips and imgs is very important it seems.
You really saved me.
I restored the TWRP backup and I am back to where I started.
Is it now possible to apply OTAs when I toggle the root off in Magisk manager and install using the stock recovery? What do you think would be the best way to do this?
And would it be worth moving to the official build of CM13 for Oneplus 2?
Thanks again, Spannaa. :victory:
Kamakiriash said:
Thank you so much Spannaa!
I was clearly missing a vital step here and let it be a lesson to anyone else in this situation....
As Spannaa said......
1. Flash the OOS 3 signed flashable zip via TWRP to update the bootloader and firmware
2. Flash TWRP 3.0.2-2 via your current TWRP's recovery image flashing option
3. Reboot recovery via TWRP SO THAT YOU NOW HAVE A RECOVERY THAT'S COMPATIBLE WITH THE NEW BOOTLOADER!
4. Wipe data, cache & dalvik-cache (but not internal storage)
5. Flash the OOS 3 signed flashable zip AGAIN to update the system.
Again, thankyou Spanna for your quick and accurate response.
The order in which you flash zips and imgs is very important it seems.
You really saved me.
I restored the TWRP backup and I am back to where I started.
Is it now possible to apply OTAs when I toggle the root off in Magisk manager and install using the stock recovery? What do you think would be the best way to do this?
And would it be worth moving to the official build of CM13 for Oneplus 2?
Thanks again, Spannaa. :victory:
Click to expand...
Click to collapse
Glad you're sorted.
Not sure about Magisk as I've never used it.
CM13 is OK but whether it's worth you moving to it is your choice. Personally, I prefer TipsyOS!
Hi,
I face the exact issue with same Oxygen OS and TWRP versions mentioned, I have tried the above steps but there are some problems:
1. Flash the OOS 3 signed flashable zip via TWRP to update the bootloader and firmware
Click to expand...
Click to collapse
when I checked the option (Zip signature verification) in TWRP, the installation failed with error "Zip signature verification failed! Error installing zip file '/sdcard/oneplus.zip'", but it's successfully installed when I unchecked (Zip signature verification) option.
2. Flash TWRP 3.0.2-2 via your current TWRP's recovery image flashing option
3. Reboot recovery via TWRP SO THAT YOU NOW HAVE A RECOVERY THAT'S COMPATIBLE WITH THE NEW BOOTLOADER!
Click to expand...
Click to collapse
second problem is that after installing the TWRP 3.0.2-2 (or above), then reboot recovery, I can't access the recovery again and the phone stuck on bootloop.
any idea ?
Aood said:
Hi,
I face the exact issue with same Oxygen OS and TWRP versions mentioned, I have tried the above steps but there are some problems:
when I checked the option (Zip signature verification) in TWRP, the installation failed with error "Zip signature verification failed! Error installing zip file '/sdcard/oneplus.zip'", but it's successfully installed when I unchecked (Zip signature verification) option.
second problem is that after installing the TWRP 3.0.2-2 (or above), then reboot recovery, I can't access the recovery again and the phone stuck on bootloop.
any idea ?
Click to expand...
Click to collapse
I don't have a OP2 anymore but that post was seven months ago and the instructions worked for numerous users.
Don't enable zip signature verification in TWRP - it's unnecessary.
Flash TWRP 3.0.2-2 via your current TWRP's recovery image flashing option and then reboot recovery directly from TWRP.
thanx for replay Spannaa,
Flash TWRP 3.0.2-2 via your current TWRP's recovery image flashing option and then reboot recovery directly from TWRP.
Click to expand...
Click to collapse
I have already did that, but same issue once I reboot "directly from TWRP" , the TWRP doesn't show up and bootloop start again.
Aood said:
thanx for replay Spannaa,
I have already did that, but same issue once I reboot "directly from TWRP" , the TWRP doesn't show up and bootloop start again.
Click to expand...
Click to collapse
Last chance and then I'll leave this for someone that has the OP2.
Are you rebooting recovery "directly from TWRP" or rebooting system?
Is your bootloader still unlocked?
Last chance and then I'll leave this for someone that has the OP2.
Are you rebooting recovery "directly from TWRP" or rebooting system?
Is your bootloader still unlocked?
Click to expand...
Click to collapse
Yes, rebooting recovery "directly from TWRP"
and bootloader loader is unlocked,..
anyway it's not important to fix the phone, it's almost one year since last time I use it, yesterday I saw it in the drawer and try to figure out the issue..,

Disable [DM-Verity]/[Force Encryption] [OnePlus 3T/3] for [Oreo] Oxygen OS

Oneplus has released the Stable and Beta OREO Oxygen OS for Oneplus 3T and 3.
This thread is only for OOS Oreo. For disabling Dm-Verity and force Encryption in PIE OOS ROMs refer to my thread here: https://forum.xda-developers.com/oneplus-3t/how-to/dm-verity-disable-oxygen-os-t3922324. For disabling Dm-Verity and force Encryption in NOUGAT OOS ROMs refer to my thread here: https://forum.xda-developers.com/oneplus-3t/how-to/rom-dm-verity-force-encryption-disabled-t3618232[/I]
Disclaimer: I am not responsible for any damage or data loss that happens to your device on embarking this procedure...
THE DETAILS....
There has been some modifications that i came across after unpacking and verifying the packages..
After extracting the ramdisk to my surprise there was no fstab file and hence no fstab entries that could be modified to disable Dm-Verity and Force encryption...
After tweaking a little i found that indeed the file fstab does exist but its not in the ramdisk but in an other location..
So i disabled the Dm-Verity and Force encryption entries in the fstab file in the new location and made a flashable zip file which will replace the original fstab file.
As @rk2612 pointed out the fact that indeed the system entries are hashed out in the fstab file and the kernel takes care of the system loading procedure in OREO, I have been working on it. Indeed it is true. After unpacking the boot image into kernel, ramdisk and device tree blobs (dtbs), I came accross 12 entries in the dtb that reference directly to mount the system after triggering the DM-Verity flag. So I patched the dtb binary to clear off the DM-Verity flags and repacked the Boot images. Moreover, in OREO as long as DM-Verity is triggered, any changes made to the system are reverted back once you boot to system which has been clearly stated with the help of posts from @BillGoss.
The other fact is that regarding force encryption, it indeed is taken care of only in the fstab.
So in a nut shell, to disable DM-Verity you will need to flash the patched Boot Images and to disable force encryption you will have to flash the force encryption disabler zip - The links of which are provided below. Do refer to the correct procedure explained in datail before attempting to do anything...
For all those who need an in-depth reading of the nature of patching the fstab in dtb file and my work you can refer here:
https://forum.xda-developers.com/showpost.php?p=74326761&postcount=3
THIS METHOD WILL WORK FOR BOTH ONEPLUS 3 T AND ONEPLUS 3...
TESTED AND WORKING TILL ONEPLUS 3/3T STABLE OOS 5.0.8 / ONEPLUS 3T BETA 30 / ONEPLUS 3 BETA 39..
FOR THOSE WHO HAVE ALREADY TRIGGERED DM-VERITY ON OOS OREO FOLLOW THE STEPS IN POST 2 IN THIS THREAD TO GET RID OF DM-VERITY BEFORE PROCEEDING...
Nothing has been changed....
It is 100% stock boot image except that the DM-Verity Flag has been patched...
Links:
For ONEPLUS 3T
STABLE OOS Boot Images
Patched Boot Image Stable OOS 5.0.8
http://www.mediafire.com/file/xcsiuizziw6xckq/boot-patched-5.0.8-OP3T.img/file
Patched Boot Image Stable OOS 5.0.7
http://www.mediafire.com/file/ckn0012znn8kw8c/boot-patched-5.0.7-OP3T.img/file
Patched Boot Image Stable OOS 5.0.6
http://www.mediafire.com/file/ma4plv5vtom4ih1/boot-patched-5.0.6-OP3T.img/file
Patched Boot Image Stable OOS 5.0.5
http://www.mediafire.com/file/adxxd99bgswez8d/boot-patched-5.0.5-OP3T.img/file
Patched Boot Image Stable OOS 5.0.4
http://www.mediafire.com/file/c8ftkmwqebmrer3/boot-patched-5.0.4-OP3T.img
Patched Boot Image Stable OOS 5.0.3
http://www.mediafire.com/file/z1kut18fycm2k57/boot-patched-5.0.3-OP3T.img/file
Patched Boot Image Stable OOS 5.0.2
http://www.mediafire.com/file/hu6n544a8yhpmma/boot-patched-5.0.2-OP3T.img
Patched Boot Image Stable OOS 5.0.1
http://www.mediafire.com/file/cjxs6plcngqc5g6/boot-patched-5.0.1-OP3T.img
Patched Boot Image Stable OOS 5.0
http://www.mediafire.com/file/dxxgn7i49sxbca1/boot-patched-5.0-OP3T.img
BETA OOS Boot Images
Patched Boot Image OOS Beta 30
http://www.mediafire.com/file/b3fu93f15zd576c/boot-patched-Beta30-OP3T.img/file
Patched Boot Image OOS Beta 29
http://www.mediafire.com/file/w80wj3lql256td3/boot-patched-Beta29-OP3T.img/file
Patched Boot Image OOS Beta 28
http://www.mediafire.com/file/k3fj0u71t85jo8q/boot-patched-Beta28-OP3T.img/file
Patched Boot Image OOS Beta 27
http://www.mediafire.com/file/d1m6awl8oda5087/boot-patched-Beta27-OP3T.img
Patched Boot Image OOS Beta 26
http://www.mediafire.com/file/6c832j5y5hwk68t/boot-patched-Beta26-OP3T.img
Patched Boot Image OOS Beta 25
http://www.mediafire.com/file/6h1h1cammycdu9f/boot-patched-Beta25-OP3T.img
Patched Boot Image OOS Beta 24
http://www.mediafire.com/file/s8q750qedda5c2n/boot-patched-Beta24-OP3T.img
Patched Boot Image OOS Beta 23
http://www.mediafire.com/file/a9r6o20qc865bij/boot-patched-Beta23-OP3T.img
Patched Boot Image OOS Beta 22
http://www.mediafire.com/file/kk5llc6s43kr2bb/boot-patched-Beta22-OP3T.img
Patched Boot Image OOS Beta 21
http://www.mediafire.com/file/di3nm7ci7fn1u6i/boot-patched-Beta21-OP3T.img
Patched Boot Image OOS Beta 20
http://www.mediafire.com/file/woow4q1enart2tf/boot-patched-Beta20-OP3T.img
Patched Boot Image OOS Beta 19
http://www.mediafire.com/file/vqud6vy7k61stzt/boot-patched-Beta19-OP3T.img
For OnePlus 3
STABLE OOS Boot Images
Patched Boot Image Stable OOS 5.0.8
http://www.mediafire.com/file/6i5yblsbx7rdiba/boot-patched-5.0.8-OP3.img/file
Patched Boot Image Stable OOS 5.0.7
http://www.mediafire.com/file/1xo7e9qr521s9z9/boot-patched-5.0.7-OP3.img/file
Patched Boot Image Stable OOS 5.0.6
http://www.mediafire.com/file/98nyyirwfy2mo9e/boot-patched-5.0.6-OP3.img/file
Patched Boot Image Stable OOS 5.0.5
http://www.mediafire.com/file/12bhw4bo48lrp8o/boot-patched-5.0.5-OP3.img/file
Patched Boot Image Stable OOS 5.0.4
http://www.mediafire.com/file/io7hqnwoiy0i9v5/boot-patched-5.0.4-OP3.img/file
Patched Boot Image Stable OOS 5.0.3
http://www.mediafire.com/file/vdeq5iox0700rou/boot-patched-5.0.3-OP3.img/file
Patched Boot Image Stable OOS 5.0.1
http://www.mediafire.com/file/e1ae6d7ae45571r/boot-patched-5.0.1-OP3.img
Patched Boot Image Stable OOS 5.0
http://www.mediafire.com/file/a69c69gw6gkj860/boot-patched-5.0-OP3.img
BETA OOS Boot Images
Patched Boot Image OOS Beta 39
http://www.mediafire.com/file/3rc3t0zc543oqf7/boot-patched-Beta39-OP3.img/file
Patched Boot Image OOS Beta 38
http://www.mediafire.com/file/6ef5szt65605woh/boot-patched-Beta38-OP3.img/file
Patched Boot Image OOS Beta 37
http://www.mediafire.com/file/856w586ctt39rg8/boot-patched-Beta37-OP3.img/file
Patched Boot Image OOS Beta 36
http://www.mediafire.com/file/2l6mj266z15vbbq/boot-patched-Beta36-OP3.img
Patched Boot Image OOS Beta 35
http://www.mediafire.com/file/cguelk95o3klcki/boot-patched-Beta35-OP3.img
Patched Boot Image OOS Beta 34
http://www.mediafire.com/file/r1sd37135f3d90u/boot-patched-Beta34-OP3.img
Patched Boot Image OOS Beta 33
http://www.mediafire.com/file/vmey23ggvafw2ps/boot-patched-Beta33-OP3.img
Patched Boot Image OOS Beta 32
http://www.mediafire.com/file/7m6gxldmenen2qs/boot-patched-Beta32-OP3.img
Patched Boot Image OOS Beta 31
http://www.mediafire.com/file/2150f2hnaclc1zk/boot-patched-Beta31-OP3.img
Patched Boot Image OOS Beta 30
http://www.mediafire.com/file/5x1bcyxzihscdj3/boot-patched-Beta30-OP3.img
Patched Boot Image OOS Beta 29
http://www.mediafire.com/file/v1cm7ddtmr6tnam/boot-patched-Beta29-OP3.img
Patched Boot Image OOS Beta 28
http://www.mediafire.com/file/1afm13h8ax9d3r0/boot-patched-Beta28-OP3.img
STEPS: This is applicable only to people who have their data currently ENCRYPTED and needs the procedure only for NOT TRIGGERING DM-VERITY
USAGE FOR STOCK OOS:
1. Flash the downloaded boot-patched.img file corresponding to the Model and OOS version in TWRP immediately after flashing the Stock ROM zip in TWRP before doing anything (even before restarting or applying any patches, root, kernels, etc.)
2. Restart back to TWRP Recovery.
3. Done.
4. Now do whatever you want like usual.. Flash root, kernel, mods or anything as usual
5. You dont have to worry about triggering DM-Verity again and any changes made to system via TWRP will not be reverted back..
The 2 Prodeures given below: This is applicable only to those people who needs the procedure for getting rid of FORCE ENCRYPTION AND PREVENT TRIGGERING DM-VERITY
PROCEDURE 1: This is applicable only to people who have their data currently NOT ENCRYPTED AND KEEP IT DECRYPTED
First of all Backup your data preferably to and usb otg or a PC for later restore. You may lose your data from your phone following this procedure...
1. Format SYSTEM, DALVIK, CACHE and then only Flash the Full Rom Oreo Beta OOS zip file in TWRP.
2. DON'T REBOOT
3. Flash the downloaded boot-patched.img file corresponding to the Model and OOS version in TWRP immediately after flashing the Stock ROM zip.
4. DON'T REBOOT TO SYSTEM
5. REBOOT TO TWRP.
6. In TWRP, MOUNT SYSTEM, GO TO ADVANCED > TERMINAL and Type "df system"(without quotes) and enter. The details of the system partition will be shown. Look at the Use% and Free Space. Make sure you have atleast 100MB free space in System before you go to the next step. If you don't have enough free space then mount system in TWRP, go to file manager and free some space in system by deleting some unwanted apps (in system/app folder like duo, google drive, hangouts,etc. which you can later reinstall via google play as it is not mandatory for them to run as system apps)...If there is low space on your system partition that fstab file flashing fails resulting in blank fstab file and you will end up in bootloop.
7. Once you have confirmed that you have atleast 100MB of free space left in system partition. REBOOT BACK TO TWRP.
8. Flash "Force Encryption Disabler For OOS Oreo v2.zip" in TWRP. (No need to mount system. The v2 zip file does it automatically)
9. Flash SuperSuSR5 / Magisk 15.3+
10. Done.
11. Reboot to System.
NB:f you have bootloop go back to TWRP by keep holding the power button to power off and powering on and rebooting to TWRP via the volume buttons, mount system, go to file manager and free some space in system by deleting some unwanted apps (in system/app folder like duo, google drive, hangouts,etc. which you can later reinstall via google play as it is not mandatory for them to run as system apps) and reflash the disabler zip and reboot..It is due to low space on your system partition that fstab file flashing fails resulting in blank fstab file. But if you followed Steps 6 and 7 carefully you wont end up here.
PROCEDURE 2: This is applicable only to people who have their data currently ENCRYPTED AND NEEDS TO GET IT DECRYPTED and PREVENT TRIGGERING DM-VERITY
First of all Backup your data preferably to and usb otg or a PC for later restore. You will lose your data from your phone following this procedure...
1. Go to Bootloader...
2. Connect to your PC..Type "fastboot format userdata" without quotes and press enter. (You will lose your data, do back up if you need something.)
3. Don't reboot to system...Using volume buttons select boot to recovery and Reboot to TWRP.....(Very Important)
4. Flash the downloaded boot-patched.img file corresponding to the Model and OOS version in TWRP immediately after flashing the Stock ROM zip.
5. DON'T REBOOT TO SYSTEM
6. REBOOT TO TWRP
7. In TWRP, MOUNT SYSTEM, GO TO ADVANCED > TERMINAL and Type "df system"(without quotes) and enter. The details of the system partition will be shown. Look at the Use% and Free Space. Make sure you have atleast 100MB free space in System before you go to the next step. If you don't have enough free space then mount system in TWRP, go to file manager and free some space in system by deleting some unwanted apps (in system/app folder like duo, google drive, hangouts,etc. which you can later reinstall via google play as it is not mandatory for them to run as system apps)...If there is low space on your system partition that fstab file flashing fails resulting in blank fstab file and you will end up in bootloop.
8. Once you have confirmed that you have atleast 100MB of free space left in system partition. REBOOT BACK TO TWRP.
9. Flash "Force Encryption Disabler For OOS Oreo v2.zip" in TWRP. (No need to mount system. The v2 zip file does it automatically)
10. Flash SuperSuSR5 / Magisk 15.3+
11. Done.
12. Reboot to System.
NB: If you have bootloop go back to TWRP by keep holding the power button to power off and powering on and rebooting to TWRP via the volume buttons, mount system, go to file manager and free some space in system by deleting some unwanted apps (in system/app folder like duo, google drive, hangouts,etc. which you can later reinstall via google play as it is not mandatory for them to run as system apps) and reflash the disabler zip and reboot..It is due to low space on your system partition that fstab file flashing fails resulting in blank fstab file. But if you followed Steps 7 and 8 carefully you won't end up here.
Rooting:
For Rooting use only SuperSu 2.82 SR5 or Magisk 14.3 or above seems to work for root...
FAQs:
Q: Is the boot.img file altered in anyway?
A: As mentioned above its 100% stock boot image except that the DM-Verity Flag has been patched in the device tree blobs (dtb)...
Q: My phone is already encrypted, will I lose encryption on flashing the zip?
A: No. It only disables force encryption. That means if you have already disabled encryption in your phone it will prevent the phone from getting encrypted when you flash a stock OOS ROM..
Q: I happen to lose TWRP and revert to stock recovery every time I update OOS, I happen to lose changes made to system via TWRP or lose data/apps accidentally while updating OOS...Can this be corrected by using this method?
A: Definitely. Follow the steps correctly. Each time while updating the OOS, after flashing the Full OOS ROM.zip, immediately flash the patched boot.img of the corresponding OOS given in this thread and then restart back to TWRP recovery. Done. You will never lose TWRP again..
Q: I am Rooting my phone using Magisk/Supersu then why do i need this?
A: Its optional.. If you are rooting phone using Magisk/Supersu it patches the stock boot.img. But in case you have problems flashing Magisk/Supersu after flashing the STOCK ROM zip this can come in handy or as an insurance policy just flash this patched boot.img before doing anything. But is very helpful to those people out there who doesn't root their phone but has unlocked their phone or installed TWRP for other purposes..
Q: How to flash the patched boot.img in TWRP?
A: Default flash option is for zip files in TWRP. Select the flash image option in TWRP. Then select the downloaded patched boot.img file and among from the partition option (boot, recovery and system) select the boot option and then flash it.
Q: What is "-Xn" seen after the OOS Version in the settings menu?
A: That's just my signature -Xn that I had put there to make sure that you have correctly done the procedure and the boot image that is currently in use is my patched boot image and to ensure you that you are 100% safe from DM verity...
Q: Where to find downloads and queries regarding the Stock OOS ROM and Beta OOS?
A: @Siddk007 has been maintaining Stock and Beta OOS threads were you can find relevant information.
Hope you find it useful...
Will update this OP as newer OOS versions come....
Thanks,
@rk2612 -- For pointing out the presence of DM-Verity checks in dtbs...
@BillGoss -- For testing out the patched boot images and providing useful posts mentioning that DM-Verity triggering reverts changes made to system...
@akhilnarang -- For helping tackle the weirdness of fstab decryption....as he pointed out the fact of clearing the system of free space to get it done...
HIT THANKS IF I HELPED YOU. IT DOESN'T COST YOU ANYTHING, BUT IT MEANS A LOT TO ME...
AND IF YOU DO APPRECIATE MY WORK DONATIONS ARE ALWAYS WELCOME...
THIS IS FOR PEOPLE WHO HAVE TRIGGERED DM-VERITY AND NEEDS TO GET RID OF THE DM-VERITY MESSAGE PERMANENTLY ON OOS OPEN BETA OREO ROMs. CONFIRMED WORKING EVEN IN THE LATEST OOS OREO STABLE 5.0.8/ BETA 30/BETA 39...
THIS IS FOR ONEPLUS 3T AND FOR ONEPLUS 3 but be careful in using the correct files corresponding to the OOS version and your MODEL
READ ALL THE STEPS AND DOWNLOAD ALL REQUIRED FILES BEFORE PROCEEDING. FOLLOW THE STEPS EXACTLY AND 100% THE DM-VERITY MESSAGE WILL BE GONE WITHOUT ANY DATA LOSS OR ANY OTHER HARM!!!
Prerequisite : Install ADB for windows from here: [url]https://forum.xda-developers.com/showthread.php?t=2588979[/URL]
1)
Download 4.0.2 Firmware for Oneplus 3T from here: [url]http://www.mediafire.com/file/cx568em66025p5b/4.0.2_firmware_OnePlus_3T.zip[/URL]
Download 4.0.2 Firmware for Oneplus 3 from here: [url]http://www.mediafire.com/file/8tt5x4xxy4m488t/4.0.2_firmware_OnePlus3.zip[/URL]
2) Flash the downloaded 4.0.2 firmware OnePlus 3.zip or 4.0.2 firmware OnePlus 3T.zip file in TWRP.
3) DONT REBOOT TO SYSTEM. REBOOT TO BOOTLOADER FROM OPTION IN TWRP.
4) Connect your phone to the pc
5) Press windows button + X
6) Open Command prompt
7) Type "fastboot oem disable_dm_verity" without quotes and press enter
8) Type "fastboot oem enable_dm_verity" without quotes and press enter
9) DONT REBOOT TO SYSTEM. REBOOT TO TWRP RECOVERY.
10)
In case of Oneplus3T, Flash the required firmware files for Stable or Open Beta OREO OOS corresponding to your current OOS (current OOS is the version of OOS which you are using now on your phone) in TWRP from this post: https://forum.xda-developers.com/oneplus-3t/how-to/firmware-beta-10-t3631166(Courtesy: @kamilmirza)
In case of Oneplus3, Flash the required firmware files for Stable or Open Beta OREO OOS corresponding to your current OOS (current OOS is the version of OREO OOS which you are using now on your phone) in TWRP from this post: [url]https://forum.xda-developers.com/oneplus-3/how-to/radio-modem-collection-flashable-zips-t3468628[/URL] (Courtesy: @jamal2367)
11) DONT REBOOT!!!!
12) VERY IMPORTANT: WITHOUT REBOOTING, Flash the downloaded boot-patched.img file corresponding to the OOS version and phone model(either stable or beta) in TWRP from post 1...
13) Reboot..The DM-verity message is gone forever...
VERY IMPORTANT:
1. If you need to keep your phone un-encrypted flash Force Encryption Disabler For OOS Oreo.zip immediately after step 12 and then only reboot.
2.If you are attempting this method on a a CUSTOM ROM then after Step 12 flash the full CUSTOM ROM zip file + latest gapps again without doing any sort of wipes in TWRP immediately and then only reboot....
Enjoy!!!
FAQs...
Q: Will I lose any data after I do these steps?
A: Never. There will be no data loss or any untoward effects of the procedure. Your data and phone will be in the exact same state as it was a before except for the fact that the damn dirty Dm-Verity message will be gone forever!!!
Q: Will this work on CUSTOM ROMs?
A: Of course. It has been tested to be perfectly working on even CUSTOM ROMs. Just follow the instructions in this post carefully where specific steps for CUSTOM ROMs are mentioned.
HIT THANKS IF I HELPED YOU. IT DOESN'T COST YOU ANYTHING, BUT IT MEANS A LOT TO ME...
Knowledge is always good and Xda is the best place to share it.. So here it is...
This is important for those interested in depth reading and for those who casually use xda to just download and use stuff because it gonna affect you all...
It all begins with the boot.img file which is located inside the Oxygen OS ROM zip file. The Boot image file can be practically for learning purpose be broken down to ramdisk, kernel and dtb(device tree blob) files.
The importance of all this is that from Oreo onwards Oneplus just shifted the fstab entry(in which the code triggering dm-verity is located) into the dtb file rather than in the ramdisk which becomes a little hard to edit rather than while being in the ramdisk.
So the essential steps being unpacking dtb file from the boot image, then editing the code triggering the dm-verity in the dtb file and then repacking the dtb into the boot image file again. Seems simple but its rather difficult...
The dtb file extracted from the boot image file in fact can be further split into 13 dtb dumps, 12 of which having an fstab entry that triggers dm-verity and each has to patched individually and then combined to a single dtb file and then repacked to the boot image....
So what is important is...
The original code in dtb file by Oneplus in the boot image file after decompiling and analysing by the dtc(device tree compiler) is :
Code:
fstab {
compatible = "android,fstab";
system {
compatible = "android,system";
dev = "/dev/block/platform/soc/624000.ufshc/by-name/system";
type = "ext4";
mnt_flags = "ro,barrier=1,discard";
fsmgr_flags = "wait,verify";
status = "ok";
};
};
The line fsmgr_flags = "wait,verify"; should be changed to fsmgr_flags = "wait" to avoid triggering dm verity.
So lets see...
What Magisk does... After analysing the patched boot image by magisk 14.5, 14.6 and 15.0 the Fstab entry in the dtb file looks like this:
Code:
fstab {
compatible = "android,fstab";
system {
compatible = "android,system";
dev = "/dev/block/platform/soc/624000.ufshc/by-name/system";
type = "ext4";
mnt_flags = "ro,barrier=1,discard";
fsmgr_flags = <0x77616974 0x0 0x0>;
status = "ok";
};
};
The problem is that magisk searches for the hex code for --->,verify and then replaces it with zero bytes....that efficiently disables the dm verity check in fs tab but the line fsmgr_flags = <0x77616974 0x0 0x0>; makes no sense...but when you translate the hex:77616974 to ASCII it becomes "wait". But whether this has any impilcations on the system or performance. I just simply dont know....
And I just couldn't analyse the dtb file produced by Magisk 15.1 as it fails to patch the dtb file in the boot image completely...just giving an error as Segmentation fault...This is well noticed as you cannot see the line stating that patching fstab in dtb file is conspicuously absent when you flash Magisk 15.1.. and hence Magisk 15.1 fails to clear the dm verity flag in the boot image...This can be ascertained by many who reported that they triggered dm verity today as they flashed Magisk 15.1 after flashing the ROM zip file in the Open Beta thread for oneplus 3T on XDA. But many didn't notice it as they just flashed Magisk 15/14.6 and then upgraded Magisk to 15.1 as the earlier versions as stated above took care of dm verity...
I have to say Magisk is one of the wonders in modern day android era and the statements i have given above is just observations and are really not meant to degrade or hurt the dev or anyone associated with magisk. @topjohnwu will already be knowing the issue as he is one hell of a developer and will definitely be correcting it...
Coming to SuperSu..This is what SuperSu does after patching the dtb file...
Code:
fstab {
compatible = "android,fstab";
system {
fsmgr_flags = "wait";
mnt_flags = "ro,barrier=1,discard";
type = "ext4";
dev = "/dev/block/platform/soc/624000.ufshc/by-name/system";
};
Now here the line fsmgr_flags = "wait"; is good but the line --->status = "ok"; is completely missing as SuperSu appends the line after the word "wait" in the fstab...And now whether this has any implications too whther I really dont know butit too does the job of removing dm-verity triggering...
Post a tiring study through all this I finally managed to patch the Oneplus boot image to as good as possible. I manually unpacked the boot image to dtb. The split the combined dtb to individual dtbs and the removed the line of code manually and the repacked the whole thing again to the original Boot image.
The dtb file in My Patched boot image looks like this after analysing with dtc.. And achieves the desired result...and perfectly avoids triggering dm-verity without causing any untoward effects in the fstab section in dtb file.
Code:
fstab {
compatible = "android,fstab";
system {
compatible = "android,system";
dev = "/dev/block/platform/soc/624000.ufshc/by-name/system";
type = "ext4";
mnt_flags = "ro,barrier=1,discard";
fsmgr_flags = "wait";
status = "ok";
};
Now the real question,
What will happen if you flash my patched boot image and then ,
---> When you flash Magisk after flashing my patched boot image it does nothing because it fails to identify the hex code for ",verify" as there is no such word/hex code in my boot.img file so it doesn't change anything to the fstab section in the dtb file in my patched boot image and so there no untoward effects in the code...
--->When you flash SuperSu, but, it still appends the line after "wait" in the dtb file in my patched boot image too and results in removal of the line status = "ok";.
Earlier Boot images posted in the OP, I too patched the hexcodes using a hex editor in the binary dtb file resulting in results in fstab section of dtb file like Magisk...
Now on I will manually patch each boot image file to produce the fstab file with no other alterations done in the dtb file so that there will never be any problems after flashing the patched boot images....
@Xennet that was quick, thanks. However i have already flashed and booted OB 16. can i still flash?
Of Course..
No problems in that...
Did you trigger Dm Verity and is your phone encrypted?
Xennet said:
Of Course..
No problems in that...
Did you trigger Dm Verity and is your phone encrypted?
Click to expand...
Click to collapse
i successfully rooted OB 16 without trigerring DM Verity and yes phone is encryptyed
Siddk007 said:
i successfully rooted OB 16 without trigerring DM Verity and yes phone is encryptyed
Click to expand...
Click to collapse
No problems still you can flash...
Thanks !
Too late for me brothers, I've fallen, I triggered dm verity and now my phone partition was wiped and it won't let me install a ROM.
Still have access to fastboot and adb tho. (Restore not working due to the dm-verity)
I'll try to flash this and play around, hopefully it will resolve my issue.
Thanks for helping everyone anyway
EDIT : Ok so I think it allowed me to restore an old old old backup so probably props to you for giving my brick a second chance.
It stills shows me the "dm-verity not enforced" message when booting up tho.
And TWRP still won't let me install a ROM. Even the officiel beta
I get an error 7 saying my build.pro ro.product.series is " " instead of "OnePlus 3T" but I checked it's OnePlus 3T...
If I remove the update script part about checking my series it just fails to update system image.
This update really ****ed up my phone because of the dm-verity when I tried to flash TWRP and Magisk (I had no issue before and was full stock)
Can anyone help ?
I triggered dm verity with oreo rom but I went and installed backup PA Nougat as I didnt like the OOS Oreo, can I still flash this zip on nougat to disable dm verity or is it only for oreo?
Isus <3 said:
I triggered dm verity with oreo rom but I went and installed backup PA Nougat as I didnt like the OOS Oreo, can I still flash this zip on nougat to disable dm verity or is it only for oreo?
Click to expand...
Click to collapse
This is only for Oreo
For Nougat go to my thread here..
https://forum.xda-developers.com/oneplus-3t/how-to/rom-dm-verity-force-encryption-disabled-t3618232
Hinoy said:
Too late for me brothers, I've fallen, I triggered dm verity and now my phone partition was wiped and it won't let me install a ROM.
Still have access to fastboot and adb tho. (Restore not working due to the dm-verity)
I'll try to flash this and play around, hopefully it will resolve my issue.
Thanks for helping everyone anyway
EDIT : Ok so I think it allowed me to restore an old old old backup so probably props to you for giving my brick a second chance.
It stills shows me the "dm-verity not enforced" message when booting up tho.
And TWRP still won't let me install a ROM. Even the officiel beta
I get an error 7 saying my build.pro ro.product.series is " " instead of "OnePlus 3T" but I checked it's OnePlus 3T...
If I remove the update script part about checking my series it just fails to update system image.
This update really ****ed up my phone because of the dm-verity when I tried to flash TWRP and Magisk (I had no issue before and was full stock)
Can anyone help ?
Click to expand...
Click to collapse
Install nougat ROM OOS 4.5.0 STABLE and remove DM verity by following instructions from my thread here...
https://forum.xda-developers.com/oneplus-3t/how-to/rom-dm-verity-force-encryption-disabled-t3618232
Then after removing DM verity if needed you can reflash Oreo beta zip after removing the first line in updater script and then immediately flashing the DM verity and force encryption disabled zip from this thread...
Can anyone confirm it works? (disabling forced encryption)
I had changed the flag in fstab manually (forceencrypt to encryptable), and I still got encrypted.
akhilnarang said:
Can anyone confirm it works? (disabling forced encryption)
I had changed the flag in fstab manually (forceencrypt to encryptable), and I still got encrypted.
Click to expand...
Click to collapse
At least for me I couldn't get it to not be encrypted. I've tried for a few hours and had no luck.
akhilnarang said:
Can anyone confirm it works? (disabling forced encryption)
I had changed the flag in fstab manually (forceencrypt to encryptable), and I still got encrypted.
Click to expand...
Click to collapse
Nope it does not. Mine started the encryption process as well.
[EDIT] correction; it does seem to work. Because the first boot took really long and the device ran hot, just like the first time when I did have encryption, I thought it was the case this time as well. Although I had to reflash the TWRP-recovery (it was replaced by stock) but it did not tell me /data was encrypted, so I think we're good!
Thank you Xennet!
Mr_Q said:
Nope it does not. Mine started the encryption process as well.
[EDIT] correction; it does seem to work. Because the first boot took really long and the device ran hot, just like the first time when I did have encryption, I thought it was the case this time as well. Although I had to reflash the TWRP-recovery (it was replaced by stock) but it did not tell me /data was encrypted, so I think we're good!
Thank you Xennet!
Click to expand...
Click to collapse
Hope you will not lose twrp if you had rebooted back to twrp before rebooting to system..
Can you confirm that the phone is not encrypted...
See the encryption status in settings, security..
Xennet said:
Hope you will not lose twrp if you had rebooted back to twrp before rebooting to system..
Can you confirm that the phone is not encrypted...
See the encryption status in settings, security..
Click to expand...
Click to collapse
I did boot TWRP -> TWRP, it become stock after I did a normal boot.
But the sad news is, it does state it's encrypted..
So I thought encryption always required a PIN or Pattern when accessing the phone and/or Recovery, am I wrong?
Mr_Q said:
I did boot TWRP -> TWRP, it become stock after I did a normal boot.
But the sad news is, it does state it's encrypted..
So I thought encryption always required a PIN or Pattern when accessing the phone and/or Recovery, am I wrong?
Click to expand...
Click to collapse
Just sent you a PM..
Check it...
Mr_Q said:
I did boot TWRP -> TWRP, it become stock after I did a normal boot.
But the sad news is, it does state it's encrypted..
So I thought encryption always required a PIN or Pattern when accessing the phone and/or Recovery, am I wrong?
Click to expand...
Click to collapse
Yup but that's right...
To access an encrypted phone data you need a pin in TWRP
Can you check in TWRP again and are you able to see your data and copy and move around files..
Xennet said:
Yup but that's right...
To access an encrypted phone data you need a pin in TWRP
Can you check in TWRP again and are you able to see your data and copy and move around files..
Click to expand...
Click to collapse
Yes I can, but I did notice something interesting in the logs of TWRP:
Data successfully decrypted, new block device: '/dev/block/dm-0'
Updating partition details...
... done
Succesfully decrypted with default password.
So yes it's encrypted, but I don't have to enter any password...
Mr_Q said:
Yes I can, but I did notice something interesting in the logs of TWRP:
Data successfully decrypted, new block device: '/dev/block/dm-0'
Updating partition details...
... done
Succesfully decrypted with default password.
So yes it's encrypted, but I don't have to enter any password...
Click to expand...
Click to collapse
You have not triggered DM verity I suppose??
So my zip file does protect from triggering DM verity but not force encryption that's weird...
Did you use any root methods..?

Magisk + dm-verity + decrypt data partition

So, I wanted to have a stock rom, rooted with magisk, and data partition decrypted, so what I did is the following:
1) wiped data partition
2) flashed stock OOS (latest, 5.1.6)
3) flashed Magisk
4) flashed DM-verity & force encryption disabler (this link)
Now I have a few questions:
1) I tried flashing the dm-verity from this link (no_verity_op5_v2.zip) but it didn't work so I flashed this newer version (disable_dm_verity_forceencrypt_09_02_2018.zip). Any ideas why it didn't work?
2) What should I do when a new OOS update comes up?
3) What should I do when a new Magisk update comes up?
Regadring Magisk: In Magisk there is a option "Preserve AVB 2.0/dm-verity":
1) What does it do?
2) What is AVB 2.0 in the first place?
Thank You all in advance
0v3rl0rd said:
So, I wanted to have a stock rom, rooted with magisk, and data partition decrypted, so what I did is the following:
1) wiped data partition
2) flashed stock OOS (latest, 5.1.6)
3) flashed Magisk
4) flashed DM-verity & force encryption disabler (this link)
Now I have a few questions:
1) I tried flashing the dm-verity from this link (no_verity_op5_v2.zip) but it didn't work so I flashed this newer version (disable_dm_verity_forceencrypt_09_02_2018.zip). Any ideas why it didn't work?
2) What should I do when a new OOS update comes up?
3) What should I do when a new Magisk update comes up?
Regadring Magisk: In Magisk there is a option "Preserve AVB 2.0/dm-verity":
1) What does it do?
2) What is AVB 2.0 in the first place?
Thank You all in advance
Click to expand...
Click to collapse
Answers:
1. It didn't work because you have to flash that zip BEFORE you flash Magisk (it's stated in the thread's first post too). The zip creates the required files which tells Magisk to disable dm-verity and forceencrypt when it is flashed.
2. When a new OOS comes out, all you have to do is dirty flash it, then the universal zip and then Magisk. You should be unencrypted with the new OOS as well.
3. The universal zip will most likely be updated if there are major changes in Magisk, but if not, then just update Magisk as usual, from within Magisk Manager. If you wish to update from TWRP by flashing the latest Magisk zip, then you have to remember to flash the universal zip BEFORE the newest Magisk zip and you should be fine.
Regarding your other queries, AVB refers to "Android Verified Boot". Google it and you'll find lots of information about it (which may be technical). Regarding the option in Magisk, it's for those people who want to let dm-verity intact while using Magisk (because some phones don't boot when dm-verity is disabled and hence this option is there for those people). Don't fiddle with it since you want to stay unencrypted and disabling dm-verity causes no issues on the OnePlus 5.
shadowstep said:
Answers:
1. It didn't work because you have to flash that zip BEFORE you flash Magisk (it's stated in the thread's first post too). The zip creates the required files which tells Magisk to disable dm-verity and forceencrypt when it is flashed.
2. When a new OOS comes out, all you have to do is dirty flash it, then the universal zip and then Magisk. You should be unencrypted with the new OOS as well.
3. The universal zip will most likely be updated if there are major changes in Magisk, but if not, then just update Magisk as usual, from within Magisk Manager. If you wish to update from TWRP by flashing the latest Magisk zip, then you have to remember to flash the universal zip BEFORE the newest Magisk zip and you should be fine.
Regarding your other queries, AVB refers to "Android Verified Boot". Google it and you'll find lots of information about it (which may be technical). Regarding the option in Magisk, it's for those people who want to let dm-verity intact while using Magisk (because some phones don't boot when dm-verity is disabled and hence this option is there for those people). Don't fiddle with it since you want to stay unencrypted and disabling dm-verity causes no issues on the OnePlus 5.
Click to expand...
Click to collapse
Thank You for Your answer
Regarding point 2 - OOS update: should I reboot after every step or no?
I mean:
1. dirty flash OS
2. reboot to recovery
3. flash universal zip
4. reboot to recovery
5. flash magisk
6. reboot to recovery
Or should I do that without rebooting: flash everything and then reboot to recovery?
0v3rl0rd said:
Thank You for Your answer
Regarding point 2 - OOS update: should I reboot after every step or no?
I mean:
1. dirty flash OS
2. reboot to recovery
3. flash universal zip
4. reboot to recovery
5. flash magisk
6. reboot to recovery
Or should I do that without rebooting: flash everything and then reboot to recovery?
Click to expand...
Click to collapse
It's not necessary to reboot to recovery after each step.

What is update process for OP6T 9.0.16 > 10.3.3 rooted [Global]

I have OP6T OxygenOS 9.0.16 and I would like to update it to the latest 10.3.3 with root.
What should be my process of doing so? I have not been in touch with rooting for the past 3 years so I don't want to mess things up. Another note is that while I am on OxygenOS 9.0.16 I tried to root it which was failed, but now few banking and calling apps such as TextNow thinks that my phone is rooted and they can not run -- but my phone is not properly rooted according to root verification apps.
Please tell me how should I do the update to the latest version from this point and then I would like to unlock bootloader and install recovery and root it as well.
Please advice.
BTW my OP6T is global
a4abbas said:
I have OP6T OxygenOS 9.0.16 and I would like to update it to the latest 10.3.3 with root.
What should be my process of doing so? I have not been in touch with rooting for the past 3 years so I don't want to mess things up. Another note is that while I am on OxygenOS 9.0.16 I tried to root it which was failed, but now few banking and calling apps such as TextNow thinks that my phone is rooted and they can not run -- but my phone is not properly rooted according to root verification apps.
Please tell me how should I do the update to the latest version from this point and then I would like to unlock bootloader and install recovery and root it as well.
Please advice.
BTW my OP6T is global
Click to expand...
Click to collapse
Hello,
Here is a link that will help you out with this update process:
https://forum.xda-developers.com/oneplus-6t/how-to/official-oxygenos-9-0-4-ota-oneplus-6t-t3860953
a4abbas said:
I have OP6T OxygenOS 9.0.16 and I would like to update it to the latest 10.3.3 with root.
What should be my process of doing so? I have not been in touch with rooting for the past 3 years so I don't want to mess things up. Another note is that while I am on OxygenOS 9.0.16 I tried to root it which was failed, but now few banking and calling apps such as TextNow thinks that my phone is rooted and they can not run -- but my phone is not properly rooted according to root verification apps.
Please tell me how should I do the update to the latest version from this point and then I would like to unlock bootloader and install recovery and root it as well.
Please advice.
BTW my OP6T is global
Click to expand...
Click to collapse
Flash OOS full rom zip on both slots using TWRP also flash TWRP installer zip on both slots reboot recovery flash magisk reboot system. Easy peasy.
Example:
Boot recovery: fastboot boot twrp.img
flash OOS 10.3.3 full rom zip
flash TWRP installer zip, reboot recovery,
flash OOS 10.3.3 full rom zip, format data, wipe data,
flash TWRP installer zip
Reboot recovery, flash magisk,
reboot system.
Note: I use a USB stick. I flash magisk zip off my USB stick.
That's what I do when I use OOS on my 6t far as installation goes.
Edited
flash713 said:
Flash OOS full rom zip on both slots using TWRP also flash TWRP installer zip on both slots reboot recovery flash magisk reboot system. Easy peasy.
Example:
Boot recovery: fastboot boot twrp.img
flash OOS 10.3.3 full rom zip
flash TWRP installer zip, reboot recovery,
flash OOS 10.3.3 full rom zip, format data, wipe data,
flash TWRP installer zip
Reboot recovery, flash magisk,
reboot system.
Note: I use a USB stick. I flash magisk zip off my USB stick.
That's what I do when I use OOS on my 6t far as installation goes.
Edited
Click to expand...
Click to collapse
Are you sure there is no need to update to 9.0.17 and then 10.3.3?
I've asked once and someone said that 9.0.17 is neccessary before update to 10.3.x.
Also there is option to flash from system without losing magisk modules:
1. Flash manually from update center (do not reboot)
2. Enter magisk and flash to another slot (after OTA)
3. Flash TWRP installer like magisk module
4. Reboot
But I'm not sure if I remember it correctly.
Michalec said:
Are you sure there is no need to update to 9.0.17 and then 10.3.3?
I've asked once and someone said that 9.0.17 is neccessary before update to 10.3.x.
Also there is option to flash from system without losing magisk modules:
1. Flash manually from update center (do not reboot)
2. Enter magisk and flash to another slot (after OTA)
3. Flash TWRP installer like magisk module
4. Reboot
But I'm not sure if I remember it correctly.
Click to expand...
Click to collapse
10.3.3 is all that you need. 9.0.17 isn't the only way anymore.
Michalec said:
Are you sure there is no need to update to 9.0.17 and then 10.3.3?
I've asked once and someone said that 9.0.17 is neccessary before update to 10.3.x.
Also there is option to flash from system without losing magisk modules:
1. Flash manually from update center (do not reboot)
2. Enter magisk and flash to another slot (after OTA)
3. Flash TWRP installer like magisk module
4. Reboot
But I'm not sure if I remember it correctly.
Click to expand...
Click to collapse
I have a T-Mobile SIM unlock OnePlus 6t and I converted it to an international model so when my conversation was done I was on OOS 9.0.1.1 and I booted TWRP and installed 10.3.4 full rom on both slots and also recovery installer and all just like my previous posts stated and everything went fine. I used mauronofrio's TWRP the version just before the latest 3.4xx when I did this.
I always download quite a bit of various firmwares and also TWRP versions before I start flashing things just in case something goes wrong I already have other things maybe I can use and I don't have to stop and wait for some download to finish... And I'm quite sure you know this but definitely make a backup of everything beforehand to USB or transfer it to your pc just in case you end up needing it as a precaution.
Edit added:
I am assuming that you already unlocked your bootloader... I believe everyone knows to do that that's on XDA forums before you can do anything to any device .. I say this after reading post below me here. I guess I should have said that earlier but I just assume everyone knows that on the forums... My bad. ??
From fastboot on Linux PC:
sudo fastboot oem unlock (then hit enter on keyboard) use volume keys to move to unlock option and your Power button to select it and confirm. For more info see: https://www.xda-developers.com/oneplus-6t-unlock-bootloader-root/
Super easy to unlock bootloader just remember it does wipe your device clean so move anything to want to PC or USB stick first...
I would think you could just update oxygenOS to latest then re-root no? Assuming your already bootloader unlocked which it seems like would be the case if you have an obsolete magisk installation.
Edit: re-reading your post maybe it is not unlocked as you failed to root. In this case just unlock then flash the latest fastboot image and then magisk as others have already stepped you through. You will lose data when you unlock so backup first.
So if I'm on 9.0.16 I could flash latest OOS directly from TWRP and then flash magisk? And no data loss? Of course I'm rooted with bootloader unlocked.
Oh dear this process is getting harder because recently I was busy doing other things it sounds way harder it actually is. Isnt there a way I pay someone on this forum so that user help me do this. Like download stuff links and proper version and follow me up with it because i want to do this without messing things up!
a4abbas said:
Oh dear this process is getting harder because recently I was busy doing other things it sounds way harder it actually is. Isnt there a way I pay someone on this forum so that user help me do this. Like download stuff links and proper version and follow me up with it because i want to do this without messing things up!
Click to expand...
Click to collapse
It is indeed a tough job. This A/B partition has had a lot of people bootloop/soft bricked their phones.
However, you need not pay anybody anything. If you are on stock, I would've recommended you upgrading it via Oxygen updater (a 3rd party app on the play store) and then using the latest recoveries (TWRP 3.4) and flashing it via Fastboot mode.
It is super easy.

Is it possible to root the phone and still getting OTA updates ?

I want to root my phone due to its huge benefits but also at the same time I want to keep my OTAs
Is it possible even if I will install them manually (but the data remains with no wipe) ?
And if so, how can I do this and whats the best way?
Thanks in advance and sorry if the language was bad <3
Tsunaimy said:
I want to root my phone due to its huge benefits but also at the same time I want to keep my OTAs
Is it possible even if I will install them manually (but the data remains with no wipe) ?
And if so, how can I do this and whats the best way?
Thanks in advance and sorry if the language was bad <3
Click to expand...
Click to collapse
Yes it's possible with a little workaround, to temporarily switch to stock Recovery (from TWRP, if you had it installed) and to stock Boot (from the one patched by Magisk) during the OTA upgrade - OTA will fail if it finds not the stock images of Recovery and Boot
After the upgrade you just flash the new Boot patched by Magisk (and flash TWRP if you will)
Or you flash TWRP and flash Magisk from TWRP
Below is a post how I recently upgraded from QFJEUXM 12.0.2 to 12.0.3. Btw, I downloaded zip and initiated OTA manually because I didn't want to wait more days to be pushed for OTA, but that's just a small detail not important for the way how to do it:
https://forum.xda-developers.com/showpost.php?p=83791185&postcount=93
Ofc, all my data, apps, settings, and Magisk modules were preserved
Generally, in the Redmi K20/Mi 9T Guides section on XDA you can find (at least two) threads about how-to root, i.e. install Magisk
Those threads describe the way to install Magisk by installing Magisk Manager, patching the Boot image, then flashing it from Fastboot (I prefer that way).
In that case TWRP is not needed (but it can be also installled)
Threads and guides are maybe old (since MIUI 11) but it doesn't matter, it's always the same method (essentially the same as in my post I gave you the link above, its part about returning back to Magisk after the OTA upgrade)
If you follow those guides you must pay attention that you patch the boot.img for exactly that (new) stock MIUI you do have and that you now use new Magisk (not some old versions as in the guides)
Alternatively, you flash TWRP by Fastboot, then flash Magisk zip from TWRP and then you install Magisk Manager
All those methods are described in other threads and posts.
Anyway, you must first unlock the Bootloader, again there is thread with a guide, or just google for how to unlock Bootloader on Xiaomi
Btw, some custom TWRP versions and Orange Fox do have Advanced options for upgrading MIUI and to keep Magisk, but when I did it that way for upgrading from QFJEUXM 11.0.5 to 12.0.2, it made me Factory reset and I lost all my files on Internal memory (it was generally an issue for the others who upgraded from MIUI 11 to MIUI 12 by flashing OTA through custom recovery)
Hence now for upgrading to 12.0.3 I didn't want to risk and did it as above
zgfg said:
Yes it's possible with a little workaround, to temporarily switch to stock Recovery (from TWRP, if you had it installed) and to stock Boot (from the one patched by Magisk) during the OTA upgrade - OTA will fail if it finds not the stock images of Recovery and Boot
After the upgrade you just flash the new Boot patched by Magisk (and flash TWRP if you will)
Or you flash TWRP and flash Magisk from TWRP
Below is a post how I recently upgraded from QFJEUXM 12.0.2 to 12.0.3. Btw, I downloaded zip and initiated OTA manually because I didn't want to wait more days to be pushed for OTA, but that's just a small detail not important for the way how to do it:
https://forum.xda-developers.com/showpost.php?p=83791185&postcount=93
Ofc, all my data, apps, settings, and Magisk modules were preserved
Generally, in the Redmi K20/Mi 9T Guides section on XDA you can find (at least two) threads about how-to root, i.e. install Magisk
Those threads describe the way to install Magisk by installing Magisk Manager, patching the Boot image, then flashing it from Fastboot (I prefer that way).
In that case TWRP is not needed (but it can be also installled)
Threads and guides are maybe old (since MIUI 11) but it doesn't matter, it's always the same method (essentially the same as in my post I gave you the link above, its part about returning back to Magisk after the OTA upgrade)
If you follow those guides you must pay attention that you patch the boot.img for exactly that (new) stock MIUI you do have and that you now use new Magisk (not some old versions as in the guides)
Alternatively, you flash TWRP by Fastboot, then flash Magisk zip from TWRP and then you install Magisk Manager
All those methods are described in other threads and posts.
Anyway, you must first unlock the Bootloader, again there is thread with a guide, or just google for how to unlock Bootloader on Xiaomi
Btw, some custom TWRP versions and Orange Fox do have Advanced options for upgrading MIUI and to keep Magisk, but when I did it that way for upgrading from QFJEUXM 11.0.5 to 12.0.2, it made me Factory reset and I lost all my files on Internal memory (it was generally an issue for the others who upgraded from MIUI 11 to MIUI 12 by flashing OTA through custom recovery)
Hence now for upgrading to 12.0.3 I didn't want to risk and did it as above
Click to expand...
Click to collapse
I really appreciate your reply but I kinda don't know much info to understand most of what u said
My last time with root was about 3 years ago with king root on Mi A1 and I didn't care about updates then
so it's my very first time with magisk and TWRP and that stuff
Could u tell me what is the best method of u mentioned to keep my files and everything with no delete and also makes me able to upgrade Official ROM with no deletes
After this i'll start digging to learn but I want to know what should I dig for
Thanks bro
Tsunaimy said:
I really appreciate your reply but I kinda don't know much info to understand most of what u said
My last time with root was about 3 years ago with king root on Mi A1 and I didn't care about updates then
so it's my very first time with magisk and TWRP and that stuff
Could u tell me what is the best method of u mentioned to keep my files and everything with no delete and also makes me able to upgrade Official ROM with no deletes
After this i'll start digging to learn but I want to know what should I dig for
Thanks bro
Click to expand...
Click to collapse
Unlocking Bootloader usually takes to wait 7 days=168 hours, hence you have enough time to read?
Unlocking Bootloader:
https://c.mi.com/thread-1857937-1-1.html
Unlocking Bootloader: and Installing TWRP, OP post #1:
https://forum.xda-developers.com/mi-9t/how-to/guide-unlock-bootloader-flash-xiaomi-eu-t3952443
- for step 6, installing TWRP, use TWRP I'm giving you below
- instead of 7, execute this command:
>> fastboot oem reboot-recovery
- step 7, don't Format Data (unless you really go to install custom ROM, otherwise you don't need to)
- stop here for installing TWRP
Suggesting you to use this TWRP, 3.4.0.2 from OP post #1:
https://forum.xda-developers.com/mi-9t/how-to/recovery-unofficial-twrp-3-4-0-1-t4135159
- every time you boot to TWRP, you must type in your Android screen unlock pin, TWRP needs to be able to read/write to Data and Internal memory
Learn about using ADB and Fastboot:
https://www.makeuseof.com/tag/use-adb-fastboot-android/
- you can't do things with ADB that require root, but you can read
- similarly, fastboot commands mostly require unlocked Bootloader, but you can read
- google yourself
About installing Magisk, read in these threads:
https://forum.xda-developers.com/mi-9t/how-to/guide-easiest-to-root-twrp-t4000209
https://forum.xda-developers.com/mi-9t/how-to/root-k20-indian-rom-v10-3-6-0-twrp-t3958566
- if you have time, go through the whole threads, you will see variations
- don't worry if talking about MIUI 11, same applies for MIUI 12, you will just need to download your MIUI 12 recovery/zip firmware, will give you link below
- I'll give you below the link for the latest Magisk
MIUI firmwares, download, etc:
https://androidfilebox.com/tips/how-to-install-miui-recovery-rom/
https://androidfilebox.com/tips/how-to-install-miui-fastboot-rom/
https://xiaomiflashtool.com/tutorial/use-xiaomi-flash-tool
https://xiaomifirmwareupdater.com/miui/davinci/
https://codeexercise.com/xiaomi-all-android-mobile-secret-code-list/amp/
Various methods to extract stock Recovery, Boot, Persist and Persistbak partitions:
https://forum.xda-developers.com/mi-9t/how-to/root-k20-indian-rom-v10-3-6-0-twrp-t3958566
Magisk documentation and download:
https://github.com/topjohnwu/Magisk/blob/master/README.MD
- read the docs
- I would suggest you to use Canary (don't worry, Stable is far behind), hence you will only need to download Magisk Manager Canary (then follow XDA guides I gave you above)
zgfg said:
Unlocking Bootloader usually takes to wait 7 days=168 hours, hence you have enough time to read
Unlocking Bootloader:
https://c.mi.com/thread-1857937-1-1.html
Unlocking Bootloader: and Installing TWRP, OP post #1:
https://forum.xda-developers.com/mi-9t/how-to/guide-unlock-bootloader-flash-xiaomi-eu-t3952443
- for step 6, installing TWRP, use TWRP I'm giving you below
- instead of 7, execute this command:
>> fastboot oem reboot-recovery
- step 7, don't Format Data (unless you really go to install custom ROM, otherwise you don't need to)
- stop here for installing TWRP
Suggesting you to use this TWRP, 3.4.0.2 from OP post #1:
https://forum.xda-developers.com/mi-9t/how-to/recovery-unofficial-twrp-3-4-0-1-t4135159
- every time you boot to TWRP, you must type in your Android screen unlock pin, TWRP needs to be able to read/write to Data and Internal memory
Learn about using ADB and Fastboot:
https://www.makeuseof.com/tag/use-adb-fastboot-android/
- you can't do things with ADB that require root, but you can read
- similarly, fastboot commands mostly require unlocked Bootloader, but you can read
- google yourself
About installing Magisk, read in these threads:
https://forum.xda-developers.com/mi-9t/how-to/guide-easiest-to-root-twrp-t4000209
https://forum.xda-developers.com/mi-9t/how-to/root-k20-indian-rom-v10-3-6-0-twrp-t3958566
- if you have time, go through the whole threads, you will see variations
- don't worry if talking about MIUI 11, same applies for MIUI 12, you will just need to download your MIUI 12 recovery/zip firmware, will give you link below
- I'll give you below the link for the latest Magisk
MIUI firmwares, download, etc:
https://androidfilebox.com/tips/how-to-install-miui-recovery-rom/
https://androidfilebox.com/tips/how-to-install-miui-fastboot-rom/
https://xiaomiflashtool.com/tutorial/use-xiaomi-flash-tool
https://xiaomifirmwareupdater.com/miui/davinci/
https://codeexercise.com/xiaomi-all-android-mobile-secret-code-list/amp/
Various methods to extract stock Recovery, Boot, Persist and Persistbak partitions:
https://forum.xda-developers.com/mi-9t/how-to/root-k20-indian-rom-v10-3-6-0-twrp-t3958566
Magisk documentation and download:
https://github.com/topjohnwu/Magisk/blob/master/README.MD
- read the docs
- I would suggest you to use Canary (don't worry, Stable is far behind), hence you will only need to download Magisk Manager Canary (then follow XDA guides I gave you above)
Click to expand...
Click to collapse
bro I can`t really thank u enough for the effort
as I got it:
1- Unlock bootloader
2- Install TWRP (the version u provided)
3- Install Magisk (last link u provided) right?
Is there any step of those that is risky or unsafe that may brick the phone ?
PS: On mi unlock application it says all phone data will be erased !
what should I do ?
By unlocking Xiaomi phone you won't lose anything but previous user data stored in phone, unlike ASUS phone losts OTA permanentry.
So make a backup, also I recommend you first picking your secondaly phone, not your daily using one.
Tsunaimy said:
bro I can`t really thank u enough for the effort
as I got it:
1- Unlock bootloader
2- Install TWRP (the version u provided)
3- Install Magisk (last link u provided) right?
Is there any step of those that is risky or unsafe that may brick the phone ?
PS: On mi unlock application it says all phone data will be erased !
what should I do ?
Click to expand...
Click to collapse
As described, TWRP is optional, not needed for Magisk/root but it would be useful to have, so yes, install TWRP
Instructions for unlocking Bootloader say to do Backup. Copy photos and files from Internal memory to PC.
Export contacts to CVS file and also copy to PC.
Backup to Google your Google accounts, contacts, WhatsApp, etc.
Use Settings, Additional settings, Backup, and cooy to PC.
You can also use Settings, MIUI account to backup things
Installations of Magisk and TWRP will not erase data. Generally, they are not risky unless you make really stupid mistake like flashing TWRP img file to System partition instead of to Recovery partition and so - that's why you have instructions how to use Fastboot command to flash TWRP
It's more risky if you go to use e.g. MiFlash (you don't need for TWRP and Magisk), then people can screw up things and need authorized EDL support

Categories

Resources