Sony - Xperia Z3 Compact - z3c - Documentation Suggestions

…Enter suggestions to improve documentation in this category. Do not raise bugs or issues here…

The Install document could be changed as follows

  • Add a download link for TWRP - I used twrp-3.3.1-z3c-20200212.img from https://androidfilehost.com/?fid=4349826312261722027
  • “continue with the formatting process”, add “entering yes in the editor, and pressing the ‘tick’/ ‘check’ buton in the keyboard”
  • In section Installing /e/ from recovery,
    • Add text to item 4 - “entering yes in the editor, and pressing the ‘tick’/ ‘check’ buton in the keyboard”
    • Add a bullet point to item 7
      • "When the installation succeeds, the connected PC shows an error message serving: 'e-0.14-q-20210204100104-dev-z3c.zip' (~47%) adb: failed to read command: Undefined error: 0"

Thanks for the suggestions @petefoth…will have them added to the guide

================================
Title

Beginner’s Guide to Install /e/ on Sony Z5C using Ubuntu

================================
Introduction

This guide provides step by step instructions how to install the /e/ version of android Q (10) on a Sony Z5 Compact using Ubuntu.

Device used: Sony Z5C, model E5823, running Android 7.1.1, build 32.4.A.1.54.

/e/ version: 0.15 (Q) from March 2021 (e-0.15-q-20210312105636-dev-suzuran).

Computer: Ubuntu 16.04 LTS.

Android Platform Tools version: 31.0.1

================================
Requirements


  1. Equipment

A Sony Z5C phone, must be either model E5803 or E5823.
A USB cable that can transfer data.
A computer running Linux (this example uses Ubuntu 16.04LTS).
Internet access to download some files.


  1. Computer skills

Only very basic computer skills are required.
You will need to know how to:
Download a file.
Unzip a .zip file.
Open a terminal window (also called shell, command line, console window).
Type (or copy and paste) commands into the terminal.

================================
PART A)
Before doing anything, run a few checks


  1. Check if the device’s bootloader can be unlocked

To check, on the device dial *#*#7378423#*#* to launch the service menu.
Go to Service info > configuration > “Rooting status”
You can only continue if it says “Bootloader unlock allowed: Yes”


  1. Check the device’s software version

The software version on the device must be 32.4.A.1.54 (according to post on 2020-11, https://forum.xda-developers.com/t/rom-unofficial-10-q-lineageos-17-1-for-z5c-suzuran.4052973/post-83895447)

To check, on the device go to Settings > About phone > Build number
You can only continue if the build number is “32.4.A.1.54”


  1. Check the phone works as expected (optional step)

This is an optional step to check that all parts of the phone work as expected.

There are two reasons for doing this step:
i) if you purchased the phone and parts of it do not work you might be able to return it. But if you unlocked the bootloader/flashed the device you would likely void the return policy.

ii) if you know something isn’t working before you install /e/, for example the rear camera is faulty, then when you install /e/ you will know the rear camera isn’t working because the camera is defective, not because of something to do with /e/.

To run the tests, on the device dial *#*#7378423#*#* to launch the service menu.
Run any test you wish.

================================
PART B)
Download Custom Recovery Image and /e/ ROM

Both the custom recovery image and /e/ ROM are specific to the Sony Z5C device.
Each is downloaded separately.


  1. Download Custom Recovery Image

Download the Custom Recovery Image called “recovery_suzuran_230218.img” from https://drive.google.com/drive/folders/1uTe7x1bWBKSUKx401wcgUSCQ7jj1e3MG
Save this file anyhwere on the computer, the Downloads directory is perfect.


  1. Download /e/ ROM

Download the latest /e/ ROM from https://images.ecloud.global/dev/suzuran/
At the time of writing this guide (April 2021) the latest was “e-0.15-q-20210312105636-dev-suzuran.zip”.
Save this file anyhwere on the computer, the Downloads directory is perfect.

================================
PART C)
Download and Test Android Platform Tools

Android Platform Tools will give you the ‘ADB’ and ‘Fastboot’ tools required to install /e/.

This software does not need to be ‘installed’ as such, just unzipped and then the tools inside the unzipped folder can be run as needed.


  1. Download

Download latest version of Platform Tools for your computer operating system from https://developer.android.com/studio/releases/platform-tools
platform-tools_r31.0.1-linux.zip


  1. Extract

Extract the Platform Tools download
Extract (unzip) platform-tools_r31.0.1-linux.zip onto your computer.
Any directory is fine, even your Downloads folder will do perfectly.


  1. Add to PATH

Add the path of the extracted zip to you system PATH (optional but helpful step)
In a terminal (console widow) type:
export PATH="/path/to/platform-tools:$PATH"
Replace ‘/path/to/platform-tools’ with the path where you extracted the .zip

Note: If you log out or reboot your computer you may need to run the export command again, other wise your computer will not find ‘adb’ or ‘fastboot’ even if you are issuing the commands from a terminal from within the /path/to/platform-tools directory.


  1. Test ADB and Fastboot

After this you should be able to access adb and fastboot by typing either of the below commands in a terminal:
adb devices
fastboot devices

================================
PART D)
Unlock the bootloader


  1. Turn Off My Xperia (optional)

If you have enabled My Xperia, this function must be turned off before you can unlock the device.


  1. Become a Developer on the device

To enable USB Debugging you will need to become a Developer first on the device.

To become a developer go to:
Settings > System > About Phone > now tap on ‘Build Number’ 7 times

Note: As you are tapping you may get a pop up ‘you are 4 taps away from becoming a developer’, that message is OK, keep taping.

After 7 taps you should get a message that you are a Developer.


  1. Allow OEM Unlocking AND USB Debugging

Settings > System > Developer Options > OEM Unlocking (allow the bootloader to be unlocked)
Settings > System > Developer Options > Debugging > USB Debugging (debug mode when usb in connected) : turn this on


  1. Make a note of the device’s IMEI

Go to Settings > About Phone > Status > IMEI Information


  1. Get the device unlock code from sony.com

Go to https://developer.sony.com/develop/open-devices/get-started/unlock-bootloader/#unlock-code
Select the device type and enter the IMEI to get the unlock code.
Make a note of the unlock code.


  1. Enter Fastboot mode

Note:
For this step you must use a USB cable that can transfer data.

Turn off the device.
Connect the USB cable to your computer (but not to the device yet).
On the device, press and hold Volume UP at the same time as you connect the USB cable to the device.
KEEP holding Volume UP until the LED on the device turns blue THEN release the Volume UP button.


  1. Test if Fastboot is working

With the device is connected to the computer, open a terminal window on the computer and enter the following command:
fastboot devices

Verify that you get an answer back without any errors.
Example of what is returned:
CB5B17CF58 fastboot


  1. Unlock the bootloader

To unlock the bootloader you need to enter unlock code provided by sony.com.

On the computer enter the following command:
fastboot oem unlock 0x
Example: fastboot oem unlock 0x30G42A275C8DD24F

Verify that you get an answer back without any errors.
Example of what is returned:
OKAY [ 0.691s]
Finished. Total time: 0.692s

Done! You have now unlocked the bootloader of the device.


  1. Re-enable Developer and USB debugging

Since the last step causes the device to reset completely, you will need to re-enable Developer and USB debugging to continue.

Disconnect the usb cable from the device.
Turn on the device.

Note:
Be patient. When device was turned on it showed an android figure for a few seconds, then a mobile operator splash screen which remained for a few minutes.
After a few minutes the Welcome screen will appear with ‘get started’.
You will need to go through the “getting started” steps, just skip as much as you can, dont sign up to any services especially google accounts LOL.

Become a Developer on the device:
Settings > System > About Phone > now tap on ‘Build Number’ 7 times
You will get a message that you are a Developer.

Enable usb debugging:
Settings > System > Developer Options > Debugging > USB Debugging (debug mode when usb in connected) : turn this on

================================
PART E)
Boot a custom recovery from Fastboot Mode


  1. Charge the device

Please now charge the device to at least to 50% in preparation for next few steps.
Best to charge it to 100% just in case.


  1. Enter Fastboot mode

Turn off the device.
Connect the USB cable to your computer (but not to the device yet).
On the device, press and hold Volume UP at the same time as you connect the USB cable to the device.
KEEP holding Volume UP until the LED on the device turns blue THEN release the Volume UP button.


  1. Test if Fastboot is working

With the device is connected to the computer, open a terminal window on the computer and enter the following command:
fastboot devices

Verify that you get an answer back without any errors.
Do not continue if the device is not listed or errors are encountered.

Note: If you see no permissions fastboot, try running fastboot as root.


  1. Flash the Custom Recovery Image

Note: Be prepared to do step 5 immediately after step 4 (which only takes 0.6 seconds!)

To flash the custom recovery image onto the device, open a terminal window on the computer and enter the following command:
fastboot flash recovery ~/path/to/recovery_suzuran_230218.img
Example of what is returned:
Sending ‘recovery’ (12008 KB) OKAY [ 0.448s]
Writing ‘recovery’ OKAY [ 0.121s]
Finished. Total time: 0.620s


  1. Reboot into Recovery Mode

As soon as the custom recovery image has been flashed, reboot into recovery mode to verify the installation.

To reboot into recovery mode:
Unplug the USB cable from the device.
Ensure device is turned off.
Press and hold Volume DOWN key while you press the Power key.
KEEP holding until the device vibrates.

Note: The device should now show a blue and black coloured interface, this is the TWRP interface which will be used in the followig steps.

================================
PART F)
Install /e/ from Recovery Mode


  1. Connect the device

Connect the device to the computer using USB cable.


  1. Use TWRP to Format and Wipe

In TWRP main menu swipe the slider that says “swipe to allow moidifications”.

Tap “Wipe”.
On the Wipe screen tap “Format Data”.
Here a new screen may show where you will have to type ‘Yes’ and confirm the action by clicking a button.
You might recieve a message: “Data format complete, sucessful”.
When the screen says “You may need to reboot recovery to be able to use /data again. Updating partition details…done”.
Do not reboot at this stage, click the blue “Back” button to get back to the “Wipe” screen.
You may need to tap “back” twice to arrive back to the “Wipe” screen.

On the Wipe screen tap “Advanced Wipe”.
Tick the “System” and “Cache” boxes and then swipe the “swipe to wipe” slider.
Tap the “Back” button to get back to the TWRP home screen.


  1. Install /e/

Now to “Sideload” the /e/ .zip package.

On the device in TWRP tap Advanced then “ADB Sideload” then swipe to begin sideload.
There are two tick boxes here ‘Wipe Dalvik Cache’ and ‘Wipe Cache’, tick both.
Open a terminal window on the computer and enter the following command:
adb sideload /path/to/e-0.15-q-20210312105636-dev-suzuran.zip

You should hopefully soon see a screen saying: “/path/to/e-0.15-q-20210312105636-dev-suzuran.zip’ (~1%)”
Wait until the blue bar has reached the right.
When it is complete it should say “Dalvik Cache Directories Wipe Complete” and then the device will vibrate.


  1. Reboot the Device

Once installation has finished , return to the TWRP main menu by tapping ‘Back’.
Tap Reboot, and then tap System.
You may receive warning got warning “no OS installed are you sure you wish to reboot?”
This is ok, swipe to reboot.
The device should restart the /e/ logo. :grin:

Congrats!

================================
PART G)
Tidy Up Your Computer

Unless you want to hold onto them for future use, you can now safely delete the following files and directories.

Files:
recovery_suzuran_230218.img
e-0.15-q-20210312105636-dev-suzuran.zip
platform-tools_r31.0.1-linux.zip

Directories:
platform-tools

4 Likes

Hi Mike, Thank you for a really clear set of instructions and no hint of jargon. It must have taken ages to get that together.

Two quick questions…

  1. Is it possible to restore the phone back to original factory settings (if I wanted to sell it say)?
  2. Have you tried ABC camera app and if so are the results now comparable to Sony’s proprietary app?

Cheers
Geoff.

Hi @gbrowne

I’m not sure, I have not done this myself, but here is an article that might help. If you do go to sell the phone it might be worthwhile first trying to sell it with /e/. There are folks out there who dont know how to install /e/ but could be interested to try it out on a not too pricey used phone, support the cause :wink:

I could not find the ABC camera app in Apps or in f-droid, so cannot test it. Where did you install it from? Anyway, I would not be able to answer this one as I never used the phone with the original Sony OS and apps so cannot compare.

Hi Mike,
Thanks for the response. I loaded ABC from playstore - I imagine the availability of apps is going to be another thing I’ll need to watch as I move to /e/
Cheers,
Geoff.

Hi Mike,

Could I just ask, which camera app you use with with /e/ please ? Could you please tell me the max res it offers in settings ? After the basics of a phone, having a decent camera app is pretty critical for me.

Forgive my ignorance but is it likely that developers of (for example) ABC will make it available to /e/ users - is it a licensing issue ?

Cheers,
G.

Hi @gbrowne

I use the default camera app that comes with /e/. I took a sample photo for you using max resolution (3840x2160 8.29MP) and zero decompression. Results below (not sure if the forum software will compress the images - but all the figures are there).

This week’s Development Update post mentions that the default camera app is being improved:

I dont know about ADB getting ported to /e/, maybe @Manoj would know, but it looks like /e/ is investing in improving the default camera app anyway. I personally dont use advanced camera options (hdr, exposure etc), I just want a camera that focuses accurately really quickly and takes a good photo straight away.




Hi Mike. Really appreciate your efforts. You were right, the bb reduced the def considerably to 33k!
Also as expected the proprietary Sony 24Mpx option not available. Good lead on the camera app development - thank you for that.
I also discovered the ABC code is open source so I may be able to set up a toolchain and have a go.

Mike, could I ask one final favour plesase? I was looking into OpenCamera, which I suspect you are using. In Sourceforge a contributor suggests…
Sony Xperia-To enable the 23MP photo resolution, you need to set Settings/“Camera API” to “Camera2 API”. He doesn’t say if an app restart is required.
Is there any chance you could possibly do another test for me if you get a minute?
Cheers, Geoff

Hmm I already had camera2 api enabled.
I think the default /e/ camera app is forked from OpenCamera, so maybe there are some differences, or maybe its an old version of OpenCamera, but thats way out of my knowledge area. @petefoth would you know if it’s possible to take a 23MP photo on the Z5C?
Below are the camera app details on my device.

Camera v1.48.1
Code: 77
(c) 2013-2019 Mark Harman
Released under the GPL v3 or later (Camera also uses additional third party files, see online help for full licences and attributions.)
Package: foundation.e.camera
Android API version: 29
Device manufacturer: Sony
Device model: E5823
Device code-name: qcom
Device variant: suzuran
Language: en
Standard max heap?: 128
Large max heap?: 256
Display size: 720x1184
Display metrics: 720x1184
Current camera ID: 0
No. of cameras: 2
Multi-camera?: false
Camera API: Camera2 (Android L)
Photo mode: Standard
Last video error: error_100_4
Preview resolutions: 1280x720, 720x480, 640x480, 352x288, 320x240, 176x144
Preview resolution: 1280x720
Photo resolutions: 3840x2160, 2048x1536, 1920x1080, 1280x720, 720x480, 640x480, 352x288, 320x240, 176x144
Photo resolution: 3840x2160
Video qualities: 1, 6_r2048x1536, 6, 5, 4, 3_r640x480, 3, 2_r320x240, 2
Video resolutions: 3840x2160, 2048x1536, 1920x1080, 1280x720, 720x480, 640x480, 352x288, 320x240, 176x144
Video quality: 6
Video frame width: 1920
Video frame height: 1080
Video bit rate: 20000000
Video frame rate: 30
Video capture rate: 30.0
Video high speed: false
Video capture rate factor: 1.0
Auto-level?: Available
Auto-level enabled?: false
Face detection?: Available
RAW?: Not available
HDR?: Available
Panorama?: Available
Gyro sensors?: Available
Expo?: Available
Expo compensation?: Available
Exposure compensation range: -6 to 6
Manual ISO?: Available
ISO range: 50 to 3200
Manual exposure?: Available
Exposure range: 100000 to 100000000
Manual WB?: Available
WB temperature: 1000 to 15000
Optical stabilization?: Not available
Optical stabilization enabled?: false
Video stabilization?: Not available
Video stabilization enabled?: false
Tonemap curve?: Available
Tonemap max curve points: 512
Can disable shutter sound?: Available
Camera view angle: 77.36718 , 44.01548
Flash modes: flash_off, flash_auto, flash_on, flash_torch
Focus modes: focus_mode_auto, focus_mode_macro, focus_mode_locked, focus_mode_infinity, focus_mode_manual2, focus_mode_continuous_picture, focus_mode_continuous_video
Color effects: none, mono, negative, solarize, sepia, posterize
Scene modes: auto, portrait, landscape, night, night-portrait, beach, snow, fireworks, sports, party, barcode
White balances: auto, manual, incandescent, fluorescent, daylight, cloudy-daylight
Magnetic accuracy?: -1
Using SAF?: false
Save Location: OpenCamera
Save Location SAF:
Parameters: None

Sorry, but I have no idea. I know very little about cameras on phones or otherwise. And the Z5C hasn’t been my daily driver for a long while so I don’t know if I’ve ever taken any pictures with it. If you tell me where to look, and what to look for I can fire it up and have a look

@petefoth ok, no worries thanks.

@gbrowne I installed the Open Camera app, and tried camera2 api on/off and restarted app each time, still the max res it offers is 8.29MP. Maybe the Z5C is considered an “older device”… from the open camera documentation:

Why doesn’t Open Camera show 23MP resolution on my Sony Xperia, only 8MP? - This was a problem on older devices and/or with the old Camera API because of Sony not making this available to third party camera applications. On newer Sony devices, this should become available if you set Settings/“Camera API” to “Camera2 API”.

If you have any other suggestions to get it working, or know of any apps that can make use of the 23MP, let me know I am happy to test.

Hi Mike,
A sample shot of Durleston Park yesterday, demonstrating the resolution of the sensor.
Durlston Park at 5520x4140px
Not so great performance for a digital camera, but bot so bad for a 5yr-old phone (on a dull day!) ?
Its a 9 Mb file, so hope you can pick it up full size straight from the URL…

Cheers, G.