How do you upgrade the Sony Xperia Z3 Compact (D5803) to Android 8.1?

There are a number of web pages that attempt to answer this question, but none of them provide every step along the way. These include:

They all skip steps or are missing key pieces of information that someone who is unfamiliar with the process would prevent from completing. A comprehensive, step-by-step guide for a complete novice would be helpful.

  • 1
    Disclaimer: unlocking the bootloader will lose some Sony proprietary DRM protected functionality, such as X-Reality Engine and Miracast. And there's no way to get it back if it's gone, unless you make a backup of a specific partition. More details here: xda-developers.com/restore-lost-functionality-unlocked-xperia
    – FCM
    Commented Apr 3, 2019 at 23:11

2 Answers 2


Upgrade Sony Xperia Z3 Compact to Android 8.1

These instructions describe how to upgrade the Sony Xperia Z3 Compact (D5803) smart phone. These instructions do not include backup instructions, so be sure to save any important information and then proceed at your own risk.


  • Laptop or Desktop - Windows 7
  • Xperia - Stock Build Number 23.5.A.1.291 (revert if necessary)
  • Xperia - Fully charged (100% recommended)
  • Xperia Companion
  • TWRP


These instructions could brick your phone, rendering it a paperweight. Read all the instructions thoroughly at least once before you begin.

Unlocking the bootloader erases Sony's DRM-protected functionality, such as X-Reality Engine and Miracast. Unless you make a backup of a specific partition, the functionality will be permanently lost.

Enable Developer Mode

Enable developer mode on the phone as follows:

  1. Power on the phone
  2. Open Settings
  3. Tap About phone
  4. Scroll down to Build number
  5. Tap Build number at least 7 times in succession
  6. Enable developer mode

Developer mode is enabled.

Install Device Drivers

On the laptop or desktop computer, perform the following steps:

  1. Disconnect Phone from USB, if not already disconnected
  2. Download Flashtool v0.9.24.4 for Windows
  3. Install into C:\Flashtool
  4. Plug phone into laptop or desktop USB port
  5. Run C:\Flashtool\drivers\Flashtool-drivers.exe
  6. Check Flashboot Drivers
  7. Scroll down
  8. Check Xperia Z3 Compact Device Driver
  9. Click Install
  10. Accept any warnings that appear

The device drivers are installed.

Install Platform Tools

Download and install the Android Debug Bridge (ADB) as follows:

  1. Download ADB platform tools
  2. Unzip into C:\Program Files\platform-tools
  3. Open a command prompt
  4. Type: cd C:\Program Files\platform-tools
  5. Type: adb devices
  6. Authorize the connection on the phone.

The phone is listed and the ADB platform tools are installed.

Unblock the Bootloader

Advanced users can use Flashtool to unlock the bootloader, which is not described herein.

Unblock the phone's bootloader as follows:

  1. Follow along with Sony's Guide
  2. Complete Step 1: Check if the bootloader can be unlocked on your device
  3. Skip Step 2: installing devices drivers and platform tools
  4. Unplug the USB cable
  5. Complete Step 3: Connect to Fastboot
  6. Complete Step 4: Enter unlock key
  7. Type: fastboot -i 0x0fce oem unlock 0x{UNLOCK CODE}
    • Replace {UNLOCK CODE} with the unlock code from Sony

The console shows:

OKAY [  1.544s]
finished. total time: 1.560s

The bootloader is unlocked.


After the bootloader is unlocked, reboot the phone as follows:

  1. Type: fastboot reboot
  2. Wait for the reboot cycle to complete

The phone is rebooted with an unlocked bootloader.


TWRP is a tool for writing custom software on mobile phones. Install TWRP as follows:

  1. On the phone, visit https://twrp.me/sony/sonyxperiaz3compact.html
  2. Install the Official TWRP App from the Play Store.
  3. Download image into C:\Program Files\platform-tools:
  4. Power off phone
  5. Unplug USB cable
  6. Press and hold volume down
  7. Plug in USB cable
  8. Wait for blue indicator light in top left (may have to re-plug in)
    • Or run: adb reboot bootloader
  9. Type: fastboot flash FOTAKernel twrp_z3c_O_2018-05-09.img

The output resembles:

target didn't report max-download-size
sending 'FOTAKernel' (10730 KB)...
OKAY [  0.345s]
writing 'FOTAKernel'...
OKAY [  0.722s]
finished. total time: 1.075s

TWRP recovery mode application is installed, to assist flashing ROM.


A handful of ROMs exist. When choosing a ROM, also find the version of GApps that is suitable for the selected ROM. The Sony Xperia Z3 Compact uses a Snapdragon 801 Processor, which has a 32-bit architecture.

Note: These instructions have only been successfully accomplished using CarbonROM and MindTheGapps.

CarbonROM 6.1

Download CarbonROM from:

Download the ARM architecture version of MindTheGapps from:

Alternatively, download the 32-bit ARM architecture version of Open GApps for Android version 8.1 from:

The version of Open GApps must match the Android version of CarbonROM.

Skip to the General ROM Installation section.

LineageOS 15.1

Download LineageOS from (forum post):

Skip to the General ROM Installation section.

OmniROM Oreo 8.1

Download OmniROM Oreo from either of the following sites (forum post):

Continue to the General ROM Installation section.

General ROM Installation

The ROM filename will differ, depending on the ROM that was downloaded, such as:

  • CarbonROM: CARBON-CR-6.1-NOCT-WEEKLY-z3c-20180605-0603.zip
  • OmniROM: omni-8.1.0-20180320-z3c-nailyk.zip
  • LineageOS: lineage-15.1-20171103-UNOFFICIAL.zip

The steps to flash a given ROM are as follows:

  1. Reboot the phone using: fastboot reboot
  2. Start Xperia Companion
  3. Click Browse Xperia
  4. Copy both the ROM and the Gapps files into the phones download directory (e.g., Computer\Xperia Z3 Compact\Internal storage\Download\) Xperia Download Folder
  5. Power off phone
  6. Unplug phone
  7. Press and hold the volume down button
  8. Press and hold the power button
  9. Wait for a slight vibration before releasing both buttons
  10. Wait for recovery application to load
  11. Swipe to allow modifications
  12. Select WIPE
  13. Select Advanced
  14. Check the following:
    • Dalvik / ART cache
    • System
    • Cache
    • Data
  15. Swipe to confirm wipe
  16. Tap Home icon
  17. Tap Install
  18. Browse to and select the OS ROM file
  19. Tap Add more Zips
  20. Browse to and select the GApps file
  21. Swipe to confirm Flash
  22. Tap Reboot System
  23. Wait for the boot to complete

Android and the GApps are installed using the specified ROM.


A small note to Dave Jarvis' answer:

I almost gave up, just getting adb/fastboot talking to the device. Turned out to be a Windows 10 problem, because it refused without notice (?) to install drivers. The flashtool64 did complain however that it failed 2 of 3 in one of its windows, but I assumed (wrongly) that it was okay. I followed this guide to disable driver signature enforcement:

Please check if you have performed these steps to disable the driver signature enforcement in Windows 10 Technical Preview.

  1. Press the Win + C and click on PC settings.
  2. Switch over to the “Update & recovery” section.
  3. Then click on the Recovery option on the left hand side.
  4. Once selected, you will see an advanced startup section appear on the right hand side. You will need to click on the “Restart now” button.
  5. Once your Computer has rebooted you will need to choose the Troubleshoot option.
  6. Then head into Advanced options.
  7. Then Startup Settings.
  8. Since we are modifying boot time configuration settings, restart your computer once more.
  9. Here you will be given a list of startup settings that you can change. The one we are looking for is “Disable driver signature enforcement”. To choose the setting, you will need to press F7.

Once this was done, the drivers were installed from guide links and with flashtool64, and then I got a message that the adb "was too old", so they were updated as well.

Note: If you follow the guide, you will have new adb drivers. I assumed wrong (again) that my present ones would suffice.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .