Am I able to grant 'root' to an app using adb?

  • Thread starter Thread starter Android Central Question
  • Start date Start date
A

Android Central Question

Hello.
I'm here to ask 2 quick questions.
I'm not rooted because there's no root apps and no recovery for my phone to be able to root it.

1) can I grant an app root permissions using adb? Will these commands do the trick? If

adb shell pm grant [package/app name] android.permission.WRITE_SECURE_SETTINGS

adb shell pm grant [package/app name] android.permission.DUMP

Or is there more or it's completely impossible . an answer would be appreciated.
Thanks
 
Root is "granted" when an app (or the user) runs su first:

$adb shell su [app name]
$

or if you elevate to root first

$adb shell su
#

If you don't have su in the phone (in other words, the phone isn't rooted), you can't run su, so you can't "grant" root to anything. ("Granting root" is just running su - elevating the pseudo-user to superuser. Rooting the phone is just installing su - which you can't do unless you're rooted, which you don't need to do if you're already rooted ... whichis why someone has to figure out a way to "fake" each ROM for each phone into temporarily elevating to superuser - so that su can get copied.)

Since you can't "grant root" unless the phone is rooted, the second question doesn't apply. (The Superuser or SU app just keeps track of which apps you've told it get to run su. That way, if a virus tries to run as root, it can't, because Superuser pops up and asks if it should grant that app root status and you say no. It's an app asking for elevation to superuser that triggers the app to run - you don't tie anything to anything.)

Oh - and "granting an app root permissions does nothing - unless the app requests root permissions - which the apps that come with the phone won't. It doesn't make the app run faster, or use less battery or anything like that, it just allows the app to do what it does, like write to a folder that can only be written to by the owner or superuser. The apps that come with the phone aren't written to do anything like that, so whether they run elevated to root or not, they do the same thing.
 

Latest posts

Forum statistics

Threads
955,878
Messages
6,965,992
Members
3,163,415
Latest member
justice1175