How to install CyanogenMod 12 on Sony Xperia Z1 Compact – Part2

How to install CyanogenMod 12 on Sony Xperia Z1 Compact – Part2 – Installation

After preparation – See my post How to install CyanogenMod 12 on Sony Xperia Z1 Compact – Part1 you are ready to Install CyanogenMod 12 on Sony Xperia Z1 Compact.

[box type=”warning”] NOTE: You are doing it at your own risk, Make sure you have backup. For Sony devices you might want to create DRM keys backup first before you start.[/box]

Unlock bootloader.

First what you have to do is unlock bootloader. In order to unlock the bootloader on your Xperia Z1 Compact you will need to obtain a code from Sony. The following process will help you acquire this code so that you can flash a custom recovery.

  1. Open the Phone application on the Xperia Z1 Compact and enter *#06# to obtain the device’s IMEI. Save this for later use.
    • Optional: if you do not have a phone app, the IMEI can be found on the box or on the device in About Device -> Status.
  2. Put the device into fastboot mode:
    • With the device powered down, hold Volume Up and connect the USB cable. The notification light should turn blue to indicate you are in fastboot mode.
  3. Open a terminal on the PC and enter:

    • If you receive the message <waiting for device> fastboot is not configured properly, please see fastboot for more details.
  4. Navigate a browser here
    • Select your device and click the ‘continue’ button at the bottom of the page.
    • Enter your email address, agree to the terms and select ‘Submit’
    • Click the link from your email, enter your IMEI and continue
    • The unlock code should now appear, write this down for the next step.
  5. In the PC’s terminal, enter the following command: fastboot oem unlock 0xKEY

    • KEY corresponds to the unlock code you were given.

The Xperia Z1 Compact’s bootloader should now be unlocked.

Replace boot loader.

Replace Sony bootloader by CyanogenMod boot loader.

  1. Download Cyanogen build for Sony Xperia Z1 Compact 
  2. Extract boot.img from the zip to your computer, you will need this file for fastboot.
  3. Put the phone into fastboot mode. With the device powered down, hold Volume Up and connect the USB cable. The notification light should turn blue to indicate you are in fastboot mode.
  4. Open a terminal on the PC with admin rights, access your platform-tools directory of the Android SDK, and enter the following:

    While the device reboots, press the Volume rockers a few times to load recovery.
Install CyanogenMod on Sony Xperia Z1 Compact
  1. Once the device boots into CyanogenMod Recovery Mode, you can either use the physical volume buttons to move up and down or use touch screen. The home button is used to confirm your selection.

    CyanogenMode 12 Recovery

    CyanogenMod 12 Recovery

  2. From Cyanogen Recovery screen go to Apply update –> apply from ADB
  3. Open elevated command prompt and run below command
  4. Reboot System

After installation and reboot your phone should boot into brand new and shiny CyanogenMod 12.X. Be patient, it might take few minutes (up to 5, but I’ve seen first boot time almost 10 minutes) to boot up for the first time. On my phone, first boot, took about 2 minutes.

Install google apps on Sony Xperia Z1 Compact.
  1. Power phone off
  2. Connect Phone to USB cable
  3. Get into Recovery Mode – power phone on and push Volume Down button
  4. From Cyanogen Recovery screen go to Apply update –> apply from ADB –> and run below command
Troubleshooting:

If you get error message – device not found – you have to update or install driver for Sony Device in Device and Printers

I always choose Sony Sa0109 ADB Interface Driver

Sony Xperia Z1 Compact usb driver

Sony Xperia Z1 Compact usb driver

After installation – Reboot System now and Enjoy 🙂

Screenshot_2015-08-05-10-07-12

Artur Krzywdzinski

Artur is Consulting Architect at Nutanix. He has been using, designing and deploying VMware based solutions since 2005 and Microsoft since 2012. He specialize in designing and implementing private and hybrid cloud solution based on VMware and Microsoft software stacks, datacenter migrations and transformation, disaster avoidance. Artur has been in IT industry since 1999 and consulting since 2008. Artur holds VMware Certified Design Expert certification (VCDX #077).

  • Johanhs

    How to make a DRM key backup? I have a sony xperia z1 compact on lollipop (bootloader locked, not rooted). All the DRM backup tools only work on rooted devices. The only way to root a z1c is by unlocking the bootloader (which deletes all DRM keys). The only option I found is kingroot (but I don’t really trust this).

    Is there an alternative way?

    Best Regards

    Johan

    • Hi Johan,

      Shame to admit but I did not make backup of my DRM keys, so I do not have tested way which I could recommend to use it.

      • Johanhs

        Thanks for the fast reply 🙂 Finally managed to fix the drivers.
        I’ll just leave the DRM keys as well. Did you already experienced some drawbacks on CM12.1? No problems with the camera quality?

        • I haven’t noticed issues with camera quality. There might be issues with GPS -however this can be fixed following instructions from generally available blog posts . My Sony got reboot when I use GSP with Google Maps. I did not try newer VM 12.1 build yet, though. I’m running 3 months old build.

  • Johanhs

    Thx the tutorial was very useful 🙂
    Only the installation of Gapps didn’t work with Cyanogen Recovery.
    I had to replace it with TWRP (found it on XDA forums)

  • Jakob Janoch

    what went wrong if it does not enter recovery mode after bootloader was replaced and doesn’t boot at all?
    I hope you can help me.