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
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
/systempartition to read-write mode:
- 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-220.127.116.11-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
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
- Install the Superuser app (with a shell console on your computer):
adb install su-18.104.22.168-efgh-signed/system/app/Superuser.apk
- You now might want to flash your mobile again with a secure kernel. The access to the
suexecutable binary is now controlled via the Superuser app.