Actually the question: could anyone get root rights to the device programmatically? I saw a sh script that I’m still messing with and messing about, and that’s all that’s googled up. Apparently such things are not advertised, and yet the interest is huge, for it is sometimes useful, especially for writing system tools.

  • What does software mean? Getting root rights on Android is usually a dance with a tambourine, i.e. hack - gecube
  • Thanks, Cap. I understand this perfectly, but there are applications (apk-i) that give these very rights, respectively, there is a way to programmatically get them or perform dances from application resources or something else. In addition, it is a matter of interest! - DroidAlex
  • So for each phone its own algorithm. There is no documented way to get root from the phone. - gecube 2:29 pm
  • That's why it’s interesting that everything is not so simple :) - DroidAlex

2 answers 2

You did not watch the example DeviceAdmin from API Demos? There, reception is obtained by obtaining administrator rights through a special dialogue. I don’t know for sure if this is what you need, but I think it may be useful ... The docks also write that you can get such rights starting from Android 2.2

  • They use the Administration API. I also saw this Doc, but whether this is what they need to hide. As far as I understand, rights are not always given. - DroidAlex 1:54 pm
  • Find out the answer to the question? - Martinez Toni
  • Root access software will not get. It is necessary to install the firmware or request it on those firmware on which it is allowed - gabin

Obtaining privileges is done by calling the su system program (for example, using the system function or exec ). This program is installed with suid-bits into a rooted phone. If you take this program from cyanogenmod, it first asks the user if he wants to grant privileges to the application that caused it.

An example of a call from java: https://stackoverflow.com/a/8750977/1566316