[FIXED] How to remove data encryption in TWRP

gary555594

New member
Jun 22, 2016
1
0
0
I got it to work! I have TWRP installed, I have Magisk working, and Safetynet check passes. I can't post screenshots because I don't have enough posts, but I suppose I have root now! ...it's not nearly as exciting on a non-bloated phone with no available roms. But I think we're maybe ready to say we officially have root? I can't learn coding or I'd try to make my own rom.
Works for me! Cheers!
 

Fstop

Senior Member
Apr 18, 2015
121
12
0
Do i have to install the Magisk.zip and Manager together? What version of Xposed is best for Doogee Mix, please?
 

Fstop

Senior Member
Apr 18, 2015
121
12
0
What does this mean:
1. When I try to wipe I get unable to mount storage.
2. If I try to copy from OTG Directory to sdcard - I get "process ended with error:1

After copying Magisk.zip to sdcard from usbotg, I try to install and get the following:
"Updater process ended with ERROR:1Error installing zip file /sdcard/Magisk-v16.4-Beta.zip' ?

Samething if I try to install from usbotg.
 
Last edited:

filazaf

Member
Oct 9, 2016
7
1
0
Users of TWRP 3.1 on Doogee Mix (including myself) faced the mammoth problem of an encrypted storage after unlocking the bootloader and flashing the custom recovery. This problem is not peculiar to the Doogee Mix, any other device with TWRP 3.1+ will likely face the same issue and the solution preferred here would work.

By default, your device storage is encrypted (Settings > Security > Encryption) and any TWRP from 3.1+ respects that protocol.
This means that the internal storage would be showing 0mb because it can't be mounted, (no) thanks to the encryption.
Previous versions of TWRP (eg 3.0.3) could easily decrypt the device using the default password but from version 3.1, things changed.

SOLUTION
Needed:
1. An unlocked bootloader
2. TWRP installed (download from the TWRP thread)
3. An SD CARD
4. Magisk.zip (latest version, copy it to the SD card)

NOTE: Copy/Backup your files from your internal storage into your PC as this process would wipe everything from the internal storage.

STEPS
> With the bootloader unlocked and TWRP flashed, boot into recovery.
> The screen might be dark when in recovery, just press the power button and the the vol- button, it'll turn ON. Then swipe to unlock.
> You can change the language to English by clicking on the 2nd rectangle by the right above the swipe function.
> Tick "do not show again" and the swipe to allow modification.
> Confirm device encryption by clicking "Backup" or "Install", if the storage size is 0mb or no folder is showing while trying to install, then the device is encrypted.
> Go back, click "Wipe"
> You can choose to Factory reset, Format data or Advanced wipe > tick /data. Either way, it's going to wipe EVERYTHING in the internal storage (that's the purpose of device encryption, to prevent unauthorized access to the storage). However, I recommend you choose "FORMAT DATA"
> If you chose "Format data", then type yes in the next screen and swipe to format.
> When completed, go home, click Reboot and choose Recovery to boot into recovery (very important, do not reboot the phone into system otherwise you'll start all over. Reboot into recovery, not system).
> When in the recovery, click install > select storage > SD card (note that the internal storage will display as normal but remember it is now empty following the data reset)
> Navigate to the Magisk in /Sdcard and install.
> When completed, you can now reboot safely into system.
> Complete the phone setup and Open Magisk Manager. Notice that Magisk is now installed and "Preserve force encryption" is now unticked". You can also go to Settings > Security > Encryption and notice that it will ask you to encrypt your device, meaning it is decrypted now.
> The next time you will boot into recovery, TWRP may still be in Russian language, just change it one more time and you are good to go.
> Now you can flash anything you want including Xposed (download latest version from the official Xposed thread/website).


That's all. Cheers! Happy tweaking
Thank You, i get inifinite loop for Magisk !!!
But it's work for SuperSU
 
  • Like
Reactions: cracktech

gianmaxfactor

Senior Member
Sep 5, 2012
65
9
0
Hi dear, what does you think about the following (backup data but media through ftp; format data through twrp; restore data content through adb):

- start the phone in safe mode
- activate an ftp server on the phone (over the wireless lan interface)
- backup the data partition on Windows pc (every files&folders except media - twrp data formatting always wipes everything but the media folder)
- restart the phone in recovery mode; format data and reboot to recovery: from now TWRP can access the data folder as unencrypted
- while in recovery mode connect to the phone through adb from the Windows pc and push data content back to the phone
- reboot the phone with all the original data content, however unencrypted now

Regards
Gian
 
  • Like
Reactions: cbadoud and Rerocc

anuragm13

Senior Member
Sep 2, 2018
72
13
8
Will you please address my query?

Situation: I have an unlocked bootloader but have secure startup (password reqd. to boot into android) enabled and usb debugging disabled

Query: If an attacker manages to flash twrp through fastboot (do fastboot commands even work if usb debugging is disabled?) and then tries to boot into it....
Q1. Will twrp ask for password or will it give direct access to my data using its file manager?

Q2. Will he be able to push/pull files via adb?
 
Last edited:

dwapking

Senior Member
Jan 9, 2015
118
39
28
Lagos
Will you please address my query?

Situation: I have an unlocked bootloader but have secure startup (password reqd. to boot into android) enabled.

Query: If an attacker manages to flash twrp through fastboot, and then tries to boot into it....
Q1. Will twrp ask for password or will it give direct access to my data using its file manager?

Q2. Will he be able to push/pull files via adb?
If you already have this setup (unlocked bootloader + secured startup), you could try to boot into twrp and see what happens.
If you don't have this, then I'm not sure I can give you a reliable answer as I've not tried that before. A
 

anuragm13

Senior Member
Sep 2, 2018
72
13
8
If you already have this setup (unlocked bootloader + secured startup), you could try to boot into twrp and see what happens.
If you don't have this, then I'm not sure I can give you a reliable answer as I've not tried that before. A
Ok, i got my answer.
Yes, anyone can flash twrp via fastboot if bootloader is unlocked.
Now, twrp versions below 3.1 decrypted user data with "default_password" if userdata was encrypted but secure boot was disabled (this is so because until the lock screen password has been set as password at boot, android uses default_password as masterkey to the main decryption key).
Twrp 3.1 and later versions started respecting this encryption and did not mount the encrypted partitions.
But if secure boot is enabled any twrp version would ask for password when booting into it and being unable to do so twrp cant mount the encrypted partitions.

For the second question.....
Although, adb would work in twrp but since encrypted partitions can't be mounted, push/pull wont work with encrypted data.
 

dwapking

Senior Member
Jan 9, 2015
118
39
28
Lagos
Ok, i got my answer.
Yes, anyone can flash twrp via fastboot if bootloader is unlocked.
Now, twrp versions below 3.1 decrypted user data with "default_password" if userdata was encrypted but secure boot was disabled (this is so because until the lock screen password has been set as password at boot, android uses default_password as masterkey to the main decryption key).
Twrp 3.1 and later versions started respecting this encryption and did not mount the encrypted partitions.
But if secure boot is enabled any twrp version would ask for password when booting into it and being unable to do so twrp cant mount the encrypted partitions.

For the second question.....
Although, adb would work in twrp but since encrypted partitions can't be mounted, push/pull wont work with encrypted data.
:good:
Exactly. I wasn't sure what happened when I was still using encrypted phone.
But my issue started when I upgraded to v3.1
Like I said, I can't remember what really happened cos it has been long, more than 1yr ago.
Thanks for your explanations.
 

pcgardner

Member
Dec 24, 2012
49
10
0
Leeds
Remove data encryption

Perhaps this is a silly question, but ... The instructions say to back up your internal storage to PC before wiping data. But as the data partition is encrypted I can't do this, as all the file/folder names in internal storage are random strings and copying the folders fails.

Is there any other way to decrypt the data partition? Does the TWRP function Advanced > Fix DataEncryption do this?
 

dwapking

Senior Member
Jan 9, 2015
118
39
28
Lagos
Perhaps this is a silly question, but ... The instructions say to back up your internal storage to PC before wiping data. But as the data partition is encrypted I can't do this, as all the file/folder names in internal storage are random strings and copying the folders fails.

Is there any other way to decrypt the data partition? Does the TWRP function Advanced > Fix DataEncryption do this?
I haven't particularly tried that method but even if it works, data loss might be inevitable.
If you are unable to transfer files over USB, try using the Xender application to transfer files/folders over WiFi.
 

dwapking

Senior Member
Jan 9, 2015
118
39
28
Lagos
Feb 21, 2018
8
4
0
Hello. This procedure does not work with my Bl12000. It just doesn't let me do a wipe because of the encryption. I tried over and over. I can install the twrp 3.2.3-0 and boot the phone into it. Thats all. Dead end.
 

dwapking

Senior Member
Jan 9, 2015
118
39
28
Lagos
Including /system?

And I should reflash ROM in all?
No. The /system is preserved of course.
No need to reflash ROM after wiping.
Only the /data (including /data/media) partition is affected; in other words your internal storage.
It's like performing a factory reset and formatting your internal storage as well.
 

Digo69

Senior Member
Feb 28, 2013
54
11
0
Hello,

I have done this procedur and it work, magisk + root.
But the system is still in write protection? How to install a module from Magisk?

Thanks
 

dwapking

Senior Member
Jan 9, 2015
118
39
28
Lagos
Hello,

I have done this procedur and it work, magisk + root.
But the system is still in write protection? How to install a module from Magisk?

Thanks
Yes... The system is still in kinda write protection. Modification of /system is limited.
[All] Magisk modules don't work.
Xposed modules work fine.

Any other modification(s) must be done through the TWRP recovery, including fonts, busybox, build.prop edits, etc.