[Xperia SP General] djibe89:
[GUIDE/TUTORIAL/HOWTO] Sony Xperia SP stock to Android 10

[GUIDE/TUTORIAL/HOWTO] Sony Xperia SP (C5303 or huashan) to Android 10 Q / LineageOS 17.1

This detailed step-by-step guide helps you transform your Sony Xperia SP to a powerful one with Android 10 Q.

To make sure you are with a Xperia SP / C5303 / huashan:

On the smartphone, go to Settings > About phone. Check that the "Model number" is correct : C5303.

Just below note the "Android version". It must be 4.3.

### We need to make sure Bootloader can be unlocked before going further.

Open dialer, enter code

*#*#7378423#*#*

In the follow menu, go to Service info > Configuration > Rooting status.

Bootloader unlock allowed: Yes

If it is set on No, you cannot update your device. You can quit this tutorial and cry, you will never unlock it.

### You must be logged as a Microsoft Windows administrator to run console commands below.

### When you lose control of your Xperia SP, hold Power + Volume+ until tab restarts.

CHANGELOG -------------------

v1. Initial release

1) DOWNLOAD FILES

- djibe Xperia SP pack (~ MB): http://bit.ly/djibe-xperiasp-pack

(contains FlashTool Xperia Driver Pack 1.8 for USB drivers + fastboot + recovery TWRP 3.4.0-0 + flashable TWRP 3.4 + Magisk root + Smartpack Kernel Manager)

+ ROM LineageOS 17.1 https://xdaforums.com/xperia-sp/orig-development/rom-lineageos-17-1-xperia-sp-t4147075

Download latest build: https://mega.nz/folder/r11xAbSL#Lwt5FOvHpV1POu_3OHU6Uw

+ OpenGApps ARM 10 Pico: https://opengapps.org/?arch=arm&api=10.0&variant=pico

+ Charge phone to 100 %.

NB. Use a USB2 port to connect tablet to PC.

2) INSTALL DRIVERS

Commands below are for Windows 10 installation of unsigned drivers.

### For other Windows versions, Google "windows X install unsigned driver".

On the keyboard of PC, use "Windows key + R" combo.

In the command prompt that opens, type:

shutdown -r -t 0 -o

This opens a Windows menu:

Go to Troubleshooting > Advanced Options > Settings > Restart

Upon restart, press on keyboard : key 7 - Disables drivers signature verification

After boot,

Start Flashtool Xperia Driver Pack 1.8,

check the Flashmode Drivers, Fastboot drivers, Common drivers Viskan board, start the installation and confirm the

forcing the driver installation. It ends by saying that everything was installed.

Restart Windows.

2bis, optionnal, FOR WARRANTY PURPOSE) Backup bootloader

Cannot help you precisely, didn't know about it at the time.

- Root. Follow Bin4ry root : http://xdaforums.com/showthread.php?t=1886460

Download : http://xdaforums.com/showthread.php?t=1886460

- Then Backup TA. https://github.com/DevShaft/Backup-TA

Unzip it in C:\

Make sure partition is saved.

3) BACKUP ALL YOUR DATA

Backup every SMS, photo, app login or sync everything in the cloud.

You will lose everything, including what is contained in the microSD card during bootloader unlock.

So backup everything and transfer every file to your computer.

### Do it now or you will regret it.

4) IMEI NUMBER AND UPDATES

On phone, go to Settings > About phone > Status > IMEI

Note the IMEI (15 digits). Store it.

If your Android version is lower than 4.3 (refer to beginning of tutorial),

connect to your Wifi network,

go to Settings > About phone > Software update > System.

5) MAKE SURE PHONE IS NOT SIMLOCKED

We need to check phone is not SIMlocked.

Open dialer, enter code again

*#*#7378423#*#*

Go to Service info > SIM lock. If everything is blank/unchecked ( [] ), phone is Desimlocked.

If not, you must contact your network provider for an unlock code.

### Don't move further until phone is simlocked. You cannot debrand/desimlock it using a custom ROM.

6) GENERATE BOOTLOADER UNLOCK CODE

From your PC, go to https://developer.sony.com/develop/open-devices/get-started/unlock-bootloader/

At the bottom of the page, in "Select your device:" menu: select Xperia SP.

Enter your IMEI, check first 2 checkboxes "I acknowledge that", click Submit and complete the captcha to generate unlock key.

Note the unlock code (beginning and end of page paragraph C.)

7) CONNECT PHONE IN FASTBOOT MODE

Phone powered off, hold "Volume up" while you plug phone in USB.

The blue light appears at the front bottom edge, the drivers install in Windows.

8) UNLOCK BOOTLOADER

In Windows, copy the path to the "flash" folder you unziped earlier.

Open a Windows command prompt : Start menu > Command prompt > Start as administrator

Then type

cd /d thePathToFlashFolder

(ex: E:\root\djibe Sony Xperia SP\flash)

Type:

fastboot getvar version

If "version: 0.5" is returned, drivers are correctly installed.

Create this text: fastboot -i 0x0fce oem unlock 0xAPPENDYOURUNLOCKCODE

Paste the previous line in windows command:

fastboot -i 0x0fce oem unlock 0xYOURUNLOCKKEY

confirm with Enter. After 5 seconds, it is displayed Finished. Total time: ...

Bootloader is unlocked !

9) FLASH TWRP RECOVERY 3.4

Still in fastboot, type in console :

fastboot flash boot twrp-3.4.0-0-huashan.img

. Confirm with Enter.

Wait, then once the confirmed success,

type :

fastboot reboot

(confirm with Enter).

AND while it restarts, repeatedly click Volume+ AND Volume- buttons to access the recovery (can take a while).

Leave phone connected to PC.

10) BACKUP CURRENT ROM AND USE TWRP RECOVERY

You are now in TWRP recovery,

check Never show this screen during boot again and Swipe to Allow modifications.

Go to Backup, select all partitions.

Tap on Select Storage > select Internal Storage and confirm with OK.

Then swipe to start backup.

Click the TWRP icon to return to home.

Go to Mount. Select Data partition and make sure bottom right button is dsiplaying Disable MTP text.

Phone must be connected to computer.

In Windows Explorer, open Xperia SP device > Internal Storage.

Copy whole TWRP folder and save it somewhere safe on your PC.

Copy twrp-3.4.0-20200808-fota-huashan.zip in your Internal storage folder.

11) INSTALL A PERMANENT TWRP RECOVERY

The TWRP recovery you are using is temporary.

We need to flash it on a partition.

Back to TWRP home menu > Install > tap on twrp-3.4.0-20200808-fota-huashan.zip and Swipe to confirm flash.

12) FORMAT PARTITIONS

### Last warning before losing all your Data. Backup

Go back to Home menu.

Go to Wipe > Data Format, type yes and click OK.

Go Wipe > Wipe Advanced > Select Cache, Data and swipe to confirm flash.

Still from Windows Explorer, copy ROM + OpenGapps + Magisk on phone.

13) INSTALL ROM AND GOOGLE APPS

Still under TWRP home menu.

Go to Install > select lineage*.zip.

### If no file is visible, click Storage > select Internal Storage.

### If you get an error and flash fails, go to Reboot > Recovery and wait for TWRP to reboot.

Add more zip > OpenGapps*.zip file

Swype to confirm flash.

Wait while Install Zips are flashed.

At the end, select Wipe Dalvik and cache, Do not install TWRP app and then Reboot system.

Wait during long first boot.

Enhoy your new phone.

14) ROOT

Magisk grants you superuser privileges from boot.

No extra Root manipulation needed.

Configure Android as you like.

14) OVERCLOCK (optionnal)

Open built-in Files app.

Open microSD folder.

Install Smartpack Kernel Manager app from my pack.

Launch app and grant root access.

Go to CPU menu > Apply on boot, CPU Maximum Frequency 1728 MHz

13) Others

For faster GPS fix, use GPS Status and Toolbox and downlaod A-GPS data.

Your tablet is a rocket, enjoy ;)

Thanks: LineageOS team, TWRP team, OpenGApps team, Flashtool Xperia Driver pack team, [MENTION=7827892]CaHbKaUp[/MENTION], [MENTION=5405613]CyberWalkMaN[/MENTION], [MENTION=2233641]AdrianDC[/MENTION], Chippa_a, [MENTION=5292989]Rootk1t[/MENTION]