Thursday, December 22, 2011

Samsung Galaxy Gio (S5660): Unlocking phone

When travelling abroad, I wish to be able to buy a local SIM card of the country and use it in my Samsung Galaxy Gio (S5660) phone. Turns out my phone is locked down so it only works with SIM cards of my Swedish provider. They're offering to unlock it for a fee after 12 months. I can't wait, so I decided to try it myself. After some searching, I found some instructions online that I followed (using Windows 7 Ultimate 64-bit machine):
  1. Verify that the phone is really network locked by "calling" *#7465625#.
  2. Root the phone (so that you can become a superuser below)
  3. Download and install Android SDK Manager (rev. 16).
  4. Enable USB debugging on the phone by enabling Menu > Settings > Applications > 'USB Debugging'.
  5. Connect the phone to the computer via USB cable.
  6. Start the Windows Command prompt (e.g. Start Menu -> cmd) and go to the ' platform-tools' directory where the Android SDK is installed, e.g. cd "c:\Program Files (x86)\Android\android-sdk\platform-tools\".
  7. Run ADB by executing 'adb shell'.
  8. In the ADB shell, become a superuser by executing 'su' (prompt will change from a dollar sign to a hash symbol confirming you are a superuser).
  9. Copy /dev/block/bml5 to the SD card by executing 'cat /dev/block/bml5 > /sdcard/bml5.img'.
  10. Exit superuser mode by executing 'exit' (prompt will go back to a dollar sign).
  11. Exit ADB by executing 'exit'.
  12. Copy the bml5.img file on the SD card to the computer by executing 'adb pull /sdcard/bml5.img'.
  13. Open the bml5.img in a hex-editor, e.g. TotalCommander.
  14. Search for the hexadecimal string "FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 30 30 30 30 30 30 30 30". There was several matches, where some were preceeded by '00000000' (non informative) and some with, say, '15351874' (the 8-digit unlock code; different for each unique phone). Done!
Then I disconnecting and turned off the phone, replaced the SIM card with a SIM card from another provider, and started up the phone. Then the phone detected the new SIM card and that the phone was locked to another provider and asks you to 'Enter Network Lock Control Key'. Entering the above 8-digit phone and voila, the phone was unlocked. Now my phone works also with this other SIM card. Also, calling '*#7465625#' now reports (it used to be that the first one was [ON]):

Network Lock [OFF]
Network Subset Lock [OFF]
SP Lock [OFF]
CP Lock [OFF]





Samsung Galaxy Gio (S5660): Root

There are many reason for acquiring root access ("run as adminstrator") to your Android phone, e.g. remove all ads (AdFree), backup all apps and their settings (Titanium Backup) and unlock the phone so it works with any network provider.

To root my Samsung Galaxy Gio (S5660) with Android 2.3.3 (Gingerbread; firmware KPS), I did the following:

A. "Installed" SuperOneClick on Windows 7 Ultimate 64-bit:
  1. Downloaded SuperOneClick (v2.3.2) and extracted to a directory, e.g. SuperOneClick/.
B. Rooted the phone following instructions by AddictiveTips:
  1. Enable USB debugging on the phone by enabling Menu > Settings > Applications > Development > 'USB Debugging'.
  2. Connected the phone to the computer via USB cable.
  3. Started the Android SDK Manager.
  4. Run SuperOneClick.exe.
  5. In SuperOneClick, click 'Root' (in the 'General' tab).
  6. Wait a couple of minutes. You'll see lots of log entries being printed. Mine ended with the three lines: '[+] Rush did it ! It's a GG, man !', '[+] Killing ADB and restarting as root... enjoy!' and '+++ LOG: write failed (errno=14)'.
  7. Your phone is rooted. It will probably reboot by itself.
C. Verified that the phone was truly rooted:
  1. Start the phone.
  2. Find the 'Superuser' app. If it exists, it is rooted, but you can also start it to make sure; at first you should see an empty list of apps with superuser rights under 'Allow'. Later this list will be populated with apps you allow to run as "superuser", e.g. AdFree and Titanium Backup.

Samsung Galaxy Gio (S5660): Update Android firmware

Current firmware version:
The quickest way to check the current firmware on any Samsung Android phone, dial *#1234#. On my phone I get:

PDA: S5660XXKPE
PHONE: S5660XXKPA
CSC: S5660HTSKP2

This firmware corresponds to Android 2.3.3 (Gingerbread) with build date June 24, 2011. Note that 'PDA' value is the same as one see in Under Menu > Settings > About Phone > Build number (I have 'GINGERBREAD.XXKPE').

Update firmware:
Install and run Samsung Kies [2] (Windows and OSX). Next, after rebooting the computer, connect the phone to the computer via a USB cable. Make sure to be connected to the internet. The Samsung Kies software will automatically detect and connect to the phone. If there is new firmware available, Kies will report this and offer to update the phone. Make sure to follow the instructions given. After a few minutes, the firmware is updated, and the phone will reboot.

New firmware version:
After updating via Samsung Kies, I get:

PDA: S5660XXKPS
PHONE: S5660XXKPA
CSC: S5660HTSKP2

which corresponds to Android 2.3.3 (Gingerbread) with build date August 25, 2011.

PS. The reason why I updated in the first place was that my phone completely froze multiple times a day. The only thing to do when it happened was to restart the phone (reboot by holding Home and Power buttons for several seconds, or simply take out the battery). This is apparently a rather common problem. Update: After updating to KPS the phone has worked flawlessly for more than 10 days now.