Unlocking Bootloader on Xperia Z3 compact

How do I download the e-recovery image? When I click on the link it shows a huge file that starts with this:

ANDROID!:ùY��€��²P����������ð���à�������R�����������������androidboot.hardware=qcom msm_rtb.filter=0x37 ehci-hcd.park=3 dwc3.maximum_speed=high dwc3_msm.prop_chg_detect=Y vmalloc=300M buildvariant=userdebug����������������������������������������������������������������������������������������������������������������������������

And as @chrisrg wrote, use this for flashing recovery on z3c:

fastboot flash recovery <recovery.img>

And then:

fastboot boot <recovery.img>

After that, in my z3c, it stayed in a blank screen (in adb mode). So, I did:

adb reboot recovery

If this worked fine, you will boot into recovery. If the recovery.img that you flashed was /e/ recovery (downloaded from dev), enter in the option (with the volume keys) “factory reset” and do the format data, cache and system. Then go back in menu (arrow up left) and go in the “Apply update”. Then, in the terminal in your computer, “sideload” de /e/ image:

adb sideload e-0.15-q-20210312105636-dev-z3c.zip

@Nifalti

Then power off the device by unplugging.

Now boot up the recovery that you have just flashed by holding vol down and power button until phone vibrates: let it boot into recovery.

Plug the phone back in again.

Then you can follow @aleam’s instructions in the post above to complete the installation.

Good luck!

When I type in:
fastboot flash recovery recovery-e-0.15-q-20210312105636-dev-z3c.img
I get an error that says
fastboot: error: cannot load ‘recovery-e-0.15-q-20210312105636-dev-z3c.img’: No such file or directory

Sounds like EITHER you didn’t download the recovery from here https://images.ecloud.global/dev/z3c/. You need to download both these files

OR you are not running fastboot in the same directory as you downloaded the recovery image. In which case, you should either cd to the directory containing the downloaded files before running fastboot flash recovery ... or copy the downloaded files to your current working directory.

Hope that helps

Yes, thank you. That worked. At least I hope so. Each of those commands took about a second to execute, and then the screen went gray until I held the volume up and power together.

What worked was holding volume up with the power button.

Is this in fastboot mode or normal mode?

I am trying all different combonations of power button and volume up/down. Nothing gives me the option to factory reset.

It sounds like you’ve got the recovery image installed. Now you need to boot into recovery. There are two possible ways to do this, and I strongly suggest that you unplug the USB cable before you try either one.

EITHER

  1. Press Volume Down and the power button OR
  2. Boot into bootloader - press Volume Up and connect the USB cable
  • if the LED glows green you are in fastboot mode. In this case, on the computer, run fastboot reboot bootloader - the LED should glow blue.
  • with the led glowing blue - either when you connected the USB cable or after performing the fastboot reboot bootloader, type fastboot reboot recovery

The device should now reboot into the TWRP recovery, and you can proceed to install the ROM, either using adb sideload.... or by ccopying the ROM zip file to the device (using adb push ...) and Installing from TWRP’s Istall menu

If you did that with the USB cable connected, you would be in fastboot (LED glowing green) or bootloader (LED glowing blue). You wont be in recovery mode. If you did it with the USB cable disconnected, then I have no idea what is going on :slight_smile:

If booting into recovery doesn’t work, then your recovery image is not correctly installed

PS It’s worth reading the 'Special Boot Modes` section of the LineageOS z3c Info page


The /e/ install documentation is closely based on (copied from :wink: ) the LOS pages, and it is possible some errors or unintended changes have crept in. Always worth double checking against the LOS pages, in particular the z3c Install page

I hope this helps, and I’m sorry that there is so much documentation which is so confusing - actually the process isn’t that hard or complicated :slight_smile:

This is the e-recovery screen:


You can navigate the options with the volume keys, and choose the selected one with the power button.

You can check if you have it installed trying to boot up the recovery:

I tested it here now. I can say that it took a long time pressing the DownVolume+Power to get a response: sony logo appeared and e-recovery loaded (just after that I released the buttons). Not an eternity, just more than I would expected.

If you dont have it installed, I dont know, but I think it will just boot the stock rom after sony logo.
In this case, just try this in bootloader:

fastboot flash recovery <name_of_your_recovery.img>
fastboot boot <name_of_recovery.img>

  • here you will get the blank/gray screen. then, while in that screen:

adb reboot recovery

Holding volume down and power now opens the e-recovery screen. I hadn’t realized how long I needed to press them for.
The light doesn’t glow any color. “fastboot reboot bootloader” returns “waiting for any device” for two hours (so far).

@Nifalti So you can boot into e-recovery now; that’s good, you’re nearly there!

I’m guessing the next step you want to do is install the e operating system zip file , yes?

Carefully follow these next steps:

On the computer open the terminal in the folder with your platform tools, /e/ os zip etc

With the phone disconnected turn it on in the e-recovery mode.

Plug phone to pc and check you can connect in adb by typing in terminal

adb devices

If all is good this should return the serial number and the word ‘device’ and you can move on to the next step below.
If nothing happens or the output says ‘unauthorized’ then this would need troubleshooting before proceeding.

I assume you need to use volume keys to navigate in recovery on this device.

On Phone navigate to ‘Factory Reset’ and press power button to confirm.

This will take you to another screen to confirm you want to ‘Factory reset and Format Data’ etc. Do that also and the device is now wiped.

Navigate to ‘Apply update’ and select. Select also ‘Apply from ADB’.

The recovery screen should now show a small message at the bottom: ‘Now send the package you want to apply…’ etc.

On the computer type the command:

adb sideload <e-0.15-q-2021...whatever.zip>

Terminal output should show that the zip is being served to the phone. Normally it goes to ~47% and then it may feel like nothing is happening, but just wait.

There will be some output on the bottom of the phone recovery screen: ‘step1’ followed by ‘step 2’. Again it might feel like nothing is happening, but just wait… When the zip file is completely loaded the recovery screen changes and you will see that you have an option to ‘Reboot system now’

At this point you can unplug phone and select ‘Reboot system now’

It worked!
Thank you so much petefoth, aibd, chrisrg, and aleam!

3 Likes

Well done @Nifalti. Enjoy! :grinning:

I believe this step is unnccesary, and may even corrupt the recovery image you flashed in the previous step. Only two steps are needed, as described in the instructions at https://doc.e.foundation/devices/z3c/install

fastboot flash recovery <whatever.img>
adb reboot recovery

(I think it would be useful if you edited your post - It seems one user has already had problems, caused I believe by going the fastboot boot ... step)

Hi @petefoth
Why you “believe” that since fastboot boot is not fastboot flash boot?

Maybe I would have been clearer if I had written “<recovery.img>” instead “<whatever.img>”, but I dont believe that “fastbooting boot” an recovery (or even a rom) would damage anything. Please, enlighten me if I’m wrong, but fastboot boot <whatever.img>, as I wrote, would just “temporary boot” the recovery.

And yes, I think it could be uneccesary if you prefer to turn off your phone and boot recovery with VOL DOWN + POWER.

Anyway, I would make an addendun if I could, but I’m not finding a way. Maybe the edit is disable for old comments. When I click the edit pencil, this is what I get:

Because according to both
fastboot help and online documentation for fastboot the fastboot boot command is intended to

Download and boot kernel from RAM.

No mention there of using it to temporarily boot a ROM image. That may be possible / necessary for devices which have no recovery partition, but that is not the case for the Z3C

In this post a user has followed those instructions, and his device will not boot into recovery.

I will try for myself later on, and let you know the results

In the post that you mention, the first printscreen shows an extra space between the fastboot boot command and the file image. Maybe this extra space have done fastboot thinks that there was no argument at all, and it “download and boot kernel from RAM”. I dont know, maybe not, since the second printscreen shows the command with right spaces… but the same error.
Anyway if it’s a risk that could be avoided (unecessary command), it definitely should.

An extra space character in a command line invocation of fastboot is not - in any personal computer OS that I know of - going to affect the correct functioning of that command.

Invoking a command intended to download and boot a kernel image with a recovery image may well affect the correct functioning of a previously flashed recovery image. Rather than wasting time trying it on my own devices, I will spend that time trying - using private messages - to help the user who has followed your advice and now cannot boot their device

Pete, now I see, you are the good one.

Please do not use the fastboot boot command after fastboot flash recovery ...

As this page explains.

There exist two different commands because of the difference in
partitions. Older devices have a separate recovery partition and
hence you could directly flash it using the fastboot flash recovery
command. But since the inception of A/B partition devices, there is
no separate recovery partition. Everything is managed by the boot
partition now. Hence we now boot the recovery into the boot partition
rather than flashing it to the non-existing recovery partition.

The Z3C is not an A/B partition device so the fastboot boot command should not be used