Decrypt OxygenOS without losing data

EpicLPer

Senior Member
Aug 29, 2012
677
380
93
25
Scheibbs
epiclper.com
Hello there!

Today, after a bit of tinkering around I managed to get my OnePlus 3 in a decrypted state without losing data!
However, this is NOT a method where your data will remain on the phone, it requires you to copy a backup to your PC and then copy everything back + fix permissions. In this guide you'll completely wipe/reset your phone prior to restoring everything.

FAQ:
Q: Why do I need an undecrypted phone?
A: So far (as of today, 06.07.2016) multiboot will not work on encrypted phones. That's probably the only reason why you'll ever want to decrypt your phone.

Q: Will updating the ROM force encryption again?
A: If you're using OxygenOS (or another encryption forcing ROM), yes. However if you flash the Full ROM ZIP and immediately after that SuperSU (DO NOT USE SYSTEMLESS OR IT WILL ENCRYPT AGAIN!!!) WITHOUT REBOOTING it'll not encrypt the device again. (Thanks to @JumboMan)

Q: I've followed your guide but my phone got encrypted again!
A: You've probably used the Systemless SuperSU version which does indeed not prevent your device from being encrypted again. Use the normal version available HERE.


You'll need:
  • A PC (obviously)
  • Unlocked OnePlus 3 (will probably work on other OnePlus phones, not tested!)
  • TWRP Recovery (follow THIS LINK for a guide)
  • About 50 GB of free space on your PC (depends on how much data you have on the phone)
  • ADB and Fastboot drivers installed on your PC (to get those connect your OP3 to your PC, as storage choose MTP, open the emulated OnePlus CD-Drive and install those drivers)
  • (Optional) 15 Seconds ADB Installer
  • A bit of time, roughly 30 minutes to 1 hour


!!!DISCLAIMER!!!
I'M NOT RESPONSIBLE FOR ANYTHING YOU'RE ABOUT TO DO HERE, THIS GUIDE IS PURELY WRITTEN "OUT OF MY HEAD" AND I CANNOT CONFIRM ANY OF THE FOLLOWING STEPS ANYMORE!!!!
ONLY DO THIS IF YOU KNOW HOW TO RECOVER FROM A HALF-INSTALLED OR COMPLETELY WIPED SYSTEM!!!

How To:
  • READ AND ACKNOWLEDGE THE DISCLAIMER ABOVE!
  • Done? Are you really sure? ... Okay!
If you don't need your data backed up simply start at Step 10 and ignore the restore parts after that.
  1. Still on OxygenOS (or any other ROM) make sure you've enabled ADB in Developer Options and connected + allowed your PC at least one time, else ADB in TWRP will not work.
  2. If you have Titanium Backup, create a backup of all your apps before starting. Just in case, you never know...
  3. Once done boot into TWRP (see above for an installation guide)
  4. Create a normal TWRP backup
  5. Type in "adb devices" to check if you're allowed to use ADB inside TWRP. If it says "unauthorized" refer to Step 1 again.
  6. Once done open up a CMD on your PC and cd to the directory you want all your backup-files to be (or navigate via Windows Explorer to the folder, hold "Shift", right-click and choose "Open command window here...")
  7. Type in "adb pull /data/media" and wait. Depending on the size this can take a few minutes.
  8. After that's done make sure all your files are here and ADB is not reporting any skipped files.
  9. Checked all your files? Okay!
  10. In TWRP choose "Reboot" and "Bootloader". This will put your phone into Fatboot mode.
  11. Type in "fastboot devices" to check if your phone is recognized. If not go into device manager, find the Google Bootloader drivers and install those.
  12. NOW IS YOUR LAST CHANCE TO MAKE SURE EVERYTHING'S BACKED UP AND THERE!
  13. Next type in "fastboot format userdata" and hit enter. This will completely wipe your device.
  14. Boot back into TWRP by using the volume rocker and the Power Button.
  15. ADB is probably not working now (will only report "unauthorized"), MTP however still works. Copy the TWRP folder we backed up earlier onto the device again.
  16. Once copying finished restore the backup and reboot into recovery again. You're now able to use ADB due to the adbpub.key being present again. (You could've done this earlier but it's easier that way.)
  17. Copy the rest back onto the device with "adb push / /data/media". (I'm not really sure if this command is right, beware!)
  18. Now type "adb shell chown -R media_rw:media_rw /data/media" to fix issues later in the ROM.
  19. You're basically finished now! Simply reboot and wait till it boots up again. If you're getting stuck at a "Wrong PIN" or "Wrong Pattern" screen SEE THIS COMMENT I made in another thread.

Finished!
As said, I'm not sure if I forgot something here or not. However I think I got everything covered :)
 
Last edited:

IlD4nX

Senior Member
Aug 3, 2008
449
94
58
Bugella Civitas
Noob questions: is the decrypted OS faster? Performances of the phone are the same? What about updates (any update will crypt it again?
Thanks for any feedback!

Sent from my OnePlus3 using XDA Labs
 

Abaddon

Senior Member
Mar 17, 2011
4,092
1,017
253
House Avernus
ota updates might encrypt it again if you're on stock. depending if there's a new kernel. the kernel I think forces encryption. so we need a modified boot img to disable forced encryptions. or use a custom kernel that disables force encryption.

If you're on a custom rom based on aosp/cm. most of them doesn't force encryption. so there's no need to worry.

Sent from the moon and back
 
  • Like
Reactions: arvindgr

JumboMan

Senior Member
Aug 3, 2013
561
216
73
Pink City
Noob questions: is the decrypted OS faster? Performances of the phone are the same? What about updates (any update will crypt it again?
Thanks for any feedback!

Sent from my OnePlus3 using XDA Labs
Yes. updates will encrypt data again.
if you want to remain non encrypted after update then following procedure.
1. download full rom zip (not ota zip)
2.flash full update zip
3.without rebooting after flashing update just flash SuperSU zip. SuperSU will patch your boot img to remain in non encrypted state.

Proof- myself tried it on 3.2.0 update and it works without any problem
 

EpicLPer

Senior Member
Aug 29, 2012
677
380
93
25
Scheibbs
epiclper.com
Yes. updates will encrypt data again.
if you want to remain non encrypted after update then following procedure.
1. download full rom zip (not ota zip)
2.flash full update zip
3.without rebooting after flashing update just flash SuperSU zip. SuperSU will patch your boot img to remain in non encrypted state.

Proof- myself tried it on 3.2.0 update and it works without any problem
Added to the OP :) Thanks for testing!
 

odooo

Member
Apr 21, 2016
37
7
0
maybe stupid questions, but not clear for me:
is there a negative point decrypting the phone or are there any risks?
will decrypting have an effect on the security of the phone?
 

EpicLPer

Senior Member
Aug 29, 2012
677
380
93
25
Scheibbs
epiclper.com
maybe stupid questions, but not clear for me:
is there a negative point decrypting the phone or are there any risks?
will decrypting have an effect on the security of the phone?
As long as you're not an "international searched criminal" where the FBI tries to break into your phone then, no ;)
I'd say it is a bit less secure but who cares, anyone who wants access to your phone somehow gets it anyways, TWRP isn't helping here either since anyone can simply boot into recovery and recover all files from there nonetheless.

Decryption risks are only when you're not good at backing up your data, else there are no risks of doing so.
 
  • Like
Reactions: Bintang Krisna

odooo

Member
Apr 21, 2016
37
7
0
@EpicLPer:
17. Copy the rest back onto the device with "adb push / /data/media". (I'm not really sure if this command is right, beware!)
"adb push / /data/media" doesnt work for me. Can somebody help? I restored the TWRP-Backup and only need to copy the rest on the device.

Edit: I did it in another way, copied all files manually.
 
Last edited:

peterogg

Member
Sep 19, 2014
17
0
0
Can someons dcrypt this
IzpG+nubzE2m3krvbos0lVDLANkIkiekZt209MYU12Vzny8WNOS7o4JGNoVAm41e/44IYPHmh

0Y7NnLW1JghbWJwbzL1WIpQw7nkzQoH9dEwvTiloTg5BI1u9TYRExzLGQEDUqN2hjq1G5cn

CqDmYoQnMs2bMiuajZweq9ZDC7gLruq6dse0L96gzZFoC/33lF0h1mEh7SBgW3FrcsjhRQ==

Sent from my SM-N910P using XDA-Developers mobile app
 

PivotMasterNM

Senior Member
Jan 19, 2013
277
228
0
Düsseldorf
Can somebody do some benchmarks? I am really curious whether it makes a difference or not.

from what I've heard it makes a big difference in sequential rw speeds, which are actually pretty important on android.
 
Last edited:

Death.From.Above

Senior Member
Jun 27, 2016
82
24
8
Will it wipe my rom too?? Or just internal storage??

---------- Post added at 04:03 PM ---------- Previous post was at 03:31 PM ----------

Hello there!

Today, after a bit of tinkering around I managed to get my OnePlus 3 in a decrypted state without losing data!
However, this is NOT a method where your data will remain on the phone, it requires you to copy a backup to your PC and then copy everything back + fix permissions. In this guide you'll completely wipe/reset your phone prior to restoring everything.

FAQ:
Q: Why do I need an undecrypted phone?
A: So far (as of today, 06.07.2016) multiboot will not work on encrypted phones. That's probably the only reason why you'll ever want to decrypt your phone.

Q: Will updating the ROM force encryption again?
A: If you're using OxygenOS (or another encryption forcing ROM), yes. However if you flash the Full ROM ZIP and immediately after that SuperSU WITHOUT REBOOTING it'll not encrypt the device again. (Thanks to @JumboMan)


You'll need:
A PC (obviously)
Unlocked OnePlus 3 (will probably work on other OnePlus phones, not tested!)
TWRP Recovery (follow THIS LINK for a guide)
About 50 GB of free space on your PC (depends on how much data you have on the phone)
ADB and Fastboot drivers installed on your PC (to get those connect your OP3 to your PC, as storage choose MTP, open the emulated OnePlus CD-Drive and install those drivers)
(Optional) 15 Seconds ADB Installer
A bit of time, roughly 30 minutes to 1 hour



!!!DISCLAIMER!!!
I'M NOT RESPONSIBLE FOR ANYTHING YOU'RE ABOUT TO DO HERE, THIS GUIDE IS PURELY WRITTEN "OUT OF MY HEAD" AND I CANNOT CONFIRM ANY OF THE FOLLOWING STEPS ANYMORE!!!!
ONLY DO THIS IF YOU KNOW HOW TO RECOVER FROM A HALF-INSTALLED OR COMPLETELY WIPED SYSTEM!!!

How To:
READ AND ACKNOWLEDGE THE DISCLAIMER ABOVE!
Done? Are you really sure? ... Okay!

If you don't need your data backed up simply start at Step 10 and ignore the restore parts after that.
Still on OxygenOS (or any other ROM) make sure you've enabled ADB in Developer Options and connected + allowed your PC at least one time, else ADB in TWRP will not work.
If you have Titanium Backup, create a backup of all your apps before starting. Just in case, you never know...
Once done boot into TWRP (see above for an installation guide)
Create a normal TWRP backup
Type in "adb devices" to check if you're allowed to use ADB inside TWRP. If it says "unauthorized" refer to Step 1 again.
Once done open up a CMD on your PC and cd to the directory you want all your backup-files to be (or navigate via Windows Explorer to the folder, hold "Shift", right-click and choose "Open command window here...")
Type in "adb pull /data/media" and wait. Depending on the size this can take a few minutes.
After that's done make sure all your files are here and ADB is not reporting any skipped files.
Checked all your files? Okay!
In TWRP choose "Reboot" and "Bootloader". This will put your phone into Fatboot mode.
Type in "fastboot devices" to check if your phone is recognized. If not go into device manager, find the Google Bootloader drivers and install those.
NOW IS YOUR LAST CHANCE TO MAKE SURE EVERYTHING'S BACKED UP AND THERE!
Next type in "fastboot format userdata" and hit enter. This will completely wipe your device.
Boot back into TWRP by using the volume rocker and the Power Button.
ADB is probably not working now (will only report "unauthorized"), MTP however still works. Copy the TWRP folder we backed up earlier onto the device again.
Once copying finished restore the backup and reboot into recovery again. You're now able to use ADB due to the adbpub.key being present again. (You could've done this earlier but it's easier that way.)
Copy the rest back onto the device with "adb push / /data/media". (I'm not really sure if this command is right, beware!)
Now type "adb shell chown -R media_rw:media_rw /data/media" to fix issues later in the ROM.
You're basically finished now! Simply reboot and wait till it boots up again. If you're getting stuck at a "Wrong PIN" or "Wrong Pattern" screen SEE THIS COMMENT I made in another thread.


Finished!
As said, I'm not sure if I forgot something here or not. However I think I got everything covered :)
Will it wipe my rom too?? Or just internal storage??
 
Last edited: