Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Install Custom ROM on Locked Bootloader Galaxy S4

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You can install a custom recovery and a custom ROM on a Samsung Galaxy S4 even if the bootloader is locked, but only on certain models and only using official or carrier-approved methods. The key is that some S4 variants (like the international GT-I9505 and most Snapdragon models) have an unlockable bootloader via Samsung's official mechanism, while others (like the AT&T or Verizon versions) are permanently locked and cannot run a custom recovery or ROM. This guide covers the unlockable models. If your bootloader is truly locked and cannot be unlocked, you cannot install a custom recovery or ROM — no workaround exists.

What You'll Need

  • A Samsung Galaxy S4 with an unlockable bootloader (check your model: GT-I9505, GT-I9500, SCH-I545 with bootloader unlock, etc.). If you have a carrier-locked model like SGH-I337 (AT&T) or SCH-I545 (Verizon) with an older bootloader, you may be able to use a special method like Loki — but that only works on certain firmware versions and is risky. This guide assumes you have a model that can be unlocked via the standard method.
  • A Windows PC (or a Mac with Heimdall) and a USB cable.
  • Odin3 (Windows) or Heimdall (Mac/Linux) — download from the official developer sites.
  • The custom recovery image (e.g., TWRP or ClockworkMod) for your exact S4 model. Download only from the official TWRP site or the device's XDA forum.
  • The custom ROM zip file (e.g., LineageOS, Resurrection Remix) that is compatible with your S4 model. Download from the official ROM website or the XDA thread for your device.
  • Google Apps (GApps) zip if the ROM does not include them — download from the Open GApps project.
  • Backup of all data on the phone, because the process wipes everything.
  • Fully charged battery (at least 80%).

Step-by-Step

  1. Enable Developer Options and USB Debugging. On your phone, go to Settings > About Phone and tap “Build number” seven times until you see “You are now a developer.” Then go to Settings > Developer Options and enable “USB Debugging” and “OEM Unlock” (if present). The exact wording may vary by Android version.
  2. Back up your data. Use Samsung Smart Switch or manually copy photos, contacts, and files to your PC. The custom ROM installation will wipe the phone.
  3. Install Samsung USB drivers on your PC. Download and install the latest Samsung USB driver from Samsung’s official site, or use the one that comes with Smart Switch.
  4. Download Odin3 and extract it. On Windows, unzip Odin3 to a folder. Run Odin3 as Administrator.
  5. Boot your S4 into Download Mode. Turn off the phone. Press and hold Volume Down + Home + Power simultaneously until you see a warning screen. Press Volume Up to continue into Download Mode.
  6. Connect your phone to the PC via USB. In Odin, you should see a blue or yellow box in the “ID:COM” section indicating the device is detected. If not, reinstall drivers or try a different USB port.
  7. Add the custom recovery to Odin. In Odin, click the “AP” or “PDA” button and select the TWRP .tar or .tar.md5 file you downloaded. Do not touch any other options like “Re-Partition” — leave them unchecked.
  8. Start the flash. Click “Start” in Odin. Wait for the process to finish — the phone will reboot automatically. When you see the “PASS” message in Odin, the recovery is installed.
  9. Boot into the custom recovery. Turn off the phone. Press and hold Volume Up + Home + Power until the recovery screen appears (TWRP or CWM). If it boots normally, you may need to flash again or check that you have the correct recovery file.
  10. Wipe data and cache. In TWRP, tap “Wipe” and then “Format Data” (type “yes” if prompted). Then go back and do a “Swipe to Factory Reset” (this wipes /data and /cache). Do not wipe the system partition unless the ROM instructions say so — most ROMs wipe system automatically.
  11. Transfer the ROM and GApps to your phone. While in recovery, use the “Mount” option to enable MTP, or better, use ADB sideload (in TWRP: Advanced > ADB Sideload). Or, before wiping, copy the ROM zip to the phone’s internal storage or an SD card. If you copied before wiping, the files remain — just do not format the internal storage (only /data).
  12. Install the ROM. In TWRP, tap “Install” and select the ROM zip. Swipe to confirm the flash. Wait for it to complete.
  13. Install GApps (optional). After the ROM, tap “Install” again and select the GApps zip. Flash it the same way.
  14. Reboot the system. Tap “Reboot” > “System.” The first boot can take 5–10 minutes — be patient.

Common Mistakes

  • Using the wrong recovery or ROM for your exact model. A GT-I9505 recovery will not work on a GT-I9500. Always check the model number in Settings > About Phone.
  • Forgetting to enable “OEM Unlock” in Developer Options. If your phone has this option and you skip it, the flash may fail or the bootloader may remain locked.
  • Leaving “Re-Partition” checked in Odin — this can brick the device. Only use the AP/PDA slot.
  • Not wiping data before flashing the ROM — this causes boot loops and random crashes.
  • Flashing a GApps package that is too large for your system partition — use the “pico” or “nano” variant for older devices.

Tips

  • Use the latest TWRP version available for your device — older versions may have bugs.
  • Keep a backup of your stock ROM (via TWRP backup) before flashing anything, so you can restore if needed.
  • Use a USB 2.0 port on your PC for Odin — USB 3.0 can cause connection issues.
  • If you are on a Mac, use Heimdall instead of Odin — the commands are similar but the interface is different.
  • After flashing a custom ROM, the first boot may take a while — do not panic and pull the battery.

Troubleshooting

Odin fails with “FAIL!” or “MD5 hash error”. Re-download the recovery file and check that it matches your model. Try a different USB cable and port. Restart the PC and phone.

Phone boots into a boot loop (stuck on the Samsung logo). This usually means you did not wipe data correctly. Boot into recovery (Volume Up + Home + Power) and perform a factory reset, then wipe cache and dalvik (if applicable). If that does not help, re-flash the ROM after a full wipe.

Phone is stuck in Download Mode. This is normal after a failed flash. Just repeat the Odin process with the correct files.

Recovery does not stick (phone boots normally instead of recovery). Some S4 models auto-restore stock recovery on boot. You may need to disable “Auto Reboot” in Odin, flash the recovery, then manually boot into recovery before the phone restarts. Or, after flashing, immediately pull the battery and boot into recovery manually.

If nothing works and the phone is bricked (no response). You can usually restore the stock firmware via Odin using a stock ROM from SamMobile or the official Samsung firmware site. This will erase all data but will bring the phone back to life.

Frequently Asked Questions

Can I install a custom ROM on a locked bootloader S4?

Only if your specific model has an unlockable bootloader. Models like the AT&T SGH-I337 or Verizon SCH-I545 have locked bootloaders that cannot be unlocked (except for a few early firmware versions that used a Loki exploit). If yours is locked and not unlockable, you cannot install a custom recovery or ROM.

Will installing a custom ROM void my warranty?

Yes, it will void the warranty. However, you can usually restore the stock firmware with Odin to regain warranty status.

Do I need to root the phone first?

No. Installing a custom recovery via Odin does not require root. The recovery itself gives you root access when you install a custom ROM that includes it.

What is the difference between TWRP and CWM?

TWRP is touch-based and more user-friendly, while CWM is older and uses physical keys. Most modern ROMs recommend TWRP.

Can I go back to the stock Samsung ROM after flashing a custom ROM?

Yes, you can flash the stock firmware via Odin (as long as your bootloader is not permanently locked). Download the correct stock firmware for your model and flash it in the AP slot.

Will my phone’s storage be wiped?

Yes, the process wipes all data on the internal storage. Make sure to back up everything important before starting.