[GUIDE] How to Flash Custom Binaries Without Ever Incrementing the Flash Counter!!

Search This thread

billyjed

Senior Member
Jan 29, 2012
384
113
^^ Do let me know guys if the query i posted was too noobish .. or if the people here were too busy to reply. :confused:

I followed the method 2c as described, and the phone rebooted after the whole process by 'Odin3 One-Click Downloader Stock I-777 UCKH7 with Root no BL' was completed duly. It did say pass and the color did changed to green too..

but upon self rebooting of the phone and removal of the cable, i keep getting the msg: Sorry! the application google services Framework (process com.google.process.gapps) has stopped unexpectedly etc etc.

I tried and was able to enter the download mode again, flashed it once again.. and again the same msg.

What went wrong here?

Try doing a full wipe.

Sent from my Apple IIe
 
  • Like
Reactions: spacescreamer

Vintage144

Guest
Jan 1, 1970
32
127
ran mobile odin , flashed the siaya tar , kernel gives me cwm , but when I try to back i get cant mount error ? should I have wiped when I went to recovery the first time before backing up (wifes phone with kk6 entropys with root) phone works great , I just wanted custom recovery , havent had a chance to look at the rcovery because the wife wanted it back! Any help thanks!
 

Eduardo9309

Senior Member
Jan 19, 2013
269
22
Cucuta
Hi. Sorry for the noob question, how do i know if mi Phone es uck versión for root vía 2b organización 2c.? Thanks

Sent from my SAMSUNG-SGH-I777 using xda app-developers app
 

judib

Member
Jan 5, 2013
19
4
Custom kernel / cwm for ver 4.0.4 clarification

This approach to customizing your phone involves the following steps:


3a.) How to Install a customized kernel containing ClockworkMod Recovery onto your Rooted phone from your phone, using Mobile Odin Lite or Mobile Odin Pro
  • This is the preferred method to install a customized kernel onto your phone. In addition, Mobile Odin is a very useful tool that will allow you to install custom software directly on your phone without using a computer.
  • Mobile Odin Lite (free) can be downloaded and installed directly on your phone, or it can be downloaded to your computer and installed with adb. Alternatively, you can purchase Mobile Odin Pro for under $5.00 and install it directly from the market. It's easier, and you'll support the developer!
  • To use Mobile Odin Lite, download the file attached to the OP of this thread. You may need to be a registerd member of xda forums to download this file. Download directly on your phone, or to your computer and move or copy it to your phones sdcard. Using any file manager such as MyFiles or Root Explorer, select the file and install it. You can also install it from your computer using the following adb command:
    Code:
    adb install MobileODINLite-v2.30.apk
  • Download the file containing the kernel you want to flash, and extract from it the zImage, which contains the actual kernel. There are several kernels available which can be found in the AT&T SGS II Android Development forum. You must use a Gingerbread kernel! Usually choose between the following two Gingerbread kernels: Entropy512's Daily Driver or Siyah 2.6.
  • Transfer the zImage to the root of your phone's internal or external sdcard, using a usb cable or another method such as dropbox.
  • On your phone, open the Mobile Odin program. If you installed Mobile Odin Lite, when it prompts you to install the add-in, click cancel. If you installed Mobile Odin Pro, you will have already downloaded and installed the add-in to activate all the features in the program. With Mobile Odin Lite, you will still be able to install the kernel.
  • In Mobile Odin, click on Kernel or Install Kernel, find and select the zImage on your internal or external SD card, and then click on Flash Firmware.
  • Mobile Odin will flash the kernel and then 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.
  • The 5.0.2.3 and later versions of ClockworkMod Recovery have a different button configuration. Home = select, Back = back, Power = back from submenu or toggle logo/main menu. The 5.0.2.7 version of ClockworkMod Recovery retains this button configuration but changes it to Power = select.
  • If you installed Mobile Odin Lite, and you don't want to keep it, you can uninstall it now. If you want to keep it and activate all its features, download the add-on MobileODIN_FlashKernel_I777-v1.0.apk from here and install it on your phone with adb using the instructions above.
-----------------------------------------

Creepy....
Thx again...you're amazing!!!! I did root with ExynosAbuse and have disabled the exploit. I'm on an SGH-i777 ver 4.0.4 base i777UCLK3

Now I want to install a custom rom. I chose to install mobileODIN pro (I agree, good to support the developer!!!!) My understanding from your post here and others I've read, I first should install a custom kernel with clockworkmod recovery, But this is where I'm confused. Your directions state the kernel needs to be gingerbread (but I know this post was originally written i 2011 and I did read your update notes as well). My question is, since I'm on ICS 4.0.4, is that still true? And if not, which kernels would be appropriate?

I've been reading lots of threads here, and truly am trying to wrap my head around this stuff. I want to try to avoid as many mistakes as possible. Other than cwm and the custom kernel, is there anything else I must do prior to installing custom roms (other than making sure usb debugging is enabled)?

TYSM!

Judi
 

Butchr

Senior Member
Apr 22, 2011
173
65
Google Pixel 4a
I personaly flashed the no mic swap kernel from this thread through mobile odin.
http://xdaforums.com/showthread.php?t=1592228

After you flash that kernel you can flash rom of your choosing. I flashed Shostock 3. It is very stable and smooth. Most of the roms I have seen for this phone will flash their own kernel so the one I linked you to won't be on your phone for long.

I was just recently at the stage you are. It isn't hard as long as you read and research you should have no trouble.
 
  • Like
Reactions: judib

creepyncrawly

Senior Member
Sep 3, 2010
2,768
3,276
Creepy....
Thx again...you're amazing!!!! I did root with ExynosAbuse and have disabled the exploit. I'm on an SGH-i777 ver 4.0.4 base i777UCLK3

Now I want to install a custom rom. I chose to install mobileODIN pro (I agree, good to support the developer!!!!) My understanding from your post here and others I've read, I first should install a custom kernel with clockworkmod recovery, But this is where I'm confused. Your directions state the kernel needs to be gingerbread (but I know this post was originally written i 2011 and I did read your update notes as well). My question is, since I'm on ICS 4.0.4, is that still true? And if not, which kernels would be appropriate?

I've been reading lots of threads here, and truly am trying to wrap my head around this stuff. I want to try to avoid as many mistakes as possible. Other than cwm and the custom kernel, is there anything else I must do prior to installing custom roms (other than making sure usb debugging is enabled)?

TYSM!

Judi

You need to install an ICS kernel if you plan to boot into the system. The current version of Siyah will work with both ICS and JellyBean systems. In the UCLE5 plus root thread in development, there are some links to older kernels to use with ICS, but might as well just use the latest one.

Theoretically, you can install any kernel, including one that does not match your system, if you plan to boot immediately into ClockworkMod Recovery and install firmware without booting the existing system first.
 
  • Like
Reactions: 4-2ndtwin and judib

judib

Member
Jan 5, 2013
19
4
Shostock3

I personaly flashed the no mic swap kernel from this thread through mobile odin.
http://xdaforums.com/showthread.php?t=1592228

After you flash that kernel you can flash rom of your choosing. I flashed Shostock 3. It is very stable and smooth. Most of the roms I have seen for this phone will flash their own kernel so the one I linked you to won't be on your phone for long.

I was just recently at the stage you are. It isn't hard as long as you read and research you should have no trouble.

Thanks for the suggestions. I've read quite a bit about shostock3 here and elsewhere and it looks great...I just may start there as my first JB rom. Will have fingers crossed!

Judi
 

alexv13

New member
there are some links to older kernels to use with ICS, but might as well just use the latest one.

Hi,

I am also about to install a new kernel for the first time on stock 4.0.4 using MobileOdin and your advice is really helpful. I noticed that the latest Siyah is 7.8.9 (http://xdaforums.com/showthread.php?t=2110542). I am planning to take one step at a time and replace the kernel first, use it with the stock 4.0.4 for a while, then install different ROM (but keep the kernel). Will that work?

Thanks again.
 

creepyncrawly

Senior Member
Sep 3, 2010
2,768
3,276
Hi,

I am also about to install a new kernel for the first time on stock 4.0.4 using MobileOdin and your advice is really helpful. I noticed that the latest Siyah is 7.8.9 (http://xdaforums.com/showthread.php?t=2110542). I am planning to take one step at a time and replace the kernel first, use it with the stock 4.0.4 for a while, then install different ROM (but keep the kernel). Will that work?

Thanks again.

Yes, and using the latest kernel would be my choice.
 
  • Like
Reactions: 4-2ndtwin

rthecurse

Member
May 18, 2008
5
0
So, I've got a quick question here. I bought another Samsung SGH-i777, the exact same one. I rooted it the exact same way as the first, and flashed the exact same Custom ROM to it. I have a full "Titanium Backup" backup of the first one. Can I safely restore the apps + system data to the second phone? Or just the apps?

Sent from my SGH-I777 using Tapatalk 2
 

rthecurse

Member
May 18, 2008
5
0
Or maybe, I can just make a NAND backup of the first phone, and restore it to the second, correct? Will the NAND backup include all the user apps?

Sent from my SGH-I777 using Tapatalk 2
 

studacris

Senior Member
Dec 25, 2010
5,463
3,960
Nashville, TN
Dude... I said try titanium backup.
Only if it gives you instability issues afterwards try just app data.

Ionno why you needed follow up questions before even trying?
 
  • Like
Reactions: 4-2ndtwin

ranjitvp

New member
Jun 7, 2013
3
1
Thanks for the great guide. I had bricked my phone by flashing a wrong kernel. I followed your instructions and reverted to stock ROM 2.3.4. I found the wifi not working. I followed your instructions to the letter upto step 4, and loaded shostock 3.02, however wifi is still not working. I have seen other threads on xda regarding this, however none had a conclusive solution. Any suggestions??
 

creepyncrawly

Senior Member
Sep 3, 2010
2,768
3,276
Thanks for the great guide. I had bricked my phone by flashing a wrong kernel. I followed your instructions and reverted to stock ROM 2.3.4. I found the wifi not working. I followed your instructions to the letter upto step 4, and loaded shostock 3.02, however wifi is still not working. I have seen other threads on xda regarding this, however none had a conclusive solution. Any suggestions??

Boot into recovery and perform a wipe data/factory reset.
 

ranjitvp

New member
Jun 7, 2013
3
1
Done that.....same problem

Boot into recovery and perform a wipe data/factory reset.

Did that a few times, the phone just wont accept the password, keeps saying authentication error and asks for password again. Had done a backup, so returned to ics, with siyah kernel, and the wifi works fine, but the home button doesnt work which is kind of irritating. Thats why I wanted shostock. tried reloading the shostock, and did the wipe/reset, no joy. any more suggestions??

edit to last.... removed the wep security, and its connecting as long as theres no authentication required....wondering why doesn work on wep
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 172
    This approach to customizing your phone involves the following steps:

    1. Read the flash counter.
    2. Root your phone:
    - by using DooMLoRD's Easy Rooting Toolkit. (ZergRush Exploit)
    - by using SuperOneClick Root. (ZergRush Exploit)
    - by flashing Entropy512's Return/Unbrick to stock, Kernel + Rooted System Package using Odin or Heimdall.
    3. Install a customized kernel containing ClockworkMod Recovery:
    - by using Mobile Odin Lite or Mobile Odin Pro on your phone.
    - by using adb on your computer.
    - by using Android Terminal Emulator on your phone.
    4. Flash the custom ROM package of your choice:
    - by using ClockworkMod Recovery and a CWM flashable zip package.
    - by using Mobile Odin.


    PLEASE NOTE: While the following guide was written before AT&T officially released ICS, the principles contained in this guide are still applicable to our phone regardless of firmware version. However if your phone is currently running stock ICS UCLE5, using this method will install Gingerbread, taking your phone back to an earlier version. To root the phone while retaining ICS, please see the [Heimdall][Odin][Stock][Root]UCLE5 Stock ICS with Root thread.


    JANUARY 2013 ROOTING UPDATE: In mid December of 2012, Samsung released an over-the-air update for the SGH-I777UCLK3, taking the operating system to version 4.0.4. Around the same time, XDA developer Chainfire released an application called ExynosAbuse APK which can be used to root the SGH-I777 with SuperSU, without the need to use a PC. ExynosAbuse APK is the best, and probably the only practical method for rooting UCLK3 without flashing some other distribution. In addition, it seems that this application is a good way to root any phone running 4.x operating systems, and possibly phones running 2.x operating systems as well. Be aware, there are possible risks involved with using this application. Please thoroughly read and understand Chainfire's thread linked above before using his application.


    Discussion

    The Samsung Galaxy S II contains an internal flash counter which is incremented each time a non-stock binary (kernel/rom) is flashed from a computer using Odin or Heimdall. (Using the new Mobile Odin on your phone does not increment the flash counter.) 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 Chainfire 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:
    On the newer versions of the i9100 ROMs apparently Samsung has updated the bootloaders to render the "jig trick" to reset the counter useless. This has also been observed in the latest ATT leak that DG posted in the General Forum (UCKJ2), where new bootloaders are included that render the jig reset obsolete.

    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.

    Here is some additional information for noobs about the tools and techniques used in this guide.




    1.) How to read the flash counter on an AT&T Samsung Galaxy S II
    • Boot into download mode by this method:
      • 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.
    • At the top of the screen you will see:
      ODIN MODE
      PRODUCT NAME: SGH-I777
      CUSTOM BINARY DOWNLOAD: NO --or-- YES (x counts)
      CURRENT BINARY: SAMSUNG OFFICIAL --or-- CUSTOM
    • Once you have verified the information, remove the usb cable, and hold down the power button until the phone begins to reboot. (Do not do this if you are actually flashing the phone. Interrupting a flash can cause bad things to happen.)
    • You will not see the above information if you enter download mode by another method, ie. by using adb or the power menu, etc.
    • Now you can check on your flash counter at any stage of the foregoing guide.


    To root UCKK6, use method 2c or 2d to flash UCKH7 stock plus root. Immediately after rooting, if you want UCKK6, open Settings and check for updates, download and install the OTA update, and it will retain root. Some have reported this works, and some say not. Alternatively, use Odin3 v1.85 to flash Entropy512's UCKK6 Stock plus Root package from his thread here.

    2a.) How to root by using DooMLoRD's Easy Rooting Toolkit. (ZergRush Exploit) (Windows)
    • This rooting method does not work on the UCKK6.
    • This is the preferred method of rooting for users with the Windows operating system on their computer, and a phone running UCKH7.
    • Download the "DooMLoRD's Easy Rooting Toolkit v4.0" package from this thread and extract it to a directory on your hard drive using WinZip or a similar program.
    • You need to have the USB drivers for SGH-I777 installed on your computer. (It will be "Samsung USB Driver for Mobile Phones" in Control Panel\Uninstall Programs.) Download and install the latest drivers from this thread. (x86 and x64)
    • Both USB Debugging (Menu\Settings\Applications\Development) and Unknown Sources (Menu\Settings\Applications) should be enabled on your phone.
    • Increase the screen timeout on your phone to 10 minutes. (Menu\Settings\Display\Screen Timeout) Remember to set it back to a shorter interval after you are done rooting.
    • Connect the USB cable to the phone and the computer. Go to the directory where you extracted the package and execute "runme.bat".
    • The toolkit will open a command prompt window where you will see the progress of the rooting process. It takes between 5 and 10 minutes for the process to complete.
    • Success. You're rooted.

    2b.) How to root by using SuperOneClick Root. (ZergRush Exploit) (Windows, Linux and Mac OS)
    • This rooting method does not work on the UCKK6.
    • Download "SuperOneClick v2.3.1 - Automatic Driver Installation" from DepositFiles (or look for links here) and extract it to a directory on your hard drive using WinZip or a similar program.
    • Please go the the SuperOneClick thread and read about the tool and how to use it. For Windows XP you need to have .NET Framework v2.0 or above installed. For Mac OS and certain flavors of Linux, you need to install Mono.
    • I have not tested this tool. It is included here because it claims to work for Mac OS and Linux, and provides a way to use the ZergRush Exploit on those operating systems. Since I am only familiar with Windows, I will be unable to support this rooting method. For problems, try posting questions in the SuperOneClick thread linked above.
    • If you try SuperOneClick on Linux or Mac, please post your (success or failure) results. Thanks.

    2c.) How to root by flashing Entropy512's Return/Unbrick to Stock, Kernel + Rooted System Package with Modem using Odin3 One-Click Downloader (Windows)
    • Download the "Odin3 One-Click Downloader Stock I-777 UCKH7 with Root no BL" package from Hotfile | Dev-Host 268.64 MB.
    • Extract the contents of the zip file to a directory on your hard disk drive. This is a One-Click version of Entropy512's Return/Unbrick to Stock, Kernel + Rooted System Package plus stock modem from the development forum. (Contains stock zImage, factoryfs.img with root, and modem.bin.)
    • Start the Odin3 One-Click Downloader program by double clicking on "I777UCKH7 OCD With Root.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 small edit box in the upper left corner will turn yellow, and say something like [0:COM8]. The number could be different.
    • Click Start. Watch the progress bar advance in green while the message box in the lower area 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.

    2d.) 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, or if you have difficulty with the links in his thread, there are alternative links for all his files in the Download Repository toward the bottom. 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.


    You must use a Gingerbread kernel when using this method. If you use an ICS kernel while your phone is running Gingerbread, it will not boot!!!

    3a.) How to Install a customized kernel containing ClockworkMod Recovery onto your Rooted phone from your phone, using Mobile Odin Lite or Mobile Odin Pro
    • This is the preferred method to install a customized kernel onto your phone. In addition, Mobile Odin is a very useful tool that will allow you to install custom software directly on your phone without using a computer.
    • Mobile Odin Lite (free) can be downloaded and installed directly on your phone, or it can be downloaded to your computer and installed with adb. Alternatively, you can purchase Mobile Odin Pro for under $5.00 and install it directly from the market. It's easier, and you'll support the developer!
    • To use Mobile Odin Lite, download the file attached to the OP of this thread. You may need to be a registerd member of xda forums to download this file. Download directly on your phone, or to your computer and move or copy it to your phones sdcard. Using any file manager such as MyFiles or Root Explorer, select the file and install it. You can also install it from your computer using the following adb command:
      Code:
      adb install MobileODINLite-v2.30.apk
    • Download the file containing the kernel you want to flash, and extract from it the zImage, which contains the actual kernel. There are several kernels available which can be found in the AT&T SGS II Android Development forum. You must use a Gingerbread kernel! Usually choose between the following two Gingerbread kernels: Entropy512's Daily Driver or Siyah 2.6.
    • Transfer the zImage to the root of your phone's internal or external sdcard, using a usb cable or another method such as dropbox.
    • On your phone, open the Mobile Odin program. If you installed Mobile Odin Lite, when it prompts you to install the add-in, click cancel. If you installed Mobile Odin Pro, you will have already downloaded and installed the add-in to activate all the features in the program. With Mobile Odin Lite, you will still be able to install the kernel.
    • In Mobile Odin, click on Kernel or Install Kernel, find and select the zImage on your internal or external SD card, and then click on Flash Firmware.
    • Mobile Odin will flash the kernel and then 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.
    • The 5.0.2.3 and later versions of ClockworkMod Recovery have a different button configuration. Home = select, Back = back, Power = back from submenu or toggle logo/main menu. The 5.0.2.7 version of ClockworkMod Recovery retains this button configuration but changes it to Power = select.
    • If you installed Mobile Odin Lite, and you don't want to keep it, you can uninstall it now. If you want to keep it and activate all its features, download the add-on MobileODIN_FlashKernel_I777-v1.0.apk from here and install it on your phone with adb using the instructions above.

    3b.) 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. You may need to run SDK Manager with administrator privledges.
    • You need to have the USB drivers for SGH-I777 installed on your computer. (It will be "Samsung USB Driver for Mobile Phones" in Control Panel\Uninstall Programs.) Download and install the latest drivers from this thread. (x86 and x64)
    • Download the file containing the kernel you want to flash, and extract from it the zImage, which contains the actual kernel. There are several kernels available which can be found in the AT&T SGS II Android Development forum. You must use a Gingerbread kernel! Usually choose between the following two Gingerbread kernels: Entropy512's Daily Driver or Siyah 2.6.
    • Move or copy the zImage into the platform-tools directory (on older installations it is the tools directory) where adb.exe resides. This will be something like (on Windows) c:\android-sdk-windows\platform-tools.
    • On your phone, first enable USB Debugging (Menu\Settings\Applications\Development\USB Debugging) and then plug in your USB cable, connecting your phone to your computer.
    • Open a command 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\platform-tools>adb push zImage /sdcard/zImage
      4279 KB/s <4776784 bytes in 1.090s>
      C:\android-sdk-windows\platform-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.
    • The 5.0.2.3 and later versions of ClockworkMod Recovery have a different button configuration. Home = select, Back = back, Power = back from submenu or toggle logo/main menu. The 5.0.2.7 version of ClockworkMod Recovery retains this button configuration but changes it to Power = select.

    3c.) 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. There are several kernels available which can be found in the AT&T SGS II Android Development forum. You must use a Gingerbread kernel! Usually choose between the following two Gingerbread kernels: Entropy512's Daily Driver or Siyah 2.6.
    • 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.
    • The 5.0.2.3 and later versions of ClockworkMod Recovery have a different button configuration. Home = select, Back = back, Power = back from submenu or toggle logo/main menu. The 5.0.2.7 version of ClockworkMod Recovery retains this button configuration but changes it to Power = select.


    4.) Flash the ROM package of your choice using ClockworkMod Recovery and a CWM flashable zip package or Mobile Odin with any package
    Your phone is now set up to flash custom software using ClockworkMod zipped install files in ClockworkMod Recovery. If you used and retained Mobile Odin, you can also flash custom software with it. Anything you flash on the phone using ClockworkMod Recovery, Mobile Odin, 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 containing a non-stock kernel with Odin or Heimdall from your computer. 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, or Odin flashable tar files.
    14
    i have a noob question. After 2 weeks of owning the sgsii and a lot of reading, i rooted my phone according to 2c and 3c and all is good. Thx OP.

    after a lot of readings i am still not clear on some issues, so here are some noob questions:

    1-a. this question is related to step 2. 2c and 2d are practically the same but i don't seem to have a perfect understanding of what the step is. Is this just flashing a new stock rooted kernel instead of the unrooted one?

    The purpose of step 2 is to root the phone. Steps 2a and 2b root the phone directly without installing anything but the root tools. To gain root access to the file system, the phone must have the Superuser.apk application and the su binary files installed in the file system. Usually, root also includes the installation of busybox, a set of commands for the file system. All of these are installed in the factoryfs partition of the file system.

    Steps 2c and 2d are the original rooting method we had for this phone, created for us by Entropy512. This consists of a bone stock kernel (no modification at all) and a factoryfs.img that has all the root tools included. Flashing this package with Odin or Heimdall does not trip the flash counter because it includes the stock kernel.

    1-b. if the new entropy kernel is different from the stock, what are the differences. I see that it factoryfs.img and modem.bin are an addition.

    It's Bone stock, unchanged.

    2-a. in 3 or specifically 3c. are we here flashing another rooted kernel instead of the entropy one and we are adding CWM as recovery in boot?

    Step 3 is where we flash a custom kernel that contains ClockworkMod Recovery. It doesn't really matter at this stage which custom kernel, because all we need at this point is to put CWM recovery on the phone.

    Root has nothing to do with the kernel. Except that some custom kernels have a root injection feature included. If root injection is included with the kernel, then installing the kernel will inject the rooting tools into the fasctoryfs partition. The problem with this method of rooting is that installing a custom kernel with Odin or Heimdall will increment the flash counter.

    2-b. which specific step of this whole process makes it such that the counter is not tripped.

    The only thing that increments the flash counter is flashing a custom kernel onto the phone using either Odin3 or Heimdall from a computer. Flashing the stock kernel using Odin3 or Heimdall will not increment the flash counter, and in fact it will remove the I9100 boot screen and yellow warning triangle, and restore the original AT&T boot screen.

    It is possible to root the phone by flashing a custom kernel. It is also possible to install a rom without rooting the phone first, by installing a custom kernel containing CWM recovery, and then flashing the rom. Both of these methods will increment the flash counter however. Another common root method is to install a CWM recovery enabled kernel using Odin or Heimdall, and then use a CWM flashable rooting tool. This method also trips the flash counter.

    How to Flash Custom Binaries Without Ever Incrementing the Flash Counter provides all the options to get custom software on the phone without flashing a custom kernel using Odin3 or Heimdall from a computer.

    2-c. what stuff can be flashed from the CWM recovery vs flashed from the Mobile Odin, Vs ADB vs the Android Terminal Emulator and why there is a difference.

    Each one of these is a different tool. Mobile Odin is practically brand new, and does anything Odin3 can do from a computer, but on the phone. It also does some other stuff as well. Mobile Odin is a very versatile tool. CWM recovery is and has been the primary tool for flashing custom software for a long time. This is the tool most developers use for their offerings. The other two tools are used only infrequently, but provide additional options to work with the phone. All of these tools can be used to flash a custom kernel without incrementing the flash counter.
    ___________________________________________

    kanonengedonner asked some more questions in a later post. I've added them here for the sake of having them answered all in the same place.
    Ok, again your explanation post was helpful. Here are some comments/questions on the post.

    My interrogation when reading step 2 and step 3 and after reading your clarification is:
    1. why couldn't we combine them in only 1 step. ie flash a kernel with CWM without incrementing the counter and have root access at the same time.

    -->to answer my own question and let me know if this true: we can't combine both steps in a unique step because it is impossible to flash a non stock CWM kernel without setting the counter using non odin3/heimdall methods and that the other methods (ADB, mobile odin, android terminal )would require a prerequisite root access. So we need to root 1st.

    Your answer to this question is essentially correct. It is possible to flash a ClockworkMod Recovery enabled custom kernel using Odin or Heimdall from a computer without having root access on the phone. In fact, since most ROMs are rooted, this would be the quickest path to installing custom software, as you don't have to root first. However, it does trip the flash counter.

    And yes, all the tools that allow installation of a custom ClockworkMod Recovery enabled kernel without incrementing the flash counter require the phone to be rooted, so the rooting step has to come first.

    Otherwise my mistake in understanding the whole process is that I had the impression that CWM is a separate entity from the kernel. I thought CWM was a GRUB like program that is in the boot partition and therefore is separate from the kernel.

    The old ROM Manager was sort of like that, the way it was done on the Captivate when it first came out running Eclair. You used stock recovery to flash an update that installed CWM recovery. Once Froyo was available with 3e recovery, kernels containing CWM Recovery became standard.

    Ok another set of questions that i don't have an answer for:
    2. CWM recovery can't be installed without flashing it within a kernel?

    This is true because the stock 3e recovery will only flash signed files, and only Samsung can sign the files. The old ROM Manager method of installing recovery will not work on this phone, and in fact ROM Manager should not be used on this phone.

    3. Why is it that the Entropy Kernel is considered stock even though it has a different factoryfs.img and modem.bin files.

    I think you are referring to the Return/Unbrick to Stock plus root package. That package is not just a kernel. It includes the stock kernel as a zImage. That kernel is bone stock, as dumped right from Entropy's unmodded phone. It also contains the system image as factoryfs.img. That is the stock system files with the root files included. This is the part of the file system that you would call the ROM, or user space. Entropy's package does not include the modem. He provided that as a separate download. The Odin3 One-click downloader of the Return/Unbrick to Stock plus root package includes the stock zImage, the rooted factoryfs.img and the modem.bin.

    The kernel and system are the two modifyable portions of the phone. None of the other parts normally get modified, inculding the modem, as source code is not available.

    Entropy's daily driver kernel is also considered a stock kernel, as it is built from the source code of the stock kernel, with all the tweaks and code improvements Entropy has included.

    4. what is modem.bin used for?

    The modem handles the voice and data communications, and also interfaces with wifi. In other manufacturer's phones, it is sometimes referred to as the radio.

    5. why "Odin3 One-Click Downloader Stock I-777 UCKH7 with Root no BL" so big (400 meg i think)?

    Factoryfs.img with root is 485,231,260 bytes uncompressed, zImage is 8,308,688 bytes, modem.bin is 16,777,216 bytes, and the Odin3 One-Click Downloader is 408,064 bytes. Even after it is put together and compressed, it is a pretty big file.

    Again Creepy, it is much clearer now, and I think most of the problem of noobs like me is that most guides out there are set up such us "do this do that" without really explaining why or what is the idea behind the step. I am assuming that it won't bother a lot of people, but more anal/analytical minds will have a big brain freezes :).
    5
    Nice write-up. The info has been floating around on various threads and posts, but you did a great job putting all together into one nice step-by-step for folks looking to learn.

    Hopefully it'll also cut down on the million of duplicate threads asking the same question! :D

    ---------- Post added at 05:02 PM ---------- Previous post was at 04:58 PM ----------

    Discussion

    It has been reported to be possible to remove the warning screen and reset the flash counter 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, while it is confirmed that the jig will both remove the triangle and reset the counter, and that flashing a stock kernel with Odin or Heimdall will remove the warning triangle, it is not certain that flashing a stock kernel with Odin or Heimdall will actually reset the flash counter. The developer Chainfire on the i9100 forums says that on the International version of the Galaxy S II, it will not. This is yet to be confirmed or denied on the AT&T version of the phone, as far as I know.

    On the newer versions of the i9100 ROMs apparently Samsung has updated the bootloaders to render the "jig trick" to reset the counter useless.

    This has also been observed in the latest ATT leak that DG posted in the General Forum (UCKJ2), where new bootloaders are included that render the jig reset obsolete.
    5
    And last but not least, here is a new pic of my phone in download mode after the reset while running entropy512's custom kernel that comes with Unamed ROM v 1.03

    This is after returning to the custom kernel I am currently running, and after a jig reset, reboot and entered download mode one more time to finish.

    Sorry about making this a series of posts, but I did not want anyone to be confused about what pic went with which step.
    4
    i have a noob question. After 2 weeks of owning the sgsii and a lot of reading, i rooted my phone according to 2c and 3c and all is good. Thx OP.

    after a lot of readings i am still not clear on some issues, so here are some noob questions:

    1-
    a. this question is related to step 2. 2c and 2d are practically the same but i don't seem to have a perfect understanding of what the step is. Is this just flashing a new stock rooted kernel instead of the unrooted one?

    b. if the new entropy kernel is different from the stock, what are the differences. I see that it factoryfs.img and modem.bin are an addition.

    2-
    a.in 3 or specifically 3c. are we here flashing another rooted kernel instead of the entropy one and we are adding CWM as recovery in boot ?


    b. which specific step of this whole process makes it such that the counter is not tripped.

    c. what stuff can be flashed from the CWM recovery vs flashed from the Mobile Odin, Vs ADB vs the Android Terminal Emulator and why there is a difference.


    These are a lot of questions, but I think if answered it will make things a lot easier for noobs :)

    thx.
    Let a fellow noob try to help with a few of the questions.

    1.a The difference between the steps are for person preference, and for operating systems.
    1.b The objective of step 2 is strictly to get rooted so you can proceed to the following steps.

    2.a Step 3 is to get a stock based kernel that includes CWM on your phone so you can proceed to step 4.
    2.b I believe it's getting the stock kernel with CWM.
    2.c Anything in CWM format zip.

    I hope it's ok that I answered. Xda has already helped me a lot and I would like to return the favor.