Unrooting and re-locking bootloader? - Moto G4 Questions & Answers

Is there any way I can unroot my G4 and re-lock the bootloader (fully, removing the message), after doing it I realise I might not get OTA updates and the reason I rooted in the first place is no longer needed. Thanks

ethantownley said:
Is there any way I can unroot my G4 and re-lock the bootloader (fully, removing the message), after doing it I realise I might not get OTA updates and the reason I rooted in the first place is no longer needed. Thanks
Click to expand...
Click to collapse
Reflash stock firmware via fastboot, then issue command "fastboot oem lock", although it'll change the bootloader state to "relocked" instead of the factory "locked".

Related

[Q] bootloader issues

So a while ago I rooted my phone but messed it up because I uninstalled a few too many system apps. I just dealt with it for a few months since I could still make calls (but not much else). I finally bit the bullet to look into flashing the stock rom again, but to do so it looked like I had to install a custom recovery, but to do that, unlock the bootloader. So I first unlocked the bootloader using motopocalypse (batch file didn't work but apk did), and got the expected BOOTLOADER UNLOCKED message at bootup, with fastboot saying unlocked, code 3. I then tried flashing CWM recovery via Rom Manager, and it seemed successful, but I was unable to boot to it either from the UI of ROM manager or from holding the buttons during bootup, it would just hang for a few more minutes than normal at the BOOTLOADER UNLOCKED screen, then boot up like normal. So I kept reading, found RSDlite, and was able to flash the stock rom, which I downloaded from the internet and the phone boots up fine, but now fastboot says locked, status code 2, and motopocalypse does not unlock it again (either the batch file or the apk), but I still get the BOOTLOADER UNLOCKED message at bootup. So I'm not sure if my bootloader is unlocked or not and if I can proceed with installing CWM recovery again, so i can make a full backup in case I mess something up again.
So how do I reunlock the bootloader, or verify if it's locked or not?
First, CWM and TWRP aren't official for this phone, so you can't use their apps to flash. You'll need to use fastboot, Flashify, or Rashr. Second, you're still unlocked, we've seen this error come from bad flashes. What is the complete text on your FB screen. You should be able to clear this by re-flashing with RSD. What firmware did you attempt to flash?
Sent from my HTC6525LVW using Tapatalk
RikRong said:
First, CWM and TWRP aren't official for this phone, so you can't use their apps to flash. You'll need to use fastboot, Flashify, or Rashr. Second, you're still unlocked, we've seen this error come from bad flashes. What is the complete text on your FB screen. You should be able to clear this by re-flashing with RSD. What firmware did you attempt to flash?
Sent from my HTC6525LVW using Tapatalk
Click to expand...
Click to collapse
FB screen:
Code:
AP Fastboot Flash Mode (S)
10.9B(*) (sha-61146a2, 2014-05-02 00:54:39)
eMMC Info: Size 8GB
Device is LOCKED. Status code: 2
Battery OK
Transfer Mode:
USB connected
Fastboot reason: Reboot to bootloader
usb connected
I've tried reflashing with RSD previously but no change. I could try it once more if you want.
Not entirely sure what you're asking for with the firmware version, but the image I used was for android 4.4.2, version 183.46.10.XT907Verizon.en.US.
modemman11 said:
Device is LOCKED. Status code: 2
Click to expand...
Click to collapse
I think your boot loader is still LOCKED. Mine is showing UNLOCKED. Status code: 3. You cannot flash a custom recovery on a phone with a locked BL. You need to motocalypse again!
To trace the issue from the ground up, if you're just trying to reinstall stock ROM, you should be relying on RSD instead of trying to mess with custom recoveries and BL unlocking. Just flash .10 (not .15) via RSD, root via Towelroot and you can start fresh.
Unlocking your BL is still highly recommended, though, 'cuz it's now or never.
Sent from Google Nexus 4 @ CM11
[WARNING: XDA Premium 4.0.13 lacks Signature function - do not update]
Code 3 as well.
Sent from my XT907 using XDA Free mobile app
rahimali said:
I think your boot loader is still LOCKED. Mine is showing UNLOCKED. Status code: 3. You cannot flash a custom recovery on a phone with a locked BL. You need to motocalypse again!
Click to expand...
Click to collapse
Yes, that's why I'm asking. So I've got one vote for unlocked, one for locked. As I said though, motopocalypse isn't working a 2nd time.
AndyYan said:
To trace the issue from the ground up, if you're just trying to reinstall stock ROM, you should be relying on RSD instead of trying to mess with custom recoveries and BL unlocking. Just flash .10 (not .15) via RSD, root via Towelroot and you can start fresh.
Unlocking your BL is still highly recommended, though, 'cuz it's now or never.
Click to expand...
Click to collapse
I would like to flash custom ROMs later down the road, but for now I just want to get the stock stuff going.
On a side note, the version of the image I downloaded was 183.x.x, but my mother, who has the same phone, purchased at the same time, and has never rooted it or anything, has version 182.something, and that is also the version I had before I started messing with the bootloader/recovery stuff. The two versions were released at the same time, but I don't know what determines which version you got if you just did OTA updates, or if it even matters. Speaking of OTA updates, the version I downloaded is prompting me to do an OTA update now to another 183.x.x version. I wonder if I'd be able to grab the 182.x.x ROM from my mom's phone without rooting it via fastboot or something.
The 182/183 does not matter regarding root/boot loader unlock its the .10/.15 that matters do not take the .15 without unlocking your boot loader....
We cannot teach people anything; we can only help them discover it within themselves.
So no other thoughts? What would happen if I flashed a custom rom/recovery with a locked bootloader? I tried flashing the ROM again and fb still says locked, code 2, and motopocalypse still doesn't do anything like it did the first time.
modemman11 said:
What would happen if I flashed a custom rom/recovery with a locked bootloader?
Click to expand...
Click to collapse
It won't let you flash a custom recovery. This is the difference between locked and unlocked.
modemman11 said:
So how do I reunlock the bootloader, or verify if it's locked or not?
Click to expand...
Click to collapse
If your bootloader is relocked for some reasons, try unlocking it again with
Code:
fastboot oem unlock
lem22 said:
It won't let you flash a custom recovery. This is the difference between locked and unlocked.
Click to expand...
Click to collapse
I guess what I'm asking is, will it let me flash it but then the phone won't work or will give an error on boot, or perhaps brick my phone? Or will it just not flash in the first place? Because if it's the latter, then I can just try to flash a custom ROM/recovery and if it works then I know it's unlocked.
If your bootloader is relocked for some reasons, try unlocking it again with
Code:
fastboot oem unlock
Click to expand...
Click to collapse
Code:
D:\adt-bundle-windows-x86-20140702\sdk\platform-tools>fastboot oem unlock
...
(bootloader) fastboot oem unlock [ unlock code ]
OKAY [ 0.031s]
finished. total time: 0.031s
Still locked code 2 though. Looks like it wants an unlock code from Motorola's website, I tried following the steps to get the code but it says I'm not eligible for bootloader unlock. So unless there's another way to get the unlock code...
modemman11 said:
I guess what I'm asking is, will it let me flash it but then the phone won't work or will give an error on boot, or perhaps brick my phone? Or will it just not flash in the first place? Because if it's the latter, then I can just try to flash a custom ROM/recovery and if it works then I know it's unlocked.
Click to expand...
Click to collapse
A "Code 0" locked device would refuse flashing an unofficial or older recovery. I have no idea about Code 2 though.
From what I was able to locate status code 2 indicates that the bootloader has been unlocked and relocked like by doing the whole "fastboot oem unlock unlock code" then the "fastboot oem lock" ... I'll look more into it but from what little I read it looks like it can not be unlocked again with out the Motorola unlock code...
We cannot teach people anything; we can only help them discover it within themselves.
ezknives said:
From what I was able to locate status code 2 indicates that the bootloader has been unlocked and relocked like by doing the whole "fastboot oem unlock unlock code" then the "fastboot oem lock" ... I'll look more into it but from what little I read it looks like it can not be unlocked again with out the Motorola unlock code...
We cannot teach people anything; we can only help them discover it within themselves.
Click to expand...
Click to collapse
Same here, I can see what it means but cannot find any way to get back to code 3 other than using the unlock code from Motorola, which I am unable to obtain because it says I am not eligible. Surprising that someone hasn't cracked the unlock code yet or made a keygen, people are so eager to do it with pirated computer software before the software is even released.
I've read of someone getting locked status code 2 b4 from flashing an older gpt with rsd (if I remember correctly) I think all that was required to fix it and get unlocked again was to flash the latest gpt. Very important..... Are you sure when you were unlocked you didn't ota update to .15? Because flashing .10 gpt while on .15 may be what caused your false relock
Nope, no OTA update to .15. The ZIP I have of the rom does include the gpt.bin file with the same timestamp as all the other files. I suppose I could try reflashing the whole rom once again later...
Hmm strange, I went to find the old thread I read about the gpt relock issue but it's not exactly the same as your situation.
http://forum.xda-developers.com/showthread.php?p=51436123
Until now I didn't think relock was possible due to the way unlocking works. It's a physical change, a qfuse was blown when the motopocalypse apk was run the first time. It can't be unblown lol. Wish I knew what went wrong here.

Is there a way to lock the bootloader?

I see plenty of guides on how to unlock the bootloader which as I understand voids the warranty. Is there any way to relock the bootloader if I need to? Maybe someone could link me to a guide?
I've had bad experiences with dodgy solder in 3 LG G4 handsets so I sort of see the value in a manufacturer's warranty these days.
In fastboot
"Fastboot oem relock YourCode"
Fastboot relock still show that the phone was unlocked before but to revert to original state you have to flash stock firmware using this guide https://forum.xda-developers.com/mate-9/how-to/guide-rebrand-chinese-al00-mate9-to-t3554656/page57
This will lock the bootloader without any trace
Many many thanks.
gm007 said:
Fastboot relock still show that the phone was unlocked before but to revert to original state you have to flash stock firmware using this guide https://forum.xda-developers.com/mate-9/how-to/guide-rebrand-chinese-al00-mate9-to-t3554656/page57
This will lock the bootloader without any trace
Click to expand...
Click to collapse
Hi can you write me step by step how lock again bootloader becuase i read this link and i dont know how. Please.
I want debrand my P10 to clear soft Huawei and again lock boot loader to have full warranty. please help me
gm007 said:
Fastboot relock still show that the phone was unlocked before but to revert to original state you have to flash stock firmware using this guide https://forum.xda-developers.com/mate-9/how-to/guide-rebrand-chinese-al00-mate9-to-t3554656/page57
This will lock the bootloader without any trace
Click to expand...
Click to collapse
Is the adb relock bootloader "Code" command connected with a factory reset? Do I keep my data?

Guide: Re-Locking the Bootloader completely on the Pixel 2 XL

I did not see this posted anywhere, nor do I see it on Google's Factory Image website/instructions.
Based on testing... When re-locking the bootloader, "fastboot flashing lock" does NOT seem to lock the critical partition.
After following Google's steps to a T and locking the regular bootloader, It was indeed locked. I even attempted to lock regular bootloader again, and received a message stating it was already locked. Bootloader screen also says everything is locked. All is fine and dandy, right?
For ****s and giggles, I tried performing "fastboot flashing lock_critical". It indeed asked me if I wanted to lock the critical partition. After re-locking critical, I was not able to lock critical again. Safe to say, critical does not get re-locked when re-locking regular bootloader.
Safe to say... to re-lock the bootloader completely, you probably want to perform "fastboot flashing lock_critical" then perform the regular "fastboot flashing lock".
bigblueshock said:
I did not see this posted anywhere, nor do I see it on Google's Factory Image website/instructions.
Based on testing... When re-locking the bootloader, "fastboot flashing lock" does NOT seem to lock the critical partition.
After following Google's steps to a T and locking the regular bootloader, It was indeed locked. I even attempted to lock regular bootloader again, and received a message stating it was already locked. Bootloader screen also says everything is locked. All is fine and dandy, right?
For ****s and giggles, I tried performing "fastboot flashing lock_critical". It indeed asked me if I wanted to lock the critical partition. After re-locking critical, I was not able to lock critical again. Safe to say, critical does not get re-locked when re-locking regular bootloader.
Safe to say... to re-lock the bootloader completely, you probably want to perform "fastboot flashing lock_critical" then perform the regular "fastboot flashing lock".
Click to expand...
Click to collapse
we unlocked bootloader then unlocked critical
so it makes sense to lock critical then lock bootloader as you said
abogrhen said:
we unlocked bootloader then unlocked critical
so it makes sense to lock critical then lock bootloader as you said
Click to expand...
Click to collapse
Oh believe me, I agree. I thought it was strange re-locking the critical isn't part of Googles Instructions. Not even sure if it matters, but just an extra security precaution
Thank You very much for the heads up. Saved me a headache
So the process for stock and locked would be to install a factory image to wipe and bring back to stock, fastboot flashing lock_critical, and fastboot flashing lock?
rester555 said:
So the process for stock and locked would be to install a factory image to wipe and bring back to stock, fastboot flashing lock_critical, and fastboot flashing lock?
Click to expand...
Click to collapse
Correct :good: However, I wouldn't do it unless you plan to RMA it, or sell it
Badger50 said:
Correct :good: However, I wouldn't do it unless you plan to RMA it, or sell it
Click to expand...
Click to collapse
Hmmmm what about if you are worried about theft. You can still wipe the phone and login with another account can't you with the bootloader unlocked? Where as the phone will always be tied to the last google account logged in if the bootloader is locked, making the phone useless to sell even overseas. I could be wrong though.
When re-locking my bootloader on my Pixel 2 XL, I only needed to enter "fastboot flashing lock_critical" first. When I entered "fastboot flashing lock" afterwards, this error was returned:
FAILED (remote: ' Device already : locked!')
Seems you only need one step not both. My device is now 100% stock and bootloader is locked and ready for RMA.
rspkt said:
When re-locking my bootloader on my Pixel 2 XL, I only needed to enter "fastboot flashing lock_critical" first. When I entered "fastboot flashing lock" afterwards, this error was returned:
FAILED (remote: ' Device already : locked!')
Seems you only need one step not both. My device is now 100% stock and bootloader is locked and ready for RMA.
Click to expand...
Click to collapse
Yes. just "fastboot flashing lock_critical" will completely lock your bootloader
Looking to sell my phone. So is there detailed instructions I can follow to return to stock and relock bootloader?
def-g said:
Looking to sell my phone. So is there detailed instructions I can follow to return to stock and relock bootloader?
Click to expand...
Click to collapse
Clean fastboot the factory and let it wipe your device. Then factory reset, then lock the bootloader. You must be 100% stock before you lock it down my friend :good:
Badger50 said:
Clean fastboot the factory and let it wipe your device. Then factory reset, then lock the bootloader. You must be 100% stock before you lock it down my friend :good:
Click to expand...
Click to collapse
If data is wiped once I flash the factory image. Why would I need to factory reset it? Your wisdom is appreciated.
def-g said:
If data is wiped once I flash the factory image. Why would I need to factory reset it? Your wisdom is appreciated.
Click to expand...
Click to collapse
Just an extra precaution my friend to make sure that puppy is squeaky clean!
Badger50 said:
Just an extra precaution my friend to make sure that puppy is squeaky clean!
Click to expand...
Click to collapse
Hahaha. :good:
Is the OEM unlocking supposed to be grayed out?
JarMagic said:
Is the OEM unlocking supposed to be grayed out?
Click to expand...
Click to collapse
Usually it's greyed out if it's already unlocked or a verizon phone

How to Relock Bootloader in MiA1

Hello Guys,
I am trying to relock the bootloader of MiA1 but if I type command- "fastboot oem unlock" then my mobile cause stuck on bootloop. The same thing also happens with AIO Tool.
So please help me if anyone knows how to relock bootloader again? And also let me know whether unlocking bootloader affect warranty or not?
I know one method to lock bootloader that is, you can install stock ROM by mi flash tool but I need to install magisk and that require to unlock bootloader and if I unlocked once then unable to relock again.
The command in fastboot is fastboot oem lock
Have you done some modifications to the stock boot.img file, such as using magisk or something else?
goofball2k said:
The command in fastboot is fastboot oem lock
Have you done some modifications to the stock boot.img file, such as using magisk or something else?
Click to expand...
Click to collapse
yes
Dipesh17 said:
yes
Click to expand...
Click to collapse
Simply use MIflashtool bro. Flash a nougat fastboot rom via MIFlashtool. Choose option to lock and all
Rajeev said:
Simply use MIflashtool bro. Flash a nougat fastboot rom via MIFlashtool. Choose option to lock and all
Click to expand...
Click to collapse
Bro I need to install Magisk and Magisk need twrp and twrp need to unlock bootloader.
Now once I unlocked bootloader then I am unable to relock bootloader.
I tried miflashtool and fastboot oem lock command but none of them works for me.
What's wrong here I didn't understand, help me please
Dipesh17 said:
Bro I need to install Magisk and Magisk need twrp and twrp need to unlock bootloader.
Now once I unlocked bootloader then I am unable to relock bootloader.
I tried miflashtool and fastboot oem lock command but none of them works for me.
What's wrong here I didn't understand, help me please
Click to expand...
Click to collapse
U did something wrong bro. MI Flashtool can lock bootloader easily with a full firmware flash
Dipesh17 said:
Bro I need to install Magisk and Magisk need twrp and twrp need to unlock bootloader.
Now once I unlocked bootloader then I am unable to relock bootloader.
I tried miflashtool and fastboot oem lock command but none of them works for me.
What's wrong here I didn't understand, help me please
Click to expand...
Click to collapse
Not sure if I understood correctly, but it seems that you want to have Magisk + TWRP + locked bootloader. That is simply not possible. For locked bootloader you must have stock ROM (no root, in fact absolutely no modification).
Dipesh17 said:
Bro I need to install Magisk and Magisk need twrp and twrp need to unlock bootloader.
Now once I unlocked bootloader then I am unable to relock bootloader.
I tried miflashtool and fastboot oem lock command but none of them works for me.
What's wrong here I didn't understand, help me please
Click to expand...
Click to collapse
Bootloader lock is like a door.
If its open you can put nice things like magisk, root, modification like custom rom and kernel.
Now if you try to relock it it won't lock until and unless you take all the modifications out.
Hope this helps.
If you need technical information just let me know
flash stock boot.img and then probably you will be able to lock bootloader. I have done the same way.
mahla13 said:
flash stock boot.img and then probably you will be able to lock bootloader. I have done the same way.
Click to expand...
Click to collapse
With Nougat i flashed stock image selecting "save user data" and i had bootloader relocked without losing data. Root and twrp were gone. I don't know if it is so with Oreo.
So you need TWRP and Magisk root but want a locked bootloader? That just isn't a possible combination.
To install TWRP, you need unlocked bootloader.
If you need root and TWRP, you need to leave the bootloader unlocked.
You can't have both worlds bro. If you unlock and install Magisk and other stuff, you simply can't relock bootloader. That's why you get bootloop
alkesh95 said:
Bootloader lock is like a door.
If its open you can put nice things like magisk, root, modification like custom rom and kernel.
Now if you try to relock it it won't lock until and unless you take all the modifications out.
Hope this helps.
If you need technical information just let me know
Click to expand...
Click to collapse
Thanks man I'll try it on nougat. Please tell me one more thing, unlocking bootloader cause lose warranty or not?
Dipesh17 said:
Thanks man I'll try it on nougat. Please tell me one more thing, unlocking bootloader cause lose warranty or not?
Click to expand...
Click to collapse
Some people might say yes some might say no.
It depends on manufacturer.
OEMs don't explicitly say that it won't void your warranty.
So its grey area.
I am going to email Xiaomi about this and update this thread when i get reply.
Had various experiences with unlocked bootloader. So better to follow safe path.
Edit: Called xiaomi helpline two times.
1st said it will void warranty
2nd said it won't.
Emailed them.
I chatted with a support representative and they said that unlocking bootloader won't void the warranty
nicolasmart said:
I chatted with a support representative and they said that unlocking bootloader won't void the warranty
Click to expand...
Click to collapse
That's just what he said it to you. I got two responses.
Support representatives aren't authorised to send you sms or mail.
If there's an issue with your device (Unlocked BL) and you took it to service center. They might say out of warranty due to bootloader unlocking and what would be your reply to that?
Support representatives said it won't void warranty.
You can't back it up with anything since you dont have any proof of that conversation.
So unless it is written somewhere by xiaomi. Words are just words.
Is it possible to unlock the bootloader, root, make some minor modifications (activation of camera api, copying fm radio apk to system folder, etc), unroot, and finally relock (flashing stock boot.img before, of course) ?
I want to have it unrooted because of bank payments, banks apps and streaming TV apps, but I would like to have proper camera and fm radio... Is it possible??
erunamor said:
Is it possible to unlock the bootloader, root, make some minor modifications (activation of camera api, copying fm radio apk to system folder, etc), unroot, and finally relock (flashing stock boot.img before, of course) ?
I want to have it unrooted because of bank payments, banks apps and streaming TV apps, but I would like to have proper camera and fm radio... Is it possible??
Click to expand...
Click to collapse
Short answer:no.
Long answer: locked bootloader must have stock system and boot partition. Stock boot image will boot only unmodified system partition. However you can have bank and streaming apps with Magisk - use systemless modifications and magisk hide feature.
Lock bootloader after uninstalling Magisk in Mi A1
Thank you for information about Mi Flash Tool but I wanted to ask if it is possible to relock boot loader in Mi A1 after uninstalling Magisk by fastboot commands ?
I haven't tried locking again ,but I wanted to relock again so...
Why oem unlocking appears grey, now why is that am not able to install magisk
alkesh95 said:
Some people might say yes some might say no.
It depends on manufacturer.
OEMs don't explicitly say that it won't void your warranty.
So its grey area.
I am going to email Xiaomi about this and update this thread when i get reply.
Had various experiences with unlocked bootloader. So better to follow safe path.
Edit: Called xiaomi helpline two times.
1st said it will void warranty
2nd said it won't.
Emailed them.[/QUOTE
How to unlock oem unlock,
It appears grey
I unlocked mi account
And installed pixel camera and later I changed the settings in camera from Nexus 6p to pixel and it got stuck, and I uninstalled the application, now oem unlocking appears grey, how to unlock oem
Below It appears bootloader is unlocked, but oem cant be unlocked
Click to expand...
Click to collapse

Can't get ota update after relocking the bootloader

So,
this is wierd, i had an unlocked phone with magisk.
Yesterday i decided to go back to stock, so i have flashed the stock rom and relocked my bootloader.
Now i cant get an ota update with again, a locked bootloader no root or system modification.
Anybody know why? Thanks.
That's most probably because the current inactive slot still has some modifications present. Simply unlock the bootloader again, then flash the fastboot image to both the slots (A and B) and you'll be good to go. An unlocked bootloader wouldn't prevent you from taking OTA updates. However, if you still wish, you can relock the bootloader again.
Just a tip: Keep "OEM unlocking" in developer options enabled, it could really come in handy if your device fails to boot on both the partitions somehow.
Same problem here! Do you have camera2api?
DJBhardwaj said:
That's most probably because the current inactive slot still has some modifications present. Simply unlock the bootloader again, then flash the fastboot image to both the slots (A and B) and you'll be good to go. An unlocked bootloader wouldn't prevent you from taking OTA updates. However, if you still wish, you can relock the bootloader again.
Just a tip: Keep "OEM unlocking" in developer options enabled, it could really come in handy if your device fails to boot on both the partitions somehow.
Click to expand...
Click to collapse
thanks i'll try!
Daniel91z said:
thanks i'll try!
Click to expand...
Click to collapse
Sure. Let me know how it goes. Good luck!

Categories

Resources