Android requires elevated access to the Operation method _android

Source: Internet
Author: User

Permission Elevation method:
One way:
1, add android:shareduserid= "Android.uid.system" in the Manifest node in Androidmanifest.xml.
2, add the program on the virtual machine can not be used directly. But you can compile it into apk with Eclipse.
3, (This step is not executed) compiled into APK after the use of compression tools to open APK, the Meta-inf directory cert.sf, CERT. RSA two files deleted.
4, the use of Android with the signature tool Signapk.jar and the source code in the Platform.x509.pem,platform.pk8 to apk to re-sign.
Execution: Java-jar signapk.jar platform.x509.pem platform.pk8 old.apk new.apk after execution new.apk is the signed file.
(Note: When executing a command, all files are placed in the same directory, and if not in the same directory, modify the path).
File Platform.x509.pem and Platform.pk8 we can find in the build/target/product/security of the source code. Signapk.jar can be compiled build/tools/signapk/get.
5, after the signature can be installed using the
The second method:
1, add android:shareduserid= "Android.uid.system" in the Manifest node in Androidmanifest.xml.
2, directly in the source code compiled, Android add local_certificate: = Platform
The two method signatures may result in the inability to manipulate files in the SDcard directory.

Actions that require elevated privileges:
1. System reboot:

Copy Code code as follows:

PowerManager pmanager= (PowerManager) Mcontext.getsystemservice (Context.power_service);
Pmanager.reboot ("");

2. write files to cache partition/cache
3, modify the system time

......

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.