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
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-126.96.36.199-ef-signed.zip 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-188.8.131.52-ef-signed.zip” 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 containing “adb“. It should be in “./android-sdk-linux_86/platform-tools/” :
6. Make sure your device is recognized by adb:
If not, kill-server and then try devices again:
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!
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):
2. Use “./adb shell” and you should see a $ indicating you are now running commands within the 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:
6. ls -a to confirm the copy was made. You should see “settings.db” and “sqlite3” among the listed files.
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 push “settings.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):
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.
Tags: 10.10, 64-bit, adb, amd64, android, android-sdk-linux_86, apk, app, captivate, chainsDD, eclair, froyo, galaxy, galaxyS, hack, hacktivate, i897, mode, non-market, phone, pull, push, recovery, root, samsung, sdcard, sdk, shell, su, su-184.108.40.206-ef-signed.zip, super, superuser, ubuntu, user