Unable to encrypt after root - Xiaomi Mi A2 Lite Questions & Answers

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

Related

How do I update the ROM OTA with rooted device?

Hi guys,
I'm on an outdated version of the global beta ROM and have received an OTA notification.
Unfortunately I can't run this as I'm rooted.
Please could you tell me the easiest way of updating the ROM without wiping everything and maintaining root?
Many thanks,
Andy
After flashing Rom root will be gone and if you need root just flash supersu.zip using twrp and you will get root back. That's all
sarthakwarlock said:
After flashing Rom root will be gone and if you need root just flash supersu.zip using twrp and you will get root back. That's all
Click to expand...
Click to collapse
thank you, unfortunately when I get into TWRP it asks for a password. Without a password I can't browse to the downloaded zip.
any idea?
andypa1 said:
thank you, unfortunately when I get into TWRP it asks for a password. Without a password I can't browse to the downloaded zip.
any idea?
Click to expand...
Click to collapse
Reflash Twrp from fastboot.
I've just found in a thread elsewhere:
"It's because of the dm-verity protection included in the MIUI firmwares.
To disable it, you have to:
- Format all encrypted partitions on fastboot (fastboot format system; fastboot format userdata;...)
- Boot on TWRP and flash a MIUI recovery image
- Download this patched boot file
- On fastboot flash the patched boot.img (fastboot flash boot boot-patched.img)
To manually remove the protection from a kernel you have to:
- Extract boot.img from a rom/device
- Unpack it, with this tool for example -> mkbootimg_tools
- Search the fstab file (fstab.qcom for example) and remove the "verify" mention and replace all "forceencrypt" mentions by "encryptable"
- Repack it and flash it"
I don't really understand this, or understand / remember how I managed to flash the global beta rom in the first place?!

Twrp and flashing a Rom

So I've done a lot of reading and there are multiple threads with steps that aren't exactly clear or contradict each other or are outdated. I just want clarification on what I believe are the steps to flash a custom rom (7.1.2 since I can wait for 8) on a brand new Pixel XL.
Setup phone to the point of enabling adb debugging and oem unlock
Fastboot unlock
Fastboot boot twrp RC1 img
Flash twrp RC2 zip in twrp
Reboot to installed twrp
Wipe system, data, caches
Flash ROM
Flash twrp again
Reboot to twrp
Flash gapps and root method (magisk working for 7.1.2 or should I be using supersu? Also which versions?)
Flash twrp again??
Boot to ROM then setup and use like normal
Should this give me custom ROM, root and twrp that I can boot directly to without a pc again? As long as I do twrp flashing after a ROM each time it'll stick? Also, I keep seeing things for setting a pin before initial twrp boot but without spending 4 days reading I can't find the reason for it. Should I be flashing vendor, bootloader and radio for the latest Nougat release BEFORE unlocking or can I do it through fastboot prior to unlocking?
Coming from Nexus 6P and that was my first run in with the bootloader, radio and vendors so I want to avoid issues for myself. Phone should be here tomorrow and want to get down to business right away lol.
Any and all information is greatly appreciated. If all of this is answered in a centralized area please point me to it and tell me I'm stupid for missing it.
Sent from my SM-N910P using Tapatalk
Found this over in PN thread. Is it accurate? Seems similar to my process.
https://forum.xda-developers.com/showthread.php?p=73846565
wgrant said:
Fastboot boot twrp RC1 img
Flash twrp RC2 zip in twrp
Reboot to installed twrp
Wipe system, data, caches
Flash ROM
Flash twrp again
Reboot to twrp
Flash gapps and root method (magisk working for 7.1.2 or should I be using supersu? Also which versions?)
Flash twrp again??
Boot to ROM then setup and use like normal
https://forum.xda-developers.com/showthread.php?p=73846565
Click to expand...
Click to collapse
Assuming the bootloader is already unlocked and disregarding the unlocking instruction, these instructions are dead on accurate. I personally dont use magisk, but maybe another user will chime in. For 7.1.2 id use supersu 2.82.
You dont have to flash twrp again after flashing gapps and supersu, but its a good practice to have.
noidea24 said:
Assuming the bootloader is already unlocked and disregarding the unlocking instruction, these instructions are dead on accurate. I personally dont use magisk, but maybe another user will chime in. For 7.1.2 id use supersu 2.82.
You dont have to flash twrp again after flashing gapps and supersu, but its a good practice to have.
Click to expand...
Click to collapse
Thank you very much. I'm about to unlock and go nuts on my phone. New phones are so fun to fiddle with!
if you want to use magisk you'll need to flash a custom kernel before you flash magisk. Also you'll need a modified magisk zip. Search around the thread you'll find one, the latest version I found was magisk v13.3.
Edit: Just found out magisk is officially support for pixel on version 14.1 Check out the magisk beta thread.

need guidance

Is there any way to install twrp recovery and keep receiving OTAs on stock Pie ROM?
saedkebbeh said:
Is there any way to install twrp recovery and keep receiving OTAs on stock Pie ROM?
Click to expand...
Click to collapse
No.
marstonpear said:
No.
Click to expand...
Click to collapse
How to install OTAs after installing twrp?
You need to flash stock boot.img, as TWRP gets installed to the boot.img on your phone. But you need to do it on the right partition otherwise you won't get the updates. Also if you've tampered with system or any other partition of the device, you need to remove them. To get rid of all the steps, just flash the stock rom via MiFlash (you'll lose your data so take a backup).
marstonpear said:
You need to flash stock boot.img, as TWRP gets installed to the boot.img on your phone. But you need to do it on the right partition otherwise you won't get the updates. Also if you've tampered with system or any other partition of the device, you need to remove them. To get rid of all the steps, just flash the stock rom via MiFlash (you'll lose your data so take a backup).
Click to expand...
Click to collapse
You don't neccesary lose your data with MiFlash, just choose the option without relock/wipe.
thorin0815 said:
You don't neccesary lose your data with MiFlash, just choose the option without relock/wipe.
Click to expand...
Click to collapse
Don't forget to flash the same version!
marstonpear said:
Don't forget to flash the same version!
Click to expand...
Click to collapse
I need to know where to flash the twrp and where to flash stock boot.img when installing OTA
Yesterday I flashed patched boot img using the command: fastboot flash boot patched boot img, without choosing a partition
I made a guide for doing OTA with TWRP and Magisk. You should be able to follow it and just ignore the Magisk bits. The start covers restoring the boot partition.
https://forum.xda-developers.com/mi-a2-lite/how-to/10-0-4-0-to-10-0-7-0-ota-keeping-magisk-t3916863/
Note that I normally get a boot loop after installing TWRP and reinstall magisk as a fix. I'll assume you have your own way to install TWRP.

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?

How to encrypt phone again?

I unlocked and rooted my 8T as described in this thread
https://forum.xda-developers.com/re...de-unlocking-bootloader-twrp-rooting-t4031831
I made decryption including format Data and installing Universal DM-Verity and ForceEncrypt disabler, also installed stock EEA V11.0.3.0.PCXEUXM (MIUI10) and Magisk
All working fine except phone password lock, and as I read now, locks don't work on decrypted phone. So I decide to encrypt my phone back. But it does not work, when I pressed "encrypt phone" button in privacy settings it just reboot and nothing happened.
I tried OrangeFox recovery, made all steps as described here
https://forum.xda-developers.com/redmi-note-8/how-to/guide-flashing-miui-ota-rom-recovery-t4041591
but still the same trouble.. So, how to encrypt phone with stock rom, root and recovery?
rusm said:
I unlocked and rooted my 8T as described in this thread
https://forum.xda-developers.com/re...de-unlocking-bootloader-twrp-rooting-t4031831
I made decryption including format Data and installing Universal DM-Verity and ForceEncrypt disabler, also installed stock EEA V11.0.3.0.PCXEUXM (MIUI10) and Magisk
All working fine except phone password lock, and as I read now, locks don't work on decrypted phone. So I decide to encrypt my phone back. But it does not work, when I pressed "encrypt phone" button in privacy settings it just reboot and nothing happened.
I tried OrangeFox recovery, made all steps as described here
https://forum.xda-developers.com/redmi-note-8/how-to/guide-flashing-miui-ota-rom-recovery-t4041591
but still the same trouble.. So, how to encrypt phone with stock rom, root and recovery?
Click to expand...
Click to collapse
All kind of phone password,pattern,pin,fingerprint,face locks etc do work on decrypted phone in stock rom without any issue..tested myself.... although if you want to encrypt phone again then flash fastboot rom via mi flash
the_weird_aquarian said:
All kind of phone password,pattern,pin,fingerprint,face locks etc do work on decrypted phone in stock rom without any issue..tested myself.... although if you want to encrypt phone again then flash fastboot rom via mi flash
Click to expand...
Click to collapse
Yes, I want encrypted phone.
How it possible with Magisk and recovery?
I need flash fresh EEA 11.0.3.0 from Miflash, than install recovery and Magisk. And what else?
If I install Dm-Verity path, than I need format data and decrypt phone.
If I skip Dm-Verity installation, than I will have a bootloop.
rusm said:
Yes, I want encrypted phone.
How it possible with Magisk and recovery?
I need flash fresh EEA 11.0.3.0 from Miflash, than install recovery and Magisk. And what else?
If I install Dm-Verity path, than I need format data and decrypt phone.
If I skip Dm-Verity installation, than I will have a bootloop.
Click to expand...
Click to collapse
flash the fastboot rom from mi flash and boot it till android setup....you don't necessarily have to set up your phone right now(you can setup your phone no issue though)...then flash orangefox recovery....then in orangefox settings->miui ota settings-> tick everything except Disable Forced Encryption...then flash stock recovery rom through orangefox once....after that flash magisk.... don't flash dm verity....now reboot.
Do not format data in any step..
the_weird_aquarian said:
flash the fastboot rom from mi flash and boot it till android setup....you don't necessarily have to set up your phone right now(you can setup your phone no issue though)...then flash orangefox recovery....then in orangefox settings->miui ota settings-> tick everything except Disable Forced Encryption...then flash stock recovery rom through orangefox once....after that flash magisk.... don't flash dm verity....now reboot.
Do not format data in any step..
Click to expand...
Click to collapse
Thank you! It working.
Seems that OrangeFox do his job well. Now I have encrypted phone with root, and recovery handling my password and decrypt data if need.
Strange, that menu items "Disable DM-Verity" and "Disable forced encryption" gray in my Orangefox any time from initial installation, but everything looks OK in system...
rusm said:
Thank you! It working.
Seems that OrangeFox do his job well. Now I have encrypted phone with root, and recovery handling my password and decrypt data if need.
Strange, that menu items "Disable DM-Verity" and "Disable forced encryption" gray in my Orangefox any time from initial installation, but everything looks OK in system...
Click to expand...
Click to collapse
:good:

Categories

Resources