how to keep my phone decrypted, after installing a force encrypted rom - Nexus 5X Q&A, Help & Troubleshooting

Currently my phone is decrypted. I am trying to install a ROM which is force encrypted.
Without wiping internal storage, how can I keep my phone decrypted?

Flash any custom kernel without encryption after you have flashed the ROM.. Didn't try this method with any custom ROM.. But tried with stock.. Worked..
Still have a backup for safety..

Joyarup said:
Flash any custom kernel without encryption after you have flashed the ROM.. Didn't try this method with any custom ROM.. But tried with stock.. Worked..
Still have a backup for safety..
Click to expand...
Click to collapse
so while flashing the ROM just install ElementalX kernel should decrypt my phone..
Thanks..

Your other option is fed_patcher_v8-signed.zip, you flash it after a ROM / kernel combo that forces encryption that forces encryption. That will disable encryption. You need to wipe everything first though to get rid of your already encrypted data though.

ForceEncrypt is a mount table option contained in the kernel (boot.img)
Encryption is done by the kernel upon first boot noticing the user partition is not encrypted.
So if you want to keep your user partition decrypted, you must never boot a kernel (boot.img) with the ForceEncrypt option in place.
There are many ways to avoid this:
One way is after you install the ROM (prior to first boot), flash a boot.img that has ForceEncrypt disabled (set to Encryptable)
Another way is to flash SuperSU (prior to first boot) and it will patch your existing boot.img to disable ForceEncrypt. If you are flashing ROMs from bootloader, eseentially this means you MUST boot into TWRP recovery to flash SuperSU PRIOR to rebooting. In the process of flashing your new ROM, if you've overwritten TWRP recovery with stock, you'll need to reflash TWRP recovery also.

Related

[Q] About 3rd party recoveries and 5.0

I noticed that when using the last dev preview for my N7 2013, it keeps killing TWRP and putting back the stock recovery. Now the final release does this. If I flash TWRP again, it just gets overwritten after a normal boot then back to recovery.
Why? Is there a way to stop this? This is the first time I've dealt with this. Nothing else does this to me. I haven't found a clear answer yet to this while searching this site or others.
I solved this by flashing a custom kernel, in my case, ElementalX 3.02.
I downloaded the zip to the tablet, rebooted to fastboot, wrote the recovery, then booted into the recovery (just after flashing it, don't boot system), flashed custom kernel, and upon booting system it stopped overwriting the recovery partition with stock recovery.
It seems the stock kernel overwrites the recovery partition if it has been modified. Correct me if I'm wrong!
rguilamo said:
I solved this by flashing a custom kernel, in my case, ElementalX 3.02.
I downloaded the zip to the tablet, rebooted to fastboot, wrote the recovery, then booted into the recovery (just after flashing it, don't boot system), flashed custom kernel, and upon booting system it stopped overwriting the recovery partition with stock recovery.
It seems the stock kernel overwrites the recovery partition if it has been modified. Correct me if I'm wrong!
Click to expand...
Click to collapse
Well it is just 5.0 that does this.
Since I posted this there is a sane reason for them to do this - it might be the way they enforce the factory reset protection. It has to use their recovery to do so. Still annoying.
But thanks for a workaround, that it simply is the kernel, or boot image. That and I want root
You can try Chainfire's CF-AutoRoot, It modifies Boot.img so root is granted in boot time, I already had a custom kernel when I rooted, but you can try to root first and see if it stops auto-writing the stock recovery.
Here's the download link: http://download.chainfire.eu/347/CF-Root/CF-Auto-Root/CF-Auto-Root-flo-razor-nexus7.zip
Extract it, and run root-windows.bat (or the one suitable to your OS) while in fastboot.

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....

Root w/o custom recovery?

Has anyone managed to root their device by patching their boot image and not installing a custom recovery (TWRP)?
I am referring to the method described on the Magisk website:
https://topjohnwu.github.io/Magisk/install.html#boot-image-patching
mmedei9 said:
Has anyone managed to root their device by patching their boot image and not installing a custom recovery (TWRP)?
I am referring to the method described on the Magisk website:
https://topjohnwu.github.io/Magisk/install.html#boot-image-patching
Click to expand...
Click to collapse
I think this would work with the xiaomi.eu rom. And I say it because when I install Magisk through TWRP, it works without the need to close AVB2.0 etc etc. Just install Magisk, reboot and you're good to go.
You need TWRP in order to flash the Xiaomi.eu rom though. Except if you flash all the partitions of the rom one by one through fastboot. And then flash the rooted boot.img.
Side note: I have not managed to root ANY rom (Chinese/global) on the Chinese device while keeping encryption. It always leads to bootloop, except if you disable forceencrypt, which of course leads to loss of encryption.
polfrank said:
Side note: I have not managed to root ANY rom (Chinese/global) on the Chinese device while keeping encryption. It always leads to bootloop, except if you disable forceencrypt, which of course leads to loss of encryption.
Click to expand...
Click to collapse
Do you suspect that the reason rooting via patching boot doesn't work is the encryption then? I'd be willing to disable encryption to obtain root with stock recovery
mmedei9 said:
Do you suspect that the reason rooting via patching boot doesn't work is the encryption then? I'd be willing to disable encryption to obtain root with stock recovery
Click to expand...
Click to collapse
Not exactly. I suspect that it is the reason for bootloop when trying to install Magisk on the Chinese device. Because Magisk does not work on the Chinese device, even if you flash and close avb2.0, you get bootloop.
In global device + global rom, you can disable avb2.0 through TWRP after flashing Magisk, and then reboot normally to get a perfectly rooted phone while keeping encryption.
But if you flash the rooted boot.img through fastboot, how are you going to close avb2.0?
polfrank said:
Not exactly. I suspect that it is the reason for bootloop when trying to install Magisk on the Chinese device. Because Magisk does not work on the Chinese device, even if you flash and close avb2.0, you get bootloop.
In global device + global rom, you can disable avb2.0 through TWRP after flashing Magisk, and then reboot normally to get a perfectly rooted phone while keeping encryption.
But if you flash the rooted boot.img through fastboot, how are you going to close avb2.0?
Click to expand...
Click to collapse
Of the handful of tutorials on the forums, which would you recommend for flashing TWRP and rooting the device?
Would it require me flashing the global rom in the place of my global (EEA) rom?
polfrank said:
I think this would work with the xiaomi.eu rom. And I say it because when I install Magisk through TWRP, it works without the need to close AVB2.0 etc etc. Just install Magisk, reboot and you're good to go.
You need TWRP in order to flash the Xiaomi.eu rom though. Except if you flash all the partitions of the rom one by one through fastboot. And then flash the rooted boot.img.
Side note: I have not managed to root ANY rom (Chinese/global) on the Chinese device while keeping encryption. It always leads to bootloop, except if you disable forceencrypt, which of course leads to loss of encryption.
Click to expand...
Click to collapse
Attention because there will be no more updates for the redmi note 8 pro concerning the rom xiaomi.eu! (announcement on their site ...)
I flashed patched boot image without disabling avb and now I'm stuck in bootloop.
Is it necessary to disable avb before flashing patched image through fastboot?

Unable to encrypt after root

Hi everyone.
I had a issue and i really want help
I had unlock the OEM,and after installing the twrp and format data (to remove the forced encrypt), i had flash the Disable_Dm-Verity_ForceEncrypt zip file.
Okay, after that i have restarted the device and configure as my away to use, after that, booted on recovery again and flashed the magisk.
But i wanna encrypt my device, and when i go to configs->security and encrypt area, says that my device its not encrypted. Okay, i followed the steps and when i gonna try to encrypt the device, the process start and... some seconds after, the phone just restart and nothing has done.
The onlys changes that i have made on system is: root and flashed a splash.img(without that stupid warning of unlocked bootloader)
I really want to encrypt my device, so, if i get stolen, the thief wont get my user data.
Can anyone help me?
Flash the stock rom and and don't flash the encryption disabler next time. You don't need to install TWRP to flash Magisk either, you can just boot it and then flash Magisk. Also you don't even need TWRP, you can just follow the guide in the forum to install Magisk by booting the magisk patched boot.img for your version of the stock ROM and then install Magisk manually via Magisk Manager.
TL;DR : Flash stock ROM and do the same things except flashing dm-verity-disabler, you don't need that for Magisk or TWRP.
marstonpear said:
Flash the stock rom and and don't flash the encryption disabler next time. You don't need to install TWRP to flash Magisk either, you can just boot it and then flash Magisk. Also you don't even need TWRP, you can just follow the guide in the forum to install Magisk by booting the magisk patched boot.img for your version of the stock ROM and then install Magisk manually via Magisk Manager.
TL;DR : Flash stock ROM and do the same things except flashing dm-verity-disabler, you don't need that for Magisk or TWRP.
Click to expand...
Click to collapse
Thanks sir, i will try!
marstonpear said:
Flash the stock rom and and don't flash the encryption disabler next time. You don't need to install TWRP to flash Magisk either, you can just boot it and then flash Magisk. Also you don't even need TWRP, you can just follow the guide in the forum to install Magisk by booting the magisk patched boot.img for your version of the stock ROM and then install Magisk manually via Magisk Manager.
TL;DR : Flash stock ROM and do the same things except flashing dm-verity-disabler, you don't need that for Magisk or TWRP.
Click to expand...
Click to collapse
Sir, i really need twrp now, its there any way i can enable encrypt after rooting the device? (to sure that, if gets stolen, the data need to be wipped out or the password must be given on twrp)
Same issue, i tried to encrypt on security menu,reboot and nothing was done.
@edit
Better, without TWRP, i can flash other zips via magisk/stock recovery?
mrkeitsuke said:
Sir, i really need twrp now, its there any way i can enable encrypt after rooting the device? (to sure that, if gets stolen, the data need to be wipped out or the password must be given on twrp)
Same issue, i tried to encrypt on security menu,reboot and nothing was done.
@edit
Better, without TWRP, i can flash other zips via magisk/stock recovery?
Click to expand...
Click to collapse
I'm not sure what you're trying to do here, do you want to have TWRP + stock encryption?
If so you can just boot TWRP and flash the TWRP installer package (.zip) inside TWRP to do that. And you don't need to change anything, currently I have TWRP installed and encryption enabled on my Stock ROM.
But if you're trying to get TWRP's own encryption, sadly that doesn't work.
You can also use TWRP without flashing/installing it, just go to the directory TWRP is stored in, open a command line, connect your phone and boot it with this command :
Code:
fastboot boot twrp.img
then flash whatever you'd like.
DO NOT lock your bootloader after you flash something on TWRP, this will most probably brick the device.
marstonpear said:
I'm not sure what you're trying to do here, do you want to have TWRP + stock encryption?
If so you can just boot TWRP and flash the TWRP installer package (.zip) inside TWRP to do that. And you don't need to change anything, currently I have TWRP installed and encryption enabled on my Stock ROM.
But if you're trying to get TWRP's own encryption, sadly that doesn't work.
You can also use TWRP without flashing/installing it, just go to the directory TWRP is stored in, open a command line, connect your phone and boot it with this command :
Code:
fastboot boot twrp.img
then flash whatever you'd like.
DO NOT lock your bootloader after you flash something on TWRP, this will most probably brick the device.
Click to expand...
Click to collapse
I want to stick with the stock rom rooted, with the twrp installed and the user data encrypted
So i can flash things through TWRP even i have encrypt enabled?
@edit
dont worry about bootloader, i will keep unlocked
It's perfectly fine to have TWRP and/or Magisk and encryption using stock ROM.
Flash stock ROM (erase user data)
Install TWRP
install Magisk
Don't flash the encryption Disabler. As its name implies, it disables the automatic encryption of the userdata partition.
a1291762 said:
It's perfectly fine to have TWRP and/or Magisk and encryption using stock ROM.
Flash stock ROM (erase user data)
Install TWRP
install Magisk
Don't flash the encryption Disabler. As its name implies, it disables the automatic encryption of the userdata partition.
Click to expand...
Click to collapse
:highfive: i had done this and... i think its working!!! :crying::crying::crying:
(crying for emotion, almost thirty factory resets to get an good result :crying::crying::crying
Anyway, if anything bad occurs, i will update here, thanks a1291762 and marstonpear

Stock ROM update to V12.0.2.0.RCOMIXM Android 11 - Magisk bootloop

My ginkgo had stock ROM V12.0.6.0.QCOMIXM (A10) and I updated to stock ROM V12.0.2.0.RCOMIXM using TWRP recovery (twrp_ginkgo-willow_3.4A9_23-12-2020_BL) However after flashing the rom zip, and after flashing magisk, my phone got into "MIUI" icon, then bootloops into recovery again with alphanumeric directory names.
I tried Disable Dm Verity Force Encrypt after flashing magisk.zip but same problem.
I have tried the following recoveries so far:
twrp_ginkgo-willow_3.4A9_23-12-2020_BL
twrp-3.5.2_10-2-ginkgo
orangefox R11.0_1 (with Disable DM-Verity, Disable Forced Encryption and Aggresive stock recovery deactivation all enabled).
But whenever I flash magisk, I still get the bootloop and alphanumeric directory names, and the only way to restore my phone without having to wipe data is to flash the recovery zip again (but without magisk).
Any suggestions on how to get around this?
bomberb17 said:
Any suggestions on how to get around this?
Click to expand...
Click to collapse
i already answered you here
use this DFE

Categories

Resources