yashsingh1/xdaforums huggingface dataset:
[OnePlus 5 Guides, News, & Discussion] snowwolf725:
Because there are too many people ask about "how to decrypt data" and "how to re-encrypt data",

I write a guide to tell you how to decrypt/re-encrypt data partition.

[Change log for V2:]

1. Update script to no-verity-opt-encrypt-6.0.zip

2. Decryption support for Android Oreo and Android Nougat

[Why we need decrypt data partion?]

1. Install MultiRom/MultiBoot

2. Some Roms only work on decrypted device

3. For better performance

[Disadvantage]

1. Low security (Cracker can access your file, and remove lock screen pin from TWRP)

2. It need to wipe your data/internal storage to decrypt data partition.

Decrypt data partition with magisk:

1. Go to “Wipe” section, tap “Format Data”, and type “yes”

2. Transfer Rom and no_verity_op5_v2.zip to the device over MTP

3. Go to “Install” section, select ROM, and swipe to confirm the flash

4. Go to “Install” section, select magisk.zip, and swipe to confirm the flash

5. Go to “Install” section, select no_verity_op5_v2.zip, and swipe to confirm the flash

6. Reboot

PS. you should format data before flashing no_verity_op5.zip.

Re-Encrypt data partition:

1. Go to “Wipe” section, tap “Format Data”, and type “yes”

2. Transfer stock Oxygen Rom to the device over MTP

3. Go to “Install” section, select the Oxygen rom, and swipe to confirm the flash

4. Reboot

[Proof]

No magic here. What you see is real.

[Youtube]nxU68RYGThM[/YouTube]

[Youtube]4F51plTk3xg[/YouTube]

[How it work?]

OnePlus 5 uses FBE(File-Based Encryption) to encrypt data partition.

The latest no-verity-opt-encrypt zip ( https://build.nethunter.com/android-tools/no-verity-opt-encrypt/ ) only replace "forceencrypt" to "encryptable".

It didn't replace "fileencryption", so your data partition is still encrypted.

In order to decrypt data partition, I modified the no-verity-opt-encrypt.zip by myself.

The no_verity_op5_v2.zip will replace "fileencryption" to "encryptable".

boot.img/ramdis/fstab.qcom
[OnePlus 5 Guides, News, & Discussion] aneeshmbabu:
Mtp transfer means .. I tried after wiping format data I tried to transfer the required file by using my laptop with original data cable , but data transfer is showing but not transferring actually waited a long .. but no transfer happens ..
[OnePlus 5 Guides, News, & Discussion] snowwolf725:
You need reboot recovery, before you use MTP.

In order to use MTP, you need remount your data partition.
[OnePlus 5 Guides, News, & Discussion] aneeshmbabu:
Hi thanks for the replay , presently i flashed twrp and magisk also I'm in Franco custom kernel , so can i possible to decrypt data,

I'm very new in one plus 5 , coming from Motorola phones , so kindly give me a step wise process for a beginner .. thanks in advance ..
[OnePlus 5 Guides, News, & Discussion] sinnbro:
Does no_verity_op5.zip still work after system update?
[OnePlus 5 Guides, News, & Discussion] snowwolf725:
No, you need re-flash it after system update.

Because system update will replace boot with stock version.

If you forget to re-flash zip file, your device will unable to boot.
[OnePlus 5 Guides, News, & Discussion] IlD4nX:
Does someone know what "better performances" means ?

I decrypted my OP3 but honestly I didn't noticed any change in performances (except opening TWRP)...
[OnePlus 5 Guides, News, & Discussion] luigiicaputo:
According to this process, can I also decrypt the stock rom?
[OnePlus 5 Guides, News, & Discussion] sinnbro:
Thanks
[OnePlus 5 Guides, News, & Discussion] Fif_:
Or worse, the device will boot fine and proceed to encrypt your drive...
[OnePlus 5 Guides, News, & Discussion] ChavitoArg:
Why is magisk required?
[OnePlus 5 Guides, News, & Discussion] snowwolf725:
You don't need to flash magisk, if you don't want it.

Yes, you are right.

It will also encrypt your device.
[OnePlus 5 Guides, News, & Discussion] ChavitoArg:
So in order to remain unencrypted i have to flash this after a custom kernel, dont they include this feature already? Sorry for the questions, but im new to this device.
[OnePlus 5 Guides, News, & Discussion] Fif_:
Yes, you have to flash it every time you write the boot partition: flash a ROM or OTA.

Note that if you use Magisk, Magisk by default automatically turns off DM Verity and force encrypt, so there's no need to flash both no_verity_op5.zip and Magisk, just Magisk is fine.
[OnePlus 5 Guides, News, & Discussion] Mar-cel:
Really ?
[OnePlus 5 Guides, News, & Discussion] wrongway213:
I have a few questions for the sake of clarity, as an experience I had makes me question if Magisk handles this. Blu_spark kernel will not boot when flashed with Magisk on my decrypted, stock OOS device - I believe status of encrypted/decrypted and FBE are two separate things based on the reply from eng.stk. it seems to use that kernel while decrypted, I still need to flash no-verity zip, even with Magisk.

This thread states both that you don't need to flash this if using Magisk, but that you need to flash this anytime you modify boot IMG - ROM flash, OTA, etc. I'm trying to nail down when I need this zip and when I don't - very curious if there's some solid info on when to use this in flashing and when not to. Guide is great as is for decrypting - just wanna stay that way.
[OnePlus 5 Guides, News, & Discussion] laupuy:
[MENTION=5964313]wrongway213[/MENTION]

Hi,

maybe this will help you: https://xdaforums.com/showpost.php?p=73311252&postcount=114

;)
[OnePlus 5 Guides, News, & Discussion] HonPig:
is decryption needed for xposed as official release has come out?
[OnePlus 5 Guides, News, & Discussion] snowwolf725:
No, new version of xposed supports encrypted data partition.
[OnePlus 5 Guides, News, & Discussion] morfances:
Which twrp is recommended for decrypt device?
[OnePlus 5 Guides, News, & Discussion] snowwolf725:
TWRP 3.2.0-0

https://twrp.me/site/update/2017/12/01/twrp-3.2.0-0-released.html

or

Mod 3.2.0-0 from shuajizu

https://androidfilehost.com/?fid=745849072291692296

The default language is Chinese, however you can change it to English
[OnePlus 5 Guides, News, & Discussion] AnDrOiDnEoV:
Decryption gives performance improvement? Can you prove your claim?
[OnePlus 5 Guides, News, & Discussion] morfances:
Advantages and disadvantages are written in OP. I am forced to decrypt if I want to put the rom Oreo on my device. No complaints here.

Inviato dal mio ONEPLUS A5000 utilizzando Tapatalk
[OnePlus 5 Guides, News, & Discussion] HonPig:
thank you.
[OnePlus 5 Guides, News, & Discussion] Paz9:
can you remove fileencryption and replace it with encryptable?
[OnePlus 5 Guides, News, & Discussion] ps000000:
Tested by me on my dumpling (5T).

Work well with modifed twrp 3.2.1.0 (twrp-3.2.1-0-oreo-8.1-codeworkx-dumpling.img).
[OnePlus 5 Guides, News, & Discussion] cpt.macp:
If I was little earlier , things might be different

also i think OOS lacks fstab thing , so it cant change the flags .

what do we need to do with that then?
[OnePlus 5 Guides, News, & Discussion] Pshemo__:
Hi! I just depcrypted my phone and I currently am on depcrypted rom. Can I restore in TWRP backup of a rom which was encrypted? Will it encrypt my phone? Or can I just restore it and than flash noverity to stay depcrypted?
[OnePlus 5 Guides, News, & Discussion] acrylamid:
Hi.

I'm running xXx Oreo right now decrypted.

Is it possible do encrypt via the settings-panel in Oreo?

I don't want to wipe another time again.
[OnePlus 5 Guides, News, & Discussion] rehannali:
No, You have to format data and then flash OTA zip to encrypt your phone.
[OnePlus 5 Guides, News, & Discussion] Freddyfre:
Works with OP 5T?
[OnePlus 5 Guides, News, & Discussion] Matija Gubec:
https://xdaforums.com/showpost.php?p=75094452&postcount=26 :D
[OnePlus 5 Guides, News, & Discussion] lazostat:
In order to re-encrypt we must install only stock rom and not custom? Which version?
[OnePlus 5 Guides, News, & Discussion] morfances:
If the device is encrypted you can install only rom encrypted otherwise both would be enough to eventually flash no_verity at the end
[OnePlus 5 Guides, News, & Discussion] lazostat:
If I go decrypt and then I want encrypt? I don't use any pin pattern or face unlock. So I guess decryption is ok for me? I can't be helped if my device is stolen, encrypted or decrypted.
[OnePlus 5 Guides, News, & Discussion] morfances:
From OP:

Decrypt data partition with magisk:

1. Go to “Wipe” section, tap “Format Data”, and type “yes”

2. Transfer Rom and no_verity_op5_v2.zip to the device over MTP

3. Go to “Install” section, select ROM, and swipe to confirm the flash

4. Go to “Install” section, select magisk.zip, and swipe to confirm the flash

5. Go to “Install” section, select no_verity_op5_v2.zip, and swipe to confirm the flash

6. Reboot

PS. you should format data before flashing no_verity_op5.zip.

Re-Encrypt data partition:

1. Go to “Wipe” section, tap “Format Data”, and type “yes”

2. Transfer stock Oxygen Rom to the device over MTP

3. Go to “Install” section, select the Oxygen rom, and swipe to confirm the flash

4. Reboot
[OnePlus 5 Guides, News, & Discussion] lazostat:
This is a clever answer? I already read this.. It says to move stock oxygen rom and flash. What rom, version? The same as the custom one for example?
[OnePlus 5 Guides, News, & Discussion] mipirakas:
To re-encrypt, Just flash oxygenos. The latest version of course.
[OnePlus 5 Guides, News, & Discussion] CoCoGirl886:
Would this help me in decrypting my device that's stuck in encryption w/o formatting? My issue is that I deleted the gatekeekper/lockscreen keys and now when booting up my phone, it only shows a black screen with my wallpaper but I can't access any data/apps. When I boot into twrp, it asks me for a password that I never set. I've tried default_password, as well as some other ones but none worked. So now it looks like my device is stuck in encryption mode and I'm trying to figure out how to decrypt it and access my files so I can back it up :confused:.
[OnePlus 5 Guides, News, & Discussion] mipirakas:
Only way to decrypt is to do a full wipe including internal storage. This file is only to stay decrypted if you already are decrypted so i think your data is lost. Never delete gatekeeper and lockscreen keys when you are encrypted.
[OnePlus 5 Guides, News, & Discussion] drockin:
I am potentially looking at having to decrypt a copy of data recovered from a OnePlus 5 which had a touchscreen stop working. Would it be possible to decrypt this data once it has been recovered from the phone? Or would it need to be loaded back onto a OnePlus 5 to be decrypted and be readable?
[OnePlus 5 Guides, News, & Discussion] shadowstep:
You mean you want to decrypt the data recovered from a OP5 which was encrypted by default earlier? If so, then the only way it can be decrypted is restoring that partition via TWRP and using the passcode/key/whatever was used to encrypt it. There is no other workaround. If you do not know the passcode/key/whatever, you're out of luck.
[OnePlus 5 Guides, News, & Discussion] drockin:
Thanks, that was my understanding. The data was encrypted and protected using a pattern lock which I set, so in theory that shouldn't be a problem. That challenge I am facing is actually getting a copy of the partition to restore and then access/unlock, as it on a phone that has a non-working touchscreen and limited to no way to access it via software.
[OnePlus 5 Guides, News, & Discussion] shadowstep:
Ah, I see. Unfortunately, there's no way it can be decrypted if it's not on the phone. That's why the encryption is there in the first place, to prevent misuse of data if someone manages to gets a copy of it somehow. :)
[OnePlus 5 Guides, News, & Discussion] Fatadxb:
why does my phone encrypted again when I use fingerprint and pattern etc How to avoid that to happen again?

i did format data and use no_verity with no success

Do I have to keep my phone unlocker all the time or theres another way?
[OnePlus 5 Guides, News, & Discussion] mipirakas:
No you can set pin/pattern when you are decrypted. If it asks you the password in recovery then that means you are not decrypted. To decrypt you have to wipe your entire internal storage. Did you maybe only tick the data checbox in twrp? Because you also need to tick internal storage.
[OnePlus 5 Guides, News, & Discussion] zls8635878:
The latest version of the Mokee ROM patch is invalid.
[OnePlus 5 Guides, News, & Discussion] ZFranz:
Does it still work for oxygen OS 5.1.1?
[OnePlus 5 Guides, News, & Discussion] mipirakas:
Yes. Works fine.
[OnePlus 5 Guides, News, & Discussion] Mervingio:
Sorry to ask but I’m new to Oneplus got the 5t I assume this works on it too? I remember the LG v20 use a file for no encryption too but once the file was flashed and your internal wiped no need to do the same again so with OP5/5T are the same?

I`m little lost here any help is great
[OnePlus 5 Guides, News, & Discussion] ahmed.ismael:
if you wnat to stay decrypted so you have to format data in twrp then flash a decrypted rom ( encrypted roms works but you have to flash the no variety zip every time you flash an encrypted rom )

and also op5 and op5t is the same ( kernel is unified ) each device have it's own rom zip but both are the same in terms of encryption

anyway you will have to put in mind that you will fu** it up in some point as everyone did lol

just backup your data and dive into it,you will find it easy after a couple of soft brick ( no harm will be done ) you could always flash oos official builds and encrypt it and you will got a fresh device
[OnePlus 5 Guides, News, & Discussion] Mervingio:
LOL this happen on my v20 like 3 times lost everything because of device has been encrypted after i learn my lesson

Thank You Buddy!
[OnePlus 5 Guides, News, & Discussion] digger16309:
This happened to me, but after setting my phone up, I'm not in the mood to pull all of my internal storage off (backup), format, decrypt, and then load it all back up again. I don't understand the overall problem. I set a lockscreen PIN. The same PIN is needed in TWRP to decrypt data. Isn't this a good feature? Doesn't that prevent anyone who steals my phone from just booting into TWRP to access my data? Yes?

Setting aside the performance argument, which I understand but don't fully buy into, what's the reason for having decrypted data that anyone with physical access to the phone and a small amount of knowledge can use against me?
[OnePlus 5 Guides, News, & Discussion] gianmaxfactor:
I would keep data encrypted, but I also need to backup and restore it.

How can I make a backup of the data folder while it is encrypted? And could I restore it later?

Or better, how can I temporarily decrypt data to backup/restore it? Sometimes ago I had read something about TWRP + adb + decryption keys but at that moment I was not interested because I had not the problem, so I don't remember where and specially how...
[OnePlus 5 Guides, News, & Discussion] Mesmurized:
Simple: connect phone to PC. Open phone internal storage in explorer and copy whateveryouwant. It's stored on the PC unencrypted. If needed back on phone, copy in reverse. It reencrypts before it's written to disk.

---------- Post added at 09:29 PM ---------- Previous post was at 09:20 PM ----------

Yes it does. The argument is because bootloader is not locked, hackers can easily access data and eventually crack it.

It is much easier for the flash-a-holics. And sometimes being encrypted requires additional steps. Like before a twrp nanoid, you should remove the pin/fp. Makes restoring a whole lot easier.

---------- Post added at 09:37 PM ---------- Previous post was at 09:29 PM ----------

I have one suggestion. The above line implies magisk is the reason for decryption. It's not. Format did the decryption.

Just a suggested rewording as some non-experienced users I've come across in other forums believe magisk actually does the decryption.

Your thread, you decide. A humble suggestion.
[OnePlus 5 Guides, News, & Discussion] Mesmurized:
Your OP5 twrp is outdated. DL&Update either 20180309 or 20180414 versions from here:

https://sourceforge.net/projects/cheeseburgerdumplings/files/15.1/cheeseburger/recovery/
[OnePlus 5 Guides, News, & Discussion] Pho3nX:
[MENTION=2447659]snowwolf725[/MENTION] hi mate

Could you purpose a update no_verity_op5_v3.zip for the new OpenBeta 13 with Treble support (Vendor partition). Actualy v2 don't work and a dmverity v3 is available here

but i prefer your file because of that :
[OnePlus 5 Guides, News, & Discussion] jahidinbedod:
try this file

work on me decrypt data in open beta 13 treble

see METHOD 1: Using TWRP recovery [ For Decrypted Users] on this thread for flashing

https://xdaforums.com/oneplus-5/how-to/official-stable-oxygen-os-5-0-update-t3724247

use the file below that I provide
[OnePlus 5 Guides, News, & Discussion] shadowstep:
Are you willing to do some testing? If so, could you try the attached zip and see if it works for you (on OB13, of course)? I've modified the existing v2 to work with treble (hopefully :fingers-crossed:) but since I don't run OOS and use a custom ROM myself, I can't test. Make sure you're using a treble compatible TWRP before flashing! :)

EDIT

: Removed zip as it wasn't working, sorry!
[OnePlus 5 Guides, News, & Discussion] Pho3nX:
Thanks mate, i will test this evening after the World Cup matchs ;):D
[OnePlus 5 Guides, News, & Discussion] Pho3nX:
Don't work for me, the no_verity_op5_treble.zip work fine
[OnePlus 5 Guides, News, & Discussion] shadowstep:
Yeah, I figured. I've removed the zip from my post. Thanks for testing!

Also, just for your information, a little background on the zip you used (which works fine) and then one I (tried to) modify: the one that I tried to modify is the actual no-verity-optional-encryption zip which dynamically find the boot image, patches the required file (fstab.qcom) on-the-go, then rewrites the boot image with the updated boot image. Hence, it's more universal and multi-device compatible as it uses the existing boot image and makes modifications to it. The zip that you used, on the other hand, is nothing but a patched version fstab.qcom file which is being replaced in the /vendor partition. Meaning it's not universal and can only be used with people running OxygenOS only on the OnePlus 5. :)
[OnePlus 5 Guides, News, & Discussion] daxiaamu:
Here is the confirmed working file made by me. You can attach it in your thread https://drive.google.com/open?id=1BtZKnNc2ooe9lcDd0JJ8eHzylA0StSm2
[OnePlus 5 Guides, News, & Discussion] shadowstep:
[MENTION=5308099]Pho3nX[/MENTION] Did you try the zip that is linked above?
[OnePlus 5 Guides, News, & Discussion] Pho3nX:
Humm i'm on Customs Roms (Havoc/AEX/ToxycOS) lol

Even with the new OOS Beta interface/features i prefer so far customs
[OnePlus 5 Guides, News, & Discussion] ReyTheBoss:
Steps to decrypt with this zip please ? i tried it and many others but couldn't decrypt my data

what i did :

reboot recovery

wipe all partitions for clean flash

format data

reboot recovery

flash rom

reboot recovery

flash no verity

reboot

and always end up encrypted

please help
[OnePlus 5 Guides, News, & Discussion] shadowstep:
I recently clean flashed OB13 and here's what I did:

Booted to bootloader

Fastboot flashed the latest blu_spark TWRP

Reboot to recovery

Wipe everything (selected everything for wiping except USB-OTG, obviously)

Once the wipe process finished, I formatted the data partition as well

Reboot to recovery again

Copied all the zips to my interna storage

Flashed the zips in the following order: OOS OB13 Full Zip --> Magisk 15.4 Zip (Note that Magisk 16.x doesn't work and will error out, so use this one and then later update Magisk from Magisk Manager) --> No Verity Zip (the one by [MENTION=3787602]daxiaamu[/MENTION] worked absolutely fine)

Cleared cache and dalvik-cache

Rebooted & profit!
[OnePlus 5 Guides, News, & Discussion] Zackptg5:
I've been working on and off the last couple months on making a more universal verity and force encrypt remover zip. Finally got it figured out. Works great for me on ob11 and liquid remix on my op5t. You won't need magisk or anything else, just this zip :)

I still want to tweak it slightly but it's complete and works flawlessly if you want to use it instead (I'll be making a thread for it this week).

Also, magisk 16.6 works fine. There's just a bug with it where you can't put your .magisk file in /data or it'll throw an error so put it somewhere else like /cache (although you won't need magisk for verity/fec removal thanks to this zip)
[OnePlus 5 Guides, News, & Discussion] Zackptg5:
Wipe all partitions (and format data), reboot to recovery, flash rom, if using oos - you may need to reboot to recovery once more, flash attached zip in my previous post on this thread
[OnePlus 5 Guides, News, & Discussion] shadowstep:
Thanks! This will be very useful -- one zip, instead of two separate ones for Treble and non-Treble ROMs. :) I'll test this the next time I clean flash. Also, yes, you should definitely make a new thread for this. Please also tag/mention me in the new thread (whenever you create it) so that I can update my index post and add a link to your thread in it.

On a separate note, good work on the website! I just saw it (from your signature). It's nice to have all of your mods at one place for convenience and completeness. I've bookmarked it. :good: Oh and also, I see that under the other mods section, you have the native call recording enabler sub-section as well (in Android mods). In the description, I see "..it'll run at the proper time each boot unlike the other buggy methods..". I hope you weren't referring to the other methods which I've mentioned in my thread when you said that. :p
[OnePlus 5 Guides, News, & Discussion] Zackptg5:
Thanks! This is what happens when I make last second edits late at night, I use the wrong words :(

For timing, I meant the magisk module since you can't really have it run exactly when boot completes with any boot scripts and for "buggy", that was more referring to the build prop method although buggy was definitely the wrong word to be used. Sorry about that, I just edited the description of it on the site to get rid of that (I need to proofread it in general)
[OnePlus 5 Guides, News, & Discussion] shadowstep:
Don't worry about it. I appreciate you making the changes that you did, thanks. :) You've made some great contributions to the community, keep up the good work! :)
[OnePlus 5 Guides, News, & Discussion] Zackptg5:
New thread is live! https://xdaforums.com/android/software/universal-dm-verity-forceencrypt-t3817389
[OnePlus 5 Guides, News, & Discussion] Jole7:
Hi thanks for the new updated no verity i wanna ask you can you mod it to make it boot f2fs with new OB rom please?Thanks
[OnePlus 5 Guides, News, & Discussion] legolas06:
Hi, I'm on OOS 5.1.5. Can anyone please tell me if the script linked in the OP works for that version?

I've read the above posts, but I couldn't get any clear answer as to what the correct flashing order is if I want to flash magisk too.

It would be really great if someone could post the steps to start from scratch and which version of the script to use.

TIA

Nevermind, I followed the above new thread again and it worked:

Format -> Reboot -> Flash Rom -> Script -> Magisk-> Reboot
[OnePlus 5 Guides, News, & Discussion] rmroot:
Sorry if my questions are mainstream, I cannot find a good explanation about dm verity and no verity:

-What is exactly dm verity? What is no verity? Can you link me a complete explanation?

-Is this thread valid for one plus 5t too? Can you link me the op5t no verity thread?

Thank you !
[OnePlus 5 Guides, News, & Discussion] strongst:
Why you don't search the 5t forums?

https://xdaforums.com/oneplus-5t/help/verity-zip-t3763088
[OnePlus 5 Guides, News, & Discussion] Jakkomo77:
Hello guys,

I want to flash the new DU 13 !

It is possible to decrypt with the last verity 6.zip?

Tjanks
[OnePlus 5 Guides, News, & Discussion] mipirakas:
I don't know but i use this one. It works very well.

https://xdaforums.com/android/software/universal-dm-verity-forceencrypt-t3817389
[OnePlus 5 Guides, News, & Discussion] c1ph4:
Hello,

what if I did a backup of my /data partition as *.img file and want to decrypt that afterwards on my PC? Is this possible somehow too??