How to re-lock bootlader

Pathera

Senior Member
Dec 31, 2012
151
9
0
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:
I have the exact same problem did u manage to fix it friend
 

ximmox

Senior Member
Mar 14, 2010
589
312
0
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
Code:
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!

@lesbianu, 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):

Code:
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!
 
  • Like
Reactions: lesbianu

frac85

New member
Feb 26, 2010
1
0
0
Hello everyone.
I've already tried two times to re-lock my bootlader using @lesbianu method and GRIFFIN_OPLS27.76-51-5_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml ROM. Everything goes well (phone boots up an I'm able to allow OEM unlocking and enable USB debugging) until trying to run second set of commands. I'm getting errors as below:

Code:
C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash system system.img_sparsechunk.14
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:system: not found
target reported max download size of 536870912 bytes
sending 'system' (151688 KB)...
OKAY [  3.828s]
writing 'system'...
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 3.844s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash boot boot.img
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
(bootloader) has-slot:boot: not found
target reported max download size of 536870912 bytes
sending 'boot' (32768 KB)...
OKAY [  0.907s]
writing 'boot'...
(bootloader) Image boot failed validation
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 1.423s

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot oem lock
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
...
(bootloader) Still require signed boot.img
OKAY [  0.078s]
finished. total time: 0.078s
I have to mention that my phone is chinese version dual sim XT1650-05, originally on OPL27.76-51 ROM with march security update.
I would appreciate any and all help!
 

Techvir

Senior Member
Jul 13, 2007
3,515
886
253
Here are the steps that worked for me:

-download the firmware posted by @damentz on post #107: GRIFFIN_OPLS27.76-51-5_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
-extract the firmware at a location of your choice, in the same folder extract Android SDK Platform-Tools (I used the latest from Google: https://developer.android.com/studio/releases/platform-tools)
-open a command prompt and change directory to work on the location where you extracted the firmware and the latest Platform Tools (I worked on my desktop so the command was - cd C:\Users\RAZVAN\Desktop\GRIFFIN_OPLS27.76-51-5)
-reboot the phone to fastboot (bootloader) and connect it to your PC
-check the driver and the connectivity with the phone by typing in the command prompt - fastboot devices
-now you are ready to start
-run the first set of commands:
Code:
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 DDR
fastboot oem fb_mode_clear
-when done flashing, select Start from the bootloader by pressing the Power Key and let the phone boot once
-after the phone completely boots, go to Settings, enable Developer Settings and move the check for OEM unlocking to Allow
-if you are in Developer Settings allow also USB debugging
-when all done, with the phone connected to the PC and without rebooting it, come back to the command prompt window and type - adb reboot bootloader
-after the phone is back to fastboot (bootloader) run the second set of commands:
Code:
fastboot oem lock
fastboot oem lock
fastboot flash oem oem.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 boot boot.img
fastboot oem lock
-if all goes well after the last command the phone should reboot by itself and your Moto Z should be with the bootloader unlocked as the day you pull it out of the box.
I got errors that the boot.img and recovery.img are not signed, but the re-locking process was successful.

I do not recommend using a lower version of firmware, use at least the last official firmware that was installed on your phone or the latest available. Downgrading can cause unexpected problems and you are on your own.

Break a leg! :good:
Latest firmware as of now (https://androidfilehost.com/?fid=1322778262904008219) If you followed the guide in the thread and faced errors try this.
Thank you guys..
I used the latest firmware and the instructions and was able to relock the device.
My battery was running horrible and need to return the device for battery replacement.
Hopefully moto repair wont be able to tell that I had un:rolleyes:locked the device.
 

armaghejohn

Senior Member
Apr 2, 2018
51
1
0
SOLVED

If you whan`t this to work you must have the last version of software that was flash on your device . If you use an older version it`s not going to help . But with the last software it`s work and you can relock your phone like it was when was new .
 

Gododin

Member
Dec 5, 2014
5
0
0
Here are the steps that worked for me:

-download the firmware posted by @damentz on post #107: GRIFFIN_OPLS27.76-51-5_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
-extract the firmware at a location of your choice, in the same folder extract Android SDK Platform-Tools (I used the latest from Google:
-open a command prompt and change directory to work on the location where you extracted the firmware and the latest Platform Tools (I worked on my desktop so the command was - cd C:\Users\RAZVAN\Desktop\GRIFFIN_OPLS27.76-51-5)
-reboot the phone to fastboot (bootloader) and connect it to your PC
-check the driver and the connectivity with the phone by typing in the command prompt - fastboot devices
-now you are ready to start
-run the first set of commands:
Code:
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 DDR
fastboot oem fb_mode_clear
-when done flashing, select Start from the bootloader by pressing the Power Key and let the phone boot once
-after the phone completely boots, go to Settings, enable Developer Settings and move the check for OEM unlocking to Allow
-if you are in Developer Settings allow also USB debugging
-when all done, with the phone connected to the PC and without rebooting it, come back to the command prompt window and type - adb reboot bootloader
-after the phone is back to fastboot (bootloader) run the second set of commands:
Code:
fastboot oem lock
fastboot oem lock
fastboot flash oem oem.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 boot boot.img
fastboot oem lock
-if all goes well after the last command the phone should reboot by itself and your Moto Z should be with the bootloader unlocked as the day you pull it out of the box.
I got errors that the boot.img and recovery.img are not signed, but the re-locking process was successful.

I do not recommend using a lower version of firmware, use at least the last official firmware that was installed on your phone or the latest available. Downgrading can cause unexpected problems and you are on your own.

Break a leg! :good:
First part is successful
However while I trying second part I have a error

C:\Users\Özçekiç\Desktop\platform-tools>fastboot flash oem oem.img
(bootloader) has-slot:eek:em: not found
(bootloader) is-logical:eek:em: not found
Sending 'oem' (63212 KB) OKAY [ 1.525s]
Writing 'oem' (bootloader) Security version downgrade
(bootloader) Image o failed validation
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote: '')
fastboot: error: Command failed
 

Gododin

Member
Dec 5, 2014
5
0
0
First part is successful
However while I trying second part I have a error

C:\Users\Özçekiç\Desktop\platform-tools>fastboot flash oem oem.img
(bootloader) has-slot:eek:em: not found
(bootloader) is-logical:eek:em: not found
Sending 'oem' (63212 KB) OKAY [ 1.525s]
Writing 'oem' (bootloader) Security version downgrade
(bootloader) Image o failed validation
(bootloader) Invalid signed image
(bootloader) Preflash validation failed
FAILED (remote: '')
fastboot: error: Command failed
Solved You have to use Last firmware OPL27.76-71-2-3

I can't share link because I'm new in the XDA but you can find the lastest firmware on the GOOGLE.
 

Shojaei

Member
Sep 14, 2017
14
0
0
Here are the steps that worked for me:

-download the firmware posted by @damentz on post #107: GRIFFIN_OPLS27.76-51-5_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
-extract the firmware at a location of your choice, in the same folder extract Android SDK Platform-Tools (I used the latest from Google: https://developer.android.com/studio/releases/platform-tools)
-open a command prompt and change directory to work on the location where you extracted the firmware and the latest Platform Tools (I worked on my desktop so the command was - cd C:\Users\RAZVAN\Desktop\GRIFFIN_OPLS27.76-51-5)
-reboot the phone to fastboot (bootloader) and connect it to your PC
-check the driver and the connectivity with the phone by typing in the command prompt - fastboot devices
-now you are ready to start
-run the first set of commands:
Code:
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 DDR
fastboot oem fb_mode_clear
-when done flashing, select Start from the bootloader by pressing the Power Key and let the phone boot once
-after the phone completely boots, go to Settings, enable Developer Settings and move the check for OEM unlocking to Allow
-if you are in Developer Settings allow also USB debugging
-when all done, with the phone connected to the PC and without rebooting it, come back to the command prompt window and type - adb reboot bootloader
-after the phone is back to fastboot (bootloader) run the second set of commands:
Code:
fastboot oem lock
fastboot oem lock
fastboot flash oem oem.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 boot boot.img
fastboot oem lock
-if all goes well after the last command the phone should reboot by itself and your Moto Z should be with the bootloader unlocked as the day you pull it out of the box.
I got errors that the boot.img and recovery.img are not signed, but the re-locking process was successful.

I do not recommend using a lower version of firmware, use at least the last official firmware that was installed on your phone or the latest available. Downgrading can cause unexpected problems and you are on your own.

Break a leg! :good:
This didn't work for me. Perhaps because between the first and second set of commands, I can't enable "OEM unlocking" because it is greyed out and says "Bootloader is already unlocked"

Any suggestions?