Samsung Galaxy S4 I9505: Unroot and restore to stock ROM

There are several reasons to restore a Samsung Galaxy S4 back to official stock firmware. The main reasons are:

  • Unroot and receive OTA updates again.
  • Resurrect/unbrick the device.
  • Reclaim the manufacturer warranty.

This guide is intended only for the I9505 international version of the Galaxy S4 to flash I9505XXUBMEA – XEF 4.2.2 Jelly Bean stock Samsung firmware. Do not try this on any other models of the Galaxy S4 or you will end up bricking your device. Use it at your own risk.

Prerequisites

- Make a backup of all your important data before following this guide. All data on your device will be deleted and your custom recovery will be overwritten.
– Ensure the battery of the phone is charged more than 80%.
– Download I9505XXUBMEA_I9505OXXBMF1_XEF.zip stock Samsung 4.2.2 Jelly Bean firmware.
– Download Odin v3.07.
– Download Samsung Galaxy S4 USB drivers.
– Windows 7 x64.

Procedure

- Install the Samsung Galaxy S4 USB drivers.

Note that the Samsung Kies also installs the USB drivers. However, Kies is known to cause problems when Odin is attempting to communicate with your device, so ensure it is really closed (use Windows Task Manager to kill it and its related processes if you need to).

- Unzip I9505XXUBMEA_I9505OXXBMF1_XEF.zip to a folder of your choice. The file I9505XXUBMEA_I9505OXXBMF1_I9505XXUBMEA_HOME.tar.md5 is a stock Samsung firmware and has the following settings:

Model: GT-I9505
Country: France
Version: Android 4.2.2
Changelist: 768421
Build date: Wed, 29 May 2013 16:05:23 +0000
Product Code: XEF
PDA: I9505XXUBMEA
CSC: I9505OXXBMF1
MODEM: I9505XXUBMEA

- Run Odin v3.07 as administrator:

  • Check Auto Reboot and F. Reset Time.
  • Make sure that the re-partition checkbox is not selected.
  • Click on PDA and select I9505XXUBMEA_I9505OXXBMF1_I9505XXUBMEA_HOME.tar.md5 file.

- Optionally reset the Flash Counter:

The Flash Counter is something that Samsung put in to keep track of how many custom firmwares were flashed on your device. To reclaim the manufacturer warranty and to enable OTA updates again, do this:

  • Download Triangle Away from Google Play or from XDA web site (free download).
  • Run Triangle Away and grant SuperUser permission once asked.
  • Tap Continue to confirm your correct Galaxy S4 model number.
  • Verify your Flash Counter status. then select Reset flash counter.
  • Follow the on-screen instructions till your device reboots into Download mode.
  • Once you see Downloading… press the power button for 10 seconds until the screen turns off.
  • The device will automatically turn back into the Triangle Away reset flash counter mode.
  • Press the volume up key to reset counter and status.
  • After a few seconds it says Done!.  The Flash Counter is reset.
  • Press the volume up to reboot the device.

- Wipe data, cache and Dalvik cache. This will not wipe your external MicroSD card.

Using Stock Recovery:

  • Turn off your device.
  • Press and hold Volume up + Power + Home buttons simultaneously. After appearing Samsung logo release the buttons. To navigate through this menu, use the volume up/down buttons to scroll up and down and the power button to confirm selection.
  • Choose Wipe data/factory reset then select Yes — delete all user data.
  •  Return to the main and select reboot system now to reboot the device.

Using TWRP Recovery:

  • Turn off your device.
  • Press and hold Volume up + Power + Home buttons simultaneously. After appearing Samsung logo release the buttons.
  • Select Wipe then slide Swipe to factory Reset.
  • Go back to main menu.
  • Select Reboot then tap Download to reboot in Download mode (Skip next step).

- Set your device in Download mode:

  • Turn off your device.
  • Press and hold Volume Down + Power + Home buttons simultaneously. Release the buttons only when the Warning!! message appears.
  • Press Volume Up button to enter into Download mode.

- Connect your device to your PC. Odin should now recognize the device and the ID:COM field should turn yellow. This means that it has detected your device without a problem.

- Click Start. Wait a couple of minutes until the following conditions are met:

  • The device reboots (except entering PIN code for your SIM after reboot, avoid any other action).
  • The ID:COM box turns green and says PASS!.
  • The log box displays all threads completed.

Stock_ODIN_SGS4

- The flashing operation is complete. Unplug the USB cable.

Log

Below a copy of Odin’s log box content:

<OSM> Enter CS for MD5..
<OSM> Check MD5.. Do not unplug the cable..
<OSM> Please wait..
<OSM> I9505XXUBMEA_I9505OXXBMF1_I9505XXUBMEA_HOME.tar.md5 is valid.
<OSM> Checking MD5 finished Sucessfully..
<OSM> Leave CS..
<ID:0/004> Added!!
<ID:0/004> Odin v.3 engine (ID:4)..
<ID:0/004> File analysis..
<ID:0/004> SetupConnection..
<ID:0/004> Initialzation..
<ID:0/004> Get PIT for mapping..
<ID:0/004> Firmware update start..
<ID:0/004> boot.img
<ID:0/004> NAND Write Start!!
<ID:0/004> recovery.img
<ID:0/004> system.img.ext4
<ID:0/004> modem.bin
<ID:0/004> NON-HLOS.bin
<ID:0/004> cache.img.ext4
<ID:0/004> hidden.img.ext4
<ID:0/004> RQT_CLOSE !!
<ID:0/004> RES OK !!
<ID:0/004> Removed!!
<ID:0/004> Remain Port .... 0
<OSM> All threads completed. (succeed 1 / failed 0)
About these ads

15 thoughts on “Samsung Galaxy S4 I9505: Unroot and restore to stock ROM

  1. Craig Perry

    If you run triangle away to reset the flash counter, then use ODIN to install the stock rom, does it set your flash counter to 1 and result in you being unable to install updates?

    Reply
  2. Cain

    Hi, I just use your description and stuck installing rom. Odin trow error message : fail (Auth) and at phone screen I see information : sw rev check fail. Fused: 2 binary : 1.

    Did you get any of this error and do you know how to pass it, cause now I can’t install anything

    Reply
      1. Cain

        So there’s no solution to fix it:( I should watch that triangle away show me that he don’t detect “any count and data”.
        Should be mention it at description for others so they won’t block bootloader like me.

  3. kramdeseyer

    i have this error, what should I next??
    Added!!
    Enter CS for MD5..
    Check MD5.. Do not unplug the cable..
    Please wait..
    I9505XXUBMEA_I9505OXXBMF1_I9505XXUBMEA_HOME.tar.md5 is valid.
    Checking MD5 finished Sucessfully..
    Leave CS..
    Odin v.3 engine (ID:3)..
    File analysis..
    SetupConnection..
    Initialzation..
    Get PIT for mapping..
    Firmware update start..
    boot.img
    NAND Write Start!!
    recovery.img
    system.img.ext4
    modem.bin
    FAIL! (Auth)
    All threads completed. (succeed 0 / failed 1)

    Reply
    1. briolidz Post author

      The I9505XXUBMEA_I9505OXXBMF1_I9505XXUBMEA_HOME.tar.md5 is a French XEF Firmware. You first need to download a stock ROM that matches your device information: country and carrier network (Check http://www.sammobile.com/firmwares/1/ for downloads). Then try again.

      If your device is not protected from flashing you should not see “FAIL! (Auth)” message.

      Reply
    1. briolidz Post author

      You need to wait a couple of minutes until the the ID:COM box turns green and says PASS!.

      Indeed the ID:COM box turns yellow first, then blue and finishes green.

      Reply
  4. chris

    Hi I have the galaxy s4 gt i9505 and I’m trying to find the stock firmware but for Australia and possibly unlocked im only new to this side of things and would greatly appreciate any help thanks

    Reply
  5. Emmanuel Pierre Sylvain Joseph

    it works fine.
    the first time i tried it failed, so i started task manager and closed Kies and kies tray agent, after that i reopen odin and strat it over, finally its works.
    I aslo notice that i did not wipe data and use triangle away to be able to received OTA Updates, i just install it via odin without making all the firats clean-up, but aftrer flashing the new rom, i got stuck for a while in samsung booting logo so go back to recovery mode to clean cache and wipe all data, and there we gfo, my fone is back to initial. it works perfectly.
    thank you guys, you are really helpfull to us…. thanks to you… very good help. thumbs up….
    with regards from Sylvainl10 (Emmanuel Pierre Sylvain).

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s