How to Upgrade Sony Xperia Z3 Compact (D5803) to Android 8.1?


Question

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.


Answer

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.



Requirements




  • 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



Disclaimer



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.



Reboot



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



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.



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.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes