Flashing TWRP - decryption mandatory? - Moto Z2 Play Questions & Answers

I come from a Nexus. So I am bit confused regarding the process of flashing TWRP on the Z2 play. On Nexus devices I could flash TWRP but did not have to decrypt anything. However in the TWRP post (dev forum) I could read:
"Force encryption is enabled by default in stock OS and twrp will successfully decrypt /data at first boot if all goes well"
Why does TWRP (have to) decrypt /data on the Z2 play?

TWRP supports encrypted phones. The early versions required you to leave the phone decrypted or you couldn't read anything in recovery. DM verity seems to go both ways too.

Thanks for your response! Yes, TWRP supports encrypted phones (I did that on my Nexus). However in the TWRP topic you can read:
twrp will successfully decrypt /data at first boot if all goes well
Click to expand...
Click to collapse
So I am wondering whether it is possible to disable decryption when you flash twrp on the z2p?
Normally I would have tried it already and re-flashed the stock image if something went wrong (but there is no stock-image yet ...)

Related

[Q] Device encryption and TWRP recovery?

I've enabled device encryption in the stock AT&T ROM. Is it possible to mount this encrypted /data in TWRP? The TWRP threads suggest it is, but TWRP 2.7.0.2 just errors out, never asking me for a password. The TWRP 2.6.x M7 port did ask me for one, but didn't accept the correct one.

boot loop after installing twrp 2.8.7.2

so after i unlocked my bootloader, installed twrp 2.8.7.2, rebooted boot loader and went into recovery, i was greeted by twrp but it asked me for a decryption password (which i never set up) and Heisnberg said I wouldn't have worry about here under section 3 of how to decrypt the data partition "This is no longer necessary as long as you use TWRP 2.8.7.1 or newer". So I tried making a nandroid backup as normal, but that failed because twrp couldn't get to the data partition, unlike what Heisnberg said. So i just restarted the phone, and now I'm in a boot loop (about to flash factory image now).
So what I want to know is what twrp ppl use, do you have to do the decrypt data partition step, and the practical differences between systemless and nonsystemless root? why would anyone want to do systemless root if it doesn't work with all root apps?
Thank you so much for anyone who replies :angel:

BIG trouble when trying to un-root

I've just screwed up, big time. Was trying to un-root using the SuperSU app's "Full unroot" function, unaware that my device was encrypted.
Soo, now it won't boot. I can access both recovery and bootloader, but not the internal memory, which is the big problem here (pictures etc.).
When trying to boot I got the dm-verity error, and then the phone shuts off. In twrp I can't access the internal memory, so I can't backup my stuff.
I tried flashing stock boot, (does it have to be from the exakt OOS version as i have?), stock recovery and also re-flashing SuperSU, but nothing works. When flashing SuperSU i can boot my phone, but then I get the message "Can't encrypt your phone", and it tells me that I have to do a factory reset (which I don't want to atm)
Is there any hope of fixing this?
Thank you!
Try using adb to pull your files on your computer. Though since TWRP can't access internal storage, I doubt adb will.
You could also try to dirty flash the full ROM of whatever version of OOS you were using before (flash full rom in TWRP, wipe cache/dalvik, flash SuperSU or Magisk). This should restore most of your corrupted system and boot images. Since you tripped DM-verity, you will have to root again before rebooting. The no-verity/encript zip that's floating around the forums might also work? This shouldn't delete any of your user data, though I can't be certain if the dirty flashed ROM would be able to decrypt it.
Anova's Origin said:
Try using adb to pull your files on your computer. Though since TWRP can't access internal storage, I doubt adb will.
You could also try to dirty flash the full ROM of whatever version of OOS you were using before (flash full rom in TWRP, wipe cache/dalvik, flash SuperSU or Magisk). This should restore most of your corrupted system and boot images. Since you tripped DM-verity, you will have to root again before rebooting. The no-verity/encript zip that's floating around the forums might also work? This shouldn't delete any of your user data, though I can't be certain if the dirty flashed ROM would be able to decrypt it.
Click to expand...
Click to collapse
Try to dirty flash the rom you have now instaled. If you can't from TWRP, then try sideloading it. Good luck
Thank you for your tips, but didn't work
Tried wipe cache/dalvik -> sideload 4.0.2 -> sideload SuperSU -> fastboot twrp 3.0.3-0 (all of these I had before). And also only wipe cache/dalvik with a sideload of just the ROM, but I still get "Can not encrypt phone" when booting.
What does the SuperSU change in the system? And why does it not trigger dm-verity when flashing SuperSU, but when i remove it? I'm so confused. Is it even possible to get the phone in the same state as before uninstalling SuperSU, so it's bootable?
Systemless SuperSU modifies the /boot partition. Scripts have been added to the SuperSU installer to prevent dm-verity from detecting changes, which is why it doesn't get triggered when you root your phone after enabling system access in TWRP. Whenever you flash OOS (which has dm-verity enabled by default), you must root immediately before rebooting or it will replace TWRP with the stock recovery. Future attempts to enable TWRP without rooting will trigger dm-verity.
It's odd that you phone states that it cannot encrypt storage rather than decrypt it at boot. If you still have access to TWRP, try clean flashing OOS on your phone (use the wipe feature in TWRP). This will wipe /data and all your apps, but leave behind user files such as music and photos. Then flash OOS and immediately root before rebooting. Both SuperSU and Magisk will prevent OOS from attempting to encrypt /data on boot, which it does by default.
You didn't by any chance make a nandroid backup before unrooting did you?
Anova's Origin said:
Systemless SuperSU modifies the /boot partition. Scripts have been added to the SuperSU installer to prevent dm-verity from detecting changes, which is why it doesn't get triggered when you root your phone after enabling system access in TWRP. Whenever you flash OOS (which has dm-verity enabled by default), you must root immediately before rebooting or it will replace TWRP with the stock recovery. Future attempts to enable TWRP without rooting will trigger dm-verity.
It's odd that you phone states that it cannot encrypt storage rather than decrypt it at boot. If you still have access to TWRP, try clean flashing OOS on your phone (use the wipe feature in TWRP). This will wipe /data and all your apps, but leave behind user files such as music and photos. Then flash OOS and immediately root before rebooting. Both SuperSU and Magisk will prevent OOS from attempting to encrypt /data on boot, which it does by default.
You didn't by any chance make a nandroid backup before unrooting did you?
Click to expand...
Click to collapse
Sorry, I was wrong there, of course it's decrypt, NOT encrypt
I can flash twrp with fastboot and use it partially (says phone is encrypted, so limited options). I do not have access to /data or /system i belive, but I can sideload with the ADB function in TWRP. Tried to access files from twrp, but no go.
If dm-verity is not triggered when just flashing for example 4.0.2, why do I need to root it and install twrp? Is that so that I in some way could get it "un-triggered"?
Yep, I did a nandroid before, but was so stupid that I didn't backup to my computer. It's sitting inside the phone, encrypted
Dude I tried to unroot the N5X of my girlfriend the other day as snapchat didn't let us login with root. Phone was also decrypted, but after you boot it it will encrypt. If you stop the process (because you thought it was bootlooping, as those little motherf*****s don't tell when they are busy encrypting) and I am sure you did, the data is lost. That's exactly what happened to me. Don't try to encrypt or rescue anything. It wont work. Wipe the filesystem and start all over.
I am sorry though.
EDIT: I might be a little late, didn't check the date. But that encrypting stuff is serious, It should at least display a text with "ENCRYPTING..." or so. I let my phones encrypted since that day.
orreborre said:
I've just screwed up, big time. Was trying to un-root using the SuperSU app's "Full unroot" function, unaware that my device was encrypted.
Soo, now it won't boot. I can access both recovery and bootloader, but not the internal memory, which is the big problem here (pictures etc.).
When trying to boot I got the dm-verity error, and then the phone shuts off. In twrp I can't access the internal memory, so I can't backup my stuff.
I tried flashing stock boot, (does it have to be from the exakt OOS version as i have?), stock recovery and also re-flashing SuperSU, but nothing works. When flashing SuperSU i can boot my phone, but then I get the message "Can't encrypt your phone", and it tells me that I have to do a factory reset (which I don't want to atm)
Is there any hope of fixing this?
Thank you!
Click to expand...
Click to collapse
I don't understand why unrooting will have any problem with phone being encrypted.
I have done this unrooting process without a hiccup and my phone is also factory-encrypted so there's that.
What version of TWRP were you using? Try flashing the full OOS zip in TWRP but please flash the latest TWRP before doing so.
mharis05 said:
I don't understand why unrooting will have any problem with phone being encrypted.
I have done this unrooting process without a hiccup and my phone is also factory-encrypted so there's that.
What version of TWRP were you using? Try flashing the full OOS zip in TWRP but please flash the latest TWRP before doing so.
Click to expand...
Click to collapse
I believe what they meant was they were unaware their phone was decrypted. Unrooting will cause the phone to begin encrypting on boot, and I imagine OP cancelled it (as the phone does not say when it is encrypting)
orreborre said:
I've just screwed up, big time. Was trying to un-root using the SuperSU app's "Full unroot" function, unaware that my device was encrypted.
Soo, now it won't boot. I can access both recovery and bootloader, but not the internal memory, which is the big problem here (pictures etc.).
When trying to boot I got the dm-verity error, and then the phone shuts off. In twrp I can't access the internal memory, so I can't backup my stuff.
I tried flashing stock boot, (does it have to be from the exakt OOS version as i have?), stock recovery and also re-flashing SuperSU, but nothing works. When flashing SuperSU i can boot my phone, but then I get the message "Can't encrypt your phone", and it tells me that I have to do a factory reset (which I don't want to atm)
Is there any hope of fixing this?
Thank you!
Click to expand...
Click to collapse
I had a different issue but same like this....
i unrooted my phone and my device was decrypted.....
after reboot the phone encrypted automatically and all my datas were lost...
the dm-verity was are triggered....

Flashing TWRP - Will it clear the data and apps? - Bootloader is already unlocked

I unlocked the bootloader on my device previously. I hadn't rooted it yet, just haven't had the time. I'm ready to do so now, and i've read that you need to boot to this modified version of TWRP and use it to flash the TWRP image to the device, in doing so it flashes it to both the A/B partition of the device. I know you are always supposed to do good backups when you are doing these types of mods, BUT is it by functionality going to clear the device when it writes TWRP to both the A/B partition? When flashing TWRP to any other device that has never been the case. I just wondered if this works differently given the dual partition setup?
Afterwards I plan on using TWRP to flash magisk beta 14.3 to my pixel xl.
Thanks in advance.
Flashing TWRP will not wipe your dsevice.
Using the unofficial modified twrp is no longer necessary. Use twrp 3.1.1.1 img and 3.1.1.1 zip.

[MOD][X01BD] Disable forced encryption of data partition [stock][pie]

Disable forced encryption of data partition​
Instructions:
1. Download the decrypt.zip and move/copy to sdcard/otg drive
2. Flash in recovery
3. Format /data
4. Reboot
To encrypt the rom again, flash encrypt(pie).zip and format /data
What is the meaning of forced encryption on data partition
#ArtFuL said:
Disable forced encryption of data partition
Instructions:
1. Download the decrypt.zip and move/copy to sdcard/otg drive
2. Flash in recovery
3. Format /data
4. Reboot
Click to expand...
Click to collapse
In which recovery stock or on custom recovery?
Sdsahu101 said:
In which recovery stock or on custom recovery?
Click to expand...
Click to collapse
Custom recovery
Can I update to Pie via TWRP, after editing updater-script, if yes, can I flash decrypt.zip just after updating without formatting data. Actually, I don't want to format my device and install all the applications again.
Is 1903.064 is stable enough to use, I mean cam2api, screen flickering, PUBG on HD setting, charging time it was taking too long to charge earlier, reduced battery backup, screen brightness, cracking sound, double tap was also not working.
nice_guy75 said:
Can I update to Pie via TWRP, after editing updater-script, if yes, can I flash decrypt.zip just after updating without formatting data. Actually, I don't want to format my device and install all the applications again.
Is 1903.064 is stable enough to use, I mean cam2api, screen flickering, PUBG on HD setting, charging time it was taking too long to charge earlier, reduced battery backup, screen brightness, cracking sound, double tap was also not working.
Click to expand...
Click to collapse
Yes. You can. But if the phone is encrypted and flashing decrypt for the first time, decryption comes into effect only after formatting data
#ArtFuL said:
Yes. You can. But if the phone is encrypted and flashing decrypt for the first time, decryption comes into effect only after formatting data
Click to expand...
Click to collapse
No, Mine is decrypted. I am on Oreo with TWRP and already flashed decrypt.zip of Oreo? So can I flash 1903.064 zip via TWRP, after editing updater script and then flash decrypt.zip of Pie, to save my data partition?
I hope decrypt.zip of Pie does not format data while flashing.....
nice_guy75 said:
No, Mine is decrypted. I am on Oreo with TWRP and already flashed decrypt.zip of Oreo? So can I flash 1903.064 zip via TWRP, after editing updater script and then flash decrypt.zip of Pie, to save my data partition?
I hope decrypt.zip of Pie does not format data while flashing.....
Click to expand...
Click to collapse
Then no need to format. You won't loose data
is this necessary if i will go for custom rom? i mean just like in oreo, can i use the decrypt.zip for oreo to stock pie in order to decrypt my device? or i will use this one for pie? just to clarify sir.
kayamokid said:
is this necessary if i will go for custom rom? i mean just like in oreo, can i use the decrypt.zip for oreo to stock pie in order to decrypt my device? or i will use this one for pie? just to clarify sir.
Click to expand...
Click to collapse
Flashing decrypt oreo infact caused many problems on wifi/modem for many users. Also decrypt oreo didn't worked on pie for some users. So flashing decrypt pie is recommended for Oreo too.
legacy07 said:
Flashing decrypt oreo infact caused many problems on wifi/modem for many users. Also decrypt oreo didn't worked on pie for some users. So flashing decrypt pie is recommended for Oreo too.
Click to expand...
Click to collapse
it meams its just like the updated version of decrypt.zip? thanks sir.
Which one of these two files should be flashed
Karthik kollapureddy said:
Which one of these two files should be flashed
Click to expand...
Click to collapse
Choose according to whether you have to encrypt or decrypt
legacy07 said:
Choose according to whether you have to encrypt or decrypt
Click to expand...
Click to collapse
I'm a beginner so would you please tell me what's encypt and decrypt
---------- Post added at 06:32 AM ---------- Previous post was at 06:29 AM ----------
Karthik kollapureddy said:
I'm a beginner so would you please tell me what's encypt and decrypt
Click to expand...
Click to collapse
I'm confused and the rooting step
Hi all. I have zenfone updated to Oreo/android 8.1.
Phone model Z01BDC = ZC551KL .
What should I do to apply this patch to decrypt my /data ?
I installed TWRP 3.1.0.0 and the fact that /data is Encrypted is a problem.
Thank you.
sintoo said:
Hi all. I have zenfone updated to Oreo/android 8.1.
Phone model Z01BDC = ZC551KL .
What should I do to apply this patch to decrypt my /data ?
I installed TWRP 3.1.0.0 and the fact that /data is Encrypted is a problem.
Thank you.
Click to expand...
Click to collapse
This mod works in X01BD and X00TD. Not sure if it work for Z01BD. You can flash this patch by following the steps in the thread but success isn't guaranteed. Take a system backup as if anything goes wrong. Also be ready to loose your data
legacy07 said:
... So flashing decrypt pie is recommended for Oreo too.
Click to expand...
Click to collapse
I'm not sure about that... I am flashing this file (decrypt pie) for Oreo just. The phone does not boot in this case. I was forced to flashing old decrypt file for Oreo after and it all worked again.
It's not working with Official TWRP 3.3.1-0. I'm using stock Pie .065. Every time I reboot to system, it starts encrypting my device and when I reboot to recovery, TWRP is gone and I'll be booted to stock recovery. Then I flashed TWRP and checked the fstab.qcom. It was never patched. With OFRP, I don't have this issue as it patches fstab.qcom automatically after flashing a zip. But with the zip provided in OP, I'm unable to disable forced encryption. I don't get any error while flashing the zip though. Does any other file needs to be patched to disable forced encryption other than fstab.qcom?
anagramgenius said:
It's not working with Official TWRP 3.3.1-0. I'm using stock Pie .065. Every time I reboot to system, it starts encrypting my device and when I reboot to recovery, TWRP is gone and I'll be booted to stock recovery. Then I flashed TWRP and checked the fstab.qcom. It was never patched. With OFRP, I don't have this issue as it patches fstab.qcom automatically after flashing a zip. But with the zip provided in OP, I'm unable to disable forced encryption. I don't get any error while flashing the zip though. Does any other file needs to be patched to disable forced encryption other than fstab.qcom?
Click to expand...
Click to collapse
I think twrp official has decryption issues. Check with twrp 3.2.3
legacy07 said:
I think twrp official has decryption issues. Check with twrp 3.2.3
Click to expand...
Click to collapse
I checked with Rk585's TWRP 3.2.3 too. Same issue persists. It worked fine when I was in Oreo.
After flashing the zip, I booted back to recovery and copied the fstab.qcom to my PC to check if it has been replaced with the flashed zip. It did replace it. But when I boot to system, it starts encrypting my device and TWRP gets replaced by stock recovery. So I flashed the TWRP again and checked the fstab.qcom. Voila. It was unpatched. I don't know what is happening during the boot. The patched fstab is getting replaced by original fstab.
Edit: Seems there is a problem with the zip I guess. Or more files need to be patched to disable forced encryption in stock Pie rom. I tested in both PBRP and OFRP.
Case 1: I flashed stock rom in Official TWRP, then flashed PBRP zip and booted into PBRP. After booting into PBRP, it doesn't automatically disable forced encryption if no rom zip is flashed in it. So I flashed the decrypt zip provided in this OP. Then I booted to system, it started encrypting my device.
Case 2: I flashed stock rom in Official TWRP, then flashed OFRP zip and booted into OFRP. After booting into OFRP, it automatically disabled forced encryption even though no rom zip was flashed. Hence after booting into system, it didn't automatically encrypt my device as forced encryption was disabled automatically by OFRP.
So PBRP and OFRP do something else to disable forced encryption other than just patching fstab.qcom. Atleast in stock Pie rom. That's why I'm unable to disable forced encryption by flashing decrypt zip in any of the recoveries unless it is patched by recoveries themselves.

Categories

Resources