Prepare Your Phone to Return to the Store or for Warranty Replacement by following these steps:
1. Read the flash counter to make sure your flash count is at "NO". If it reads "YES (x counts)" then you must buy or build a Jig to reset it to "NO"...
...or use chainfire's "Triangle Away" program (which only work on ICS, Android 4.x)
2. Flash the UCKH7-CL503881 stock kernel and system package using Odin or Heimdall.
3. Deal with any special problems.
4. Do a wipe data/factory reset, and remove any personal or sensitive information that remains on the phone.
Note:
Both new and refurbished SGH-I777 phones are now shipping with Android version 2.3.6, UCKK6. As of this writing, March 24, 2012, there is no release of the UCKK6 firmware on sammobile.com, and no one has pulled the stock UCKK6 firmware and packaged it into an Odin flashable tar. For warranty return of phones that shipped with UCKK6, I recommend flashing the stock UCKH7 package contained in this guide. An alternative would be to flash Entropy512's Return/Unbrick to stock Kernel + cache + rooted UCKK6 system package from here, and then to manually remove the traces of root.
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. In order to safely return the phone to the store or to a warranty center, it is necessary that the flash counter indicates "NO" custom binary download and "Samsung Official" current binary. If the flash counter has been incremented, it is necessary to reset the flash counter before returning the phone. The only known way to do this on Gingerbread is by using a Micro Usb Jig to place the phone into download mode which resets the flash counter. Since the advent of ICS for the I777, it is also possible to reset the flash counter using chairfire's TriangleAway application, but only while running an ICS rom.
The Jig is a micro usb plug with 301,000 ohms of resistance connected across pins 4 and 5. The use of the Jig became well known in late 2010 when a batch of Samsung Galaxy S Captivate phones were shipped with bootloaders that did not allow a button combination to enter download mode. That was before the Galaxy S II was released, and the only purpose for the Jig was to put the phone into download mode. Shortly after the International version of the Galaxy S II was released in May 2011, it was discovered that using a Jig to place the phone into download mode also resets the flash counter. Some who had a Jig for their Captivate found that the Jig would not work on the Galaxy S II. It seems that the Galaxy S II's tolerance for the 301k ohms is closer than the Captivate was, so if the resistance of the Jig was a little bit out of tolerance, it wouldn't work on the newer phone.
If you are handy, you can build your own jig. There are several threads in the Captivate forums that detail how, either with or without soldering. For a place to start, check out this thread and this one. There are also multiple places that sell pre-made Jigs. Check out dayv's thread in the Accessories forum. I bought a cheap JIG that works for under $2.00 and free shipping. A google search for "where to buy micro usb jig" will bring up a good number of them. Some of these may not be close enough tolerance for the Galaxy S II. Users on this forum have reported good results with Jigs from Moble Tech Videos.
Once your flash counter reads "NO", use Odin or Heimdall to flash the stock kernel, system image and modem. A wipe data/factory reset performed from the phone or from stock 3e recovery, and removing any personal or sensitive information on the internal sdcard, completes the process.
Information from dayv:
Information from pinoymutt:
Entropy512 adds:
If you are reading this Guide before you have flashed anything that would increment the flash counter, your best bet woruld be to never increment the flash counter in the first place. It is possible to root and to flash a custom ROM/Kernel without incrementing the flash counter. Please see the Guide: How to Flash Custom Binaries Without Ever Incrementing the Flash Counter!!
1.) How to read the flash counter on an AT&T Samsung Galaxy S II
2a.) Flash the UCKH7-CL503881 stock kernel and system package using Odin3 One-Click Downloader (Windows)
2b.) Flash the UCKH7-CL503881 stock kernel and system package from the command line using Heimdall (Linux and Mac OS)
3.) Dealing with special problems.
4.) Do a wipe data/factory reset, and remove any personal or sensitive information that remains on the phone.
To perform a wipe data/factory reset from the phone:
1. Read the flash counter to make sure your flash count is at "NO". If it reads "YES (x counts)" then you must buy or build a Jig to reset it to "NO"...
...or use chainfire's "Triangle Away" program (which only work on ICS, Android 4.x)
2. Flash the UCKH7-CL503881 stock kernel and system package using Odin or Heimdall.
3. Deal with any special problems.
4. Do a wipe data/factory reset, and remove any personal or sensitive information that remains on the phone.
Note:
Both new and refurbished SGH-I777 phones are now shipping with Android version 2.3.6, UCKK6. As of this writing, March 24, 2012, there is no release of the UCKK6 firmware on sammobile.com, and no one has pulled the stock UCKK6 firmware and packaged it into an Odin flashable tar. For warranty return of phones that shipped with UCKK6, I recommend flashing the stock UCKH7 package contained in this guide. An alternative would be to flash Entropy512's Return/Unbrick to stock Kernel + cache + rooted UCKK6 system package from here, and then to manually remove the traces of root.
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. In order to safely return the phone to the store or to a warranty center, it is necessary that the flash counter indicates "NO" custom binary download and "Samsung Official" current binary. If the flash counter has been incremented, it is necessary to reset the flash counter before returning the phone. The only known way to do this on Gingerbread is by using a Micro Usb Jig to place the phone into download mode which resets the flash counter. Since the advent of ICS for the I777, it is also possible to reset the flash counter using chairfire's TriangleAway application, but only while running an ICS rom.
The Jig is a micro usb plug with 301,000 ohms of resistance connected across pins 4 and 5. The use of the Jig became well known in late 2010 when a batch of Samsung Galaxy S Captivate phones were shipped with bootloaders that did not allow a button combination to enter download mode. That was before the Galaxy S II was released, and the only purpose for the Jig was to put the phone into download mode. Shortly after the International version of the Galaxy S II was released in May 2011, it was discovered that using a Jig to place the phone into download mode also resets the flash counter. Some who had a Jig for their Captivate found that the Jig would not work on the Galaxy S II. It seems that the Galaxy S II's tolerance for the 301k ohms is closer than the Captivate was, so if the resistance of the Jig was a little bit out of tolerance, it wouldn't work on the newer phone.
If you are handy, you can build your own jig. There are several threads in the Captivate forums that detail how, either with or without soldering. For a place to start, check out this thread and this one. There are also multiple places that sell pre-made Jigs. Check out dayv's thread in the Accessories forum. I bought a cheap JIG that works for under $2.00 and free shipping. A google search for "where to buy micro usb jig" will bring up a good number of them. Some of these may not be close enough tolerance for the Galaxy S II. Users on this forum have reported good results with Jigs from Moble Tech Videos.
Once your flash counter reads "NO", use Odin or Heimdall to flash the stock kernel, system image and modem. A wipe data/factory reset performed from the phone or from stock 3e recovery, and removing any personal or sensitive information on the internal sdcard, completes the process.
Information from dayv:
Step 1) settings> privacy> factory data reset.
Step 2) Flash with heimdall or Odin
In case you need to repartition, you will need a stock .pit file as well - though as of now as far as I know this is not needed for any reason - none of the roms or kernels in the dev section here in the at&t xda forums would cause any need for a repartition. Take care with .pit and repartitioning as you could end up with a soft brick, a situation that can be recovered from but still not desirable.
And if you have flashed anything containing the boot loaders you will need stock boot loaders too, but be very careful with boot loaders as a mistake with boot loaders can result in a hard brick
Information from pinoymutt:
If you flashed the newer i777 leak that DG posted in the General section (I777UCKJ2) or went a little crazy and accidentally flashed one of the newer firmwares in the SGSII international section -- you'll find that they contain newer bootloaders -- the main difference being that they render the "jig trick" useless for resetting the custom firmware flasher.
This (i777 UCKH7 Secondary Bootloader) will allow you to revert back to the older (stock) bootloader that will let the jig reset the counter.
Most likely as new ROMs are built for our phones, many devs will remove the bootloaders, since it's not really advisable to flash these unless absolutely necessary (which for instance it was on the Captivate when flash from a Eclair/Froyo ROM to a Gingerbread one).
Be forewarned -- DO NOT mess with or flash bootloaders unless you absolutely know what you are doing or are sure you need them. Many things can be recovered from if things go wrong, but a bad bootloader flash can create a nasty "brick" that almost always needs some sort of professional help to undo.
Entropy512 adds:
This (flashing UCKH7 Secondary Bootloader) reverts to current if you flashed the 2.3.5 leak package accidentally.
I would advise:
DO NOT flash this bootloader unless you have flashed a 2.3.5 leak or I9100 ROM that included bootloaders, AND you have confirmed by trying it that using the jig does not reset your flash counter.
If you don't have a jig, this does nothing for you except risk hardbricking.
If you have a jig and it works to reset the custom binary flash counter, this does nothing for you except risk hardbricking.
If you are reading this Guide before you have flashed anything that would increment the flash counter, your best bet woruld be to never increment the flash counter in the first place. It is possible to root and to flash a custom ROM/Kernel without incrementing the flash counter. Please see the Guide: How to Flash Custom Binaries Without Ever Incrementing the Flash Counter!!
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.
- If your Custom Binary Download is NO, proceed to step 2. If your Custom Binary download is YES, your only option to reset this to NO is to use a Jig. The Jig is a micro usb plug with 301k ohms of resistance connected across pins 4 and 5. On the i777 running original bootloaders, it will reset the flash counter to NO as it puts the phone into download mode. You can make your own jig, or purchase one from many sources on the web. See the Discussion above for more information.
2a.) Flash the UCKH7-CL503881 stock kernel and system package using Odin3 One-Click Downloader (Windows)
- Download the "I777UCKH7-CL503881-No-BL.7z" package from Hotfile | Dev-Host 270.17 MB.
- Extract the contents of the zip file to a directory on your hard disk drive. This Odin3 One-click downloader contains firmware from the stock binary download available from samfirmware on sammobile.com. The bootloaders boot.bin, sbl.bin and param.lfs have been removed for safety. (Contains cache.img, factoryfs.img, hidden.img, modem.bin and zImage.)
- Start the Odin3 One-Click Downloader program by double clicking on "I777UCKH7-CL503881-No-BL.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 Bone Stock.
- If your phone enters a bootloop, enter 3e recovery and perform a wipe data/factory reset. See step 4.
2b.) Flash the UCKH7-CL503881 stock kernel and 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 the UCKH7-CL503881 stock kernel and system package from Hotfile | Dev-Host 269.86 MB.
- Extract the contents of this 7zip package to a directory on your hard disk drive, and move or copy all files to the directory where you have the Heimdall command line executable. These were extracted from the stock binary download available from samfirmware on sammobile.com. (Contains cache.img, factoryfs.img, hidden.img, modem.bin and zImage.)
- Enter the following at the command prompt:
Code:heimdall flash --kernel zImage --factoryfs factoryfs.img --cache cache.img --hidden hidden.img --modem modem.bin
- Reboot the phone. Success. You're Bone Stock.
- If your phone enters a bootloop, enter 3e recovery and perform a wipe data/factory reset. See step 4.
3.) Dealing with special problems.
- If you are unable to reset the flash counter with a jig, you may have a modified version of the secondary bootloader, perhaps from flashing one of the leaked versions of I777 firmware onto your phone, and will need to flash back to the I777 Stock sbl.bin in order to clear the flash counter.
- If your flash counter says that your phone is an I9100, you have an I9100 secondary bootloader, probably from flashing an I9100 rom onto your phone, and you will need to flash back to the I777 Stock sbl.bin to correct the flash counter. You will also probably need to flash the stock param.lfs back onto your phone.
- If you get the error "'logo_att.jpg' draw failed", you will need to replace the param.lfs with the I777 Stock param.lfs.
- If you get the "Deleting Cryption Meta Data" error while your phone is in a bootloop, see this post.
- Necessary files and flashing instructions for these are in the Download Repository.
4.) Do a wipe data/factory reset, and remove any personal or sensitive information that remains on the phone.
To perform a wipe data/factory reset from the phone:
- From the home screen, go to Menu > Settings > Privacy > Factory Data Reset (Gingerbread) or Menu > Settings > Back up and reset > Factory data reset (ICS).
- If you want to Format USB Storage (erase the internal sdcard), tick the check box.
- Click the "Reset Phone" button.
- Done.
- Reboot into stock 3e recovery: With the phone powered off, hold down the vol up + vol down + power buttons continuously until the initial boot screen appears a second time. Then let the phone boot on into the recovery screen.
- Use the vol up and vol down keys to select the "wipe data/factory reset" option.
- Press the home button to start the wipe data/factory reset.
- Done.
- From the home screen, go to Menu > Settings > Storage > Format USB Storage.
- Click the "Format USB Storage" button.
- Done.
Last edited: