yashsingh1/xdaforums huggingface dataset:
[OnePlus 3T Guides, News, & Discussion] Xennet:
Once encrypted..

Go to bootloader...

Connect to pc..Type fastboot format userdata (you will lose your data, do back up if you need something.)

Don't reboot to system...using volume buttons and select boot to recovery and Reboot to TWRP...

MAKE SURE SYSTEM IS MOUNTED...

Flash "DM-Verity and Force Encryption Disabler For OOS Oreo.zip"

Reboot to system
[OnePlus 3T Guides, News, & Discussion] Chuck Bartowski:
The zip is working fine for me with BluSpark TWRP.

I think that the problem with most users is system not mounted.

It may also be SuperSu, because I tried to replace the fstab manually (with system mounted) and I was still encrypted (without triggering dm-verify), then I tried again flashing SuperSu 2.82 SR5 and everything was fine.
[OnePlus 3T Guides, News, & Discussion] 2CAN0:
have you used magisk or super su to root OB16
[OnePlus 3T Guides, News, & Discussion] Xennet:
Use Supersu 2.82 sr5

Magisk don't work with this Oreo build..
[OnePlus 3T Guides, News, & Discussion] elmer_fudd:
Yes, it works. I'm not encrypted anymore.

Yesterday I flashed OOS Oreo and immediately after, without booting into system in-between, SuperSU 2.82-SR5. I didn't trip DM-Verity, but I was encrypted.

Now I formatted userdata from fastboot and flashed "DM-Verity and Force Encryption Disabler For OOS Oreo.zip". And I'm not encrypted anymore.
[OnePlus 3T Guides, News, & Discussion] Hinoy:
So I tried this method first. I installed blu_spark recovery in case it could help me but after going back to OOS 4.5.0 and flashing your boot img I still can't flash the god damn beta ROM. Still the same error "Patching system image unconditionally --- ERROR 1001 : Failed to update systeme image" (Error 7 of TWRP). Tried with 3.1.1.0 the -2 one and blu_spark v45. Same message every single time. I am so sorry to take of your time for such a stupid error which might be my fault.
[OnePlus 3T Guides, News, & Discussion] Xennet:
You can't flash Oreo beta ROM via bluspark twrp

You have to remove the assert line at the top of updater script or use a compatible twrp...like [MENTION=5854483]akhilnarang[/MENTION] twrp
[OnePlus 3T Guides, News, & Discussion] Xennet:
So finally we have it...

This method works...

Thanks [MENTION=4561671]Chuck Bartowski[/MENTION], [MENTION=6972080]elmer_fudd[/MENTION] and all others who reported back...
[OnePlus 3T Guides, News, & Discussion] candiesdoodle:
So if I don't want/care about root at the moment and will skip SuperSU. Will this zip ensure no encryption and no dm-verity? Assuming i mount system for the script and flash

Can someone confirm
[OnePlus 3T Guides, News, & Discussion] Xennet:
Refer to this post:

https://xdaforums.com/showpost.php?p=74166131&postcount=28

It should work..

Flashing this zip will definitely not trigger Dm-verity... That's definite..

For disabling encryption...

Goto bootloader, Format user data, go back to twrp, flash this zip and then reboot...

Steps given in OP...

Do backup your data in case if something happens..
[OnePlus 3T Guides, News, & Discussion] candiesdoodle:
Got it thanks. So u r saying that if I am already decrypted, the zip will ensure no encryption? No need for bootloader>format userdata... ?
[OnePlus 3T Guides, News, & Discussion] Xennet:
For that I may say...

Some users say it will work while others not...

I think it may be due the faulty procedures that it didn't work

Like the post I gave reference to clearly states that flashing my zip prevents encryption and it's not SuperSU ...

Like I said formatting user data and flashing my zip will definitely prevent encryption

But without formatting and flashing my zip theoretically has to prevent encryption...but can't ensure 100% until i get further user analysis...

But without formatting user data flashing SuperSU followed by my zip will definitely prevent encryption
[OnePlus 3T Guides, News, & Discussion] DelicatePanda:
Is there any other way other than the firmware 4.0.2 downgrade method or the unbrick tutorial to remove DM variety as I had flashed open beta 16 and (tried flashing) magisk before the posts updated on xda but as magisk doesn't support open beta 16 yet I triggered DM variety.:(

Both methods mentioned above require wiping data. Is there any method without wiping data?

Does ported Google Camera work? For me, it works for sometime but then it starts crashing and doesn't work till I clear its data.
[OnePlus 3T Guides, News, & Discussion] Xennet:
Refer to my thread here:

https://xdaforums.com/oneplus-3t/how-to/rom-dm-verity-force-encryption-disabled-t3618232

Read the post 2...

There is no loss of data involved..
[OnePlus 3T Guides, News, & Discussion] tandevilz:
I might be totally wrong but going through the thread looks like if I have already triggered DM-verity and am on OB25 (Oreo), I can't get rid of it without downgrading to Nougat?? I really am confused..
[OnePlus 3T Guides, News, & Discussion] puli112:
stayed de-crypted, after flashing FreedomOs 3.0 test build and this zip
[OnePlus 3T Guides, News, & Discussion] Xennet:
Did you flash the patched boot image?
[OnePlus 3T Guides, News, & Discussion] KforHorizon:
Yes I did.
[OnePlus 3T Guides, News, & Discussion] Xennet:
That doesn't make sense SuperSU or Magisk has nothing to do with decryption...

Just modifying the fstab file and preventing it from being overwritten by patching the DM Verity in boot image is only what is required to achieve decryption...

And I posted the STEPS after decrypting my wife's OP3T with just the steps in OP...

Wonder why it didn't work for some of you....

For the time being I will update OP, until further investigation let's assume that you flash either SuperSU or Magisk before booting back...
[OnePlus 3T Guides, News, & Discussion] KforHorizon:
So the problem isn't just decryption. The problem is even if it stays decrypted somehow flashing SuperSU or Magisk enables it to not get stuck in BootLoop forever!
[OnePlus 3T Guides, News, & Discussion] Vuska:
Work for me..

From 5.0.1 stable :

1. Clear Cache and Dalvick

2. Flash OB21 then reboot twrp

3. Flash Boot patched21 image then reboot twrp

4. use terminal, df system to check then remove some files from system app like : Gmail, Drive, Maps, Google Calendar, Google Photo and Youtube, get about 300++ free on system

then reboot twrp

5. Flash Force Disabler v2

6. Flash Magisk

7. Reboot system

Everything still same.. i have all my apps still available

and after that i flash Franco Kernel because i need to use Color Control by savica to make my screen more white.

Thank You dev...
[OnePlus 3T Guides, News, & Discussion] silentkiller143:
Thanks [MENTION=7874870]Xennet[/MENTION] for your hard work

This is what I did on my 3T (decrypted), if it helps someone (coming from OB20) :

1. Reboot to recovery (first step first :))

2. Wipe system, data, dalvik, cache

3. reboot to recovery

4. flash ob21

5. flash magisk 15.3

6. go to file manager : delete some apps to free up memory

7. flash force disabler v2

8. wipe cache dalvik (optional)

9. reboot to system

10. profit
[OnePlus 3T Guides, News, & Discussion] Fredheg:
Hello

its works on OnePlus3 encripted and dm-verity message.

I have decript and delete the dm-verity message.

Thanks for your job
[OnePlus 3T Guides, News, & Discussion] ramanz:
sorry for the long post... but please guide the correct procedure..

I have read the thread a lot... but still confused..

My current situation

Device - Oneplus 3t

Unlocked bootloader

Stable OOS 5.01

Stock recovery

Never rooted

Data encrypted

I want to root and install xposed

so i guess the steps would be...

for keeping data encrypted

install oreo twrp recovery

return to twrp recovery

install Patched Boot Image Stable OOS 5.0.1

return to twrp recovery

install supersu/ magisk

return to twrp recovery

reboot to system..

for data decrypted

install oreo twrp recovery

return to twrp recovery

fastboot format userdata

return to twrp recovery

install Patched Boot Image Stable OOS 5.0.1

return to twrp recovery

in TWRP, MOUNT SYSTEM

Flash "Force Encryption Disabler For OOS Oreo v2.zip" in TWRP

install supersu/ magisk

return to twrp recovery

reboot to system..

are the above steps correct?? please guide... which method should i follow if i want to install custom rom in future....

n am still not able to understand the password thing ((in twrp and boot and at unlock device))...
[OnePlus 3T Guides, News, & Discussion] Xennet:
Don't return to twrp recovery from twrp recovery after flashing twrp recovery for the first time...it will trigger DM Verity..

Flash twrp recovery

Swipe to allow modifications

Immediately flash patched boot image

Then only return back to twrp recovery....

Rest all steps are correct...
[OnePlus 3T Guides, News, & Discussion] zurih:
If I upgrade OOS to latest beta, will it be encrypted again? How about OTA updates?
[OnePlus 3T Guides, News, & Discussion] Rodger_Rulez:
yes, you have to wait for new patched boot.img
[OnePlus 3T Guides, News, & Discussion] ramanz:
thanks... will try....

please tell also.. which method to follow.. encryption or decryption..... if I want try some custom rom..
[OnePlus 3T Guides, News, & Discussion] Xennet:
Encryption is always better..
[OnePlus 3T Guides, News, & Discussion] zurih:
Ok so what's the procedure for upgrade? There is a patched boot.imh for the beta already.

I flash the update zip of the beta, then flash boot.img, then flash Force_Encryption_Disabler_For_OOS_Oreo.zip v2.zip?

Can anyone please confirm

Thanks
[OnePlus 3T Guides, News, & Discussion] Xennet:
What Upgrade???

Which OOS are you now on?

Please mention all details if you want help..
[OnePlus 3T Guides, News, & Discussion] Vuska:
yeah.. you better give more informations.

Your current Rom version, your Encryption status, your twrp version..
[OnePlus 3T Guides, News, & Discussion] zurih:
OOS 5.0.1

UNENCRYPTED

Latest TWRP

I'd like to upgrade to latest beta.
[OnePlus 3T Guides, News, & Discussion] ramanz:
does xposed works in encrypted environment ..??
[OnePlus 3T Guides, News, & Discussion] Paschfire:
Ask questions about Xposed in the appropriate discussion thread.
[OnePlus 3T Guides, News, & Discussion] Xennet:
Wipe Dalvk, system, cache and data ( I would recommend to format data)

And follow steps in OP accordingly for either encrypted or decrypted procedures....
[OnePlus 3T Guides, News, & Discussion] zurih:
Wait, I have to wipe data Everytime I upgrade?
[OnePlus 3T Guides, News, & Discussion] Xennet:
Going from stable to beta, I would recommend it...

No for stable to stable or for beta to beta...
[OnePlus 3T Guides, News, & Discussion] zurih:
Is there anything I can't do when my phone is encrypted? I suppose I can root & install Xposed.

Anything I am missing?

If I flash the beta as is without patched boot.img the phone will be encrypted and then I can normally root my phone and install Xposed, right?

---------- Post added at 04:26 PM ---------- Previous post was at 04:14 PM ----------

If I want to get back to an encrypted phone how I do that safely?
[OnePlus 3T Guides, News, & Discussion] ramanz:
Thanks to this thread...

Installed on encrypted 3t oss 5.0.1

Oreo twrp...

patched boot image..

magisk

Xposed

Still encrypted... Everything working good...

Just one more question.. what I need to take care when installing custom rom...
[OnePlus 3T Guides, News, & Discussion] Xennet:
Custom ROMs usually have inbuilt kernels which are patched for DM Verity and may be forced encryption..so you can do whatever right out of the box...or if you need some instructions read the instructions for custom ROMs in the OP...
[OnePlus 3T Guides, News, & Discussion] BillGoss:
You lose nothing by having the phone encrypted. In fact you gain in security as no one can access your system without entering the password (provided you specified the password to be used at boot). At best, they can wipe your phone.

With an unencrypted phone it's easy to remove the lock screen password in TWRP and then one can gain access to the entire system.

To re-encrypt a phone, select Settings>Security>Encrypt phone.
[OnePlus 3T Guides, News, & Discussion] Vuska:
How to give password to system?
[OnePlus 3T Guides, News, & Discussion] BillGoss:
Settings>Security>Screen lock (the words, not the gear icon)>Password>Require password on start device
[OnePlus 3T Guides, News, & Discussion] zurih:
And I want to upgrade just flash latest OOS zip from twrp and that's it?
[OnePlus 3T Guides, News, & Discussion] BillGoss:
If you just flash the OOS zip, you'll end up with the stock kernel. If you boot that you'll lose TWRP as it will be replaced with the stock recovery.

If you're ok with that, that's fine.

If you want to keep TWRP, then you need to flash either [MENTION=7874870]Xennet[/MENTION]'s patched kernel (see OP and use the correct version) or root (eg Magisk 15.3) or use a custom kernel.
[OnePlus 3T Guides, News, & Discussion] zurih:
I'm planning to root. So if I flash latest OOS zip in TWRP, then flash TWRP recovery, and flash Magisk, will I be ok?
[OnePlus 3T Guides, News, & Discussion] BillGoss:
Keep it simple:

1. OOS

2. Magisk

3. Reboot system

Just don't reboot between 1 and 2 or you'll have to flash TWRP again in fastboot.

You phone will have TWRP, be rooted, and encrypted.
[OnePlus 3T Guides, News, & Discussion] Wild Penguin:
Hi,

I can not seem to be able to remove the "unlocked bootloader" message with a custom ROM.

I though I had this message because I had previously used boot-patched-Beta20 on a non-fresh flash (I was on Open beta 20; sequence: install TWRP, without reboot, install boot-patched-Beta20.img -> reboot to system -> reboot to twrp -> install Omni and Gapps). Everything went smooth except that this message is still there.

So, I'm currently on TWRP 3.2.1-0 and Omni-8.2.1-20180122., with "unlocked bootloader" -message (which I presume, equals dm_verity orange warning). So, I followed these steps:

From TWRP: install 4.0.2 firmware OnePlus 3T.zip

From TWRP: reboot to bootloader

sudo fastboot oem disable_dm_verity && sudo fastboot oem enable_dm_verity (no error messages; did these as root since regular user can not see android devices on my Linux)

Reboot to recovery (TWRP)

From TWRP: Flash OnePlus3T_Beta21-(15-01-18)-FIRMWARE-flashable.zip

From TWRP: Flash boot-patched-Beta21-OP3T.img

From TWRP: Flash omni-8.1.0-20180122-oneplus3-WEEKLY.zip

From TWRP: Flash open_gapps-arm64-8.1-aroma-20180123-UNOFFICIAL.zip

Poweroff, disconnect from PC, and restart the phone -> Unlocked bootloader is still there

Now I believe either:

I should have rebooted instead of poweroff as last step; but I presumed it should not matter?!?? Already tried...

The error about unlocked bootloader is not caused dm_verity and I'm confused?

I did something else wrong above? (should I reboot after step 12 in post #2 before flashing Omni again?)

EDIT: Ok, good thing there is bash history! I double-checked everything and I had first enabled dm_verity and then disabled it (instead of vice versa, as I though I did, just like in my list above!). But I re-ddid everything the correct way and the warning is still there...
[OnePlus 3T Guides, News, & Discussion] Sam Nakamura:
Bootloader unlocked warning cannot be removed as long as your bootloader is indeed unlocked - obviously it will disappear when you lock the bootloader BUT you'll have to return to completely stock before, otherwise your phone won't boot properly...

Edit:

Don't confuse this with the dm-verity warning, it's not the same!
[OnePlus 3T Guides, News, & Discussion] Wild Penguin:
I know this is not entirely true. You can lock your bootloader with custom ROM, but you need to manually sign each image before locking (and if something is goes wrong, your device will be at least soft bricked; this is why there are no step-by-step guides since no one wants to take the possible hordes of replies from users bricking their devices). Also, I do not want to lock my bootloader (at least not for the time being).

However, you haven't actually answered my question or told me anything I do not know (except: you suspect, as I fear, that this message can not be removed). It should be obvious I want to use a custom ROM (otherwise there would not be any problem!). It is unclear for me from this thread if this "Disables dm_verity" altogether or only removes red warnings. See this link: https://source.android.com/security/verifiedboot/verified-boot

From above, I still think (contrary to what you claim) that this warning is actually the orange state warning?

Sorry about my noobness; but I tried to skim trough the thread and search, but my searches proved inconclusive for these questions :eek:

Specifically, I believe my banking application (which also includes a virtual credit card for NFC payment) is checking for dm_verity state and refuses to run on anything except green. This is why I wish to disable it (if possible), to try if it will allow it to run.

(safety net checks pass, as I'm not rooted, but the banking app still refuses to run)
[OnePlus 3T Guides, News, & Discussion] Sam Nakamura:
DM variety warning in red can be solved, DM-verity is a stock kernel security feature and therfore it's not triggered by a custom kernel as they all patch it or if you flash Magisk, SuperSU or a dm-verity disabler...

Usually banking apps check the locked / unlocked bootloader state, not dm-verity... Only because you see the "open bootleader warning" does not mean your banking app can detect it too, usually custom kernels hide /patch that unlocked bootloader detection, using Magisk helps too, are you using Magisk and pass safetynet? This is a fundamental requirement to run banking apps, if it still gives issues use magisk hide, choose and ✅ the specific app in the magisk hide options...

Again, the yellow unlocked bootloader warning can't be dismissed, it will be there as long as you have an open bootloader - of course you don't want to close it but that's the only way to get rid of it, keep in mind that there's no reason to get rid of it besides esthetics :)
[OnePlus 3T Guides, News, & Discussion] BillGoss:
The changes this thread provides prevent the red dm-verity warnings from showing. They don't disable dm-verity itself, which, I guess, is built in to bootloader.

The zip file, for example, changes /vendor/etc/fstab.qcom so that it doesn't force encryption on. This allows you to run with an encrypted data partition.

If your banking app is checking for a locked bootloader then I think the only way you can run your phone is pure stock with a locked bootloader.
[OnePlus 3T Guides, News, & Discussion] Xennet:
That's not true... Absolutely NOT TRUE.. [MENTION=2911853]BillGoss[/MENTION]

The patched boot images and boot images patched by magisk and SuperSU actually disables the dm-verity check altogether and thus prevents triggering DM Verity check altogether and it's not just preventing from showing the the red warning message....

It disables the DM Verity check and as a result of which [MENTION=2911853]BillGoss[/MENTION] you are just not thrown back to the boot loader if you make changes to the system...if it was just disabling the message you would still be at boot loader....

Regarding the bootloader unlock message....

See I have been for the last many years been in depth into reverse engineering windows softwares of all sorts...serial fishing, crypto algorithms, time expiry, hard coded machine signatures and all sorts of protection s. The protection schema changes and advances over time...but as of such NO PROTECTION ALGORITHM IS UNCRACKABLE..IF ITS CODED THEN IT CAN BE REVERSED. BUT IT JUST NEEDS TO FOUND OUT HOW...

Just as such is the case with unlocked bootloader message..no one told that it cannot be got rid off..it's just that at present noone knows how to get rid off it..like you told, one just logical approach would be to sign it with the factory signature...by no one has done it...

Like wise just remember that "We all would be still in the Neanderthal age if we all thought the same way as each other...but thinking out of the box is way to advance...anything is possible..but at present it has not been achieved..may be someday someone can...

And if signing a firmware zip, boot image zip or for the record any flashable file with a factory signature was possible then everything can be done via stock recovery and there will be no need to flash even TWRP. But as I said "nothing is impossible but at present it's not just possible"...
[OnePlus 3T Guides, News, & Discussion] Sam Nakamura:
You're most likely right in theory but it simply lacks the proof of reality on our device, I read about certain moto devices where people found measures to patch / circumvent / dismiss / disable the bootloader warning - there're probably more examples but reducing the answer to the possibilities of the known reality it's just "no, it's not possible (yet) to get rid of the bootloader unlocked warning" even though some people are confident because theoretically there's a way, it's just that theoretically does not help the standard user on xda because if they need to be told that they're usually not able to contribute to a solution, those who could contribute to the solution doesn't need to be told as they already know :)

That DM-verity is indeed disabled completely by magisk is nicely shown and explained in your work with the boot image patching - respect for this by the way, that was a very nice read :highfive:
[OnePlus 3T Guides, News, & Discussion] :
How do I install OB21 from no OS with Magisk? I'm on the latest version of blu_spark TWRP and whenever I install OOS it boots, but there is no Magisk.
[OnePlus 3T Guides, News, & Discussion] Xennet:
Flash ob21

Flash Magisk

Before rebooting save the twrp recovery log...

Post it so that I can look at it...
[OnePlus 3T Guides, News, & Discussion] Xennet:
[MENTION=7242396]swimmerstar[/MENTION]

You flashed Magisk 14.6 right?

As per logs the installation went alright and the dtbs are also patched...

What do you mean by actually no Magisk found after rebooting...?

Is it no Magisk manager? Or is it no Magisk installed or no Magisk manager installed?

If it's no Magisk manager installed, try extracting the Magisk manger apk from the Magisk installer zip file and install it...

But I would definitely ask you to use Magisk 15.3 instead of 14.6 and install latest Magisk manager apk manually if not installed automatically and recheck your Magisk installation...
[OnePlus 3T Guides, News, & Discussion] :
There is no Magisk manager app installed and when I manually install the APK, it says "Magisk is not installed." I will try installing 15.3.

---------- Post added at 09:33 AM ---------- Previous post was at 09:13 AM ----------

After clean installing OB21 and Magisk 15.3, I had Magisk working after setup. However, it stopped working after I rebooted the phone.
[OnePlus 3T Guides, News, & Discussion] Xennet:
That's doesn't make sense...

As per logs your boot image is patched by magisk..

That shouldn't just disappear after reboot..

Is there a Magisk folder in data/adb ?
[OnePlus 3T Guides, News, & Discussion] :
Formatting my cache as EXT4 solved all of my issues. Can anyone explain why this is the case?
[OnePlus 3T Guides, News, & Discussion] Xennet:
I think it may not be just Magisk at fault....

The default kernel as I understand cannot handle cache as f2fs but only ext4..

Try another kernel which supports cache as f2fs like bluspark kernel and if still Magisk gives the same error hmmm may be Magisk will have to be blamed..
[OnePlus 3T Guides, News, & Discussion] AlphaGolf:
Hi

First of all you saved my phone I almost gave up until I came across this thread. I went from Paranoid to Bricked to Bootloop on OOS because of the dm verity thing. But you helped me fix it so thanks :)

Now, I'm on oxygen OS ob21 and I wanted to know that in case of an update what do I do? Do I have to worry about the dm-verity thing again? I've rooted using magisk and I'm on twrp Blu spark. So I'm assuming when there is an update all I have to do is dirty flash the next version over this one along with magisk. Is that it or is there something else to follow?
[OnePlus 3T Guides, News, & Discussion] Xennet:
Yup you are good...

Or follow the instructions in the OP...