So I wanted to upgrade my Sony Xperia Ray from its now old (and official) Gingerbread version of Android to the relatively more modern Jellybean. The most reliable alternative out there is Cyanogenmod.
While the Cyanogenmod wiki was generally useful, here's what I think is a cleaner guide. I performed the upgrade via a Kubuntu Trusty (14.04) laptop.
N.B. Cyanogenmod only provides a Jellybean 4.1 upgrade for the Ray via it's 10.0 package. 10.1 and later are all not available for the Ray officially. I've yet to see anything semi-reliable that offers to do better than Jellybean 4.1.
- Backup everything; particularly your contacts. Don't trust Google's auto-sync feature. Export your contacts or use an app like this random one. Also, don't store the backups on the phone! Save them to a laptop, import your contacts to Gmail, etc.
- Install required packages on lInux:
sudo apt-get install android-tools-fastboot android-tools-adb
You will be asked to reboot your system.
- Download the latest Cyanogenmod packages for the Sony Xperia Ray (codenamed "Urushi", a type of lacquer apparently). The nightly is an unstable version, but it's from October 2013 and most peeps on various fora reckon that it's fine to use.
cm-10-20131007-NIGHTLY-urushi.zipis, therefore, what I downloaded.
- If you want your Android phone sans Google, then don't bother with this step. But you probably do as El GOOG just makes life easier. If so, download the Google Apps package for CM 10. The file I downloaded was
- Now, this is important: Make sure that you either perform any of the following steps which involve the LInux terminal as root or use
- The first step in the upgrade process is the unlocking of the bootloader. A couple of years ago, this was something of a complicated process as manufacturers weren't terribly helpful and believed that "openness" was wrong and hurt their brand/bottomline, things have now changed. Unlocking the Xperia Ray is as simple as following this official Sony unlocker guide. Scroll down and choose the Xperia Ray and following the prompt. There is no clean alternative to this process which involves giving Sony your e-mail address, IMEI number, and voiding your warranty. The process ends with Sony giving you a code (something like
A1B3374CCC37C731) and telling you how to unlock it (mainly on windows). Just retain the code from the page and use it in the following steps for lInux.
- In the phone's settings, look in the Applications menu and Developer options for a USB Debugging option and turn it on.
- Now, switch off the phone.
- Connect the phone to the laptop's USB port. As you connect the cable to the laptop/phone to finish the connection, press the VOLUME UP button (with a long press) or perhaps trying pressing the UP and Down buttons on the rocker. This pops the phone into what is known as a fastboot mode.
Note: there will be no indicator on the phone that it has worked as it is currently switched off.
- To check if the phone has entered fastboot mode and is accessible via the laptop, enter the following in a terminal:
sudo fastboot devices
If the phone is accessible, you will see something like the following:
$ sudo fastboot devices
If you don't see this, then disconnect the cable and repeat the previous step until this works. Another alternative command I've seen in guides to test connectivity is the following:
$ sudo fastboot getvar version
finished. total time: 0.000s
- Once connectivity has been established, unlock the bootloader. There is no going back after this in terms of your warranty!
sudo fastboot -i 0x0fce oem unlock 0xSONYKEY
where SONYKEY represents the unlock key that Sony gave you. This would make the command look something like:
sudo fastboot -i 0x0fce oem unlock 0xA1B3374CCC37C731
I don't remember the exact output, but the tool performed a few steps and then said "Done!" which was very satisfying!
- Now that Sony has unlocked the phone for us, we can now install a cusom boot image. Unzip the Cyanogenmod ZIP file (
cm-10-20131007-NIGHTLY-urushi.zip) that you downloaded earlier and look for a file within named
boot.img. We need to transfer this to the phone as its new bootloader. To do this type:
fastboot flash boot boot.img
I don't remember what message this results in, but there's a confirmation of success, IIRC.
sudo fastboot rebootto boot the phone.
- it's time to install Cyanogenmod! As the phone starts up, immediately start pressing the buttons on the volume rocker repeatedly until you see a bright blue menu (the ClockworkMod recovery menu) on the screen. This menu can be navigated using the volume rocker buttons for UP and DOWN and the HOME/Power button to SELECT an option.
- First select the backup and restore menu (and the backup option within) to backup the current install just in case the shit hitteth the fan.
- Press the phone's BACK button to go back to the main menu and choose wipe data/factory reset and select Yes after much button pressing.
- Back on the main menu, choose install zip from sideload which will give you the folllowing message:
Now send the package you want to apply to the device with "adb sideload <filename>" ...
- To send the package, we will need to go back to the Linux terminal to type (remember the sudo/root warning):
$ sudo adb sideload cm-10-20131007-NIGHTLY-urushi.zip
which will result in:
sending: 'sideload' 100%
On the phone's screen, you will see something like:
Finding update package...
Opening update package...
And that's it. There's NO confirmation that the installation has succeeding or even completed. However, if you are able to navigate the blue menu above using the volume buttons, then the installation is over. I waited an extra while just to be sure! Not terribly user-friendly!
- If you're interested in installing the Google apps package you downloaded earlier, you can do it now. I however performed this step (by returning to after I got CM working.
$ sudo adb sideload gapps-jb-20121011-signed.zip
This install does give you an "Installation completed" message :|
- And that's it really. Now select the reboot system now option in the blue menu and if you wait for a while, you will see the wonderful cyanogenmod animated logo booting into your new OS!
I must say though that the "Free Xperia" logo is ridiculously fugly :/
I hope that this has helped somebody out there :) Please leave a note if I've made any errors.