Hacktivate Android on Samsung Captivate SGH-i897 root, superuser access

My goal here is to help you, even if you are a rooting virgin, to penetrate your way deep into your Captivate, forever breaking the settings.db hymen that had previously prevented the insertion of non-market apps. Resist as she may, it shall be thrust upon her until she is liberated from her former inhibitions!

I am writing this mainly for Linux Ubuntu users with little to no experience. This should contain everything you need to root your Samsung GalaxyS / Captivate model SGH-i897 phone. It is a bit long as I tried to be as thorough as possible for noobs, but hopefully the extensive use of bold font will make browsing through the instructions easier for the rest of you.

Specs: I am working on Ubuntu 10.10 amd64 with the Samsung Captivate SGH-i897 running the Android 2.1 (Eclair) platform.

Let’s Install SDK Tools First

Download Android SDK manager. See SDK dependencies and install first if needed.

1. Download and extract the file android-sdk_r08-linux_86.tgz to any directory you prefer.

2. In terminal, run the file “android” located in ./android-sdk-linux_86/tools/ to load the SDK manager UI:

3. In the Android SDK and AVD Manager UI, go to “Installed packages” on the left. You should see “Android SDK tools, revision 8″ listed. Click “Update All…” and click through the download prompt to finish installing. Close the SDK manager.

4. Check your ./android-sdk-linux_86/ directory and you should see some new files. You will be working with “adb” located* in the directory ./android-sdk-linux_86/platform-tools/

5. On your phone, go to Settings > Applications > USB settings and enable debug mode. Debug mode will need to be enabled for SDK tools (adb) to communicate with your Captivate. More on that later.

*Ok every single tutorial I’ve read says that adb is located in the “tools” directory.
I assume this is the case for the Windows and Mac SDK package, but this one has adb located in the “platform-tools” directory. Meanwhile, sqlite3, which you will use later, is located in the “tools” directory. Don’t worry, I’ll remind you when we get there.

Gaining Superuser Access

1. Download ChainsDD’s Superuser update. I’m rooting Android 2.1 Eclair. Be sure to grab the right one for your platform. If you aren’t sure then open applications, go to Settings > About Phone > Firmware Version. While you’re there, you can also confirm you are using the SGH-i897 (which if you didn’t already know then you really are a noob. I mean, how did you even find this page? :| No worries. Sigamos!).

2. Copy su- to the /sdcard/ directory of your phone (you have to plug in the USB cable and mount it first… ZOMG NOOB!). This is the top directory you browse to on your phone when you are transfering files via USB.

3. Rename “su-” to “update.zip”

4. Eject/dismount your Captivate and unplug USB cable.

5. Reconnect USB without mounting. With debug mode still enabled, open your terminal and change to the directory containingadb“. It should be in “./android-sdk-linux_86/platform-tools/” :
cd ./android-sdk-linux_86/platform-tools/

6. Make sure your device is recognized by adb:
./adb devices

If not, kill-server and then try devices again:
./adb kill-server
./adb devices

7. Use./adb reboot recovery” from terminal and your phone should reboot into recovery mode:
./adb reboot recovery
If permission errors, try sudo:
sudo ./adb reboot recovery

Otherwise, if it fails, you can still boot into recovery mode. Power off the phone, then hold both [up & down volume + power] buttons simultaneously until it boots into recovery mode.

8. In the recovery menu, select “Reinstall packages” and it will echo that it is installing update.zip; the file you placed on your /sdcard earlier. It says something like deleting files, mounting this, that and what not (zomg scary!).

Your phone will boot and you will now have the Superuser app installed! \o/ – YATTA!

Pull settings.db

1. Plug in USB and make sure the red debug mode symbol is showing. In your bash terminal, cd to the directory where your adb file is located (./android-sdk-linux_86/platform-tools/ or if you are on Windows or Mac, this isn’t really your tutorial, but try the “tools” directory):
cd ./android-sdk-linux_86/platform-tools/

2. Use “./adb shell” and you should see a $ indicating you are now running commands within the shell:
./adb shell

3. Use the command “su”. Meanwhile, on your Captivate, the Superuser app should pop up asking if you want to allow root access. Yes! Do it! Touch “Allow” on phone. Exit twice back to your bash terminal:
Press “allow” when prompted on phone.

4. Copy settings.db to the SDK directory containing sqlite3. For me it is ./android-sdk-linux_86/tools/. You are using abd and copying settings.db from the directory /dbdata/databases/com.android.providers.settings/ as you can see in this example:

./adb pull /dbdata/databases/com.android.providers.settings/settings.db ../tools/settings.db

5. cd to the directory containing sqlite3. Following this tutorial, you are currently running adb from the directory ./android-sdk-linux_86/platform-tools/ so use something like:
cd ../android-sdk-linux_86/tools/

6. ls -a to confirm the copy was made. You should see “settings.db” and “sqlite3” among the listed files.
ls -a

Ok, good.

Now Let’s Allow Non-Market Apps!

1. Run this command through sqlite3.
echo "update secure set value = 1 where name = 'install_non_market_apps';"|./sqlite3 settings.db

2. Use adb to pushsettings.db” back to it’s Captivate place of origin, /dbdata/databases/com.android.providers.settings/settings.db*:
../platform-tools/adb push settings.db /dbdata/databases/com.android.providers.settings/settings.db

*Instead of changing back to the /platform-tools/ directory this time, you entered the full path to adb followed by the command push. Since you are working in the directory that contains our edited settings.db file, specifying the full path isn’t necessary, but the destination is.

3. Since we just wrote over the original settings.db file with the edited version, let’s use the adb shell to chmod & chown it so it will function normally. Then reboot (press enter after each line or forever a noob):

./adb shell
chmod 660 /dbdata/databases/com.android.providers.settings/settings.db
chown system.system /dbdata/databases/com.android.providers.settings/settings.db

Congrats! You should be done.

After the phone boots, try installing an app that requires root access.
For my test, I used the app MyBackup Root. Woot! Now I can save my data for when I brick it. :)


***There are alternative methods for copying the settings.db file by using adb shell instead of from bash terminal, should you need to. This may be the case for Mac, so just throwing this out there. Also, the Froyo platform apparently doesn’t have cp and I don’t seem to have it either:

Run adb shell and then “su”
cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db

If you get the error “cp: not found” like I did, then do this instead:
cat /dbdata/databases/com.android.providers.settings/settings.db > /sdcard/settings.db

After that, you can move it from /sdcard/ to your appropriate tools directory containing sqlite3 and continue following instructions in a tutorial that considers your non-Linux, OS such as this one.***

This noob tutorial for rooting the Samsugn GalaxyS Captivate running Android 2.1 made possible by Android SDK, numerous forums & Google searches (especially xda-developers and androidcentral), a bad ass called ChainsDD who updated the Superuser package so that it works for this model & platform (it’s the only one I’ve gotten to work after trying many), as well as whoever developed Superuser before him. On that note, let’s throw in Al Gore for inventing the internet, me for taking the time to give a crap about my fellow noobs, my mother for giving birth to me and my pops for knocking her up while she was still young and naive. Nyah!

I’ma let ya finish, but I just want to say that I offer no disclaimer about what this may or may not do to a warranty you may or may not have or the possibility of bricking your phone and having to figure out how to recover from such a thing. If anything bad happens to you because you took my advice it will not my make life any more miserable so either cowboy up and take responsibility for your own actions else suck on me balls. :D

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

12 Responses to “Hacktivate Android on Samsung Captivate SGH-i897 root, superuser access”

  1. Ken says:

    Yes, noob I am to rooting and tech stuff for my captivate, I have rooted, last night, and I am running 2.2 froyo, and super user app is there, but I still cant install any other than market apps. I have astro file manager, was going to wait to get titanium till I was able to install apk files. The above lesson is well….not noob friendly?..I have read through 3 times….and still wonder what its about…for instance in step one you say to copy Copy su- to the /sdcard/
    then rename it…rename it after its copied to the sd card?.. and I notice linux is used a lot..I run win vista 32 bit is it compatible..am I on the right upload?…I have to say this fix is extremely complicated without any screen shots or step by step..in noob talk instructions…lol…damn I hate being stupid.

  2. illunatic says:

    Second paragraph:
    “I am writing this mainly for Linux Ubuntu users with little to no experience.”

    “Specs: I am working on Ubuntu 10.10 amd64 with the Samsung Captivate SGH-i897 running the Android 2.1 (Eclair) platform.”

    Try googling a bit more. There are likely some Windows apps that do it for you.

  3. matt says:

    I used a similar guide no prob rooting on 2.1 However setting.db was a pain in the balls to pull from phone but once you do it. it stays even thru a upgrade to 2.2.

  4. Lighthouse4men says:

    Good guide overall. One key omission – CP command is missing in the basic toolkit. After installing Superuser, you need to install the Busybox application which includes the CP command. Do this, and I think all will go smoother.

    Alternately, you can install TitaniumBackup (another a good application to have) and then use it to install a version of BusyBox.

  5. Shahin says:

    Great step-by-step instructions and it worked like a charm with a minor issue for me. I had a problem when I tried to “pull settings.db”. I was getting file not found. The way I got around it was to change the file permission. In step 3 where you have shown to go to superuser mode on the phone, I did the following:

    3. Use the command “su”. Meanwhile, on your Captivate, the Superuser app should pop up asking if you want to allow root access. Yes! Do it! Touch “Allow” on phone. Exit twice back to your bash terminal:
    Press “allow” when prompted on phone.
    change to /dbdata/databases/com.android.providers.settings/ directory by typing the following command at # prompot
    cd ./dbdata/databases/com.android.providers.settings/

    change permission on settings.db with the following command
    chmod 777 settings.db

    *** END OF MY ADDITION. LOG OFF OF su MODE by typing exit twice and go back to your PC for the rest *****

    Thanks again for great instructions.

  6. Nòmada says:

    Man, This post is excellent! Superbe! It help A LOT to me that am a newbie….

    Thanks a lot. Really!

  7. illunatic says:

    Thanks a lot for the comments!

    By far the easiest way to do this now is to find someone with a Windows machine (if you can) and use superoneclick.

  8. Aimless Rambler says:

    Many thanks!!!! I recently bought a used Samsung Captivate I897 (2.2 Froyo) to experiment with and after many frustrating days spent perusing the forums pertaining to rooting a system and trying out various GUI clickity-click programs (to no avail) I found this POST! I’ve decided after my eyes started bleeding that every other illiterate with a computer has a method for doing something. Mostly the wrong way. For instance … after reading a post and following procedure, 5 pages later …”Oh yeah forgot to say yer phone won’t reset by an update.zip.” .. OR ..”Dang, I meant download mode not recovery mode.” .. OR .. “Whoops I told you wrong button to hold down.” I’ve used Ubuntu for a couple years and the MANUAL SDK-ADB terminal way went relatively painless by comparison. It lends itself to having to learn a little bit about what you’re doing other than just pressing a button. I’m reading up on how to flash a ROM via SDK Fastboot now.


  9. Matty says:

    You dumb fucking Linux cocksucker. Fuck you and fuck Linux. I hope your children are born retarded and your parents contract AIDS from sucking Magic Johnson’s dick.

    • llanyort says:

      dont worry. as long as magic johnson’s “johnson” TCELL count stays low. Your Parents will never contract AIDS.

  10. A person essentially lend a hand to make critically posts I might state. That is the very first time I frequented your website page and to this point? I surprised with the research you made to create this actual post incredible. Great task!

  11. BEA says:

    Great! thank you for sharing. Tips on geting my site to rank well are what I`m looking for

Leave a Reply