Flash Android L stock on Sony Xperia Z3 Compact using a Linux machine

So I decided I’d like to flash Android on Sony’s Z3 Compact device and spent the whole of the past two days on figuring out how to do it without taking the help of a Windows machine.

I’ve tested the process on Ubuntu 14.04 LTS as well as Fedora 23. Here, goes!

  1. Add udev rules so that the system recognizes the device
    # sudo wget -O /etc/udev/rules.d/51-android.rules https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/android/51-android.rules
    # sudo chmod a+r /etc/udev/rules.d/51-android.rules
    
  2. Install Android tools required just to flash a ROM
    # sudo apt-get install android-tools-adb android-tools-fastboot
  3. Update to ADB 1.0.32
    #adb version
    Android Debug Bridge version 1.0.31
    # wget -O - https://skia.googlesource.com/skia/+archive/cd048d18e0b81338c1a04b9749a00444597df394/platform_tools/android/bin/linux.tar.gz | tar -zxvf - adb
    # sudo mv adb /usr/bin/adb
    # sudo chmod +x /usr/bin/adb
    # adb version
    Android Debug Bridge version 1.0.32
  4. Download the FlashTool app from here for Linux. The file is of the form .7z and so you need to install the 7zip package using this:
    # 7Zip for extracting the package
    sudo apt-get install p7zip-full
  5. Extract the downloaded file preferably in a directory which has 644 permissions set.
  6. To run the FlashTool, we’ll be needing open-jdk and so we’ll need to install it:
    # Java to run the program
    # http://openjdk.java.net/install/
    sudo apt-get install openjdk-7-jre
  7. To make sure your FlashTool is working fine, run this command where you’ve extracted the folder:
    [abhiram@localhost xperia]$ pwd
    /home/abhiram/Documents/xperia
    [abhiram@localhost xperia]$ sudo FlashTool/FlashTool
    [sudo] password for abhiram: 
    Running as root.
    Used java home : ./x10flasher_lib/linjre64
    1. And the pop-up window appearsScreenshot from 2016-03-04 23-26-58
  8. Please wait till the sync gets completed and then proceed to download the ROM image of your choice. I’ve used the custom ROM which can be downloaded here. Ensure that the downloaded file has to be of the form .ftf 
  9. Place the downloaded .ftf file in the folder /root/.flashTool/firmwares
    [abhiram@localhost rom]$ sudo su
    [root@localhost rom]# cd /root/.flashTool/firmwares/
    [root@localhost firmwares]# ls
    Downloads prepared sinExtracted
    [root@localhost firmwares]# cp /home/abhiram/Documents/xperia/rom/D5803_23.4.A.1.264_IT.ftf .
  10. If all goes well, you can connect your phone to the machine using an USB cable and the message appears in the FlashTool saying that your device has been connected. Once you’ve selected the device type as Sony Xperia Z3 Compact you’re all set to flash your device.
  11. Disconnect the device, Click on the lightning bolt in the top left of Flashtool to “Flash device”.

    FlashTool

    FlashTool

  12. Select “Flashmode” and click “OK”.

Screenshot from 2016-03-05 20-56-31

13. Select the firmware build version that you want to flash from the “Firmware” pane. If you want to retain your apps/data, untick “DATA” in the “Wipe” pane. Then click “Flash”.

14. Flashtool will then indicate that it is “preparing files for flashing”.

FlashTool

You may have to wait around 60 seconds for the pop-up below to appear. Once it does, you should now connect your Sony Xperia device. Make sure the device is powered off and then hold the ‘volume down’ button whilst connecting the USB cable. Once the pop-up disappears and flashing has started, you can let go of the ‘volume down’ button.

NOTE: Ignore the instructions displayed which says “press the back button” – these relate to the older Sony Ericsson Xperia handsets.

Flash Tool Update

Flashtool will then start flashing your Xperia device. Once you see “Flashing finished” as indicated below, your Sony Xperia has been successfully flashed.

Congratulations you have just installed Android Lollipop! Now disconnect your Xperia device and power on the handset. Don’t despair if it takes a while for the handset to boot.

FlashTool_17-640x358

References:

 

Dabbles on web development, loves to talk and write.
Regional Ambassador Lead, Mozilla.
Writes code for Mozilla and FSMK.

Twitter Google+  

6 thoughts on “Flash Android L stock on Sony Xperia Z3 Compact using a Linux machine

    • This is what I could make out from Google translate:
      “Is a short version of the guide of Abhiram Ravikumar, which works wonderfully under a recent Debian. Java should be installed (whether [”

      I’m glad that it worked flawlessly. Is there any other issue?

Leave a Reply

Your email address will not be published. Required fields are marked *