How to Install CyanogenMod on the Sony Ericsson Xperia Ray ("urushi")

From CyanogenMod
Jump to: navigation, search

This guide will walk you through the process of taking the Xperia Ray from stock to having a custom recovery image and the ability to flash the latest version of CyanogenMod.

Note: DISCLAIMER

Modifying or replacing your device's software may void your device's warranty, lead to data loss, hair loss, financial loss, privacy loss, security breaches, or other damage, and therefore must be done entirely at your own risk. No one affiliated with the CyanogenMod project is responsible for your actions. Good luck.


Important Notes

The Sony Ericsson Xperia Ray (aka urushi) is a touchscreen smartphone manufactured by Sony Ericsson. Official CyanogenMod support for the Sony Ericsson Xperia Ray was added in CyanogenMod 7.1.

Unlock your Xperia Ray

What does "unlocking" mean?

The first step in putting any custom operating system on your Xperia Ray is to unlock the bootloader. A bootloader is the very first program that runs when you turn on your device. The bootloader initializes some hardware and then loads the kernel and ramdisk, and gets the boot process going. If the bootloader is in locked mode, it will ensure that only the stock operating system can run. Since you will be installing your own operating system (CyanogenMod), you need to turn this off.

To unlock your bootloader, you’ll first need a program on your computer called adb. One way to get adb is to download and install the Android SDK (Software Developer Kit) from Google. The SDK is used by app developers when they’re writing programs for Android, and who knows, you may want to write apps someday.

Install the Android SDK

Download the SDK, per the steps on Google's web page. Then install it by following the specific instructions for your computer.

Obtaining the Bootloader Unlock Code

Note:

Unlocking the bootloader on a Sony device may automatically wipe internal storage; a backup of the sdcard is suggested. It will also irreversibly erase the DRM keys stored in the TA partition of some devices, which will result in the loss of certain proprietary features that may have been included. Check your specific device forum on XDA to learn more.

In order to unlock the bootloader on your Xperia Ray 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 Ray and enter *#06# to obtain the device's IMEI, IDID or MEID. Save this for later use.
    • Optional: if you do not have a phone app, the IMEI, IDID or MEID can be found on the box or on the device in Settings -> About Device -> Status.
  2. Put the device into fastboot mode:
    • Vol Up
  3. Open a terminal on the PC and enter fastboot getvar version
    • 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, IDID or MEID 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 Ray's bootloader should now be unlocked.

Installing CyanogenMod on Sony Devices

  1. Download the CyanogenMod build package for your device that you'd like to install to your computer.
    Optional: Download 3rd party applications packages, like Google Apps which are necessary to download apps from Google Play.
  2. Extract boot.img from the zip to your computer, you will need this file for fastboot.
  3. Put the phone into fastboot mode:
    Vol Up
  4. Open a terminal on the PC with admin rights, access your platform-tools directory of the Android SDK, and enter the following:
    • fastboot flash boot boot.img
    • fastboot reboot
    While the device reboots, press the Volume rockers a few times to load recovery.
Note: Make the selection below based on the recovery version you see on your screen. If you're installing CyanogenMod 11, you will have CWM Recovery. If installing CyanogenMod 12.0 or newer, you will have CyanogenMod Recovery.

Click here to continue instructions using CyanogenMod Recovery
Note: Once the device boots into CyanogenMod Recovery, use the physical volume buttons to move up and down. The home button is used to confirm your selection. The recovery is also touch screen friendly, so you can swipe up or down to scroll and tap the item you wish to select.
  1. Optional (Recommended): Using adb you can create a backup on your PC of your apps and app data. Boot the device into android and open a command prompt (or terminal on Mac and Linux) and enter the following:
    • adb backup -apk -all -f backup20161225.ab
    When the backup is complete return to recovery mode.
  2. On the device, select wipe data/factory reset.
  3. You have two options for installing the installation zip packages. (Note: The sideload method requires a recent version of adb to be working in recovery (adb bundled with ubuntu may have protocol errors):
    • Sideload method: Select apply update > apply update from adb. Open a command prompt (or Terminal on Mac and Linux) and enter adb sideload update.zip, where update.zip should be replaced with the package filename. If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it. The installer does not necessarily display an "Install complete." message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Install update method: If you previously placed the installation zip packages on your internal storage, select apply update > choose from internal storage. Navigate to the directory where you placed the packages and select one. If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  4. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Note:

On all 2011 model Sony devices, the kernel will not update when flashed in recovery, so the kernel must be updated via fastboot every time you flash a new build of CyanogenMod.


Click here to continue instructions using CWM Recovery
Note:Once the device boots into ClockworkMod Recovery, use the physical volume buttons to move up and down. The home button is used to confirm your selection.
  1. Optional (Recommended): Select backup and restore to create a backup of your current ROM.
  2. Select wipe data/factory reset. If you get an error formatting /data, try format /data and /data/media from the mounts and storage menu
  3. You have two options for transferring and installing the installation zip packages. Both cases require a recent version of adb to be working in recovery (adb bundled with ubuntu may have protocol errors). The sideload method is more universal across devices, whereas the push and install method is more commonly used:
    • Sideload method: select install zip > install zip from sideload. Follow the on-screen notices to install the package. The installer does not necessarily display an "Install complete." message. You can tell the install is complete if there were no fatal error messages and you have regained control over the menu.
    • Push and install method: Open a command prompt (or Terminal on Mac and Linux) and navigate to the directory holding the package(s) you would like to install. On the device, navigate to the mounts and storage menu. If you see /storage/sdcard0 as a mountable volume, go ahead and mount it. If you do not see this directory, then instead mount the /data directory. Take note of which volume you mounted. Now, push the package(s) to your device:
    - If you mounted /storage/sdcard0, then: adb push update.zip /storage/sdcard0/
    - If you mounted /data, then: adb push update.zip /sdcard/0/
    where update.zip should be replaced with the package filename. Go back to the main menu and select install zip. Choose to install from the same directory where you pushed the package(s). If you are installing multiple packages, install CyanogenMod first and then install any subsequent packages on top of it.
  4. Once installation has finished, return to the main menu and select reboot system now. The device will now boot into CyanogenMod.

Note:

On all 2011 model Sony devices, the kernel will not update when flashed in recovery, so the kernel must be updated via fastboot every time you flash a new build of CyanogenMod.


Helpful Tip

See something wrong on this page? Click here: Report a Wiki Problem.