Sometimes write a program need to call the system library, if the permissions are not enough, there are some methods in the library. You will need to sign the APK system.
Simple and common method:
1, add android:shareduserid= "Android.uid.system" to the manifest node in the APK's Androidmanifest.xml
2, run or package get APK
3. Use the target system's platform key to sign the APK file:
Find the Platform.x509.pem and platform.pk8 two files in the system android\build\target\product\security directory, in the system in out/host/ Locate the Signapk.jar file in the Linux-x86/framework directory, copy it out and put it in a folder, and put the apk that needs to be signed into a folder. Then first enter the file directory, and then enter the following statement on the cmd: Java-jar signapk.jar Platform.x509.pem Platform.pk8 was signed apk name. apk After signing the APK name APK, after execution will get a new apk "signature after apk name" in the current directory. "APK" is a system-signed apk.
For example, to sign a reset.apk, such as:
CMD into current directory: input command Java-jar signapk.jar platform.x509.pem platform.pk8 reset.apk s_reset.apk
Press Enter and the resulting s_reset.apk is the system-signed apk.
It is important to note that it must be Platform.x509.pem before platform.pk8 , otherwise it will be an error.
How the Android app signs the system