Discover how to get root privileges on android, include the articles, news, trends, analysis and practical advice about how to get root privileges on android on alibabacloud.com
An example of this article describes the Android phone to get root permissions and to achieve shutdown restart function is a very common in the Android design of the important function. We are now sharing it with you for your reference in the development of Android programs.
Get the highest privileges in code first the phone is root, no root please don't look down.
The first is to write a static method
Copy Code code as follows:
public static Boolean isRoot (String pkgcodepath) {
Process process = NULL;
DataOutputStream OS = null;
try {
String cmd = "chmod 777" + Pk
system firmware version Firware is 1.0, so does not support Simplified Chinese input, but support for the Simplified Chinese display development team to work on it, now Zhao 1.5/1.6 Are all based on the root to obtain the basis of the Chinese-made package.
2 We can view the installed software through Abus
Although there is no root authority, we can still install software and games through Abus, but if we
This is an example of my successful experiment, the test environment SLES11SP1.
Change the system time
function Rootcmd ($cmd _body)
{
$cmd _head = "su--login root--command";
$cmd _body = "Date-s 07/13/2005";
$ROOTPASSWD = "Nari";
$cmd _full = sprintf ("%s \"%s\ "", $cmd _head, $cmd _body);
$fp = Popen ($cmd _full, "w");
Fputs ($fp, $ROOTPASSWD);
Pclose ($FP);
return 1;
}
???
Originally from Techfo
In the terminal, enter:sudo passwd rootEnter new UNIX Password: (enter your password here)Retype new UNIX Password: (Determine the password you entered)Passwd:password updated successfullyLater, if you want to get root privileges, just do the following:Su RootPassword: (Enter the password you set above here)If you want to disable the
Fromsdcard , here to borrow boston521 screenshot, exactly the same as mine.I search, search, find, and finally found a solution in another forum--In particular, this is for some official systems, such as the official port version of the System (mine), withODINFinish brushing third partyRecoveryAfter the automatic restart is selected, when the system is entered, a third partyRecoveryback to the official, this way, everybody knows the solution.--that is, do not choose automatic Restart! in theODI
This is an example of my successful experiment, the test environment SLES11SP1.
Change the system time
function Rootcmd ($cmd _body)
{
$cmd _head = "su--login root--command";
$cmd _body = "Date-s 07/13/2005";
$ROOTPASSWD = "Nari";
$cmd _full = sprintf ("%s \"%s\ "", $cmd _head, $cmd _body);
$fp = Popen ($cmd _full, "w");
Fputs ($fp, $ROOTPASSWD);
Pclose ($FP);
return 1;
}
?>
Originally from Techfox
latest because I want to debug the USB OTG thing, so that the USB port is occupied, so, although I am a project version, but cannot execute the ADB shell, resulting in unable to debug. So I now a system terminal APK, program http://download.csdn.net/detail/zangcf/8172151, extract so file libexec.so, put to system/lib below, source code put to: /alps/vendor/mediatek/project_xxx/artifacts/out/target/product/project_xxx/system/lib. Place the source program files under the./alps/vendor/mediatek/pro
Set android:shareduserid= "Android.uid.system" in Androidmanifest.xml
The Android API has the Systemclock.setcurrenttimemillis () function to modify the system time, but no matter how you call the function is useless, whether the simulator or the real machine, in the Logcat will always get "unable to Open alarm driver:permission denied ". This function requires root
the essence: in the system to add a user can be used to log the SU command. Of course, this is the first way to get root.
To. A rageagainstthecage in a program that z4root Android's root permissions for Android may be a program that manages to get
Android ADB obtains the root permission
(1) In Android compiled by myself, the ADB shell automatically obtains the root permission (that is, the display # instead of $ ):
Method:
Modify./Default. Prop
Set Ro. Secure to 0, persist. Service. ADB. Enable to 1, and the adbd process will start as the
To grant the Root permission to the Android app, the Android device must have the Root permission.
How an application obtains Root permissions: grant the highest permissions to the Code Execution directory of the application. In Linux, chmod 777
[Code] java code:
/**
* If th
Tags: Linu miss root permissions with no permissions images image min filterThe following example runs on the ZTE Android 5.0 phone.When we use the root-privileged python to create the socket listener Port 8088, SELinux outputs the following record to the KmsgPYTHON-ANDROID5 the operation of the socket create, setopt, bind, listen, etc. are denied disallowed, bec
Used as a reference for resolving PHP to execute commands or applications with root privileges that some ordinary users cannot perform.
In fact, the Popen () function in PHP can solve this problem, but due to some version of Linux (such as I use CentOS 5) for system security considerations,
It's a lot of trouble to solve this problem. Let's take a look at a netizen using the Popen () function example.
1, add the user, first with the AddUser command to add a normal user, the command is as follows:#adduser TommyAdd a user named Tommy#passwd Tommy//Change PasswordChanging password for user Tommy.New UNIX Password://Enter your password hereRetype new UNIX Password://Enter password againPasswd:all authentication tokens updated successfully.2. Give root permissionMethod One: Modify the/etc/sudoers file, locate the following line, remove the previous comm
Used as a reference for resolving PHP to execute commands or applications with root privileges that some ordinary users cannot perform.
In fact, the Popen () function in PHP can solve this problem, but due to some version of Linux (such as I use CentOS 5) for system security considerations,
It's a lot of trouble to solve this problem. Let's take a look at a netizen using the Popen () function example.
Copy
ROM Introduction1. First release HTC Desire 816t mobile version MIUI v5 4.10.92, 4G can be set in-Mobile network-network type selection here3. Root privileges in the Security Center-authorization management-allow the app to get root privileges4, hide the virtual key method: Settings-Additional settings-hide the bottom
Tags: etc user name root privileges/etc Ubuntu prompt system input password specWhen installing the package, you will be prompted without sudo permission.eg : sudo apt-get install golangWorkaround
Go to a user with root privilegeseg: su rootand follow the prompts to enter the password
sudo vim/etc/sudoers
Test environment: CentOS 6.51, add users, first add a normal user with the AddUser command, the command is as follows: #adduser Tommy//Add a user named Tommy #passwd Tommy // Modify the password changing password for user Tommy. New UNIX Password: //Enter this password here Retype Unix password: //Enter new password again passwd:all authentication tokens updated Successfully. 2, give root permission method One: Modify the/etc/sudoers file, find
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.