Saturday, 7 January 2012

[At Your Own Risk] How to restore your Samsung Galaxy S2 back to stock

Everyone needs a get out of jail card and if you find yourself in deep doo-doo with your phone and have no luck fixing some weird and unwanted bug you'll probably be muttering some expletives under your breath about having no choice but returning your phone for a warranty repair.

Eeek, but you've rooted it and flashed eleventy hundred roms on it and it's no longer stock.

All is not lost.

Breathe.

Take another calming breath, and then make the jump and follow our guide to make your Galaxy S II warranty-worthy again.


If you've managed to root and flash a custom rom, then you're more than likely able to find the courage to get the phone back to stock.

I don't suppose you grabbed the stock rom before you first flashed a custom rom. No?  You're not alone, many wouldn't have bookmarked where to grab the stock rom from.

There's a few steps involved in flashing the stock.  And you may even like to take a nandroid backup of your current favourite rom running on your phone now. That way when the phone is returned you can potentially place the nandroid backup on the phone and restore to it (after having gained root access and flashing a kernel that provides ClockworkMod functionality). Talking of extra steps, you might like to take screen shots of what your home screens look like. By the time you get your phone back you might have forgotten what it all looked like.  Take the screen shots and save them to your computer for refer to later.

There's an assumption that if you've already rooted your phone you'll have taken the precaution of backing up your /efs folder.  If you don't know what I'm talking about, or haven't yet done so, now is the time!  Follow Murray's tip at the end of this post: How to backup your Rooted 'Droid.

So lets get into restoring the stock rom.

In broad terms these are the steps:

  • Phone charged
  • Locate and download the stock rom
  • Note your IMEI number
  • Install Odin
  • Copy files from your Internal SD if you want them for later
  • Make sure your micro USB cable hasn't been chewed by the dog, run over by the car or damaged in some other spectacular way
  • Ensure Kies is not running (you mean you've still got Kies installed taking up valuable space on your computer?)
  • Flash the original rom with Odin
  • Confirm you're running the stock rom
  • Complete the Setup wizard
  • Smile nicely at the Customer Service Rep when you return your phone for repair

Phone charged

It's recommended that you have some decent battery life on your phone. Flashing is fairly labour intensive. You don't want a flash to go bad because your phone has run out of puff right in the middle of things.

Locate and download the stock rom

Thanks to Intratech from XDA, all the information on "Official Firmware" can be found from this thread.

Scroll through the list and download the firmware that relates to your phone. Save the files (Firmware and Kernel) to your computer – note where you've saved them to, you'll need to use these files with Odin

Note your IMEI Number

Head to Settings --> About Phone --> Status, scroll down and write down the IMEI number. You'll check the IMEI number after you've flashed in Odin and performed a factory format.

Install Odin

On Intratech's XDA page he's provided a link to download Odin. Download Odin from here.

Copy files from the Internal SD

When we perform a factory format you'll lose your Internal SD contents. If you've got anything stored on your Internal SD you want to keep, maybe a folder containing the precious game history or your Titanium backups, then connect the phone to the computer as USB mass storage and copy the folders and store them somewhere safe.

Check the quality of your micro USB cable


Check your cable is in good condition. You don't want a loose connection while you're connecting your phone to your computer. I've heard of people who have come into difficulty because their cable is less than perfect. Go. Check you don't have a dodgy cable before embarking on this. And while we're checking things that might stop working part way through. Now is a good time to reboot your computer/laptop. You don't want things to stall because there's some random update taking place, or your computer decides it's tired and would like a little nap now. Wont hurt to reboot your computer.

[I think to be safest it's always best to do this stuff on a laptop, then if your power supply is interrupted during the operation you should hopefully still be OK - it's really hard to brick Samsung Android handsets in general but a power outage during something like this will do it, Ed]

Kill Kies

Now that your computer is up and running the dreaded Kies may have reared it's ugly head and spontaneously "started". I use "started" loosely. Look in your system tray to make sure Kies isn't working (well it's never working, but you know what I mean). Make sure you've quit Kies.


Flash the original rom

There's a bit more to explain here, so I'll break this down.
If you've not taken a nandroid backup, do that now.  You'll find instructions on how to perform a nandroid backup from Murray's post.

Open Odin.

Now we're going to locate the files you previously saved of your stock rom.

  • Extract the files from the downloaded firmware
    • If there are 3 files you'll need to use the PIT when flashing
    • If there is 1 file you DON'T need a PIT file for flashing
  • Start Odin
  • Select the files needed
    • If there's 3 files include PIT and TICK re-partition
      • PDA = CODE
      • PHONE = MODEM
      • CSC = CSC
    • If there's 1 file NO PIT, and do NOT tick re-partition
      • Put the one file into PDA
  • Power off the phone
  • Put the phone into download mode by pressing the Volume Down, Home and Power buttons until you see the Samsung boot up screen. Then release all buttons together
  • Press Volume up to continue onto Download mode

factory5


  • Connect to USB
  • Wait for the ID:COM to highlight yellow
  • Click Start

clip_image006


clip_image008


factory4



  • The phone will reboot when the flash has completed successfully

Confirm the IMEI hasn't changed

Head to Settings --> About Phone --> Status

Confirm you're running stock rom

Open the dialler and press *#1234# the following screen, or one very much like it should appear:


clip_image010


Perform a factory format. This next step will completely wipe the Internal SD.

In the dialler press *2767*3855# once you've done that you'll get the following screen:

factory6


It's more than a few seconds.  Don't be alarmed.  It's probably dependant on how much you've got on your Internal SD. But it's not a quick process and I don't want you panicking that things have turned ugly because 10 seconds have gone by and you're still watching the thing spinning in the top right corner. I reckon mine easily took 2-3 minutes before the yellow writing started appearing on my screen. 

The Samsung boot up sequence will start.

If you haven't got the SIM in you'll be prompted first to connect to Wi-Fi.

You don't need to complete the Wizard to power off the phone.  Hold the power button. Power off and add the SIM and External SD if you had one which you'd earlier removed. Boot up, you're done!

Last words

Before heading to the store to leave your precious with them, make sure there's nothing on your external SD that would point to you flashing a custom Rom. Better yet, remove the external SD before heading to the shop.

Right, now that I've returned my phone to stock successfully to complete this guide I'm going to go straight back to flashing the custom rom and getting my phone back to how it was. I can't stand stock, I can't be without root privileges. I need Titanium Backup, Root Explorer and a raft of other apps that require root access.

Please feel free to leave any comments on this process, or questions you may have. If there's something you religiously do when you revert to stock that's not included but you feel is worthwhile doing let us know.