Is there a way to unlock OEM from fastboot or recovery? - Xiaomi Mi 5X Questions & Answers

I cannot boot to system for another reason (fake ROM issue, installed original mi5x rom it bootloops, so I cannot go to system and follow their instructions to unlock it properly). Hence it is preventing me from installing TWRP and fix my phone.

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

[SOLVED] Device recognized in recovery (TWRP) but not in bootloader?

Solution: Not sure why or how, but I got it to actually boot into the new system that I flashed. Now all is good and working as it should
So rooted stock ROM, but with TWRP, unlocked boot loader and USB debugging enabled... I'm No stranger to flashing custom ROMs in TWRP and flashing stock ROMS longhand by fastboot commands.
Using MacOS with latest platform-tools...
So today I decided to flash resurrection remix. Downloaded it to storage as usual for flashing via TWRP, flashed it successfully. Only it would not boot. It started going to the stock boot screens and said it could not decrypt... or something.
Anyway where I am right now is that I can boot into TWRP or boot loader just fine. But in boot loader I can't get get it to see my phone using
Code:
./adb devices
Only... for some reason in TWRP if I do ./adb devices, it sees my phone and reports back the correct device ID.
What now? I want to flash back to stock again, but I don't know how to flash line by line without being in boot loader. But in boot loader I can't see the phone?
I know there has to be hope if I can see it in TWRP. But I have no system I can boot to.
-Peter
Great that it works for you now.
For what it's worth, I think that the reason it didn't boot was that the stock rom had encrypted your phone. Current custom roms unfortunately use a different encryption, so that the whole data partition needs to be formatted. I assume that's what you ended up doing.
As to the bootloader, it was never intended to work with adb, only with fastboot.

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