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.
- 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.
- 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:
Version: Android 4.2.2
Build date: Wed, 29 May 2013 16:05:23 +0000
Product Code: XEF
- 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.
- The flashing operation is complete. Unplug the USB cable.
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)