The process of rooting your android smartphone will vary with every model and the underlying current android OS installed. Basically, rooting is relied upon by the developers in the form of a security bug that is exploited for loopholes in the firmware. The discovery of the exploit itself is tedious as the manufacturers have been taking extra precautions in defending their android versions against rooting.
Once the exploit has been sought and fully understood, it is possible to make a custom recovery image that can be flashed on to the ROM of your smartphone device. Such flashing is expected to skip the digital signature checks whenever there is a firmware update available for the android on your smartphone model. All that is required after that is the modified firmware version updated that can be flashed on to the ROM. This firmware is typically known to include the utilities needed to run the apps with the root level access and permissions.
As an example, let us understand with an example of su binary. This can be copied on to a location on the process path like /system/xbin and then can be given execute level access so that it can be readily run as an executable. You can make use of the Linux’s popular chmod command in order to modify the permissions of this binary file. There is also a requirement of the supervisor application like the SuperSU and SuperUser in order that these apps can regulate and log the elevated and special permission requests that come in from the other applications that are required to have the root level of access.
The Android Rooting process itself might be simple or complex and it is also possible that the complexity of the process is based on the serendipity. For instance, anything and everything that was typed on the keyboard of the HTC Dream android phone model was translated into a command that required elevated access of root permissions as it used to target the secured shell for execution.
Although action was take upon by Google on a quick need basis, there was still a leak in the signed image of the old firmware. This gave an opportunity for the root developers in order to downgrade to the earlier version and use the original technique in order to perform android rooting. The process of android rooting is also relatively simpler and easy to use on the Google branded flagship phones and equivalent tablet computers.
The mobile phone models like Nexus 4, Nexus 5, Nexus S and Galaxy Nexus come under this umbrella along with the tablets like Nexus 7 and Nexus 10. These can be boot loader unlocked easily. You just have to connect these models to your laptop while in the boot loader mode. Then you have to type in the command fast boot oem unlock. There shall be a warning displayed on each of these devices, past which the boot loader is unlocked and from there on it is possible for the new system images to be installed and flashed.