2010-10-16

How to Root a Samsung Fascinate Android Phone with Ubuntu Linux

android.png

These are the steps I took to root my Samsung Fascinate. Rooting gives the following abilities and more:

This article assumes you have already installed the Android SDK. I also assume that you have the platform-tools directory as part of your path. If not, you will need to specify the full path whenever you see the adb command used, like ~/android-sdk/platform-tools/adb.

The first step is to get your computer to recognize the phone. I followed the instructions on the Android developer site that explain how to do it. I'll summarize the steps for Ubuntu.

First make sure your phone is setup for development by performing the following steps:

Connect your phone to the computer using the USB cable that came with the phone. Now your phone should appear in the list of usb devices:

lsusb
...
Bus 002 Device 006: ID 04e8:681c Samsung Electronics Co., Ltd Galaxy Portal/Spica Android Phone
...

As root, edit /etc/udev/rules.d/51-android.rules so it looks like:

SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"

Replace "04e8" with the vendor id found in your lsusb output from the previous step (it's the first four characters after ID).

Now set the permissions on the file and restart udev to enable it.

sudo chmod a+r /etc/udev/rules.d/51-android.rules
sudo /etc/init.d/udev restart

Now run the adb command and check for devices:

adb devices
List of devices attached
I500cf846986    device

You should see your device listed. If you do not try restarting adb with:

sudo adb kill-server
sudo adb start-server

Assuming you have made it this far and adb can see your device, we can continue with the rooting process. The following instructions were taken from this Newbie Guide to Rooting the Fascinate.

Download and unzip root.zip into a new directory. You should have the following files:

busybox
rageagainstthecage-arm5.bin
su
Superuser.apk

Push the rageagainstthecage-arm5.bin file over to the phone:

adb push rageagainstthecage-arm5.bin /data/local/tmp/rageagainstthecage-arm5.bin

Shell into the phone and setup the next step:

adb shell
cd /data/local/tmp
chmod 0755 rageagainstthecage-arm5.bin

After the next step there will be a pause (for a few seconds) then you will be returned to the shell prompt. Then wait another 20 seconds or longer and you should be kicked out of the adb shell. If your phone locks up, nothing bad should happen, just try forcing a reboot by pressing and holding the power button, or removing the battery for a few seconds.

./rageagainstthecage-arm5.bin

You should see the following then the command prompt again.

[*] CVE-2010-EASY Android local root exploit (C) 2010 by 743C

[*] checking NPROC limit ...
[+] RLIMIT_NPROC={3712, 3712}
[*] Searching for adb ...
[+] Found adb as PID 2200
[*] Spawning children. Dont type anything and wait for reset!
[*]
[*] If you like what we are doing you can send us PayPal money to
[*] 7-4-3-C@web.de so we can compensate time, effort and HW costs.
[*] If you are a company and feel like you profit from our work,
[*] we also accept donations > 1000 USD!
[*]
[*] adb connection will be reset. restart adb server on desktop and re-login.

After waiting until you are kicked out of the shell, restart the adb server and re-login:

sudo adb kill-server
sudo adb start-server
adb shell

You should now be at a root (pound symbol) prompt. Exit the shell:

exit

Now to make the root permanent do the following:

adb push su /data/local/tmp/su
adb push busybox /data/local/tmp/busybox
adb shell
mount -t rfs -o remount,rw /dev/block/stl9 /system
cat /data/local/tmp/su > /system/xbin/su
cat /data/local/tmp/busybox > /system/xbin/busybox
chmod 4755 /system/xbin/su
chmod 4755 /system/xbin/busybox
exit

Install the Android application that controls root access:

adb install Superuser.apk

After it installs you will see Success on your screen and the connection will hang. Press Ctrl-C and reboot your phone. You should now have permanent root.

The Library of Congress has specifically exempted rooting from the DMCA (Digital Millennium Copyright Act)… This means that it is now 100 percent legal to root your Android phone (or jailbreak your iPhone) whenever you want without fear of legal action taken against you.

David Wasserman, Android Phone Geek, "Rooting Your Phone Now 100% Legal", 2010-07-26

Tags: android phone ubuntu linux programming software technology