Installing Magisk Relocks the Bootloader - Xiaomi Redmi 8 Questions & Answers

Hi,
I recently bought a Redmi 8 and installed Magisk through TWRP. It gets installed successfully but relocks the bootloader at the software level (unlock status in developer options says the phone is still locked, but the boot animation says the phone is unlocked).
My Issue is that I cannot perform any root action and I believe the relocked bootloader is the cause. How can I fix this?
I've tried pulling the unlocked the boot.img through adb and patching it through the magisk app but that also has the same result.
Any help will be greatly appreciated.

uz3390 said:
Hi,
I recently bought a Redmi 8 and installed Magisk through TWRP. It gets installed successfully but relocks the bootloader at the software level (unlock status in developer options says the phone is still locked, but the boot animation says the phone is unlocked).
My Issue is that I cannot perform any root action and I believe the relocked bootloader is the cause. How can I fix this?
I've tried pulling the unlocked the boot.img through adb and patching it through the magisk app but that also has the same result.
Any help will be greatly appreciated.
Click to expand...
Click to collapse
If anyone is having the same problem, it took me a while but I was able to fix it. Another is issue was the recovery kept getting wiped with every reboot and I think this was causing the above issue.
These are the steps I took to fix it-
1. Download the respective rom for your phone (I used a stock global rom)
2. Extract the rom, in it there is a folder called images and in that folder there is a file called vbmeta.img. Save this file to your fastboot folder.
3. After you flash the recovery, flash the vbmeta.img using this command "fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img"
After doing the above, I was able to flash magisk and get the root working.
Thanks to @J0SH1X (For the fastboot command to disable the avb)

Related

Re-Lock bootloader?

I unlocked my bootloader, installed twrp and several roms to try them out, then decided to go back to stock. Currently have OOS 3.5.4 installed with stock recovery (that came with the toolkit). However, whenever I try to lock the booltloader again, the phone won't boot up. It will bootloop, or just stay off with the led glowing white. I tried to sideload the stock ROM from OnePlus, but it fails after about 45% completion. I tried both 3.5.3 and 3.5.4 and both fail after about 45%. The only way to get the phone to boot again is by unlocking the bootloader again, then it boots just fine. Tried unlocking with the toolkit as well as fastboot oem lock. Both give me the prompt on the phone, then wipe the phone and go into the bootloop.
Any suggestions on how to re-lock the bootloader? I want to be able to get the OTA update, which I think will fail with an unlocked bootloader. Note, I have also tried loading the Nougat update from settings - system update - local upgade (both full and update) and they also fail to load shortly after booting to recovery.
Thanks,
TR
Instead of using the toolkit, try just doing it manually.
fastboot oem lock IS the correct way to lock the bootloader.
If you're running into all those issues, try to reflash the stock rom from the official site. OR try this
NOTE: This WILL wipe everything on your phone so make a backup first!
First Unlock booloader​1. On your phone go into Developer screen (Settings --> Developer Options)
If you don't have this go back to Settings --> About Device. Tap "Build number" 7-10 times to unlok developer options
2. In Developer Options turn on "USB Debugging" and "OEM Unlock"
3. Open ADB in command prompt and go to the directory where ADB is.
Type adb reboot bootloader
4. Once your device is in fastboot mode, type in fastboot devices to make sure your device is listed
5. Type in fastboot oem unlock to unlock your device bootloader
You can check to make sure it was properly unlocked by typing in fastboot oem device-info.
6. Reboot into your system
Files we need​7. Download the following files:
TWRP - https://build.nethunter.com/test-builds/twrp/oneplus/twrp-3.0.2-0-oneplus3t.img
No-verity-opt-encrypt - https://build.nethunter.com/android-tools/no-verity-opt-encrypt/no-verity-opt-encrypt-5.0.zip
Magisk - http://tiny.cc/latestmagisk
Phh-Superuser - https://forum.xda-developers.com/attachment.php?attachmentid=3988488&d=1483407725
Latest Stable Nougat Rom - http://otafsc.h2os.com/patch/amazon...s3TOxygen_28_OTA_035_all_1612310259_2dc0c.zip
8. Copy all the files to your phone (keep the original on your pc just in case)
9. Load back up to fastboot mode
In ADB type adb reboot bootloader
10. Flash twrp img we downloaded above by typing
fastboot flash recovery twrp-3.0.2-0-oneplus3t.img
11. After this reboot into the system
Install all of our downloaded files through TWRP​12. Now boot into recovery by issuing the following ADB command
adb reboot recovery (you should go into TWRP)
13. Once you're in twrp flash the "no-verity-opt-encrypt-5.0.zip" file OR you can format the data partition to f2fs to prevent the dm-verity error.
14. Now install the stock stable nougat rom we downloaded above
15. Do a factory system wipe / cache & dalvik
16. Install magisk through TWRP
17. Wipe cache/dalvik
18. Install phh SuperUser
19. Now reboot into the system normally.
NOTE: This *COULD* take a while since you did a clean install of nougat so just be patient and you should be good to go after this.
Thanks for the reply.
I did do fastboot oem lock, and it results in an unbootable system. fastboot oem unlock makes it bootable again. Not sure why. Also, whenever I do adb sideload <any_rom> it fails after about 45%. Not sure what's happening. Your instructions would get me to Nougat with TWRP and an unlocked bootloader, which may be what I end up doing, but I was trying to get back to fully stock, and locked again, so that OTA's will work properly. If nothing else works, I will go the route you suggest above.
Thanks again!
I just figured I'd try to get you to a working system/phone. After you get all that working you can probably lock your bootloader back to default. Now, I'm not 100% sure, but I believe that if you have a custom recovery you will need to restore that to stock as well before setting the bootloader back to locked.
TXRangerXDA said:
I unlocked my bootloader, installed twrp and several roms to try them out, then decided to go back to stock. Currently have OOS 3.5.4 installed with stock recovery (that came with the toolkit). However, whenever I try to lock the booltloader again, the phone won't boot up. It will bootloop, or just stay off with the led glowing white. I tried to sideload the stock ROM from OnePlus, but it fails after about 45% completion. I tried both 3.5.3 and 3.5.4 and both fail after about 45%. The only way to get the phone to boot again is by unlocking the bootloader again, then it boots just fine. Tried unlocking with the toolkit as well as fastboot oem lock. Both give me the prompt on the phone, then wipe the phone and go into the bootloop.
Any suggestions on how to re-lock the bootloader? I want to be able to get the OTA update, which I think will fail with an unlocked bootloader. Note, I have also tried loading the Nougat update from settings - system update - local upgade (both full and update) and they also fail to load shortly after booting to recovery.
Thanks,
TR
Click to expand...
Click to collapse
I also have the same problem, after the bootloader lock the phone does not start.
I tried with all the possible procedures, also even the rom flash in local and sideload it does not work, It comes to 45% and then fails.
we will highlight the problem, so everyone will know and maybe there is a solution
m0d hipp¥ said:
I just figured I'd try to get you to a working system/phone. After you get all that working you can probably lock your bootloader back to default. Now, I'm not 100% sure, but I believe that if you have a custom recovery you will need to restore that to stock as well before setting the bootloader back to locked.
Click to expand...
Click to collapse
But of course, you can't relock phone with a non standard recovery. Replace TWRP with the ROMs real recovery and relock will work again.
That's what I figured. Thanks for the confirmation.
Use the unbrick tutorial to go back to stock
This is what i did
https://forum.xda-developers.com/oneplus-3t/how-to/unbrick-unbrick-tutorial-oneplus-3t-t3515306
pitrus- said:
But of course, you can't relock phone with a non standard recovery. Replace TWRP with the ROMs real recovery and relock will work again.
Click to expand...
Click to collapse
I'm sorry, even with the stock recovery but does not work, it was the first thing I did
You can a unbick tutorial. It worked for my OnePlus 3T. Just search up How to unbrick (whatever OnePlus device you have) on Google. Then follow all the instructions carefully. If you need help with it I could try to do a remote session with you. Edit: It will erase all data and you will boot with oos 3.5.3 ( I also had the same issue as you. But I couldn't install any zip with stock recovery or adb side load.
Haven't seen nothing on the fórum about this particular subject, locking the bootloader seems a problem in this phone
enokack said:
Haven't seen nothing on the fórum about this particular subject, locking the bootloader seems a problem in this phone
Click to expand...
Click to collapse
Only if you have modified the phone in some way or another (like rooting and installing twrp) before trying to re-lock.
If you keep it stock, you should be able to re-lock. Or else, just use the Qualcomm restore method to re-lock.
tried this
OK what i did was when the phone was starting and vibrating I push the power bottom and volume down bottom at the same time ,then i connected the phone to the PC,from the panel in the phone there are 3 categories to erase everything on the phone I did it all(1,2,3) and then I put the phone in ADB mode from the control panel in the phone,After that I flash via fastboot the original .zip from one plus for the version 4.0.3 (1.4 GB) ,when it finished I restarted and the phone started normal again,I hope this help someone alse,I was so desesperated:silly:.
I think the problem in re-locking it is the modified boot image. Locked bootloaders don't support those.
re-locking bootloader will getback the warranty ???
No solutions till now
enokack said:
Haven't seen nothing on the fórum about this particular subject, locking the bootloader seems a problem in this phone
Click to expand...
Click to collapse
Its three easy steps, no need to use any toolkit just follow the instructions. https://forums.oneplus.net/threads/...-3-3t-and-go-back-completely-to-stock.456232/
Abrar123 said:
re-locking bootloader will getback the warranty ???
Click to expand...
Click to collapse
Unlocking the bootloader does not void the warranty on this device:
https://oneplus.net/support/answer/will-rooting-or-unlocking-the-bootloader-void-my-warranty
Once I have root, is there a command to re-lock and later eventually unlock the bootloader again?
I remember this was possible with google nexus devices, there was a shell command (require root) that was able to change bootloader status

Rooting Problems Need Help

Hi I'm a new Android user and don't know much about it :'( I recently got my OnePlus 3T and I wanted to root it
so I followed a tutorial video from YouTube successfully unlocked bootloader and flashed twrp recovery then I tried to install SuperSU... well it installed but the device got soft bricked when I rebooted after finishing the installation and wiping cache/dalvik
then I format/factory reset everything using twrp recovery and it's working now but the device isn't rooted :'( tried to install SuperSU again and it got bricked again
Also I'm getting these messages on the startup screen-
1st one: Your device has been unlocked and can't be trusted. If you don't want to see this screen please lock your device by "fastboot oem lock" and erase user data.
2nd one: The dm-verity is not started in enforcing mode and may not work properly.
(My os version is 4.1.7)
device OP 3t A3010
plz help me :'(
The 1st and the 2nd msg that gets displayed is shown because the bootloader is unlocked..
Bootloops are common while flashing su...when I flashed super su for the first time, I got 3 or 4 random reboots and took almost 7 to 10 mins for the phone to boot up..
I would suggest using Magisk as a rooting method instead of SuperSU. If you use SuperSU then some apps can detect root and object to you being rooted and Google's SafetyNet gets triggered. Magisk solves this by trying to hide root from apps and Google so that you can use your device as if it wasnt rooted at all (but in fact is rooted). Go the the Magisk forum and download Magisk 13.3 zip from there.
I am assuming you are using OxygenOS (Oneplus's software) and not a custom ROM. Download the Open Beta or Stable build from here/
These steps will erase all the data on your phone permanently (including internal storage) so please backup anything in there.
To fix the DM verity error youll have to follow the steps outlined here
Once you have fixed that, flash oneplus recovery via fastboot which you can download here
To flash it go to fastboot mode, and cd into the folder where you downloaded it. Run the command 'fastboot flash recovery <RECOVERY_NAME>'.
Then run the command 'fastboot oem lock' to lock the bootloader. After you confirm the prompt on screen, the phone will boot into the recovery and youll see a progress bar. Once the progress completes and the screen turns off, be ready to immediately go back to fastboot mode by pressing volume up and power.
When you enter fastboot mode again, run the command 'fastboot oem unlock' and follow the same steps as before.
Once you are in fastboot mode, the phone is now in a clean state with no OS.
Follow the steps outlined on the oneplus website to flash a clean OxygenOS build (stable or open beta as per your taste)
Once the flashing is complete you have to let the phone boot up completely once. When you get to the setup screen, go through it and reach the launcher.
Now we flash TWRP recovery. Reboot to fastboot again. Flash TWRP recovery (I personally use blu_spark's twrp but you can use one of your choice). When it is done, boot into the recovery. Youll now be able to copy magisk zip into the internal sd. Do that, and flash it. Reboot.
Youll now be rooted. If you have any problems holla at me.

Unable to boot images via Fastboot

Hi,
Recently I updated my EMUI firmware via the official OTA system.
I had the bootloader unlocked prior to installing the update however afterwards the bootloader was locked. I have verified this in Fastboot.
I wish to flash Magisk on my P9 Plus, however, I have a bootloader unlock code (back when Huawei gave them out freely) however I don't want to unlock the bootloader as it will factory reset (I spent a long time setting everything up).
I tried flashing a TWRP image however the bootloader prevents it as it is not unlocked.
The only other method would to boot the custom recovery image however when executing fastboot boot recovery TWRP twrp-3.1.1-1-vie.img it gives FAILED (remote: Command not allowed). I had noticed this inability to boot images even when I had the bootloader unlocked (I did not want to overwrite the stock recovery or eRecovery for easier OTA updates).
I have the Chinese variant of the P9 Plus : VIE-AL10 Full Netcom Edition.
Is anyone else having this problem? Please let me know if or how to fix this.
Thanks
It's been a while since I last used fastboot boot but if i remember correctly the command is "fastboot boot recovey.img, without that" recovery" in between
if the bootloader is locked you cant flash magisk or any other, also you cant boot with any images

Help! I really screwed up...

It all started when I tried to temporarily boot into the TWRP img file. It didn't work so I tried flashing the file to boot_a. Then I installed TWRP through the installer (stupidly didn't wipe the caches) and... Well. When I try to boot into System through TWRP, it gets COMPLETELY stuck at the powered by Android logo screen. No amount or combination of button holding will shut it off and I actually had to let the battery (thank you SO MUCH for non-removable batteries by the way, smartphone manufacturers >_>) drain before it would actually boot again. Rebooting it into Download mode will get it stuck in there too where every time I hold the power button and shut it off, it will just reboot right back into Download mode again. And now, here's probably the worst part. I CAN'T UNLOCK the critical partition to flash when in Download mode, so I can't use the OST tool! When I try to unlock it, it just complains that flashing unlock is not allowed even though the rest of the bootloader is completely unlocked.
TL;DR - When I power the phone up it goes straight into TWRP. Booting to System totally freezes it and the Bootloader puts it in a loop when I try to power it off. Critical partition is locked for some reason. I CAN get around the bootloader loop though and get back to TWRP by switching active slots and rebooting.
Did you flash the TWRP installer to your active boot partition or your inactive one? If you flashed it to the active one, you can't get into system anymore because TWRP is your boot partition.
If you are on Oreo, and you flashed to the inactive slot, and then patched the active slot, you have to reboot into the active slot recovery and flash the Magisk installer to disable verification of the partitions.
If you can get into the bootloader, and you still have the unlock key from nokia, do fastboot flash unlock <unlock.key>, and then fastboot oem unlock_critical. Then you should be able to flash using OST.
THMSP said:
do fastboot flash unlock <unlock.key>, and then fastboot oem unlock_critical. Then you should be able to flash using OST.
Click to expand...
Click to collapse
This unlocked it! Thank you! <3
I also did have an issue with the OST tool complaining that the updater was out of date, but changing the .mlf file and leaving it unpacked when I opened it in OST seemed to make it work perfectly. My phone is now booting just fine and back to stock!
Now I just need to solve the original problem I had. How can I install TWRP to recovery since the img file wouldn't temporarily boot last time?
EDIT: Apparently unlocking the critical partition seemed to solve the problem of the TWRP image file not temporarily booting as well!
S5Guy said:
EDIT: Apparently unlocking the critical partition seemed to solve the problem of the TWRP image file not temporarily booting as well!
Click to expand...
Click to collapse
No, thats because you flashed back the May firmware, where fastboot boot was still working properly. It only broke after the august update. If you want TWRP on newer security patch versions, you can get it here: https://bit.ly/nokia-nb1 in the folder "Boot Images". Those images are prepatched, you can safely flash them to your active boot partition. It also contains stock images for restoring before updating.
THMSP said:
No, thats because you flashed back the May firmware, where fastboot boot was still working properly. It only broke after the august update. If you want TWRP on newer security patch versions, you can get it here: https://bit.ly/nokia-nb1 in the folder "Boot Images". Those images are prepatched, you can safely flash them to your active boot partition. It also contains stock images for restoring before updating.
Click to expand...
Click to collapse
Yeah looks like you're right. Letting it update back to Android 9 deleted TWRP and made fastboot boot for TWRP nonfunctional again.
Wait, so can I use that TWRP boot image you specified to boot temporarily to TWRP and then run the installer zip? Or will that not work and I'll have to flash the img directly from the bootloader?
S5Guy said:
Wait, so can I use that TWRP boot image you specified to boot temporarily to TWRP and then run the installer zip? Or will that not work and I'll have to flash the img directly from the bootloader?
Click to expand...
Click to collapse
You have to flash it directly to your boot partition. fastboot boot will work for nothing (and even if it worked those images would just send you directly into the system)
THMSP said:
No, thats because you flashed back the May firmware, where fastboot boot was still working properly. It only broke after the august update. If you want TWRP on newer security patch versions, you can get it here: https://bit.ly/nokia-nb1 in the folder "Boot Images". Those images are prepatched, you can safely flash them to your active boot partition. It also contains stock images for restoring before updating.
Click to expand...
Click to collapse
Alright! fastboot flash boot_a (TWRP image) worked! Thank you so much for all the help. <333

Question Can't find valid os??

I was locking my bootloader to try to reroot and pass safetynet. So, I factory reset it, set it up, and then went into the bootloader and typed "fastboot flashing lock". I selected yes to confirm the locking of my bootloader and then my phone rebooted. But now my phone says "Can't find valid operating system" and I can't boot into Android. i was able to unlock the bootloader again but now i don't have magisk installed and I can't even boot into Android to install anything. Is there anything i can do to fix this?
Yes, if you're bootloader is unlocked then you can fastboot flash (or use Chrome web based Android Flash Tool) factory images from https://developers.google.com/android/images
If you want to root extract the boot.img from the zip and patch with Magisk, then fastboot flash boot magisk_patched.img after you boot the phone once on stock unrooted kernel.
Thank you. I did it with the flash tool. Then later, it happened again and I realized I could use the boot.img. I'm glad these Google pixels are noob friendly.
Never lock your bootloader unless you know for a fact that you are on bone stock OEM firmware.

Categories

Resources