How do I update the ROM OTA with rooted device? - Xiaomi Mi Max Questions & Answers

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?!

Related

Do I need to revert to read only ?

Hi,
I've just bought a Nexus 5X and wanted to root it with systemless method for being able to get OTA in futur.
I've booted to TWRP to flash SuperSU zip but I've made the mistake to use the slider when TWRP ask if I want to keep the system as read only.
Is there an easy way to revert back without the reflashing the rom ?
And is there a way to boot to TWRP from android (if i keep the. .img on my phone) ?
Thank you
Sebacestmoi said:
Hi,
I've just bought a Nexus 5X and wanted to root it with systemless method for being able to get OTA in futur.
I've booted to TWRP to flash SuperSU zip but I've made the mistake to use the slider when TWRP ask if I want to keep the system as read only.
Is there an easy way to revert back without the reflashing the rom ?
And is there a way to boot to TWRP from android (if i keep the. .img on my phone) ?
Thank you
Click to expand...
Click to collapse
If you had TWRP touch your /system in R/W mode even if it made no changes, the system partition is tainted (there is meta-data that changed)
The only practical way to get back to untainted /system is to flash the stock system.img. The flashing is simple, but it might take a little time to download the factory image and extract the system.img.
I usually keep twrp in the recovery partition, probably chainfire has something to boot twrp directly. I do know that if you boot twrp over usb there is a problem where it doesn't accept your pin/pattern/pass to decrypt the user partition. I don't know if it suffers the same problem through other booting methods.
BTW even with systemless root, you cannot flash the differential OTA you receive over the air directly. You need to restore the stock boot.img before flashing the OTA.
The FULL OTA you get from the factory image website, on the other hand, can flash over anything, regardless of whether you have boot, system, or vendor modified.
Thank you for the clear answer
Sebacestmoi said:
Hi,
I've just bought a Nexus 5X and wanted to root it with systemless method for being able to get OTA in futur.
I've booted to TWRP to flash SuperSU zip but I've made the mistake to use the slider when TWRP ask if I want to keep the system as read only.
Is there an easy way to revert back without the reflashing the rom ?
And is there a way to boot to TWRP from android (if i keep the. .img on my phone) ?
Thank you
Click to expand...
Click to collapse
The command
Code:
[I]fastboot boot <img file name>[/I]
will boot twrp from your computer with out having to install it.

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.

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

Question Magisk is not installing

The magisk apk, when flashed in TWRP flashes as normal but the app does not show up in the ROM, and the phone doesn't get rooted.
I had this problem on both ArrowOS and Syberia OS now, and I clean flashed both times directly from MIUI.
Can anyone help me out with this?
Install the magisk app
Rename magisk.apk to magisk.zip (only change the last 3 letters) and install it from TWRP-recovery.
zhyylz0201 said:
Install the magisk app
Click to expand...
Click to collapse
I already tried, this happened -
Iceman66 said:
Rename magisk.apk to magisk.zip (only change the last 3 letters) and install it from TWRP-recovery.
Click to expand...
Click to collapse
It didn't work either, when I open magisk app it shows this -
Download Canary version of Magisk (23001) from Github: https://raw.githubusercontent.com/topjohnwu/magisk-files/canary/app-debug.apk
Rename app-debug.apk to app-debug.zip and flash it with TWRP
Iceman66 said:
Download Canary version of Magisk (23001) from Github: https://raw.githubusercontent.com/topjohnwu/magisk-files/canary/app-debug.apk
Rename app-debug.apk to app-debug.zip and flash it with TWRP
Click to expand...
Click to collapse
No change
Other method is patching boot.img with magisk manager. You can find some tutorials with google. Extract the boot.img from ROM.zip, put in on internal memory of your phone and patch it with magisk manager app on your phone.
Than flash the patched boot.img with adb or TWRP. You need an extractor tool to get the boot.img from the rom.zip.
Iceman66 said:
Other method is patching boot.img with magisk manager. You can find some tutorials with google. Extract the boot.img from ROM.zip, put in on internal memory of your phone and patch it with magisk manager app on your phone.
Than flash the patched boot.img with adb or TWRP. You need an extractor tool to get the boot.img from the rom.zip.
Click to expand...
Click to collapse
I am using a custom kernel, will that change the process?
You need to reflash the custom kernel again after flashing the patched boot.img, but first check if your phone is rooted. (check in magisk app or install a root check app.)
The boot backup that I took before I flashed my custom kernel is the one that needs to be patched right?
If this isn't the case, can you guide me on how to get the boot.img? I only see payload.bin in my ROM.zip .
Okay, thank you for your help everyone
I ran into a different problem - when I install the patched boot.img, I get magisk but then I boot into TWRP and flash TWRP and my custom kernel, and I lose my root.
Dhruv.m said:
Okay, thank you for your help everyone
I ran into a different problem - when I install the patched boot.img, I get magisk but then I boot into TWRP and flash TWRP and my custom kernel, and I lose my root.
Click to expand...
Click to collapse
You have to patch the boot IMG with the TWRP already flashed, our phone doesn't have a recovery partition, so it's saved in the boot partition and installing Magisk from TWRP deletes the recovery, here is a good tutorial:
TWRP + Root
Hi all. Hope you are good and safe from Covid-19. If you like TWRP as your recovery and want to keep root access as well, I am going to show you how to do that. Because if you take the stock boot.img and patch it via magisk, you will lose TWRP...
forum.xda-developers.com

Question How can reinstall stock ROM over TWRP recovery?

Hello.
How can I please reinstall the stock rom via TWRP recovery without data loss, or how can I reinstall it via the Miflash tool?
I have a bootloop and would like to try reinstalling rom. Thanks
basically what u can do is flash stock rom using mi flash tool. ensure that down to the bottom u click save user data. and i think u should be fine flashing the stock rom and preserving your data in that sense. after flashing wait and let the device reboot for itself it usually takes a couple mins
TormentedHeart said:
basically what u can do is flash stock rom using mi flash tool. ensure that down to the bottom u click save user data. and i think u should be fine flashing the stock rom and preserving your data in that sense. after flashing wait and let the device reboot for itself it usually takes a couple mins
Click to expand...
Click to collapse
I have already managed to boot into the system, in TWRP Recovery I wipe dalvik.
But I need root and I must to patch the boot.img again via Magisk. And then I must flash patched boot.img via ADB back to the mobile, but I'm afraid I'll go back to the bootloop.
Any other options to do root or avoid bootloop?
Thanks
jkmaxfli said:
I have already managed to boot into the system, in TWRP Recovery I wipe dalvik.
But I need root and I must to patch the boot.img again via Magisk. And then I must flash patched boot.img via ADB back to the mobile, but I'm afraid I'll go back to the bootloop.
Any other options to do root or avoid bootloop?
Thanks
Click to expand...
Click to collapse
Stupid question but did you extracted boot.img before or after update? Maybe you flashed patched boot.img from previous update to last update? That would cause bootloop
Greenspoof said:
Stupid question but did you extracted boot.img before or after update? Maybe you flashed patched boot.img from previous update to last update? That would cause bootloop
Click to expand...
Click to collapse
It's not a stupid question.
The update was displayed on my phone, downloaded, installed, restarted and booted into the system, everything is fine.
Then I had to download the update manually from the Internet and extract the boot.img. and I then patched it via Magisk and flashed it back to the mobile via ADB, and then a bootloop occurred.
jkmaxfli said:
I have already managed to boot into the system, in TWRP Recovery I wipe dalvik.
But I need root and I must to patch the boot.img again via Magisk. And then I must flash patched boot.img via ADB back to the mobile, but I'm afraid I'll go back to the bootloop.
Any other options to do root or avoid bootloop?
Thanks
Click to expand...
Click to collapse
basically to root its just best to flash the official magisk zip via twrp. it patches the boot img during the process. and u wont get bootloop

Categories

Resources