Android requires an action method that enhances permissions

  • 2020-05-26 10:05:18
  • OfStack

Authority promotion method:
1 method:
1. Add android:sharedUserId=" android.uid.system "to the manifest node in AndroidManifest.xml.
2, after adding the program in the virtual machine is not directly used. But you can compile apk with eclipse.
3. After compiling to apk, use the compression tool to open apk, and delete the CERT.SF and CERT.RSA files in the META-INF directory.
4, android used to own signature tool signapk. jar and source of platform. x509. pem, platform. pk8 apk for signature again.
Execution: java - jar signapk. jar platform. x509. pem platform. pk8old. apk new. apk new. After perform apk is the documents after signature.
Note: all the files are in the same directory when executing the command. If they are not in the same directory, please modify the path.
File platform. x509. pem and platform pk8 we can source build/target/product/security found. signapk.jar can be compiled to build/tools/signapk/.
5, after the signature can be installed and used
Method 2:
1. Add android:sharedUserId=" android.uid.system "to the manifest node in AndroidManifest.xml.
2, directly in the source code compilation, Android LOCAL_CERTIFICATE := platform
Two-method signatures may cause you to fail to manipulate files in the sdcard directory.

Operations that need to upgrade permissions:
1. System restart:


PowerManager pManager=(PowerManager) mContext.getSystemService(Context.POWER_SERVICE);   
pManager.reboot("");  

2. Write to the cache partition /cache
3. Modify the system time

...


Related articles: