Toolroot -- get root permission for your APK

Source: Internet
Author: User

 

ThisProgramThis is an example of modifying Su in superuser. For more information about superuser, see these two articles.Article:

How to obtain the root permission of the rootexplorer?

Http://blog.csdn.net/a345017062/archive/2011/05/24/6441986.aspx

How to get the root permission for the rootexplorer? -- continue

Http://blog.csdn.net/a345017062/archive/2011/05/24/6442306.aspx

 

Here, we will only describe how this program runs and its principles.

I. How to run

The format used is "toolroot specific shell command", for example

Toolroot pwd

Ii. Principles

First, toolroot changes the UID and gid of the current process:

If (setgid (0) | setuid (0) {<br/> logw ("Su: Permission denied (% s)", strerror (errno )); <br/> return-1; <br/>} 

Here, the user of the toolroot program file should be root. For more information, see setgid and setuid in advanced Unix programming.

Next, toolroot runs the sh program to execute the PWD command, and then packs it into logwrapper to view the output of the PWD command.

 

The program is open-source and can be downloaded from:

Http://code.google.com/p/flying-on-android/

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.