How to obtain the Root permission of Android in the program

Source: Internet
Author: User

We know that the Android mobile phone operating system uses the Linux kernel, and the highest system permission in Linux is Root, which is similar to the Administrator privilege in Windows, that is, the highest privilege in the operating system.
Because the Root permission is too high, mobile phone manufacturers generally do not allow users to directly use the Root permission to prevent users from modifying the built-in business and programs of the system. But for users, of course, they want to have the Root permission to change their mobile phones to one of their own features, because with the Root permission, they can modify all files and programs on their mobile phones at will, make mobile phones more personalized.
So how can we get the Root permission of Android in Android development? The following is the main simple code.
[Html]
Process process = null;

Try {

Process = runtime.getruntime(cmd.exe c ("su ");

// Here is the main program code ATAAW. COM

Process. waitFor ();

} Catch (Exception e ){

E. printStackTrace ();

} Finally {

Process. destroy ();

}

Related Article

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.