Home
Samsung

How to Install a Custom Recovery & New ROM on Your Bootloader-Locked Samsung Galaxy S4

Mar 18, 2014 10:03 PM
635306529342402596.jpg

Third-party ROMs like CyanogenMod are the ultimate form of customization for softModders. Hard-working developers offer us alternate Android experiences to replace our often bloatware-riddled stock ROMs.

Installing custom ROMs is performed with a special type of software called a recovery. You may have heard of popular ones like ClockworkMod, or Team Win Recovery Project (TWRP). If you have an unlockable bootloader, injecting a custom recovery into your phone is quite simple. However, that's not the case for AT&T and Verizon Samsung Galaxy S4 owners.

The Case of the Locked Bootloader

The bootloader is the lowest-level piece of programming on your device, initializing the Android operating system upon boot. AT&T and Verizon have completely locked down the bootloader on their GS4s so that we can only run their version of the OS.

The situation was so dire, bounties were created for anyone that could offer a fully-unlocked bootloader. Unfortunately, they have yet to be claimed, with the Verizon GS4 bounty still sitting at just under $4,000!

Being able to install a custom ROM has been largely impossible on locked phones, but a developer by the name of Hashcode has created a special custom recovery called Safestrap, which works alongside locked bootloaders. It's not a perfect solution, but it certainly gets us close.

Step 1: Complete These Prerequisites

In order to get the Safestrap recovery onto your AT&Tor Verizon Galaxy S4, you'll need to knock some prerequisites out of the way:

Also, ensure that you don't have Android's Encryption option enabled. You can check this under Settings -> More -> Security -> Encrypt device.

Step 2: Download the Correct Safestrap APK File

Find the correct Safestrap version below for your Galaxy S4's build number. If you don't know what your build number is, head to your GS4's Settings -> More -> About device. Scroll down to Build number and take note of the last three digits.

635301334680477847.jpg

Download the appropriate version below directly onto your Galaxy S4, or download to your computer and transfer it over.

AT&T Models:

Verizon Models:

Step 3: Install Safestrap on Your GS4

Open up the .apk file from your downloads folder to start the installer. Tap the Install button, then Open once it finishes.

635296614604893251.jpg
635296614858303808.jpg
635296614604893251.jpg
635296614858303808.jpg

When it first opens, you'll need to grant Safestrap superuser access, then agree to the disclaimer. Tap the Install Recovery button.

635296619432059199.jpg
635296619665154867.jpg
635296712305647157.jpg
635296619432059199.jpg
635296619665154867.jpg
635296712305647157.jpg

It's as simple as that! The "state" should stay Installed, and you now have a custom recovery on your phone. If you later on find that flashing custom ROMs isn't for you, you can remove Safestrap with the Uninstall Recovery button.

Step 4: Choose a Custom ROM

Unfortunately with our bootloader situation, we can only flash TouchWiz-based ROMs. Sadly, that means no ROMs based on Android Open Source Project (AOSP), like CyanogenMod or ParanoidAndroid. Check out these threads on XDA for a list of Safestrap-compatible ROMs:

You also need to make sure that the ROM you choose matches the Android version that you have on your stock system. If you're running Android 4.2.2, you need a ROM with Android 4.2.2. Likewise, if you have Android 4.3, you're going to need a ROM with Android 4.3.

Download your chosen ROM's .zip file onto your Galaxy S4's external SD card. To keep things organized, I recommend making a separate folder to keep all your ROMs and mods that you need to flash.

Step 5: Choose a Custom Kernel

In addition to the ROM, you'll also need to download a kernel module which will ensure that your GS4's radios (Wi-Fi, Bluetooth, etc.) work properly. Grab the kernel module specific to your build number here:

AT&T Kernel Modules:

Verizon Kernel Modules:

Make sure you have both your ROM .zip file and kernel module on your external SD card.

Step 6: Boot into Safestrap Recovery

There are two ways to boot into Safestrap Recovery:

  1. Simply open up Safestrap from your app drawer and tap the Reboot to Recovery button.
  2. Reboot your phone like normal, and you'll be greeted by a Safestrap splash screen. As long as you have Safestrap installed, this screen will appear every time your GS4 boots up. Tap on Recovery at the bottom left. For a normal boot-up, you can just tap Continue or leave it alone for ten seconds.
635301076729425893.jpg
635301078640959957.jpg
635306548185205684.jpg
635301076729425893.jpg
635301078640959957.jpg
635306548185205684.jpg

Either method will take you to the Safestrap recovery screen.

Step 7: Create a Backup

A vital step to perform before flashing any custom ROM is making a full nandroid backup which you can easily restore in case anything goes wrong.

A nandroid is a complete snapshot of all the data on your device, including your apps, text messages, even all the way down to the cookies stored by your internet browser. Everything is backed up, and everything is easily restored. In this step we'll make a nandroid backup of our stock TouchWiz ROM.

At the very top of the recovery screen, you'll see that it says in red text ROM Slot: stock. Safestrap works by creating virtual ROM slots on which you can install custom ROMs, sort of like partitions on a hard drive.

635306550732080644.jpg

You can perform backups, restores, and installs on these slots. Any action you take will be directed at whichever slot is designated active at the top. By default, it's your stock ROM slot.

Making Your Backup with Safestrap

To make a nandroid, select the Backup button and make sure that all three partitions (data, cache, and system) are checked. At the bottom, swipe the button to the right to start the backup, which will be stored on your external SD card.

635306588116299588.jpg
635306588221143148.jpg
635306588116299588.jpg
635306588221143148.jpg

Restoring from a Backup with Safestrap

To restore a backup, tap the Restore button, select your backup file, make sure all partitions are checked, the swipe the button to the right.

635306590000206012.jpg
635306590106926070.jpg
635306590000206012.jpg
635306590106926070.jpg

Now that you know how to create and restore nandroid backups, we can start flashing new ROMs!

Step 8: Create a ROM Slot

From the main page, select Boot Options, then ROM-Slot-1. Here you'll need to decide how much space you want the slot to take up. In most cases, you should leave System partition size and Cache partition size alone. You can use the plus (+) and minus (-) buttons to change Data partition size (where your apps, pictures, texts, etc. are stored) up to 4000MB (4GB).

635306591953330580.jpg
635306592052394952.jpg
635306591953330580.jpg
635306592052394952.jpg

You can see how much Free Space you have, so make sure the Selected Space doesn't exceed it. Hit the Create ROM Slot button when you're done.

Step 9: Flash Your Custom ROM

Now that your ROM slot has been created, you can activate it. From Boot Options, select the ROM slot, then hit the Activate button. Verify that it's active by making sure it says ROM Slot: rom-slot1 in green at the top.

635306593621611992.jpg
635306593519437216.jpg
635306593621611992.jpg
635306593519437216.jpg

Since this is a brand new ROM slot, you can just go straight to Install.

However, for future reference, if you want to re-use a ROM slot (perhaps you tried out one ROM and didn't like it), you'll need to perform a Wipe before installing a new ROM. Simply hit the "Wipe" option and slide across to do a factory reset, after which you'll have a clean slate to work with.

635306594515675967.jpg

Once you're at the Install page, select your ROM's zip file. You'll also need to flash the appropriate kernel module, so select Add More Zips at the next page to add it to the queue.

Be sure to also read the installation instructions for your particular ROM; some developers optimize ROMs specifically for Safestrap recovery and already include the kernel module in the ROM .zip file. If that's the case, you will only need to flash the ROM file.

635306596168330927.jpg
635306596283488776.jpg
635306596168330927.jpg
635306596283488776.jpg

Once you have both .zip files in the queue, swipe the bar at the bottom to confirm the flash. When it finishes, you can back out to Safestrap's main menu. Select Reboot, then System to boot into your new custom ROM.

Step 10: Enjoy Your New ROM!

Upon installation of a new ROM, you may notice that it takes a while to boot up. This is completely normal, so no need to worry. Set your phone aside for a few minutes, let everything boot up, then come back to sign in with your Google account.

You'll need to re-install the Safestrap APK file in your new ROM—the actual recovery is still installed, this is just so you can easily boot into it.

If you want to switch back to your stock ROM, boot into Safestrap recovery, go to Boot Options, select Stock ROM, then Activate it. Verify that it says ROM Slot: stock in red at the top of the screen, go to Reboot, then System.

Even among experienced ROM flashers, Safestrap can be intimidating and confusing, but you have all the tools to get comfortable flashing with it. If you have any questions, feel free to ask away in the comments section below.

Comments

No Comments Exist

Be the first, drop a comment!