can someone tell me how to type this command?

qwertyu8

Honorable
May 26, 2012
106
0
10,690
im not good at command prompt stuff but im sure there is some smart guy here that can tech how to type this in. all i want to do is lock the bootloader in this phone. the only directions they give me online are to unlock it. maybe with these two pictures someone could tell me how to lock it by typing in the correct command. the only thing is i dont understand how to type commands unless its already written out lol. https://ibb.co/go0tka
https://ibb.co/bOLFyv
 
Solution
Okay. Well, there are two different ways phones are locked or unlocked. We're only dealing with one, but I'll mention the other briefly.

The other one: Phones can be "locked" to a particular carrier. You have to use that carrier while you have the phone unless you obtain a network unlock code and enter it, which will disable that and let you use your phone on any carrier it technologically can.

The one we are dealing with: Your phone was locked in the bootloader. The bootloader is base code that runs before anything else does and everything else requires the bootloader to work before it executes other code. Think of it somewhat like a BIOS in a computer, it that doesn't work... game over.

What I've seen and heard about...

XaveT

Distinguished
Jul 15, 2013
205
6
18,765
Generally it isn't recommended to relock the bootloader after you unlock it. Murphy's law may cameo in full force.

Are you certain you want to do this? You may have problems or even brick the phone.
 

qwertyu8

Honorable
May 26, 2012
106
0
10,690


i bought this phone brand new (sony z5 compact) but it was actually previously owned by someone who messed with it. i had to flash the whole phone and put on UK software and have been having issues since. if i lock the phone i should be able to run it through sony's pc companion to fix my issues. i think. or do you suspect it still wont work?

 

XaveT

Distinguished
Jul 15, 2013
205
6
18,765
Feel free to seek other opinions, but I sincerely doubt that would do much, unless that's the only thing that software needing. Usually you have a key to unlock it (was that first image you linked personalized to you, or was it just found on a site?) and the same key would lock it again. If there's any chance that any of the stock image (or firmware) is different than it shipped with, I would not do so. (ref: for a different phone, but I don't really have a reason to believe the base function would be different for you. https://forum.xda-developers.com/showthread.php?t=1077019)

That's a great site out there for phone modding and the like, at xda-developers.com. I've been using it for several years for all kinds of Android based devices and it's been pretty good. You may check there for better and more specialized help.
 

qwertyu8

Honorable
May 26, 2012
106
0
10,690

yes, that key was personalized to me for this phone. they want me to lock it. long story on how i got to this point buti just dont know how to type in the code. i would mention that when i do type in what sony tells me to type in it says this phone is already unlocled. but if i go to update it it says it cant cause the phone is unlocked. so i dont really get it.

 

XaveT

Distinguished
Jul 15, 2013
205
6
18,765
I did a little more looking today, and I'm reading all kinds of problems that can (and most likely will) happen if you try to relock your phone.

Again, I DO NOT RECOMMEND YOU ACTUALLY DO THIS!

If your phone is already unlocked, go to XDA (xda-developers.com) and find a ROM for your device with great support and try that first. You are much less likely to end up with a brick!

If you are dead-set on the procedure, and are okay with this risk (that is, bricking your phone) then you should be able to do it with one of the following commands (note: If one works, stop and reboot and see if it works in your program. All three will not be required. I can't test them, I don't have a sony device, nor would I relock it even if I could):

fastboot -i 0x0fce oem relock
fastboot -i 0x0fce oem lock
fastboot -i 0x0fce flashing lock

Explanation:
"fastboot" is the program.
"-i 0x0fce" is the usb vendor for special commands, in this case, sony
"oem lock" is the command


I know I'm harping about XDA and not doing this, but there's just so much that can happen here I just think that's a better solution by far.
 

XaveT

Distinguished
Jul 15, 2013
205
6
18,765
Okay. Well, there are two different ways phones are locked or unlocked. We're only dealing with one, but I'll mention the other briefly.

The other one: Phones can be "locked" to a particular carrier. You have to use that carrier while you have the phone unless you obtain a network unlock code and enter it, which will disable that and let you use your phone on any carrier it technologically can.

The one we are dealing with: Your phone was locked in the bootloader. The bootloader is base code that runs before anything else does and everything else requires the bootloader to work before it executes other code. Think of it somewhat like a BIOS in a computer, it that doesn't work... game over.

What I've seen and heard about frequently when relocking your bootloader is that "something" has changed, and the lock no longer requires the same "key". So the embedded key in the hardware to unlock it for use doesn't work. So it tries to start the device, reaches that point, tries the key, and it doesn't work. So then it can't progress. You also may not reach a point where you could get into "bootloader mode" and poke at it with fastboot to try to get it unlocked again. There's no industry standard way of doing it, and some companies are better about fail-safes than others. Honestly, I don't know where Sony falls on that spectrum. So if you have issues, it's possible to make it (nearly) completely bricked.

Sometimes you can open it up, solder or unsolder a jumper or lead and get into it that way. There's not much chance of that on modern phones. Sony also could pull the chip and reprogram it, but the cost would make that option laughable. Plus, your warranty generally becomes invalid if you unlock bootloader code, but check if you have one.

So the reason I'm advising caution (or just find a new ROM for it on XDA) is because there is a very real danger of making the phone completely unusable. And since you've already unlocked the bootloader, there's no reason you couldn't find a better-than-stock ROM out there to customize your phone to your needs.
 
Solution

qwertyu8

Honorable
May 26, 2012
106
0
10,690
So are you saying that I don't have to put Sony's stock OS on? I could technically put on Samsung or I've plus one's? And I see now what you mean about the unlocking thing. It's not worth the risk if it could go south. I won't try it
 

XaveT

Distinguished
Jul 15, 2013
205
6
18,765
Indeed, you don't have to deal with Sony's take on the UI if you don't want to ever again. It even looks like that phone is fairly active and well developed for. They even have Android 7.0 (Nougat) versions if you are so inclined. There's a fairly large amount of reading to do, but you can do some really cool things with the OS on Android phone.

https://forum.xda-developers.com/z5-compact is where you can start.