You might have read some articles on rooting Samsung Galaxy S4 but most of them are not tested. Most of the guys are following the same old method of rooting Samsung devices which involves using the firmware packages with ODIN but this trick doesn’t work on Galaxy S4 because Galaxy S4 is more secure, this is because of the new feature named as Samsung Knox.
A senior developer Chainfire was working on Galaxy S4 and he has finally got the success in rooting the Galaxy S4 GT-I9505 Qualcomm LTE device on the XXUAMD2 firmware with the CF-Auto-Root method. If you also want to root your device then follow the below method. Remember that this only works with I9505, it will not work on Exynos 5 Octa.
Steps to root Samsung Galaxy S4 GT-I9505
Step 1: First of all make sure that you have taken the backup of your device, this includes the contacts, SMS, Apps etc.
Step 2: Make sure that the device is at least 60% charged.
Step 3: Now download the CF-Auto-Root package. Extract it, you will find the .tar.md5 file.
Step 4: Open the ODIN and flash the above file by selecting the PDA option. Note that you should not check the “repartition” option.
Step 5: After some time you will notice the red Android. This indicates that your S4 has been rooted. If you don’t see red Android then you will have to reboot your device into the recovery mode.
That’s it! After following the above steps you’ll be able to root your Galaxy S4 GT-I9505. This method works and has been tested. This method may work on other versions of S4 too but we are not sure about that, if you want to do it then do it at your own risk.