Xperia Ray ICS Update

A description of upgrading the Xperia Ray from Android 2.3 (Gingerbread) to Android 4.0.4 (Ice Cream Sandwich)

Last updated: 28 November 2012


Disclaimer

Let’s start with the usual disclaimers. This document was written based entirely on my own experiences. I make no guarantees that the procedures outlined in this document will work for you. It is entirely possible that you can damage your phone by following the steps in this document. I accept no liability if you damage your phone or in any way render it unusable or unfit for purpose. Any loss of data, money, or time incurred due to actions taken after reading this document are solely your responsibility. If you perform any (or all) of the steps described in this document, you agree to absolve me of any and all liability with respect to any damages or penalties incurred (including, but not limited to, financial loss, data loss, inability to use your phone, or other damage to your phone). Perform the actions outlined in this document AT YOUR OWN RISK!

In addition to the above, I do not accept responsibility for any of the content that is linked-to from this document.

References and Thanks

I would usually put this at the end, but then I fear that people would not read it, and that’s not fair on the people without whom this document would not have been written.

There are no doubt more people to thank than just the people I have listed in this section. It seems like every forum post related to phone flashing links to other people’s forum posts and they link to others etc. It becomes a very large web of information that can be hard to navigate (which was really my main inspiration for trying to bring all the information together into this document). So if I have missed out any credits here, then I apologise. If you are reading this and feel that you ought to be credited, then let me know and I will add your name.

Upgrading

Thanks to uliwooly-wooly for this thread, which was the source of all my information (albeit, information collected from other threads, with thank-yous going out to all the other contributers): http://talk.sonymobile.com/thread/38251?start=0&tstart=0

Rooting

Thanks to Anicane for this post:

http://forum.xda-developers.com/showthread.php?t=1854415

Thanks to zstoichev for this post:

http://forum.xda-developers.com/showthread.php?t=1682224

Big thanks go to [W]ar[H]ead for his little nugget of information contained in this post: http://forum.xda-developers.com/showthread.php?t=1898236. I spent around 1 hour trying to find out why the kernel on my phone had not been downgraded on my phone after I flashed it with Flashtool. I kept checking in the “About phone” section of my phone and the kernel had not changed. Then I stumbled on this post and read; “Even your build number, android version won't change. Everything would remain same. So please don't go to phone settings to check anything” - it turned out that my kernel was flashed and I had wasted an hour chasing my tail!

Thanks, of course, to DooMLoRD for his script and instructions here: http://forum.xda-developers.com/showthread.php?t=1601038

A belated thanks to Nabeel, whose detailed guide is posted here (unfortunately I did not find it until after writing this document):

http://talk.sonymobile.com/message/178992#178992

Preamble

This document was written based on my experience of updating my Sony Ericsson Xperia Ray from the official Android 2.3.4 (“Gingerbread” - Sony Build Number 4.0.2.A.0.62) to the official Android 4.0.4 release (“Ice Cream Sandwich” - Sony Build Number 4.1.B.0.587). My phone has the notorius (in the UK) SI number of: 1252-368. If you believe everything you read, this will never be updated to ICS officially by Sony.

The update was carried out on a Windows PC running Windows 8 64-bit. Whether it will work using other PCs is, of course, unknown to me. I believe the Americans like to say “your mileage may vary”... ;-)

Recommendations

I always recommend you do the following (unless you don’t really care about your data, or your phone is virgin and you have nothing to lose!)

  1. On your phone, go to “Settings > Privacy and ensure that “Backup my data” and “Automatic restore” are checked.

  1. Backup your SMS, MMS, Call Logs, Settings, Apps & Contacts.
    (Apps are automatically remembered by Google Play, so there is not really a need to back these up. Contacts can also be backed up with Google if you are using your phone with a Google account.)


I have read that it is possible to use the Sony Ericsson Backup and Restore utility from the previous generation Xperia devices on 2011/2012 devices. See here:
http://talk.sonymobile.com/thread/36355
And see here for instructions on installing it:
http://talk.sonymobile.com/message/186671#186671

However, I didn’t like the idea of running an APK from an “unknown source” with access to everything on my phone.* This is no reflection on whoever posted the APK as they are quite possibly well known and well respected within “the scene”, but I am not part of the scene, so I decided to play-it-safe and, since I only wanted to backup my SMS messages, I downloaded “SMS Backup & Restore”:

https://play.google.com/store/apps/details?id=com.riteshsahu.SMSBackupRestore&hl=en

which is also linked to in the thread above.

Read the whole thread for any extra information you might need. I won’t re-invent the wheel by repeating what has already been said here. I assume that if you are not entirely sure how to backup your data and sideload apps, then maybe you should not be reading documents about flashing phones... ;-p

* But I do like installing a complete Android 4.0.4 ROM from an unknown source, yes, life is full of contradictions...

Backing-up Current Firmware

I felt very strongly that I should backup my firmware. If I have any problems, or decide I don’t like the ICS update or for whatever other reason, if I have a backup, I can easily go back to the official firmware that came with my phone. I didn’t like the prospect of having to take the phone to a Sony Service Centre, or use another firmware from the internet somewhere, should I want to revert back to 2.3.x from ICS...

Downloading and Installing Sony Update Service

Firstly I downloaded and installed Sony Update Service (SUS) from here:
http://www.sonymobile.com/gb/tools/update-service/

Downloading and Installing “Flashtool”

For a discussion about Flashtool and how to use it, see here:

http://forum.xda-developers.com/showthread.php?t=920746

For information about the program itself and to download, visit here:

http://androxyde.github.com/Flashtool/

Now I downloaded and installed Flashtool following the instructions on the Flashtool website.

Reseting Phone to Factory Defaults

I thought it would be best to ensure there was nothing “strange” happening when performing the repair and making a backup of my firmware. I believe the repair operation will wipe your phone clean anyway, so I certainly didn’t see any harm in doing this.

Running Sony Update Service and Making Backup

At this point, I performed the following steps.

  1. Ran Sony Update Service (SUS) and followed the instructions.

  1. When I got to the screen with the option to re-install the software for my phone, I selected “Install”.

    I followed the instructions to the end and once the re-install was complete, closed down the Sony Update Centre
    .

  1. Created a new folder in the C:\Flashtool folder. I called it “RayFW” (the name was not important, knowing where to find it was).

  1. On my PC, I navigated to the following folder:
    C:\Program Files (x86)\Sony Mobile\Update Service\db\13740270\blob_fs
    (It is “Program Files (x86)” for 64-bit Windows. There is only one folder - “Program Files” - in 32-bit Windows.)

  1. I copied the two largest files in that folder (named “FILE_<something>”) to the folder that I created in C:\Flashtool “RayFW”.

  1. Because I’m a “better safe than sorry” kind of guy, I copied all the files from the “Sony Mobile” directory to a separate “backup” directory on my PC.

  1. Then I ran Flashtool and selected “Tools > Decrypt Files”

  1. On the following window, I clicked the button with three dots to open the “Folder Chooser” window. I navigated to the folder I created, “C:\Flashtool\RayFW”, and clicked the “Open” button.

  1. I selected the two files in the “Files” box (clicking on the first file, then holding CTRL and clicking on the second) and clicked the “->” button to move them to the “Files to convert” box.

  1. I then clicked “OK” and waited patiently for Flashtool to convert the files.

  1. Next I was faced with the “Bundle Creation” window. I selected all the files in the Folder list (easiest way was to select the first file, scroll to the bottom, hold the “Shift” key and click the last file) and clicked on the “->” button to move all the files over to the “Firmware content” box.

  1. Once I had copied over the files, I entered some information in the Device, Version and Branding boxes. I think that what is entered here is not too important, though I could find no confirmation of this. (I took inspiration from another guide that I found here: http://mytechencounters.wordpress.com/2012/06/12/how-to-create-an-ftf-file-of-your-xperia-ics-firmware/)

    Apparently, if backing up ICS, the “Disable Final Verification Check” box should be selected. I don’t know about this as I have not backed up ICS, so I left it blank.

  1. Click “OK”

  1. I selected my phone model from the window that appeared and clicked OK.

  1. Now I waited again for Flashtool to do some data-crunching and everything was complete. I navigated to “C:\Flashtool\firmwares\”, and could see my backup firmware file there.


Flashing New Firmware

At this point, I started to see the “point of no return” approaching. This is where things got exciting! :-D

Just for completeness, at this point, I entered the service menu on my phone (dialing *#*#7378423#*#*) and selected “Service info > Software info” from the menu. I took a screenshot of this screen and saved it to my SD card. That way I had a record of my phone’s software as it stood.

Now I needed a firmware file (*.ftf file) from somewhere. There was a nice list of where you can download one here:

http://talk.sonymobile.com/message/198480#198480

Once I had downloaded my chosen firmware file, I copied it to the “C:\Flashtool\firmwares\” folder and did the following:

  1. I had closed Flashtool, so I re-opened it and clicked the “Flash” button.

  1. From the following window, I left “Flashmode” selected.

  1. I selected the firmware that I wanted to flash and clicked “OK” (leaving all the “Wipe” boxes checked).

  1. I ignored the advice to hold down the “back” button (it doesn’t apply for the Ray) - I held the volume-down key (as for the SUS utility) and connected my phone.

  1. Now I made a cup of tea (though I considered a shot of brandy to calm my nerves) while Flashtool did its thing.

  1. When it was finished, I did as it said and unplugged the phone and turned it on.

  1. I then considered again pouring myself another shot of brandy as I waited for a very long time for the phone to do something and began contemplating whether or not I’d “bricked” it, and whether I should have even embarked on this mission (did I really want ics on my phone that badly?)

  1. Finally, the phone booted and all the hours I spent reading and digesting information on the SE and XDA forums paid off!

Rooting

I spent a great deal of time researching this as I was interested in using link2sd in order to free up internal memory on my phone.

At this point, I was running “stock ICS”. In “Settings > About phone”, the “Build number” was reported as 4.1.B.0.587. In order to root, I learnt that I needed to downgrade the kernel to 4.1.A.0.562, root and then upgrade the kernel back to 4.1.B.0.587.

In retrospect, the process was quite simple, but the challenge (as with upgrading from GB to ICS) was in finding the right information and getting an understanding of what was going on.

I had already backed up my data when upgrading the Android version. Data should not be lost when rooting, but as with everything in life, there is no guarantee and I felt more comfortable rooting my phone knowing that everything was backed up - it’s better to be safe than sorry...

The first step was to flash the 4.1.A.0.562 kernel with Flashtool.

Anicane has kindly made the kernel available here: http://www.mediafire.com/?gbs29dw3tzx765k. I downloaded this file and copied it into the “C:\Flashtool\firmwares\” folder. I already had a copy of my existing (ICS) firmware in the same folder, so I did not need to download the 4.1.B.0.587 kernel which Anicane has provided for download here: http://www.mediafire.com/?1pthkluxcsjkp5k.

Before I started, I downloaded the DooMLoRD rooter script. The link for the download was in the first post here: http://forum.xda-developers.com/showthread.php?t=1601038. I downloaded it to my C:\ drive and extracted the files. Once I’d done that, I was ready, so I got to it:

  1. On my phone, I navigated to “Settings > Developer options” and enabled “USB debugging”. I then went into “Settings > Security” and enabled “Unknown sources”. When enabling these settings, I got security warnings.  I figured if I wanted root, then I had to take some risks... ;-)

  1. I opened Flashtool and selected “Flash”.

  1. From the following window, I left “Flashmode” selected.

  1. Now I selected the 4.1.A.0.562 kernel and ensured that “No final verification” was selected.

  1. I clicked “OK” and again held the “volume down” button while connecting my phone to the PC. At this point, according to the guides I have read, there may be errors reported - I did not see this. The guides I have read tell you to carry on regardless, if this happens! Not sure I’d like to do that myself, but still, maybe I was just lucky!

  1. Then I disconnected my phone and turned it on.

  1. At this point, according to other users, I may also have seen errors on the phone, or it may not have booted properly. Again, I did not experience this and again, I have read that you should carry on if it happens, but I’m not sure I’d be comfortable with that personally.

  1. At this point, I went to “Settings > About phone” and saw that nothing had changed! I discovered that it is normal to see that the version and kernel numbers have not changed - you just have to trust that it has happened.

  1. At this point, I increased my phone’s screen timeout to 10 minutes (“Settings > Display > Sleep”) in order that the phone stayed awake for the next steps.

  1. I connected my phone to my PC with the USB cable and ensured that no other “ADB” server was running in the background (e.g.: Flashtool, PCC, SEUS) - DooMLoRD’s advice. He also advised to disable any antivirus software, but I don’t have any (I’m walking on the wild side with Windows 8 and Windows Defender, which I made no changes to).

  1. On my PC, I navigated to DooMLoRD’s script on my C:\ drive and double-clicked on “runme.bat”, which brought up the following DOS window.

  1. I pressed any key and the phone rebooted 3 times. The ouptut from DooMLoRD’s script for each reboot was as follows.




  1. I did as it said and pressed any key!

  1. Then I re-flashed my original ICS kernel... I disconnected my phone from the PC and turned it off.

  1. I re-opened Flashtool and clicked on “Flash”.

  1. From the following window, I left “Flashmode” selected.

  1. Now, if I had downloaded the 4.1.A.0.587 kernel (and only the kernel) earlier, then I could have simply selected that firmware and selected “OK”. However, I wanted to restore the kernel from the original ICS firmware that I downloaded and flashed the phone with.

  1. I selected my firmware then de-selected everything in the “Wipe” box (i.e. “Wipe data”, “Wipe cache”, Wipe apps log”) in order that I did not delete any of my data (which was backed up anyway ;-)). Then I ensured that I had selected everything in the “Exclude” box except for the “kernel” (which seemed obvious, since if I excluded the kernel, I would not flash the kernel!) - I was left with only “kernel.sin” and “loader.sin” in the “Firmware Content” box.

  1. I clicked “OK” and again, held the “volume down” button while connecting my phone to the PC.

The kernel was now flashed back to 4.1.B.0.587, or at least, so I hoped! I have no idea how I can verify this. Searching with Google, I can’t find an answer, so this may be a question I have to post in the forums. The important thing was that after doing all that, I had root access, so now I could install and use link2sd! :-)