Help. Re-locked bootloader without reset. - OnePlus 7 Pro Questions & Answers

Hey guys. I had promised myself not to drink and flash but it seems the OP7P had me a bit out of sorts.
I rooted my phone then started flashing things until I tried Xposed and something went sideways. Couldn't boot out of Fastboot then I had the genius idea...
If unlocking the bootloader forces a factory reset re-locking should do the same should it not???
Here I am, way out of my depth. I thought it would be an easy fix like flashing the firmware like on a pixel. Flash-all bat and start over but I can't find firmware that I can easily flash.
Read a few tutorial about the mmstool or something but they all show my device's name as something other than android bootloader interface.
I'm just confused now. Was wondering if I could get some help flashing the stock firmware.
Any help is appreciated.

Yes , relocking will erase your phone as well but you've to restore everything back to default before relocking your bootloader.
Use MSM TOOL - https://forum.xda-developers.com/oneplus-7-pro/how-to/msm-tool-guac-t3934691
It'll restore back to out of the box default.

Related

Can't unlock bootloader after relocking it

So I tried to install TWRP which didn't work (said it flashed succesfully but when trying to enter it, it'd just reboot into the normal OS).
Then I tried to relock the bootloader and unlocking it again. The locking part did work, but now I can't seem to unlock it again using fastboot.
I've seen several threads with the same problem, and they have fixed it by flashing a zip, which I unfortuantely can't do that because my recovery won't let me..
Is there anyway to flash the stock recovery?
I still have access to ADB and Fastboot, so any help is really appreciated
Welp, somehow trying it multiple times after I left it alone for a while solved it

Lock/Unlock boot loader?

Can we re-lock the boot loader on Pixel devices if the device is rooted and modded with custom boot and recovery partitions? I heard that it will brick the device when you try to re-lock the boot loader.
Also what if recovery partition ever gets corrupted and a user never had enabled OEM unlocking for the boot loader in the developer option as set as default, and the boot loader is locked as is, user can'f flash the factory images and /or full OTA from ADB.
I'm no expert but from what I've read 'Never relock the bootloader unless you are 10000% sure it's full stuck' and if I remember correctly there is no recovery partition on A/B slot builds which is why a brick is a non recoverable scenario (check that out just in case I'm wrong)
I've unlocked my bootloader and it ain't getting relocked after reading through heaps of bricked pixel threads, best to be safe than bricked.
Yep @junglism93 is right, only re-lock bootloader if you are 100% stock and unrooted to avoid bricks. Also Pixel doesn't have a recovery partition, everything happens in the boot partition, that means that in case of problems if you don't want to reflash the whole factory image (which needs unlocked bootloader), you can just reflash boot.img on slot-a and slot-b (which needs unlocked bootloader anyway).
I unlocked my bootloader straight after the unboxing and I can tell it's like a life saviour, if any problem occurs you can always solve it with an unlocked bootloader.
TENN3R said:
Yep @junglism93 is right, only re-lock bootloader if you are 100% stock and unrooted to avoid bricks. Also Pixel doesn't have a recovery partition, everything happens in the boot partition, that means that in case of problems if you don't want to reflash the whole factory image (which needs unlocked bootloader), you can just reflash boot.img on slot-a and slot-b (which needs unlocked bootloader anyway).
I unlocked my bootloader straight after the unboxing and I can tell it's like a life saviour, if any problem occurs you can always solve it with an unlocked bootloader.
Click to expand...
Click to collapse
That seems like a crazy partition scheme on the device. I can't stand that dreaded unlock screen at the startup. plus you never know for sure if that OEM unlock switch in the developer menu will stay enabled all the time and not accidentally get disabled after modding your device so you're just having a very vulnerable device if it is modded...eh?
I wonder if there is a pure Android device which does not have such restrictions and/or actually comes pre-rooted?

When to re-lock bootloader after flashing Android 10

I was experiencing some minor glitches the past couple of weeks after taking the Android 10 OTA, so I decided to a factory reset and flash the Android 10 image. I had to unlock the bootloader to do that of course.
Now I'm realizing I need to re-lock the bootloader so that it's not in this insecure state. However I'm reading that re-locking the bootloader wipes the device (which returns it to Pie?) I'm also reading it can brick the phone if custom data is written.
When exactly do I re-lock the bootloader to preserve my clean install of Android 10?
terrapin01 said:
I was experiencing some minor glitches the past couple of weeks after taking the Android 10 OTA, so I decided to a factory reset and flash the Android 10 image. I had to unlock the bootloader to do that of course.
Now I'm realizing I need to re-lock the bootloader so that it's not in this insecure state. However I'm reading that re-locking the bootloader wipes the device (which returns it to Pie?) I'm also reading it can brick the phone if custom data is written.
When exactly do I re-lock the bootloader to preserve my clean install of Android 10?
Click to expand...
Click to collapse
If you're completely stock you can lock the bootloader. Before you do i would make sure you can boot into the stock recovery as sometimes flashing an ota in the stock recovery is the only way to recover your device if the bootloader is locked. Locking will wipe your device, but it won't change the operating system you're currently on. So if you're on andriod 10 it'll still be 10 after a wipe.

Best way to factory reset other than MSM tool?

Hey what's up.
Having issues and want to start from scratch but the MSM download tool isn't working for me due to driver issues I can't seem to resolve.
I'm unlocked and rooted with a custom kernel but otherwise totally stock.
Would I be able to just fastboot flash the stock boot.img and relock the bootloader for a total data wipe? Would that be enough to start fresh?
Go into magisk. Click uninstall. Click restore images. Your images should have been backup by the app. Reboot and reset from reset option in phone. No need to relock.
Thanks. Is that as good as the MSM tool as data wipes go? Want to get as fresh as I possibly can without MSM...
shadowofdeth said:
Thanks. Is that as good as the MSM tool as data wipes go? Want to get as fresh as I possibly can without MSM...
Click to expand...
Click to collapse
Boot to fastboot,
Code:
fastboot -w
what is the best way to relock the bootloader from Rooted( Magisk) and unlocked bootloader ? I did fastboot lock last time, I guess it locked successfully but refused to boot. Had to use msm to unbrick. Could you suggest best practice for Locking the bootloader again from rooted stock ?
rohanhole said:
what is the best way to relock the bootloader from Rooted( Magisk) and unlocked bootloader ? I did fastboot lock last time, I guess it locked successfully but refused to boot. Had to use msm to unbrick. Could you suggest best practice for Locking the bootloader again from rooted stock ?
Click to expand...
Click to collapse
Don't lock bootloader after rooting
Keinta15 said:
Don't lock bootloader after rooting
Click to expand...
Click to collapse
Then ? Should I unroot and then lock ?
Don't try to lock the bootloader
rohanhole said:
Then ? Should I unroot and then lock ?
Click to expand...
Click to collapse
You can't lock the bootloader while rooted. Your patched boot fails startup checks. The only phone i remember that you could root and relock was the oneplus one. There was a software hack to do a soft bootloader lock/unlock without wiping the data.
To expand on that, if you modified any locked partitions and try to relock the bootloader, you'll essentially soft brick. The only thing you can modify is I believe is userdata. If you are unsure, why take the chance, especially since your MSM isn't working.
Just do a factory reset from recovery lol or use fastboot

How to relock bootloader?

I factory reset my phone through TWRP after unlocking bootloader, rooting and bricking trying to get read write access.
But my bootloader is still unlocked and now preventing me from updating OTA update to Android 11.
As long as you remain unlocked you will not get updates. Just download the 11 stock ROM and fastboot it. You will be updated.
boltjuice said:
I factory reset my phone through TWRP after unlocking bootloader, rooting and bricking trying to get read write access.
But my bootloader is still unlocked and now preventing me from updating OTA update to Android 11.
Click to expand...
Click to collapse
You can get the firmware with LSMA
Rescue and Smart Assistant (LMSA)(Motorola/Lenovo Only)
Rescue and Smart Assistant LMSA: Lenovo's Motorola Smart Assistant (PC) For Lenovo and Motorola Devices Only Rescue and Smart Assistant (LMSA) is an official tool installs on PC. Can help to manage smart device (include all Lenovo android phone...
forum.xda-developers.com
I just downloaded it and ran the rescue but it just flashed the rom and is still unlocked.
Is there an option to re-lock bootloader with that tool?
What is your carrier and where did you get your phone? Not every bootloader can be unlocked.
Carrier is metro PCS. Model # XT2113-2
I did a factory reset. But I still get the message bootloader is unlocked when it boots.
I just want to re-lock it and revert it back to stock.
ADB code: fastboot oem lock
didnt work. Just made my phone not boot with error "no valid operating system could be found."
ADB code: fastboot oem unlock
restored it to booting again with same bootloader is unlocked message.
Any way to re-lock this?
boltjuice said:
Carrier is metro PCS. Model # XT2113-2
I did a factory reset. But I still get the message bootloader is unlocked when it boots.
I just want to re-lock it and revert it back to stock.
ADB code: fastboot oem lock
didnt work. Just made my phone not boot with error "no valid operating system could be found."
ADB code: fastboot oem unlock
restored it to booting again with same bootloader is unlocked message.
Any way to re-lock this?
Click to expand...
Click to collapse
Re locking is not advisable, can be tricky with Moto devices
Re-Locking see Post #4
I'm a little unclear what state your device is in atm.
I just downloaded it and ran the rescue but it just flashed the rom
Click to expand...
Click to collapse
but then you write
I just want to re-lock it and revert it back to stock.
Click to expand...
Click to collapse
"it just flashed the rom" implies to me that the moto rescue software flashed a stock image so you now should be back to stock (I'm not sure what was downloaded tho). Regardless of how you flash (moto's rescue tool or by using fastboot with the device booted into the bootloader), I'd recomend using an image specific to MetroPCS (assuming the device was originally a metroPCS device and not something else like retus) and not one older than the last stock version flashed to your device.
It might help to boot your device into the bootloader, and then record the output of
Code:
fastboot getvar all
the lines with `ro.build.fingerprint` (perhaps also ro.carrier) in them will tell you what bootloader is currently running on your device and should help you figure out what the last stock version was flashed to your device.
HTH
notmyrealhandle said:
I'm a little unclear what state your device is in atm.
but then you write
"it just flashed the rom" implies to me that the moto rescue software flashed a stock image so you now should be back to stock (I'm not sure what was downloaded tho). Regardless of how you flash (moto's rescue tool or by using fastboot with the device booted into the bootloader), I'd recomend using an image specific to MetroPCS (assuming the device was originally a metroPCS device and not something else like retus) and not one older than the last stock version flashed to your device.
It might help to boot your device into the bootloader, and then record the output of
Code:
fastboot getvar all
the lines with `ro.build.fingerprint` (perhaps also ro.carrier) in them will tell you what bootloader is currently running on your device and should help you figure out what the last stock version was flashed to your device.
HTH
Click to expand...
Click to collapse
I factory reset the phone. Everything gets reset except for the unlocked bootloader does not re-lock... which prevents me from OTA update to Android 11.
Ok. If I understand correctly, your post with "it just flashed the rom" means a factory reset (and no flashing an image via moto's rescue tool or fastboot) - my misunderstanding.
As I mentioned to you in my reply to your PM, I don't use stock other than to initially get the bootloader unlocked, test a few things, and occasionally verify that my device still works on stock.
Others posting in this thread have offered helpful and safe suggestions - consider following these. I do a fair amount of "risky" tweaking with custom roms so please be cautious about the following suggestions/observations. (Apologies if my comments below seem basic - it looks like you've tried some fairly sophisticated tweaking of your own but it's hard to judge others skill level in a forum.)
Based on your comment:
made my phone not boot with error "no valid operating system could be found."
Click to expand...
Click to collapse
I suspect your phone wont boot after re-locking due to prior modifications to it's OS, the evidence of which can survive a factory reset. Re-locking enables android to verify that certain parts of the OS have not been modified and if it detects a difference, the device won't boot.
If you insist on re-locking your device now, I think the only way to accomplish that is to re-flash your device with the correct factory (aka stock) image some of which are available on lolinet. This is much more than a "factory reset." The instructions linked by sd_shawdow above should help with this:
Re-Locking see Post #4
Click to expand...
Click to collapse
Choosing the correct factory image is important. For example, I have a XT2113-2 RETUS. At one point early on when I was playing with this device, I tried flashing the TMO variant which is also a XT2113-2 model. My device did not boot until I re-flashed a RETUS variant. It's possible I just made a mistake while trying to flash the TMO variant I can't be certain at this point. If your phone was originaly (meaning new out of the box) a MetroPCS variant, make sure you flash a MetroPCS image.
Android also has roll back protection to prevent reverting to an older image that might have security flaws. The roll back "index" can be written to persistent storage on your phone that not only will survive factory resets but likely also survives flashing factory images. Motorola's implementation of roll back protection does not seem consistent with what I've read online from android/google. I'm pretty sure I had the most recent Android 10 RETUS bootloader on my device but I was able to flash an older factory image and then relock the device while on stock. (As I mentioned in my PM, I have not tried re-locking stock android 11). This observation may be the result of a motorola bug specific to RETUS so don't count on this working for you. Flash an image that is the same as or newer than the newest factory image you've ever had on the device.
Moto's rescue tool apparently can select and download an image for you making the process of image selection easier. I have not used this tool so I don't know how smart it is. Trust your knowledge about what you've done with the device since you owned it.
Lastly, it looks like the OEM unlocking toggle issue I and others have observed upon upgrading to Android 11 is resolved by connecting the device to your carrier and waiting several days. If you don't mind the wait, it's probably safe to flash android 11 (by using an image form lolinet and fastboot or by using the moto rescue tool - not via ota) while the device is unlocked and then re-locking the device.
Sorry about the long post.
HTH.
EDIT: I prefer not to be PM'd. Please just communicate (with me) in the open.
I was on Lineage 19.1 on my 5g ace. When I heard about the version 11 software for Retail US, I went to the lolinet mirrors to download the firmware for my phone.
Make sure oem unlocking in the developer options menu is off. If you can't turn it off you will need to root your phone.
Make sure USB debugging is on and you allow access for the pc your using.
Start adb and verify it sees your phone. If so, type...
reboot bootloader
Verify fastboot is authorized
Use Motoflash Pro to flash the version 11 firmware to my phone. Motoflash can be downloaded from the one 5g ace telegram channel. When it is done close Motoflash Pro and then from your pc use adb to run:
fastboot oem lock
Your phone will ask you if you want to relock bootloader. Choose Yes
Now reboot to the stock recovery and then use power + Volume up to access the recovery menu.
Navigate down to factory reset and select. It will warn you ... Blah blah blah. Now choose reboot system.
Moto boot logo should appear and then setup should begin.
Hopefully this helps someone.

Categories

Resources