Android - How to add root permission to some app by myself?
No. You should request the app developer to do so.
On UNIX like systems, permissions are managed with something called UIDs.
Every process has one and it dictates what they can access. Moreover, there are also groups that have permission that their members can use. When an app has permissions like Write to SD card
they're put into a group that has this permission.
The root permissions are an exception since they are not declared in the app's manifest, but rather in its code. Root is also not a group but a separate UID (as it is a separate user) so it's not that easy for an app to use it. Apps that have root rights need to be explicitly written to do so.
The way this works is every time an app wants to do something as root, it has to request the su
binary to do it instead. su
will then ask the app that manages these permissions (e.g., SuperSU) whether the app is allowed to gain root access. If it isn't, it'll prompt you to allow or deny it. Then the action is carried out as root
, not as the app user. These actions are not an integral part of the app but rather an external executable.
While theoretically it is possible to add this to an app, this would be a non-trivial process requiring knowledge of writing smali code, which is the internal format of the Dalvik virtual machine (the part of the system that runs the apk file) called smali. And even then, there'd be a huge security risk if the app allows other apps to access it: it wouldn't know how to keep the privileged root access separate from its normal access. So in reality this isn't really feasible.