Samsung is known to be rather friendly to the hacking and modding community around Android. They have unlocked boot loaders in their phones, making it easy to flash custom kernels and ROMs, and they even sent a bunch of Galaxy S2s to the Cyanogenmod team with the request that they make the Cyanogenmod ROM compatible with Galaxy S2.
However, being a business, Samsung has to protect its profits, and this includes detecting modification to software and denying warranty to such devices. Samsung Galaxy S2, successor to the Galaxy S and one of the most popular Android smartphones around, is known to have a flash counter in its boot loader.
Simply put, this flash counter counts the number of times that you flash a non-stock kernel (ie. something other than Samsung-provided kernel). This is an easy way to detect whether your phone’s software has been modified by you.
A common method of rooting a phone is to flash a custom kernel (via Odin or Heimdall) that has Superuser.apk and su binary in it, or has some vulnerabilities that can then be exploited by a desktop app like Super One Click Root to root the phone. Unfortunately, these methods would trigger the flash counter, and you might loose your warranty claims.
If you flash a custom kernel (non-Samsung or Touchwiz or stock kernel) directly with fastboot or Odin or Hemdall,, then the phone detects it and shows a yellow triangle at boot time. Once you trigger this flashing triangle, it is not trivial to reset it. Previous versions of bootloaders had vulnerabilies that were exploited by a tiny USB chip to reset the triangle. These USB keys were available for cheap on eBay. Unfortunately, newer bootloaders (especially those with Android 4 ICS and newer) can no longer be reset by this USB dongle.
So, the best way to avoid this mess is really not trigger the triangle / flashcounter in the first place. Below is a workaround to the flash counter, that helps you root and flash all you want, without ever incrementing the flash counter. I have used this method for several months now without any issues.
Note: All instructions below are for the international version of Galaxy S2 called i9100. Instructions are similar for other carrier specific variants like AT&T’s Skyrocket i777 or SGS2 i9100G, but you just have to pick the specific kernel and ROMs for your device (and not those meant for i9100).
Rooting and flashing without incrementing flash counter
- Use Superoneclick or DoomLoRD’s Easy Rooting toolkit to root your phone without flashing any custom kernel, so it won’t increment. Downloads and rooting instructions are given on the respective links. Ask here in comments if you have any issues.
- Install Mobile Odin.
- From Mobile Odin, flash a CF Root kernel that contains Clockworkmod Recovery.
Once you have Clockwork Mod Recovery, you can flash any ROM, kernel or modem files by downloading CWM-flashable zip files (which are provided by most ROM and kernel makers), putting it on your SD card and entering CWM during device startup, to flash it. Make sure to not flash anything via Odin or Heimdall on your desktop.
You can use Mobile Odin, or ADB from your computer(if you have ADB and all required drivers) also. However, I didn’t include those steps as only a minority of Anrdoid users would have it all set up.