In the past two months, I switched my phone from my trusty and venerable Moto X (1st gen, 2013) to a Sony Xperia Z5 Compact (circa 2015).  However, due to a strange Lollipop MMS texting issue, I was forced to switch to a Sony Xperia Z3 Compact (circa 2014).  Even though Sony is one of the better manufacturers in allowing users to unlock their bootloaders, it does come with a few tradeoffs:
  • Voided warranty
  • Loss of DRM-related features
    • SD card storage capacity
    • fancy display features
    • fancy audio features
    • fancy camera features
Thus, the choice originally was whether the fancy features were worth the tradeoff of sticking with an older version of Android.  At the time, the answer was yes.  Warranty was not an issue, as the phone was already way out of the warranty time period.  But, the older version of Android was still plenty good, as it was what I was using on my old Moto X.  However, the MMS issue was a dealbreaker, and pushed me over the edge, into sacrificing the fancy features for a newer version of Android, and hopefully fixing the MMS issue.  Now, if I could somehow keep the DRM keys, and update my version of Android, it might be the best of both worlds.  Spoiler: I lost the DRM keys, but I honestly don't feel that the loss of any of the fancy features caused any heartache.

As for why I am stuck with using these old phones, it is simply because there's no reasonably priced new phones that I can use with one hand and easily put into my pocket.

It might've been a combination of most guides I found were either for people who had been living in this world, and that things have changed in the years between when they were written and now, that I ultimately could not save my DRM keys.  However, I did end up being able to update my Android, and in so doing, fix the MMS issue.  Here is the updated guide on how to do it.

Procedure
  1. Install required tools
    • Download drivers (OEM/adb, fastboot, and Google USB driver - see links below)
    • Download platform tools (be sure to install r26, not the latest) - see link below
    • Download iovyroot, Flashtool (Emma), and Xperia Companion - see links below
    • For Windows 10, reboot the computer with driver signature disabled - more info here
    • Extract all downloaded packages and install
      • OEM/adb: Xperia_Z5_Compact_driver (for Z5 Compact) or Xperia_Z3_Compact_driver (for Z3 Compact)
        1. Extract zip package
        2. Right-click on sa0113adb.inf (for Z5 Compact) or sa0111adb.inf (for Z3 Compact)
        3. Select "Install"
        4. Go through the process to install the driver
      • Fastboot: latest_usb_driver_windows (Google USB driver) and downloadinf_v1.01 (Sony fastboot driver)
        1. Extract zip packages
        2. Copy downloadinf_v1.01/android_winusb.inf to latest_usb_driver_windows/usb_driver, replacing the android_winusb.inf file
        3. Right-click on android_winusb.inf
        4. Select "Install"
        5. Go through the process to install the driver
      • Platform tools: platform-tools_r26.0.2-windows
        1. Extract zip package
      • iovyroot: iovyroot_v0.1, iovyroot_v0.2, or iovyroot_v0.3
        1. Extract zip package
      • Flashtool (Emma): Xperia_Flash_Tool_Setup.exe
        1. Double-click the executable
        2. Go through the process to install the application
      • Xperia Companion: XperiaCompanion.exe
        1. Double-click the executable
        2. Go through the process to install the application
  2. Set up the phone
    1. Enable Developer options
      1. Go to Settings > About phone
      2. Tap on "Build number" 7 times
    2. Enable USB debugging
      1. Go to Settings > Developer options
      2. Make sure it is on
      3. Toggle "USB debugging", so it is enabled
    3. Enable unknown sources (can install unsigned 3rd party apps)
      1. Go to Settings > Lock screen & security
      2. Toggle "Unknown sources", so it is enabled
  3. Backup DRM keys
    1. Plug the phone into the computer via USB
    2. Open a command prompt, and navigate to the iovyroot directory
    3. Enter the command "tabackup.bat".  It should backup the DRM keys into a file in this directory.  Please note that your phone needs to have a Lollipop firmware; specifically 32.0.A.6.200 for E5803 and E5823 (Z5 Compact).  If for some reason this step fails, then sad to say, but you probably can't unlock the bootloader and still keep the DRM keys.
    4. Hang on to the file (should be named TA-XXX.img, where XXX is a random string)
  4. Unlock bootloader (and lose DRM keys)
    1. Generate the bootloader unlock code here
    2. Follow these instructions
      1. Turn off the phone (and make sure it is not connected to the computer; disconnect if it is)
      2. Plug the phone into the computer via USB while holding down the Volume up key (fastboot key)
      3. Enter the command "fastboot devices".  You should see your phone listed
      4. Enter the command "fastboot -i 0x0fce oem unlock 0x<insert your unlock code>
  5. Flash firmware
    1. Follow these instructions
      1. Open the Flashtool (Emma)
      2. Turn off the phone (and make sure it is not connected to the computer; disconnect if it is)
      3. Plug the phone into the computer via USB while holding down the Volume down key (flash key)
      4. Select a firmware from the list of choices
      5. Click "Apply Service"
      6. Follow the instructions in the Flashtool
  6. Restore DRM keys
    1. Turn off the phone (and make sure it is not connected to the computer; disconnect if it is)
    2. Turn the phone on
    3. Plug the phone into the computer via USB
    4. Open a command prompt, and navigate to the iovyroot directory
    5. Enter the command "tarestore.bat TA-XXX.img", where XXX is the specific string when you backed up the DRM keys.

Guides

How to unlock bootloader - warning: you will lose your DRM keys
Unlock bootloader procedure - generates bootloader unlock code

Tools
iovyroot - backup DRM keys
XperiFirm - download Xperia firmware
Flashtool (Emma) - flash Xperia devices (official tool from Sony)
Xperia Companion - update firmware, backup, restore, transfer files (official tool from Sony); previously called Sony Update Service (SUS)
Platform tools - utility to unlock bootloader

Firmwares
Z3 Compact - AOSP 23.5.A.1.291
Software binaries for AOSP - Android 6.0.1 (also works for Android 7.1)

Other information

Written on November 3, 2018
Updated on December 27, 2023. © Copyright 2024 David Chang. All Rights Reserved. Log in | Visitors