Recently, I encountered the problem of restarting the Android system during development. After a day of tossing and surfing the Internet, I finally solved the problem. Here the problem is mainly about permissions. Share as follows:
Environment: android2.2 eclipse3.7 jdk1.6
My main signature method is as follows:
1. Add Android: shareduserid = "android. uid. system" to the manifest node in androidmanifest. xml ".
2. After addingProgramIt cannot be used directly on a virtual machine. However, you can use eclipse to compile the SDK into an APK.
3. Compile the APK and open the APK with the compression tool. Delete the CERT. SF and cert. RSA files in the META-INF directory.
4. Use the signapk. Jar tool that comes with Android and platform. x509.pem and platform. pk8 in the source code to re-sign the APK.
Run Java-jar signapk. Jar platform. x509.pem platform. pk8 old.apk new.apk. After the execution, new.apk is the signed file.
(Note: when executing the command, all files are stored in the same directory. If not, modify the path ).
The platform. x509.pem and platform. pk8 files can be found in build/target/product/security of the source code. Signapk. jar can be compiled to build/tools/signapk.
5. You can install and use the signature.
In addition, this signature may cause the operation of files in the sdcard directory to fail.