Wednesday, October 2, 2019

rooting - Difference between installing SuperSU using Play Store versus a custom recovery that installs it from a file?


I see that some rooting guides say that rooting involves:



  1. Download a SuperSU as a zip file that would be accessible to the phone (e.g. the sdcard).

  2. Unlock the phone's bootloader.

  3. Booting into a "custom" recovery mode. E.g. TWRP or CWM. Either temporarily booting using fastboot or flashing the custom recovery to the phone and then booting.

  4. Use the custom recovery mode to install the downloaded SuperSU zip file.

  5. Reboot the phone into normal mode and root access should be A) available and B) managed by the SuperSU program.



However, I also see that SuperSU is also on the Play Store. Installing from the Play Store does not promise any root access. (It actually assumes you already have it.)


So, my questions are:



  • What is different between these installation methods practically?

  • What is are the technical differences in actions or restrictions?

  • And how can/does the custom recovery installation method provide root access whereas the Play Store method can not?



Answer



Root access (typically) requires several components that work in concert with one another. A somewhat simplified view of what you need is:




  • A native su binary. This can be invoked from the command line or from applications. It is what actually performs the act of switching users, and grants a process root permission.

  • A "gatekeeper" application, that regulates which other apps and processes are allowed to invoke su to gain root privileges.


Think of the SuperSU application as being a sort of graphical front-end for the su binary.


Because of the way directory/file permissions are configured on Android, you need to have the su binary on your /system partition in order for it to work. Putting elsewhere will not suffice, because it will not have the permissions it needs to actually allow processes to switch users.


Normal applications (without root) cannot write to /system, so the SuperSU application itself cannot simply install su where it needs to be. This is the reason why you will not have root if you install SuperSU from the Play Store without taking any other steps. All you have is the front-end, but not the underlying pieces that are necessary. You only have half of what you need for root, and no way to get the other half from the SuperSU application alone.


Therefore, the most common way to get the su file in the proper place is to install it from recovery, since the recovery system has full access to the device storage and can install files anywhere it wants. Once that is done, SuperSU and su can talk to each other and provide root access to other processes.


The recovery installation file also installs SuperSU because it is convenient, and putting it in /system prevents it from being erased by a factory reset. However, if you wanted to, you could install only su from recovery and then get SuperSU from the Play Store. It would function just fine. Similarly, you can update SuperSU from the Play Store later on and it will continue to function (because su is already in place at that point).


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...