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 ();
}