Chapter 11: Nexus S: An Unlocked Device

In this chapter:

• Information about the Nexus S

• Rooting the Nexus S

The Nexus S is Google’s second flagship vanilla Android smartphone. Periodically, Google releases one phone in conjunction with a device manufacturer. These phones feature “Nexus” branding. Nexus phones are vanilla Android installations, with no interface or operating system customizations. Unlocked or unlockable bootloaders and freely available driver binaries make the Nexus phones highly prized by the hacking and hobbyist communities.

Unlocked devices are usually locked from the factory but have firmware in place that allows them to be unlocked with Fastboot commands. The Nexus S follows this pattern. Unlike the Google Nexus One, the Nexus S allows the bootloader to be relocked as well. After unlocking the Nexus S, it is fairly straightforward to use native Fastboot flashing functionality to flash the recovery or firmware of your choice.

Nexus phones are unlocked because Google sees them as developer devices. Developers need to be able to access the Android operating system at a very low level. When a developer is creating an application, there needs to be a common device that can be considered to be the reference device for a particular version of Android.

Connecting the Device to a PC

The Nexus S may require some special attention to connect to your PC so that ADB and Fastboot commands can be used. Be sure to download and install the correct drivers for your Nexus S from the reference thread at http://forum.xda-developers.com/showthread.php?t=935819.

After installing the third-party drivers, you should thoroughly test ADB and Fastboot connectivity. Refer to Appendix A for connectivity tests and Android SDK installation instructions.

Resources Required for this Walkthrough

Download the required files to a dedicated folder on your PC to make it easier to perform the flashing:

• drivers for Fastboot and ADB connectivity

• a custom recovery, such as ClockworkMod

• the SuperUser binary and application from the reference thread on the XDA forum.

Walkthrough

Unlocking the Device

Follow these steps to unlock the Nexus S and prepare it for flashing a custom recovery.

1. Back up everything on your device.

Unlocking the Nexus will completely erase all the data on the device as well as on the SD card. Connect the device to your PC, mount the SD card as storage and copy all its contents to your PC. When you have completed the re-rooting procedure, you will be able to copy back the contents of your SD card.

2. Put your Nexus S in Fastboot mode:

a. Start with the device off.

b. Power it on while pressing the volume up and power buttons.

The device should boot to the white Fastboot screen with the skating Androids.

3. From a command prompt window on your PC, run the following command to unlock your Nexus S:

fastboot oem unlock

4. Your device will prompt you to verify that you want to unlock. Remember that unlocking not only erases your device, it also voids your warranty.

5. Press the volume up button and then the power button to verify the unlock.

The device will wipe and reboot. When the phone reboots, it will be unlocked and can be flashed with the Fastboot command.

Flashing the Device with a Recovery

Next you will use the Fastboot command to flash the device with the ClockworkMod recovery. Make sure that you download the recovery appropriate for the Nexus S. The reference thread on the XDA forum will have a link to the latest version.

1. Put the Nexus S in Fastboot mode.

2. With the device connected to your PC, enter the following command from the folder to which you downloaded ClockworkMod:

fastboot flash recovery recovery-clockwork-crespo.img

Note: The name of the image file may include a version number that will change with the version of the recovery.

After the successful flash, you can reboot into recovery by powering the Nexus on while holding the volume up and power button. When the white HBOOT screen comes up, select the recovery option.

Flashing the Device with the SuperUser application

1. Use the ClockworkMod mount USB option (see Chapter 4) to mount the SD card as mass storage.

2. Copy SuperUser.zip to the root of the SD card.

3. Use the “Install Zip” option to select the SuperUser application and flash it to your Nexus S.

At this point, your Nexus S is unlocked and rooted. However, it will replace the recovery on reboot thanks to the file system protection system: code in the boot process will detect that the recovery has been altered and rewrite the default recovery to the recovery partition. To change this behavior, follow these steps:

1. Download a root permissions file explorer, such as the Root File Explorer, that can mount the file system for reading and writing.

2. Mount the file system as writable (in Root File Explorer, click the gray “Mount r/w” button).

3. Navigate to the /etc folder.

4. Rename the recovery-install.sh file to recovery-install.old.

5. Open Google Play, download RomManager and install it.

6. Use the “Install Clockwork Recovery” option to reinstall ClockworkMod recovery.

At this point, ClockworkMod should be permanent and you are rooted and ready to install custom ROMs or other customizations.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.239.123