This approach to customizing your phone involves the following steps:
1. Read the flash counter.
2. Root by flashing Entropy512's Return/Unbrick to stock, Kernel + Rooted System Package using Odin or Heimdall.
3. Install a customized kernel containing ClockworkMod Recovery using either adb on your pc or Android Terminal Emulator on your phone.
4. Flash the custom ROM package of your choice using ClockworkMod Recovery and a CWM flashable zip package.
Discussion
The Samsung Galaxy S II contains an internal flash counter which is incremented each time a non-stock binary (kernel/rom) is flashed using Odin or Heimdall. The purpose of the flash counter is believed to be to allow Samsung and or AT&T technicians to detect if the phone has a voided warranty through flashing non-stock firmware. The first time the flash counter is activated, the phone also displays a warning screen on boot up with a yellow warning triangle containing an exclamation point. The warning screen also contains the i9100 logo. (Evidently, Samsung did not change the warning screen from the International version of the Galaxy S II for the AT&T version.) Some rooting methods require that a non-stock kernel be flashed before rooting can be accomplished. So rooting and flashing custom software can both cause the dreaded yellow triangle, and increment the flash counter.
It is possible to remove the warning screen by two methods. One is by using a Jig to place the phone into download mode. The other is by flashing a stock kernel using either Odin or Heimdall. However, there is only one way to reset the flash counter, and that is with a micro usb Jig. This was true for the International version of the Galaxy S II
as confirmed by Chairfire on the i9100 forums. This has also been confirmed for the AT&T Galaxy S II by dayv. Please see his post
here, and then go to
this post and read it and the following five posts for a complete description with screen shots.
pinoymutt adds:
Additionally, there have been rumors that there is a secondary counter hidden in the code of the Galaxy S II which increments each time the primary flash counter is reset to zero. This rumor was either
started or strengthened over in the i9100 forums by Chainfire. He never did find any code, and later said he was not fully convinced there ever was any code. But the rumor has already had some discussion in these At&T forums, so it's worth mentioning. My opinion is that a secondary counter doesn't exist, but if it does, this would be an additional reason for this guide.
Some people may be reluctant to root their phone and/or flash custom software onto it, not wishing to take a chance on voiding their warranty. However, there is a way to completely avoid this problem. The solution is to never increment the flash counter in the first place, and never activate the yellow warning triangle. Using this guide to root and modify an AT&T Galaxy S II phone right out of the box, along with the ability to flash back to completely stock firmware followed by a wipe data/factory reset from stock 3e recovery, (
see this Guide), will result in a phone that can be returned for warranty purposes to either AT&T or Samsung without fear of the warranty being denied.
Disclaimer: I didn't think all this stuff up. The following information is mainly gleaned from all the great developers and knowledgable users on this forum. A special thanks to Entropy512 for creating the stock + root package that makes this all possible.
1.) How to read the flash counter on an AT&T Samsung Galaxy S II
2a.) How to root by flashing Entropy512's Return/Unbrick to Stock, Kernel + Rooted System Package using Odin3 v1.85 (Windows)
- Download the Odin3 v1.85 package from MediaFire or MegaUpload, or another source of your choice. Odin3 v1.82 is will also work. Extract the contents of the zip file to a directory on your hard disk drive.
- Download Entropy512's Return/Unbrick to Stock, Kernel + Rooted System Package from here. Extract the PDA.tar file from this package to a directory on your hard disk drive.
- Start the Odin3 program by double clicking on "Odin3 v1.85.exe".
- Now Enter Download Mode:
- With the phone powered off, plug in the usb cable while holding the vol up + vol down buttons (but not the power button).
- When the warning screen appears, press Volume up to continue into download mode.
- In Odin, the first small edit box under the words "ID:COM" will turn yellow, and say something like [0:COM8].
- In Odin, the two items "Auto Reboot" and "F. Reset Time' should be checked, and everything else should be left unchecked. (Very Important)
- In Odin, click on the button that is labeled "PDA". In the dialog box find and select the PDA.tar file you downloaded. The tick box next to the PDA button should become checked. This will be the only file that will be flashed.
- Click Start. Watch the progress bar advance in green while the message box in the lower left describes the steps. When the flash is finished, the top left larger edit box will turn green and say PASS! and your phone will automatically reboot.
- Unplug the usb cable from you phone after it boots up. Success. You're Rooted.
2b.) How to root by flashing Entropy512's Return/Unbrick to Stock, Kernel + Rooted System Package from the command line using Heimdall (Linux and Mac OS)
- Tested on Linux, should work on Mac OS
- Download and install the latest version of Heimdall Command Line for your operating system from here. (Latest version 1.3.1 at this writing.)
- Download Entropy512's Return/Unbrick to Stock, Kernel + Rooted System Package from here. Extract the PDA.tar file from this package to a directory on your hard disk drive, then extract the two component files from the tar - zImage and factoryfs.img.
- Place zImage and factoryfs.img both in the directory where you have the Heimdall command line executable, and enter the following at the command prompt:
Code:
heimdall flash --kernel zImage --factoryfs factoryfs.img
- Reboot the phone. Success. You're Rooted.
3a.) How to Install a customized kernel containing ClockworkMod Recovery onto your Rooted phone from a pc, using Android Debug Bridge (Windows, Linux and Mac OS)
- Download and install the Android Software Developer Kit (SDK) from here.
- Download the file containing the kernel you want to flash, and extract from it the zImage, which contains the actual kernel.
- Move or copy the zImage into the tools directory where adb.exe resides. This will be something like (on Windows) c:\android-sdk-windows\tools.
- Open a command prompt. Windows users may think of it as a DOS prompt. Change directory to the tools directory, then enter the following at the command line:
Code:
adb push ZImage /sdcard/zImage
adb shell
$ su
# dd if=/sdcard/zImage of=/dev/block/mmcblk0p5
# exit
$ exit
- The dd command requires superuser permission on the phone represented by a # prompt. After you type su and hit enter, look for a superuser window on your phone and give the permission. If the permission request doesn't pop up, open superuser on your phone to force the phone to prompt for superuser permission. After approval, the adb session will be listed as Unknown in superuser.
- After you've finished, the code in the Command prompt window will look something like this (your command prompt and some numbers will be different):
Code:
C:\android-sdk-windows\tools>adb push ZImage /sdcard/zImage
4279 KB/s <4776784 bytes in 1.090s>
C:\android-sdk-windows\tools>adb shell
$ su
su
# dd if=/sdcard/zImage of=/dev/block/mmcblk0p5
dd if=/sdcard/zImage of=/dev/block/mmcblk0p5
10153+1 records in
10153+1 records out
5198492 bytes transferred in 2.558 secs <2032248 bytes/sec>
# exit
exit
$ exit
exit
- Reboot the phone. You have now installed a custom kernel containing clockworkMod Recovery without changing the flash counter.
- If you want to confirm installation of the new kernel, reboot into recovery to verify that you now have ClockworkMod Recovery. (The stock kernel has 3e recovery.) Or install CPU Spy from the Market (before you root) and compare the Kernel Info it displays with the same info from the stock kernel.
- To reboot into recovery on the SGH-I777: With the phone powered off, hold down the vol up + vol down + power buttons continuously until the initial boot screen appears a second time.
3b.) How to Install a customized kernel containing ClockworkMod Recovery onto your Rooted phone from your phone, using Android Terminal Emulator
- Download and Install Android Terminal Emulator onto your phone from the Market.
- Download (onto your PC) the file containing the kernel you want to flash, and extract from it the zImage, which contains the actual kernel.
- Transfer the zImage to the root of your phone's sdcard, using a usb cable or another method such as dropbox.
- On the phone, open a terminal session with Android Terminal Emulator.
- A few points to be aware of:
Android is a version of linux so you are using linux commands. Linux commands are case sensitive, so you must for instance type "zImage" and not "zimage", if that is the way the file is spelled on the sd card.
Since this will be the first time you have used superuser.apk with the terminal, you may need to approve it on you phone. After that, superuser permission will be remembered.
When you first open a terminal session, you will be at the root of the phone, or essentially "/". The $ prompt means shell access, the # prompt means root file access.
You need a # prompt to complete this Step.
If your keyboard goes away, use the menu button options to get it back.
- In the terminal session, type su and then enter. You will get a superuser request. Once you approve it, you will get the # prompt.
- Then type the following:
Code:
dd if=/sdcard/zImage of=/dev/block/mmcblk0p5
- Press enter, wait till the zImage is copied over to the named block. (takes about 2 or 3 seconds)
- To close the root session, type "exit" and enter. Use the back button to close Android Terminal Emulator.
- Reboot the phone. You have now installed a custom kernel containing clockworkMod Recovery without changing the flash counter.
- If you want to confirm installation of the new kernel, reboot into recovery to verify that you now have ClockworkMod Recovery. (The stock kernel has 3e recovery.) Or install CPU Spy from the Market (before you root) and compare the Kernel Info it displays with the same info from the stock kernel.
- To reboot into recovery on the SGH-I777: With the phone powered off, hold down the vol up + vol down + power buttons continuously until the initial boot screen appears a second time.
4.) Flash the ROM package of your choice using ClockworkMod Recovery and a CWM flashable zip package
Your phone is now set up to flash custom software using ClockworkMod zipped install files in ClockworkMod Recovery. Anything you flash on the phone using ClockworkMod Recovery, or using adb or terminal, will not affect the flash counter or invoke the warning triangle. Therefore, you can flash ROM's Kernels and Modems to your hearts content. Just avoid ever flashing anything non-stock with Odin or Heimdall. I would also caution against flashing any package with bootloaders. There is no valid reason to flash bootloaders on the SGH-I777 at this time, but some developers may include bootloaders in their CWM flashable zip files.