[Xperia Z5 Compact General] djibe89:
[GUIDE/TUTORIAL/HOWTO] Sony Xperia Z5 Compact Stock to Android 12

[GUIDE/TUTORIAL/HOWTO] Sony Xperia Z5 Compact (z5c/suzuran) Stock to Android 12.1 / LineageOS 19.1

This detailed step-by-step guide helps you transform your Sony Xperia Z5 Compact (Z5c) to a powerful one with Android 12.

Netflix, Disney+ and my bank app work as 2024/02/11, gestures navigation too.

BEFORE GOING FURTHER

- Make sure you are with a Xperia Z5c

Go to Menu > Settings > About phone > Model number is: E5803 or E5823.

- Make sure bootloader is unlockable

Open phone app, dial *#*#7378423#*#* > Service info > Configuration > Rooting status: Bootloader unlock allowed: Yes

If No, you can cry, you cannot get further.

In previous menu, go to SIM Lock and make sure all the networks start with [].

If not, ask your Telecom provider the SIM unlock code.

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

### When you lose control of Xperia Z5c, hold Power + Volume+ until phone restarts.

### READ THOSE WARNING COMMENTS

Read all my tutorials at: https://github.com/djibe/Android-tutorials

CHANGELOG

v1. Initial release

1) DOWNLOAD FILES

- djibe Xperia Z5 Compact pack: https://mega.nz/file/YbM2AZrJ#SIFuEObj7soHZFIX0OqQnLUQ22CJgR6YJrWe-K2zw1A

(contains official Z5c USB drivers + adb + fastboot + XperiFirm by @IgorEisberg + Flashtool by Androxyde + recovery TWRP 3.7 by @Berni-0815 + microG_Remover + Magisk 27 + PlayIntegrityFix)

+ ROM LineageOS Unofficial 19.1: https://forum.xda-developers.com/t/rom-unofficial-12-s-lineageos-19-1-for-z5c-suzuran.4417131/

Download latest build (2024-01-19 or newer): https://mega.nz/file/3N9FWACL#x1HNPxX5e7ySMrB_mv47rorLSeVQTGbe9yypS5iFu6o

Extract both files from .7z archive (.zip and .md5, don't extract zipfile content).

### Not working: payment, VOLTE

+ BitGApps ARM64 12.1 OMNI or the version you want: (v2.7+): https://forum.xda-developers.com/t/custom-gapps-bitgapps-for-android.4012165/post-81060605

Download latest build: https://github.com/BiTGApps/BiTGApps-Release/releases

+ FTF: E5823_32.4.A.1.54_1298-5498_Customized-IT.zip from https://androidfilehost.com/?fid=11050483647474833416

or http://depositfiles.com/files/e6dsnxhy2

Unzip it.

+ a microSD card. Unzip ROM from .7z container, copy ROM's zipfile, microG_Remover, BitGApps, Magisk apk + zip, PlayIntegrityFix on microSD card and insert it in phone.

+ Charge phone to 100%.

2) IMEI NUMBER

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

Note the IMEI. Store it.

3) INSTALL DRIVERS

Commands below are for Windows 10/11 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.9 (from my pack),

check the Flashmode Drivers, Fastboot drivers, Xperia Z5 Compact Device > Install.

Authorize forcing the driver installation.

4) FIRMWARE NUMBER AND USB DEBUGGING

On phone, go to Menu > Settings > About phone > Build number

Make sure it is 32.4.A.1.54 (or higher) and tap 7 times on it to unlock Developer options.

### Don't go too fast if you are not with 32.4.A.1.54 firmware. Mine was 32.0.A.4.11 (Android 5.1.1) and we will upgrade it in a few chapters.

Go to Menu > Settings > Developer options > USB debugging, switch it ON and confirm it in next Dialog.

Within Developer options menu, switch ON OEM unlocking too.

5) GENERATE BOOTLOADER UNLOCK CODE

First, whatever firmware you have, we need to unlock the bootloader.

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: Select Xperia Z5 Compact

Enter your IMEI + check both checkboxes after this.

Copy the unlock code.

6) FASTBOOT MODE

Connect phone to USB with Android started.

Open the flash/ folder from my pack.

In Windows address bar, type "cmd" and hit Enter. A Windows Command window will open.

Now type

adb devices

Command returns: List of devices attached

YT91190206 unauthorized

If no Allow USB debugging? screen shows up on phone, disconnect and reconnect phone.

Check ON always allow from this computer and tap on OK.

Enter command:

adb reboot bootloader

Phone restarts and a blue LED is active on top right corner.

Now you can enter command:

fastboot devices

Command returns: CB5A28GGWK fastboot

### If command throws an error, go to Windows Device Manager and make sure Android device is set as Sony Fastboot interface.

### If not you'll have to force this driver.

We can go further.

7) UNLOCK XPERIA Z5C BOOTLOADER

### All data will be lost

Fill the command with your Unlock Code:

fastboot oem unlock 0xYOURUNLOCKKEY

confirm with Enter. After 2 seconds, it is displayed OKAY.

Bootloader is unlocked !

Unplug phone to shut it down.

Turn it on, wait during initialization.

Tap big grey button when it appears to restart phone.

Then fast configure it.

Activate Developer options again to set USB debugging ON.

Go to Security > Check Unknow sources.

8) UPGRADE FIRMWARE TO ANDROID 7.1

### If your firmware is not 32.4.A.1.54, complete this chapter. If it is already, skip to next chapter.

Install Flashtool.exe from my pack.

Launch Flashtool64.exe (Sony Mobile Flasher by Androxyde).

Click Flash Icon > Flashmode.

Source folder: set download folder for FTF firmware file (Download folder in my case).

In the firmwares panel, Sony Xperia Z5 Compact will be displayed.

Click on the arrows to open subfolders > E5823 > Customized IT and finally select 32.4.A.1.54.

Content panel will display many files.

Check all Wipe Sin items: APPS_LOG, DIAG, PERSIST, SSD, USERDATA.

Shutdown phone.

Hold Volume- and plug phone to USB, release when LED is red.

Wait till it becomes green.

Then click Flash (still in Flashtool64).

Wait during operations to complete, then unplug phone.

Start it again and wait during first boot.

Then when introduction screen is loaded,

wait until the warning stops popping and tap on the big POWER OFF button.

Then restart phone and fast configure it.

You now have Android 7.1 with 32.4.A.1.54 firmware.

Again, activate Developer console and USB debugging.

Shutdown phone.

9) FLASH TWRP RECOVERY 3.7

Android is launched.

Open a command on my /flash folder, type in console :

adb reboot bootloader

Again grant USB debugging from this computer.

Then when LED is blue:

fastboot flash recovery TWRP_3.7.0_9-0-recovery_suzuran_2022-12-23.img

. Confirm with Enter.

Wait, then once the confirmed success,

type :

fastboot reboot

, confirm with Enter

Let phone restart, then shut it down.

Let the command active.

Hold Power + Volume- until phone vibrates and release buttons, wait during TWRP boot.

9) BACKUP CURRENT ROM

You are now in TWRP recovery, Swipe to Allow Modifications.

Go to Backup.

Select Boot, FOTAKernel "Recovery", System, Data, OEM, LTALabel and Firmware partitions.

Tap on Select Storage and select MicroSD Card.

Swipe to Backup.

Go to TWRP Home screen.

Go to Wipe > Advanced Wipe > Select Dalvik, Cache, Data, Internal Storage, System and swipe to confirm erasing.

Go to Wipe > Format Data, type yes and tap on botton right check icon.

10) INSTALL ROM, GAPPS AND MAGISK

Back to TWRP home menu.

Go to Install > Select Storage > Micro SD card > OK

Select lineage*.zip.

Swipe to confirm flash.

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

### If you want to stay with MicroG (no Google apps), jump to next chapter.

To remove microG and install GApps, we need extra steps.

TWRP > Install > microG_Remover.zip

### If problems with microG_Remover:

### TWRP > Advanced > File Manager.

### Navigate to system > system > priv-app > DroidGuard. Tap on DroidGuard.apk > Delete and swipe.

### To return to parent folder, scroll to top and tap on (Up A Level).

### Repeat operation for: FakeStore, GmsCore and GsfProxy.

Back to TWRP home screen > Reboot > Power Off.

Boot to Recovery again: hold Power + Volume- until phone vibrates and release buttons, wait during TWRP boot.

Back to TWRP > Go to Install > flash bitgapps*.zip

then flash Magisk*.zip

Swipe to confirm flash.

At the end, tap on Wipe Cache/Dalvik, swipe and Reboot System.

Wait during boot.

11) ROOT (Optional)

### Needed to work with Netflix or Disney+

Do not connect to your Android account.

Configure Android as you like.

Don't try to set fingerprints at first setup. It will crash.

### If you copied bitgapps.conf, Android starts with SetupWizard.

No need for extra work to be root.

Magisk launches with Android.

Superuser permissions can be managed from Magisk Manager app.

Go to Files app > Menu > E5823 > Magisk*.apk and tap to Install

Launch Magisk.

Then in Magisk go to Settings > Hide the Magisk app, give it a name and switch Zygisk option ON.

Go to Modules Tab > Install from Storage: PlayIntegrityFix (located in my archive) > Reboot.

Unlock Developer options: go to Settings > About.

At the bottom, tap 7 times on Build number.

Go to Settings > System > Advanced > Developer options > Disable Android debugging (ADB).

Reboot phone.

On reboot, you can connect to Wi-Fi and test SafetyNet tests with an app like YASNAC.

12) TWEAKS

Go to Settings > About phone > Tap 7 times on Build number.

Go to Settings > System > Advanced > Developer options.

Advanced restart switched ON (Hold power > Restart > Restart to recovery to access TWRP easily later)

Android debugging switched ON

Windows animation scale to Animation scale .5x

Same for Transition animation scale and Animator duration scale to improve reactivity

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

Your phone is a rocket, enjoy ;-)

Thanks: LineageOS team, TWRP team, BitGApps team, @NeoArian, @TheHitMan, TopJohnWu

----------------------------------------------------

Boot to recovery: hold Power + Volume- until phone vibrates and release buttons