How to root the Samsung Galaxy S II (GT-i9100) with GNU/Linux or Mac OSX using the FOSS tool heimdall
There are thousands of reports on the internet already explaining how the new and shiny Samsung Galaxy SGII Android smartphone can be rooted. But most of them suggest using »Odin«, which is a leaked internal tool from Samsung and which is included in many Samsung firmware packages you can find on the world wild web. Unfortunately, Odin is only available for Microsoft Windows.
For this reason, I put a short guide here, which explains how to root the Samsung Galaxy SGII with GNU/Linux using the FOSS tool heimdall (heimdall and this guide work on Apple Mac OSX and Microsoft Windows, as well):
- Download and install heimdall.
- Download an »insecure« kernel image »XWKDD_insecure.tar«, e.g. from here.
- Put your SGII into download mode by pressing the volume down button, the home button and the power button at once.
- Flash the device:
sudo heimdall flash --kernel zImage-insecure
If you now do
adb shell,
you end up in a root shell.
If you would like to have further root functionality (e.g. for root apps), you can now install the su
binary and the Superuser app from androidsu.com:
- From your computer: Remount the
/system
partition to read-write mode:
adb remount
- Download the su zip file from androidsu.com to your computer and extract it. Then, on a console on your computer, push the su image to your phone with adb:
adb push su-2.3.6.3-efgh-signed/system/bin/su /system/bin/su
- Start a root shell on your phone with
adb shell
. On your phone: Correct the permissions and the ownership of the image and set a symlink to/system/xbin
:
rm /system/xbin/su
ln -s /system/bin/su /system/xbin/su
chown root.shell /system/bin/su /system/xbin/su
chmod 6755 /system/bin/su /system/xbin/su
exit
- Install the Superuser app (with a shell console on your computer):
adb install su-2.3.6.3-efgh-signed/system/app/Superuser.apk
- You now might want to flash your mobile again with a secure kernel. The access to the
su
executable binary is now controlled via the Superuser app.
‹ Ethisches Investment | Die GLS Bank | Esoterik in der Öko- und Hippiebewegung Eine Woche nach der Bundestagswahl: Eine kleine Wahlnachlese ›
Thanks for the clear explanation!
The only thing I messed up in is downloading the -d version of superuser instead of -efgh, causing a „CANNOT LINK EXECUTABLE“ when executing su. but after that, it worked like a charm.
Perfect guide for linux users 😀 , thanks a lot 😀
Do you also have a link to a secure kernel? Unfortunately, I could not find one (Samsung site requires account?) Before, I had GT-i9100XWKF3… is that the most recent one?
Interesting guide. I’ll probably try this later.
I’ve however heard that rooting your phone can void the warranty. Is there a way to undo this root if this is needed? (I apologise if this is a stupid question, I have very limited android rooting experience)
Great, it worked. BUT. The phone is now quite flakey (reboot every other day for no reason, sometimes no sound at all – that’s calls and alarm clock…).
1. How do I get the old ROM back, now that I have root (and backup root!)
2. If the phone in its current state still „kies friendly“ – as in will it upgrade to „stable, stock“ ICS once samsung UK get off their arse?