Unroot/Hide root without causing a bootloop? - Xiaomi Mi Max Questions & Answers

Hello,
I spent all day trying to find an answer to my problem, hope that you guys will help me
So, first of all, I'm on Mi Max 4/128, MIUI 8.2.3.0, unlocked BL.
What I need to do is root this device, add some apps as system apps and, since I use some apps which are quite keen on checking the SafetyNet, get rid of the root or hide it while keeping the changes I made while rooted.
I installed TWRP, flashed SuperSU, modified what I wanted, unrooted using the SuperSU GUI... And on the restart it started bootlooping, showing only the MI logo.... The only way out of this bootloop is to install the SuperSU again or clear the Data in TWRP, both of which defeat the purpose.
Tried with Magisk, hoping to simply hide the root... But it seems that MIUI won't fully pass the SafetyNet verification. Also after uninstalling it's all the same story with bootloops.
Next, after unrooting I tried flashing just the stock recovery.img and boot.img via fastboot, no luck there...
From what I've managed to find out, it's all caused by the forced dm-verity encryption. So one of the options for me would be to flash a modified kernel/boot.img that would not force the encryption, I guess? (I'm still a little hazy on the subject, correct me if I'm wrong ) Tried to do it, but I can't for the life of me find the modified boot.img or kernel for the latest Helium MIUI
Do you have any sugestions?

Okay, I figured it out! All it takes to avoid a bootloop after the unrooting is to flash this script:
https://forum.xda-developers.com/redmi-note-3/how-to/modified-twrp-deleting-emmcappsboot-t3371667
Unless anyone's got an idea how to hide the root with Magisk on MIUI, thread can be closed

Hi,
Even I'm facing the same issue. I'm on stock ROM and unrooting from SU caused bootloop. Now, I restored the nandroid backup and the Redmi 3s prime is booting. However, I would like to unroot it. Can we simply disable Dm-verity from TWRP before unrooting from SU? Or disabling Dm-verity will cause any issue?

The boot.img patcher I mentioned in the second post does just that, it deletes the dm-verity. Try it out

Related

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?

J6 SM-J600FN - Is it possible to install TWRP without boot-loop?

I have been trying to root my J6 SM-J600FN for a while, and I thought I was getting close to rooting it when I installed TWRP. But then, my phone was stuck in a boot-loop. I was able to fix it by installing current firmware, and I decided to attempt it a second time. I got the same result. Is there anything I can use to install TWRP that doesn't result in a boot-loop? I just want my phone rooted and be done with it.
As far as i know, trying to root stock rom isn't easy. I could be wrong but idk. You can try by:
1. Flashing stock
2. Flashing TWRP
3. Format data
4. Flash DM-Verity and Disable Force-Encrypt then flash magisk.
And i think you can't flash kernels on stock. I could be wrong but idk.
Hey, how did you even install TWRP?
Before I tried installing it my model number was "SM-J600 FN/DS" and now after the install, when I plug it into my pc it says that it's "FN-600G." Whenever I try to boot it in system mode it's stuck in a loop.
I haven't tried flashing the newest firmware yet because I can't even download it for my country.
Sorry, I am a total newbie and can't seem to fix it.
Al-Ameen Adewunmi said:
I have been trying to root my J6 SM-J600FN for a while, and I thought I was getting close to rooting it when I installed TWRP. But then, my phone was stuck in a boot-loop. I was able to fix it by installing current firmware, and I decided to attempt it a second time. I got the same result. Is there anything I can use to install TWRP that doesn't result in a boot-loop? I just want my phone rooted and be done with it.
Click to expand...
Click to collapse
Hi Guys,
Did you manage to do this? I was experiencing the same bootloop issue and I think it is the version of Twrp (I was using 3.3.1-0).
I used Odin to flash a lower version 3.2.3 found here after which I flashed this DM Verity + Magisk.
Root Success!

Magisk problems since most recent OTA

I have the xt-1952-4 variant. When I first got this phone and tried the various methods to flash and install Magisk, it worked then. Since then for whatever reason, whether it be to fix a soft brick or restore a backup, and having flashed the most recent (March 2020) stock ROM for this phone, never I repeat never have I gotten Magisk to take right. I don't know if it's Magisk or the security updates from Google or Motorola but it's made flashing root nonexistent, even yet while my bootloader is unlocked. Every thread here or on any Google search to install Magisk or root and install TWRP seems obsolete now. Anyone else have this problem And how to perhaps fix it? Am I the only one with such a problem? Thanks.
theburrus1 said:
I have the xt-1952-4 variant. When I first got this phone and tried the various methods to flash and install Magisk, it worked then. Since then for whatever reason, whether it be to fix a soft brick or restore a backup, and having flashed the most recent (March 2020) stock ROM for this phone, never I repeat never have I gotten Magisk to take right. I don't know if it's Magisk or the security updates from Google or Motorola but it's made flashing root nonexistent, even yet while my bootloader is unlocked. Every thread here or on any Google search to install Magisk or root and install TWRP seems obsolete now. Anyone else have this problem And how to perhaps fix it? Am I the only one with such a problem? Thanks.
Click to expand...
Click to collapse
It's only possible to install twrp if you also install a GSI. Twrp will not work on stock. Magisk is also incompatible with twrp, the two can never be installed together no matter what. This is a magisk problem. Magisk uses the recovery partition, so it can use mirrors to make changes (systemless root). Twrp also needs to occupy the same place, because twrp is a custom recovery. Because of this conflict, they can't coexist. Magisk needs you to boot into "recovery" to boot the normal OS with root, and twrp needs you to boot into recovery to operate normally. So it's one or the other.
Unless the developer of Magisk decides to use system root, all newer devices will continue to have this problem. I highly doubt that will change anytime soon. The foundation of Magisk is built on being systemless, and so are all the modules for it.
If you want to use magisk, install the app, and patch your boot.img with it as "recovery", then flash it with fastboot. You must always "reboot recovery" to keep root afterwards.

Boot issues after removing magisk

Got the notice there was an OTA. As per instructions I tried uninstalling magisk and restore images. Got a toast notification saying no backups found.
Tried a complete removal of magisk, now stuck at the Bootloader unlocked screen.
Tried flashing the patched boot.img in fast boot and rebooting. Now I'm stuck on the boot animation.
Done with root on this phone, not worth the headaches. (TiBU was the only thing I use it for these days) Get me back to no magisk without loosing data.
[edit]
Ended up having to wipe litterly everything via recovery then it finally booted. :/
The patched image you're flashing won't work because you updated to 10.0.14. When updating, you're not supposed to uninstall Magisk, just disable the modules you have downloaded in the "Modules" section.
You need the updated root boot.img. I'll try to upload it later.
Snaxe123 said:
The patched image you're flashing won't work because you updated to 10.0.14. When updating, you're not supposed to uninstall Magisk, just disable the modules you have downloaded in the "Modules" section.
You need the updated root boot.img. I'll try to upload it later.
Click to expand...
Click to collapse
Thanks. At that point I hadn't installed the OTA update yet. I had just prepped by going into Magisk manager and (mistakenly) hit completely remove magisk. Which it did, then rebooted but left me hanging at the unlocked bootloader warning.
I tried flashing the patched boot.img from fastboot, and reflashing magisk from inside of the temporary twrp, but after a reboot I was left with the boot animation that never went away.
After I wiped it and got back in, I let it download the latest OTA and installed it.
So currently I'm at 10.0.14 now, but without root.

Bootloop after uninstalling Magisk any solution?

Hi guys i rooted my m30 using magisk for few months ago and i realized i cant use any bank application in my phone and that is really uncovenient. so i decided i want to unroot my phone, i tried to uninstalled the magisk from the application, after the system reboot my phone stuck in bootloop. the only way to escape the bootloop is to install magisk again. can someone help me to unroot my phone without any problem from bootloop? Any replies is appreciated
Bootloop after uninstalling​Experiencing a bootloop after uninstalling Magisk, either through the app or with the apk renamed to uninstall.zip and flashed through recovery, might mean that the boot image hasn't been restored correctly or that dm-verity otherwise triggers.
Try one of the following:
Restore your stock boot image (there's a copy of it stored in /data, named stock_boot_<sha1>.img.gz).
Flash a no-verity zip directly after uninstalling Magisk/restoring your stock boot image.
Dirty flash your ROM/factory image/firmware package.
Clean flash your ROM/factory image/firmware package.
contackcontact said:
Hi guys i rooted my m30 using magisk for few months ago and i realized i cant use any bank application in my phone and that is really uncovenient. so i decided i want to unroot my phone, i tried to uninstalled the magisk from the application, after the system reboot my phone stuck in bootloop. the only way to escape the bootloop is to install magisk again. can someone help me to unroot my phone without any problem from bootloop? Any replies is appreciated
Click to expand...
Click to collapse
Have u rooted ur device running on latest April 2021 patch? I also want to root but stuck....
Btw you can install latest firmware using odin it will solve all prblms

Categories

Resources