Advanced phone customization/Rooting your phone

Now that we're ready, let's start.

Quick and easy: using an app
There are many apps which claim to be able to root your phone in a jiffy like KingoRoot. While this method is indeed far less tedious than the alternative, personal experience shows that this method is not always reliable (see note before).

You'll normally have to install the app through an APK (ignoring the warnings your phone may give) and then follow the instructions given. You may also be doing this through a PC, in which case you should enable USB Debugging from Developer Options in Settings.


 * Personal note: I tried to root using five Samsung phones: Galaxy S, Galaxy S2, Galaxy Grand Duos, Galaxy S6 and Galaxy Grand 2. Only the last one (along with an old Lenovo tablet) rooted successfully, despite the app's claim that the root would easily be performed.

Using Odin
''For Samsung phones only. Only available on Windows. The Knox switch (if present) will trip. ''


 * 1) Get the root file ready.
 * 2) Download Odin (there are many different versions, which mainly differ in the names used).
 * 3) Launch the phone in Download mode: hold the Volume Down+Power+Home buttons together when the phone is off. Accept the disclaimer.
 * 4) Select the root file in the appropriate category in Odin (the file should tell you which one).
 * 5) Click Start. Make sure that the phone is detected (a yellow box like COM x should appear).
 * 6) The phone will restart and the phone should now be rooted. Look for a SuperSu app or similar to confirm the presence of a root.

Logs
1. Odin failed during rooting. The writing to the phone memory never started on a Galaxy S6. The USB plug was pulled off after waiting for a noticeable amount of time with no progress sign either on the phone or Odin. Rebooting the phone led to stock, as expected (as nothing actually happened). Here's the log from Odin3 v3.09:  Added!!  Removed!!  Added!!  Odin v.3 engine (ID:12)..  File analysis..  SetupConnection..  Initialization..  Get PIT for mapping..  Firmware update start..  SingleDownload.  recovery.img  NAND Write Start!!  Complete(Write) operation failed.  All threads completed. (succeed 0 / failed 1)  Removed!!  Added!!

So I tried to change the USB port on the computer and then downloaded the latest version of Odin3. And it worked! What I'm not sure is which of the two (or both?) helped; but do keep it in mind if you do the same.

Magisk
It is a very useful application which can manage your root and can 'hide' it from applications which check for its presence. It can be installed by flashing its ROM in TWRP.

Passing SafetyNet
You may find that you are unable to use Google Pay or access similar services (like Netflix). This happens because you are rooted, custom OS phone will fail SafetyNet. Fixing this problem usually involves editing the fingerprint of build.prop to match one which has been previously validated with the phone (apps exist on the Play Store to assist with it, or you can do it from TWRP itself). Sources like XDA Developers are a good place to find one; alternatively, one can try using the Magisk extension MagiskHidePropsConf instead.

After that, you may find that your phone gives an error saying that "there is an internal problem with your phone". While this problem is not hard to fix, your phone is safe as is and there is no cause for concern over this message being displayed.