[Sprint Samsung Galaxy S 4 General] happyoutkast:
To start and get it out of the way:

DISCLAIMER: Typical legal stuff. Use this guide at your own risk. Author makes no claim as to guarantee, or warranty any software described in this document. The author cannot be held liable for any damages caused to your device or any other harm as a result of attempting to do anything described in this guide or anything that you choose to do with your device whatsoever. USE THIS GUIDE AT YOUR OWN RISK! MODIFY YOUR DEVICE COMPLETELY AT YOUR OWN RISK!

This is a basic guide for those wanting to root their brand new Galaxy S4 and get it to what I call general working condition. This is specifically written for and tested on the SPRINT Galaxy S4 (sph-L720) preinstalled with and running the MK2 firmware, and the links provided are for the sprint model listed. Although these basic steps may work on other galaxy S4 variants, the software specific for your model of phone will need to be downloaded. The relevant threads do link "main" threads where you can find information and downloads specific to your device model. Again, be careful.

what I call "general" working condition includes:

Root access (using CF-Auto-Root found here)

Advanced recovery (in this case using PhilZ CWM found here)

I know this is all basic stuff, however I have found that the guides so far are either overly complicated or too specific for a certain step. Don't misinterpret this as an attack or insult to the other authors of those guides. They are all very well written and great resources in their own right for their own purposes, and I had referenced many of them myself before taking the steps I chose to take. However I found that many of them are written for older stock ROM versions migrating to MK2 or again very specific for just rooting or just installing CWM. What I was looking for was what to do if you just bought an S4 a week ago preinstalled with the latest MK2 official ROM. I found that the procedure was far simpler than what I was worried about.

First, what you'll need:

samsung usb drivers, I got them directly from samsung's website and you should too. Download here.

When it comes to drivers I am far too paranoid about viruses and such to download them from anybody but the device manufacturer and I highly recommend sticking with official drivers only. Use downloaded drivers from other sources AT YOUR OWN RISK!

Odin (download here)

CF-Auto-Root (found here)

The next ones are optional and are required ONLY if you want a custom recovery installed. Currently I only have instructions for PhilZ CWM however at this point I think TWRP or any other custom recovery should flash just fine assuming they work well for your Galaxy S4.

(optional, required for custom roms, etc)PhilZ CWM found here).

---------------------------------------------------------------------------------

What I used (for reference): AMD A8 on Windows 8.1. Not sure if OS/System type has anything to do with it, but it is conceivable and is there for reference and possible troubleshooting. For example if this doesn't work as well on windows XP systems, we may want to know that. For now until a reason develops, assume this works well on all MODERN versions of windows (I will laugh if you fail on windows 9x/ME, seriously, laugh hard. Don't try to flash your phone on *old* OS's!)

Before you start, verify your phone is on MK2. I got my phone brand new with it preinstalled but if you got it from the store for example, it could've been sitting on a shelf for the last 3 months and not on MK2 yet. Again I wrote this guide and tested it using a phone with MK2 preinstalled and not having even seen a connection to a PC yet, root, custom flash, or anything outside of normal stock usage. This should theoretically work on a completely stock phone upgraded to MK2 however that's not what I tested with. Results may vary with variables changed. To verify your current build version, from your home screen: menu button > settings > more > about device. Look at both "software version" and "build number". if the last 3 characters in both are "MK2" then you're on the latest and greatest and can proceed. Otherwise do a system update and take your chances once your phone is finished doing its stock update. DO NOT TAKE AN OTA UPDATE IF YOUR PHONE HAS BEEN MODIFIED IN ANY WAY WITH ROOT, CUSTOM ROMS, RECOVERIES, OR ANYTHING FLASHED THAT DIDN'T COME OTA FROM SPRINT!!!!!! You may end up with a very expensive paperweight.

FIRST PART, ROOTING:

Now let's get to business. First thing, make sure you downloaded all the files listed above, including PhilZ CWM if you want a custom recovery. Most people who want root also want a custom recovery, and I like it for the backup capabilities but since it's not *absolutely* necessary I listed it as optional.

1. Install the samsung USB drivers. Your computer needs to know how to talk to your phone before we can do anything. I reccommend the official ones from the samsung site as I am incredibly leery of downloading device drivers from anywhere but the manufacturer for ANY hardware ever. Call me paranoid but that's why I don't end up with viruses and malware on my systems either :) I'm not saying that all of the non-samsung site downloads are bad, I'm sure others have reuploaded the official drivers to other mirrors but like I said I'm paranoid when it comes to "system modifying" type of files like drivers.

1a. reboot your computer. Yes I shoehorned this step in and didn't want to renumber everything. I didn't reboot because I was lazy but you probably should. Really, don't be lazy like me, even though it worked for me. Ok, be lazy, but at your own risk.

1b. Also, at this point if you're at all familiar with ADB and are so inclined (or paranoid) you may want to consider making a backup of your phone, however to be honest I'm not certain how well this works since ADB doesn't get root access by default. I'm sure there's a guide somewhere if you really want to make a backup of your original phone prior to flashing anything. I should do this step myself but I generally opt to wait until I get a custom recovery installed and make a nandriod backup that way because I'm lazy.

2. take a deep breath, it really isn't that scary. Take it from a guy who's now on his 4th rooted samsung device (T-Mobile Galaxy s4, Sprint Samsung Conquer, Sprint Galaxy S3, and now Sprint Galaxy S4). As long as you follow instructions CAREFULLY you should be just fine.

3. Extract the CF-Auto-Root zip file you downloaded. Again use windows explorer for two reasons: it handles zip files just fine, and it also DOESN'T handle .tar.* files so you don't run the risk of accidental double unzipping. Just copy the .tar.md5 file from the zip and place it somewhere you can find it, like your downloads folder. At this point you may want to consider moving all your downloaded and extracted files to a folder just for Galaxy S4 stuff, but that's a suggestion to help manage things easier.

4. Power off your phone if you haven't already. FULL power off, don't reboot. You may want to drop the battery to be absolutely certain, or wait another 15-20 seconds after you think it's off if you don't feel like it because you have an otterbox or something. Once you're 100% certain your phone is off, boot into download mode. This must be done *somewhat* carefully, read the following procedure completely before attempting. it's not hard but you can get frustrated by accidental aborts if you're unfamiliar with this. To boot into download mode: hold down the volume down button and press power until you feel the phone vibrate and the very second the screen lights up. RELEASE BOTH KEYS. You should see a screen come up with a warning about downloading a custom OS and asking you if you want to continue. Press Volume UP on your phone to continue. (volume down aborts and reboots the phone, now you see how this can be frustrating....). In some cases you may see the samsung logo first, but in my case it goes straight to the download screen. If you have problems going into download mode and see the samsung logo when the screen lights up instead, try holding volume down until you see a "recovery booting" or something similar message in tiny letters in the upper left corner of your screen with the samsung logo, then release volume down. DO NOT CONNECT YOUR PHONE TO YOUR COMPUTER YET!

5. Extract and open ODIN (I used odin V 3.07, it seems to work just fine). This should work fine in typical windows explorer. Just open the zip file, copy the ODIN v3.07 folder (not the exe file in that folder) to a directory of your choice. I just slapped it in my downloads folder with the zip because I'm lazy like that.

6. Now that ODIN is open, connect your phone. If you have already connected your phone prior to this, go back to step two and reread that part about following directions CAREFULLY ;)

Assuming everything is going well, you should see a box that sasys ID:COM something light up like 0:[COM3] Don't be alarmed if it's not exactly the same com port, as long as there is one. The important part is that it has a valid com port, which will only happen if it detects your phone properly.

7. Click PDA and select the CF-Auto-Root...tar.md5 file you extracted. By default "auto reboot" and "F. Reset Time" are selected. Leave them checked. MAKE CERTAIN THAT Re-Partition IS NOT CHECKED!!!!!! Also, make sure everything else is unchecked besides PDA, auto reboot, and F. Reset time. Take a deep breath, then click "Start"

At this point your phone will reboot and do some automated stuff. You will see a big box light up in odin, ending up with "PASS!" if everything flashed well. Keep your phone connected until the phone reboots to your normal start screen. If your device goes as smoothly as mine did, it should flash the file, reboot the phone, do it's auto root process, reboot again, then go to the normal start screen. Essentially you end up with your phone exactly as you had it before, but with root. So root is *mostly* installed but we require one additional step to make sure things work smoothly.

8. open your app drawer, and then open the SuperSU app. It will load then it should inform you that KNOX is detected and ask you if you want to disable KNOX. Select yes. If you select NO and try to use root with KNOX enabled, root may not work well if at all, cause the earth to fall out of orbit, and god to punch your favorite cute furry animal. Also, you can disconnect your phone at this point, and should before continuing on.

Now you should be done. That's it. Really simple, You have root. Go forth and try not to destroy your phone with your newfound power, or read on and get a custom recovery installed and really do some stuff.

SECOND PART, INSTALLING PhilZ CWM RECOVERY:

1. READ ALL DIRECTIONS LISTED BELOW THOROUGHLY FIRST BEFORE ACTUALLY DOING ANYTHING!!! Also, this should only be done AFTER all the above steps are completed. Place phone into download mode as described in step 4 above. Quick reference: hold volume down, then press and hold power until the phone vibrates and screen lights up. Press volume up to continue.

2. Close ODIN from your previous flash if you haven't already. Once it's closed re-open it. This is in here to make sure we have a fresh ODIN window and aren't accidentally flashing root again. Once we have a nice and clean ODIN window, connect your phone. You should see the lovely COM box light up.

3. This process should look familiar to what we just did, since it basically is the same thing. This time click PDA and select the philz_touch...tar.md5 file. Also make sure "Auto Reboot" and "F. Reset time" as well as "PDA" are all checked. PDA should automatically get checked when you click the button and select a file. Make sure nothing else is checked ESPECIALLY MAKE SURE RE-PARTITION IS NOT CHECKED!!!

4. Click start. Again ODIN will send the file, and end up with "PASS!" in the big box above the COM:x box. Once it's done the phone will reboot. The original directions say it should go to recovery but my phone rebooted as normal. Disconnect your phone. To get to recovery at this point you should simply just need to power down the phone completely. Then press and hold Volume up and then press and hold power until you see "recovery booting" in tiny letters in the upper left side of the screen with the samsung logo. MAKE SURE you hold volume up before power as this makes booting into recovery MUCH easier. If you see a custom CWM looking recovery (if you have never seen cwm before, the "philz options" menu option in recovery should be a great clue that the flash was successful). If you see a charging icon come up when powering off your phone, disconnect it from your computer.

So now if everything went as smoothly as it did for me, you should have a rooted galaxy S4 with a custom recovery at the ready to help with installing fancy ROMS, firmwares, modems, mods, etc or simply making really good nandroid backups. I HIGHLY suggest that you boot into recovery and make a nandroid backup of your rom before you play around with it too much, preferably saving your backup to your external SD card. Also be sure to follow any additional instructions for any further customizations.

IMPORTANT NOTES: DO NOT take an OTA update once this is done. From what I have read it *may* brick your phone. Typically in the past on other devices it just fails and reboots but other devices didn't have things like KNOX for example. Just don't risk it. However this shouldn't be an issue as your phone should already have the latest MK2 firmware installed as of the date of this article, at least until the next update comes up. it is highly recommended that you disable the "system update" notification, and there are guides available here on XDA on how to do that. Maybe one day I will find and link them, or someone nice may find and link it for me in the replies ;p This will keep you from "accidentally" trying to install an OTA update and bricking your phone.

Any problems? You probably didn't follow a step properly, but it is possible that I forgot something or left something out. I thought I was pretty thorough however I am human and make mistakes. Just reply here and I will do my best to get back when I can, however I do have a full time job and a personal life so no guarantees on how soon replies will come.

THANKS goes to:

The entire XDA community, for all the help, resources, and everything else over the years despite my less patient moments.

Chainfire for his work on the CF-Auto-Root utility and instructions contained therein, which were included here and expanded upon. Also for his work on SuperSU which not only helps manage root access, but is nice enough to have the ability to disable KNOX automagically for us.

Phil3759 (aka PhilZ) for his work on his modified version of CWM for the galaxy S4 and other devices, and instructions (adapted for flashing the S4 specifically)

Spiricore for his reference material. I didn't use much, if any of it, here however it was very helpful in researching the galaxy S4 and rooting options. It is a great resource for those having issues flashing their phone for one reason or another. Some of the steps I *think* may be superfluous however if you REALLY want to make sure things will work, it should help. It's a nice alternative and can be found here.

daerragh for posting the download and info for ODIN, and possibly writing it unless I am misinformed. Otherwise thanks to the author of ODIN as well.

Unknownforce for more reference material, modem firmwares, kernels, and cool GS4 ROMS. Only researched his material for this article much like spiricores work, but worthy of a thanks nonetheless.

runwithme for more reference used for research in rooting for this article and my phone, and for the stock roms.

Anybody else I may have forgotten, or who have contributed to the works described above or used in this article.