yashsingh1/xdaforums huggingface dataset:
[Moto Z Questions & Answers] m0ritz:
That's a cute idea but the option is grayed out, you can't even click on it.
[Moto Z Questions & Answers] angourakis:
It means you had an updated version on your phone and now you're trying to restore an older version.

I advise you to wait until an updated version is available or you risk bricking your device.

PS: Now that I read your version, you may try with this one: https://rsdsecure-cloud.motorola.co...ubsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip

It's the November patch
[Moto Z Questions & Answers] m0ritz:
Thank you for the idea, I tired that version before but sadly I have since updated to the newest security patch so no luck for me.

Could you inform me when a new version is uploaded if you have time for it?
[Moto Z Questions & Answers] angourakis:
If I find it somewhere, I'll let you know
[Moto Z Questions & Answers] angourakis:
December patch ready to be downloaded =D

https://rsdsecure-cloud.motorola.co...ubsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
[Moto Z Questions & Answers] m0ritz:
Thank you I will try it (I hope this weekend) and report back...

I will use this instruction: https://xdaforums.com/showpost.php?p=74915937&postcount=50

Is this right?
[Moto Z Questions & Answers] angourakis:
Yep. If you have questions, just ask and I'll try to help =)
[Moto Z Questions & Answers] double-gee:
You are trying to relock the bootloader of a RETEU-device that has been updated to 7.1.x, aren't you.

What is your next approach: the retbr-firmware or the ota update from december 1st?

Please let me know if this works. Thanks.
[Moto Z Questions & Answers] m0ritz:
EDIT: And yes I am trying to relock the bootloader of a RETEU-device that has been updated to 7.1.x

I will try the december 1st ota first, can you give me a link to the retbr-firmware?
[Moto Z Questions & Answers] angourakis:
It's the same I shared.

The Moto Z firmwares are almost all the same (excluding Verizon firmwares). All of them are RETUS, and the firmware will identify your device based on your region and other variables it reads from the internal partitions.
[Moto Z Questions & Answers] tfactor:
Hi

I was unable to relock my Moto Z NPLS26.118-20-5-8.

I followed steps from post #50, took the firmware from https://androidfilehost.com/?fid=745849072291699078 (GRIFFIN_NPLS26.118-20-5-8_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip)

While doing

fastboot oem lock

i'm getting the message:

(bootloader) Check 'Allow OEM Unlock' in Android Settings > Developer Options

I enabled USB debugging after step 3 and logged in into Google Account (disabled all checkboxes, turned off PIN)

Any help?
[Moto Z Questions & Answers] double-gee:
Click setting, about phone, then click sevarl times (7 I think) on the build number, after that you're in developer mode and a new menu entry appears in settings.

One does not need to log into the google account.

---------- Post added at 08:57 AM ---------- Previous post was at 08:54 AM ----------

Someone collected available stock firmwares here. I could find RETBR_NPL25.86-30 there.

Please let me know if one can lock a RETEU-device on 7.1 with this file. Thanks.
[Moto Z Questions & Answers] tfactor:
I know about that.

The setting 'Allow OEM Unlock' is greyed out.
[Moto Z Questions & Answers] m0ritz:
IT ****** WORKED. I followed this instruction: https://xdaforums.com/showpost.php?p=74915937&postcount=50&nocache=1 and used the firmware above posted by [MENTION=2850718]angourakis[/MENTION]

Thank you guys!

EDIT: Now I can finaly change the disüöay size again under the display settings - this did not work anymore for me after I unlocked my bootloader.
[Moto Z Questions & Answers] angourakis:
Worked to relock bootloader or to revive phone? I'm confused ahhah
[Moto Z Questions & Answers] m0ritz:
Relock Bootloader, making the display scale thing work again was just a bonus
[Moto Z Questions & Answers] tfactor:
Reflashed from the rom provided by [MENTION=2850718]angourakis[/MENTION], still the same -

Check 'Allow OEM Unlock' in Android Settings > Developer Options (and the option 'Allow OEM Unlock' is greyed out).

But I noticed that during a reflash of boot.img and recovery.img I've got 'a message 'Image signed with key bad key'.

Is it ok, did you get same messages?
[Moto Z Questions & Answers] angourakis:
I think you're in a better path. The messages we got were invalid image or could not boot because image is corrupted (something like that)

Try to flash the others and start your phone!
[Moto Z Questions & Answers] LitD:
Maybe not exactly this thread, but somewhat similar subject:

I have stock 7.1.1 on my XT1650-03 reteu, unlocked and rooted (TWRP, custom kernel and Magisk).

My next OTA is NPL26.118-20-5 and I can not install it (because I have TWRP?) What is the simplest way to get OTAs again?

Will flashing stock bootloader be enough?

Not to loose my settings, apps and data is my priority
[Moto Z Questions & Answers] alejandroalcs:
How do you guys manage to access that website. I get , :Unauthorized:

message
[Moto Z Questions & Answers] knjigo:
Awsome. Finally after Monts i also could flash stock and relock bootloader. I'm never gonna flash custom rom on Motorola again.
[Moto Z Questions & Answers] thefatalepic:
I'm also stuck on trying to relock bootloader. I downloaded GRIFFIN_NPLS26.118-20-5-8_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml - half knowing what I'm doing. I was on 7.0 but after trying to relock bootloader with this now I am on 7.1.1.

I did everything step by step in mfastboot/fastboot and when I get to the erase clogo part, I get permission denied (not sure if this is part of the problem).

When I type fasboot oem lock it looks like everything is OK but when I reboot I still get the "bad key" and "your bootloader is unlocked" warning message.

Can someone please tell me what I am doing wrong?

Edit: After reading a little more, I'm thinking this isn't RETUS and that's why I can't lock it? Did I ruin my phone or is there some where I can find the RETUS equivalent of this? I am never getting another Motorola phone... Lol. :(
[Moto Z Questions & Answers] alejandroalcs:
My phone's fingerprint scanner is dead. is there any fix?
[Moto Z Questions & Answers] fazzula:
Hi M0ritz

I'm on MotoZ model XT1650-03 RETEU with TWRP, magisk and custom rom RR5.8.5 (based on Nougat 7.1.2), with December 5th security patch

I would like to install Oreo OTA but first I have to go back to stock

should I follow this procedure to go back to stock

https://xdaforums.com/sho...t=50&nocache=1

using this file

GRIFFIN_NPLS26.118-20-5-11_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml

?

Is there any risk of brick?

thanks for your help
[Moto Z Questions & Answers] nerci:
I same problem

I would like to make, a step by step if possible. Thank you to all collaborators.
[Moto Z Questions & Answers] alkxx:
So have you ever managed to solve that problem?

I do have the same issue.
[Moto Z Questions & Answers] rzracer2:
Am I understanding this thread correctly that unlike other devices once you unlock it's hard to relock bootloader? New to the Moto Z, got my bootloader unlock code but haven't unlocked yet.
[Moto Z Questions & Answers] Shareef17:
So for doing this we can update the device via OTA.. It'll not get bricked?.

& Final commands u find out from google, we can use while relocking it self... or else we need do separately?
[Moto Z Questions & Answers] alkxx:
I managed to solve this problem by flashing an even older stock rom (Nougat 7.0) in fastboot mode.

After that, the OEM Unlock option was not greayed out anymore, even after updating to Oreo.
[Moto Z Questions & Answers] lesbianu:
No OTA to test it... Will see in the future! :)

Started on Google, but found them here on XDA. It's your choice to add them to the first commands. My problem appeared after re-locking the bootloader, but they worked without any problems.
[Moto Z Questions & Answers] Breezzze:
How can you relock bootloader with unsigned boot.img and recovery.img?

And plz help - when I enter "fastboot oem lock begin" second time - I see "Check 'Allow OEM Unlock' in Android Settings...:: but in Developer options this option grayed out and systems says - you already unlocked.

How can I fix this?
[Moto Z Questions & Answers] Breezzze:
Can you upload full TWRP backup after OTAs? boot, data, recovery and system i mean.

Thanks in advance!
[Moto Z Questions & Answers] lesbianu:
HERE are the TWRP files to recover: Boot, Data, System and stock Recovery for Sheridan RETEU. Maybe after restore you will be able to re-lock the bootloader also...
[Moto Z Questions & Answers] Nettwerk:
I have problem, for some reason bootloader is unlocked and in Developer Options > OEM Unlocking is ON and greyed. I tried a lot variants through this topic and still not work.

Like this:
[Moto Z Questions & Answers] Breezzze:
Hi,

What state of this switch you need and for? Disabled? Enabled?
[Moto Z Questions & Answers] Nettwerk:
I want to lock bootloader.
[Moto Z Questions & Answers] Breezzze:
You can't relock using oreo full flash, because it contains unsigned boot and recovery image. Try to download TWRP backup of Lesbianu, restore boot, system, data and recovery and then try to relock.
[Moto Z Questions & Answers] Nettwerk:
Can you be more specific about Backup of Lesbianu?
[Moto Z Questions & Answers] lesbianu:
Did anyone managed to re-lock the bootloader using my TWRP recovery files and the GRIFFIN_OPL27.76-51_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC firmware?

Just curious, because I unlocked the bootloader again to test the Android P Port and LineageOS 15.1... :)

[MENTION=1776699]Nettwerk[/MENTION] Did you read at least the last two pages of this thread?
[Moto Z Questions & Answers] Breezzze:
I only done restore from your backup and install magisk. May be next weekend I'll do relock, but for now I have Google Pay working and its ok for me.

My mistake - I gave you the wrong advice. You have 1605-05 - Chinese - and I'm not shure if 1650-03 backups suitable for it
[Moto Z Questions & Answers] Nettwerk:
Well sounds more interesting. I need to find someone who has XT1650-05 and share bootloader. If I'm correct.
[Moto Z Questions & Answers] Spluwicho:
EVERYTHING HAS BEEN DELAYED WITH IN BOOTLADER MENY SYSTEM STATUS:modified
[Moto Z Questions & Answers] clsmn:
I'm not sure if I'm able to relock the bootloader of my Moto Z. I read all posts of this thread but due to my english isn't the best, I'm not sure if its possible for me.

Acutal I'm on RR-Rom based on Android 7.1.2 (securitypatch july 2017). Is it possible to relock the bootloader of my phone? If yes, with the commands shared by bionemesis (post #41), right? Which files do I need for flashing via fastboot or where do i get them? And last a general question concerning the fastboot code: do I have to enter every line one by one or is it possible to copy and paste all lines for the fastboot flash via powershell? I hope you understand what I mean!
[Moto Z Questions & Answers] 4rtik:
There are no words to describe how grateful I'm to u for sharing this, thanks to u I was able to make my phone work with all it's features ever since I bought this thing,

I came here just to thank you, I'm sure that what u share helped a lot of other people that didn't take the time to come here and thank you, keep doing what you're doing man, and once again thank you for taking the time and the work to share this with us.
[Moto Z Questions & Answers] StefanV3:
Hi,

i have done this and got the Bootloader of my device locked...

But i have another problem, I am not able to install ota updates (OPL27.76-51-5).

At flashing, it tells "error" and i must restart the device manually.

I tried this serval times...

Does someone have an idea?

My device is a griffin xt1650-03 reteu.

Thanks

StefanV3

Gesendet von meinem SM-G900F mit Tapatalk
[Moto Z Questions & Answers] saifprvz:
How did u re-locked the boot-loader and also which android version u have ?
[Moto Z Questions & Answers] StefanV3:
I used the method described in post #84, and used the full firmware flash file from erfanoabdi also mentioned in this topic.

The only thing I don't flash was gpt.bin.

Before this I had the latest 7.1.1 stock rom installed an then I used RR 6.1.0 by Loader009.

afair i had this problems when i had the latest 7.1.1 stock installed and tried to install Oreo update via ota.

Thanks

StefanV3

Gesendet von meinem SM-G900F mit Tapatalk
[Moto Z Questions & Answers] damentz:
Just because no one else has mentioned it, a lot of you that are having problem's relocking need the version of the ROM with the "S" at the end, OPL vs OPLS. The fine members of the Motorola Firmware Team on android file host uploaded an oreo version: GRIFFIN_OPLS27.76-51-5_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip - https://androidfilehost.com/?fid=5862345805528054929

I just re-locked my Moto Z again after it had received the May 2018 security patch, but I had to wait for this firmware drop to do it.

The only reason I figured this part out is my Moto X Pure wouldn't lock itself on the regular NPH25 firmware released, and I had to get the NPHS25. Not sure what Motorola is doing different on these files but they seem to have the signing key (maybe that's what the S stands for?), on the boot and recovery images that lets you re-lock your bootloader.

EDIT: And lesbianu's instructions still apply: flash flashfile.xml contents exactly, relock by flashing just the boot, recovery, oem, and system images, then optionally reflash the full flashfile.xml again or run the fastboot oem fb_mode_set / fastboot oem fb_mode_clear + erase commands again.
[Moto Z Questions & Answers] saifprvz:
But the Question here is, will this ROM works on my Moto z ... I already flashed 2 to 3 Stock roms on my moto z but none is them worked for me... The one which worked for me is ( GRIFFIN_OPL27.76-51_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml )

which boot-loader you have ?

what I think is the once who have the old boot loader (nougat) are able to re-lock the boot-loader ... the once who have flash the oreo boot-loader are not able to re-lock it.
[Moto Z Questions & Answers] lesbianu:
Thank you for the heads up! I was waiting for that firmware version to try a re-lock also... :good:

I could not behave and unlocked the bootloader again for root and a quick test of erfanoabdi's Android P port. Finally I changed the main phone and wanted to re-lock again the Z to sell it, but no chance with old GRIFFIN_OPL27.76-51_cid50 firmware. The only thing I was able was to re-flash and update via OTA to OPLS27.76-51-5. Wrote about it here.
[Moto Z Questions & Answers] saifprvz:
Thanks for this great tutorial but after the Part one .... When I booted my phone and checked the "OEM unlocking" option was still grayed out....

so again I booted my phone to boot-loader and tried second sets of commands... still no success...

Got these 3 error in whole process ...

C:\Users\saif \Desktop\platform-tools>fastboot flash boot boot.img

(bootloader) has-slot:boot: not found

Sending 'boot' (32768 KB) OKAY [ 0.824s]

Writing 'boot' (bootloader) Image signed with key bad key

OKAY [ 1.083s]

C:\Users\saif \Desktop\platform-tools>fastboot erase DDR

(bootloader) has-slot:DDR: not found

Erasing 'DDR' (bootloader) Permission denied

FAILED (remote failure)

Finished. Total time: 0.047s

C:\Users\saif \Desktop\platform-tools>fastboot flash boot boot.img

(bootloader) has-slot:boot: not found

Sending 'boot' (32768 KB) OKAY [ 0.778s]

Writing 'boot' (bootloader) Image signed with key bad key

OKAY [ 1.163s]

Finished. Total time: 2.003s
[Moto Z Questions & Answers] lesbianu:
Without allowing OEM unlocking you move to the second step of commands for nothing... If you continue the flash will end with error: (bootloader) Check 'Allow OEM Unlock' in Android Settings > Developer Options. Anyhow, the phone will start, but the bootloader will be as before: unlocked.

Had the same problem last night when I used all the commands without the pause to boot and allow OEM unlocking from the menu.

On the second try I split the commands in 2 parts and it worked, that's why I explained all the steps from start to end.

---------- Post added at 11:37 AM ---------- Previous post was at 11:26 AM ----------

After the first set of commands the phone boots with the OEM unlock check active. If you reboot it and the operating system starts completely, the check will become greyed out. That's why I rebooted to bootloader using ADB command adb reboot bootloader, not to miss the key combination. Try again...
[Moto Z Questions & Answers] saifprvz:
Figured out the issue. the problem was with the internet. internet need to active to unlock OEM.

Finally I m unlocked the Boot loader ... Thank you for the help lesbianu
[Moto Z Questions & Answers] lesbianu:
Glad you figured it out. Congratulations! :)
[Moto Z Questions & Answers] Yorgan:
You can't imagine how grateful I am: I spent weeks trying to find the right image to restore my phone.

Nothing seemed to work and I actually stopped searching... when I found your post.

And the image worked.

Wow.

Thanks.

---------- Post added at 03:37 PM ---------- Previous post was at 03:31 PM ----------

These instructions, together with the file [MENTION=2525318]damentz[/MENTION] posted on post #107 were the only instructions that were able to restore my phone and its bootloader.

I have not enough words to thank you, you really saved me!

:highfive:
[Moto Z Questions & Answers] thefatalepic:
I know it has been said multiple times, and this thread is getting old, BUT... I absolutely had to post here and thank you. Really, I can't thank you enough. This worked perfectly for me on my first try.

I have been trying to re-lock this phone for so long that I'm not even using it anymore, I bought another phone and threw this one in a drawer. I forgot why I unlocked it in the first place but I immediately regretted it. I read through countless threads and downloaded so many different firmware versions - nothing ever worked for me. I lost confidence in my ability to flash a phone, coming from the Galaxy S3 and multiple Nexus devices, I couldn't believe how much trouble the Moto Z was. I gave up on flashing/rooting altogether.

I powered up my phone the other day on a whim, and noticed there was a system update for Android Oreo. Excited, I downloaded and tried to install. I got an error and my battery went from 90% to 3% upon rebooting. This crashing and instant battery draining is why I stopped using the phone altogether, and it began when I unlocked the bootloader. (The device might even be defective, but without being able to properly restore it to stock I could never tell.)

So again, thank you, thank you so very much. Your post needs to be pinned high up on the web somewhere for anyone who has ever owned an XT1650 and has found it damn near impossible, as I did so many times, to try and re-lock this bootloader.

Update:

So it's relocked, and I don't get the error message when booting anymore and I think the whole bad key bad signature thing has been fixed. BUT,

I still get an error when trying to install OTA security updates. Am I doing something wrong? Is this just me? The XT1650 is a never-ending nightmare, lol.
[Moto Z Questions & Answers] lesbianu:
On mine the 1 July OTA installed without problems. There is another guy who's in the same situation with you... He wrote here.

No idea what to do in this situation. I was expecting an OTA to check if ti forks on my phone. In case of problems, the only way I can see it's to re-unlock the bootloader, re-flash and try to re-lock it again. Then to test OTA.

Before that, I would try to sideload it using a PC... Try that, I posted the 1 July OTA file on that topic.

I will leave the link here also: https://yadi.sk/d/KAx0C4t03aUSDn

---------- Post added at 08:28 PM ---------- Previous post was at 08:26 PM ----------

Good luck!
[Moto Z Questions & Answers] thefatalepic:
Not sure if I did it wrong, I tried to sideload the file from that link and I got this at the end:

----

Verifying current system...

E3005: "/bt_firmware/image/btfw32.tlv" has unexpected contents.

E:Error in /sideload/package.zip (Status 7)

Installation aborted.

----

:confused:
[Moto Z Questions & Answers] lesbianu:
It does not like something related to your bluetooth, but no idea why... Sorry! :(

---------- Post added at 08:18 AM ---------- Previous post was at 08:12 AM ----------

Found the same error on another Mototola model. It seems that is something wrong with your bluetooth firmware...

It seems that you need to try to fix that by re-flashing the the BTFM.bin from the latest firmware: GRIFFIN_OPLS27.76-51-5_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip

fastboot flash bluetooth BTFM.bin

Make sure you do not receive any error.

Try that, but for sure you need to re-unlock your bootloader to fastboot flash files. After you finish, re-lock if necessary, and try the latest OTA again.

This is what I would do. Hope it works!
[Moto Z Questions & Answers] Pathera:
I have the exact same problem did u manage to fix it friend
[Moto Z Questions & Answers] ximmox:
[MENTION=5352779]lesbianu[/MENTION], Thanks a lot for your guide and helping with the questions in here.

BUT: The bluetooth step you mentioned above is clearly missing from your guide in the first post and lead to me trying to lock my phone twice yesterday. It actually worked, but I got the same error as others when flashing the latest OTA I received after locking the phone.

so the correct first steps should be (identical to the flashfile.xml from Motorola, 2 corrections in bold):

fastboot getvar max-sparse-size
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase modemst1
fastboot erase modemst2
[B]fastboot flash bluetooth BTFM.bin[/B]
fastboot flash dsp adspso.bin
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash system system.img_sparsechunk.9
fastboot flash system system.img_sparsechunk.10
fastboot flash system system.img_sparsechunk.11
fastboot flash system system.img_sparsechunk.12
fastboot flash system system.img_sparsechunk.13
fastboot flash system system.img_sparsechunk.14
fastboot flash oem oem.img
fastboot erase carrier
fastboot erase cache
fastboot erase userdata
fastboot erase [B]ddr[/B]
fastboot oem fb_mode_clear

After that and following your second steps I could properly relock the phone with the OPLS27.76-51-5 images and then update via OTA to OPLS27.76-51-7 without errors. :highfive:

Would you please correct your steps in the first post so others don't struggle with OTAs afterwards? Thanks!
[Moto Z Questions & Answers] lesbianu:
On my phone, that line was not needed... Maybe you (and other users with that Bluetooth error) did more flashing or modding. :)
[Moto Z Questions & Answers] heithered:
Latest firmware as of now (https://androidfilehost.com/?fid=1322778262904008219) If you followed the guide in the thread and faced errors try this.