Monday, March 19, 2018

root access - What exactly is superuser.apk and su?


I've done a lot of reading into rooting of Android devices. I really want to know exactly what is going on at each step before I commit to the process.


I'm a little confused as to where the superuser.apk and su files come from. It doesn't look like they are official Google files, but rather files created by a (random) individual. That said, how safe are these files?


From research, I have a general understanding of their purpose. I was wondering if anyone knew what these files were (executables? scripts?), what they contained and how they generally work.


Thanks!



Answer



su (short for Switch User) is a binary executable. It's used by Android and other *nix based systems to allow a process to change the user account it is associated with. The reason it's important from a rooting standpoint is that su without any other parameters will switch to the root user, meaning that processes that require root permission for their functionality need to invoke su (since by default they are not being run by root).


Superuser is an Android application (.apk is an Android application package). It works as a sort of "gatekeeper" to the su binary. Applications which attempt to invoke su will be forced to route through Superuser, which will then prompt the user if it is an unknown or new application. The user then has the option of approving or denying the access to su and optionally having Superuser remember their decision so it can automatically apply it for subsequent calls by that app. By doing this, the only apps which are granted root permissions are ones that the user chooses.


The source of both applications is available on Github, and can be examined/audited by anyone who wishes to look at it (Superuser here, su here).



You can find further details - as well as changelogs - on Superuser's website.


Other related questions on Android Enthusiasts:



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 ...