I. Android APK Signature The APK signature must first contain a keystore signature file. The keystore is generated by the built-in JDK tool keytool. For more information, see: Start-> Run-> cmd-> Cd to the JDK directory you installed. My files are C:/program files/Java/jdk1.6.0 _ 10/bin. Then enter: Keytool-genkey-alias asaiandroid. keystore-keyalg RSA-validity 20000-keystore asaiandroid. keystore -Alias follows the alias. Here is asaiandroid. Store. -Keyalg is the encryption method. Here it is RSA. -Validity is valid. The value is 20000. -Keystore is the name of the keystore to be generated. Here is asiandroid. keystore. Then press ENTER Press enter and you will be prompted for the entered password: This is used for signature, remember Then confirm your password. You will be asked to enter the name, organization unit, organization name, city region, province name, country code (CN), and so on.Start signing. Jarsigner.exe also provides a tool in C:/program files/Java/jdk1.6.0 _ 10/bin. Run the command to sign the APK: Jarsigner-verbose-keystore asaiandroid. keystore-signedjar lotteryonline_signed.apk lotteryonline.apk asaiandroid. keystore -Keystore: the name of the keystore. Lotteryonline_signed.apk: signed APK Lotteryonline.apk: APK before signature Press enter to enter the password you just set. Press enter to start signing. 2. Compile the eclipse source code without using make (Android source code directory <D:/myandroid_mx27> ): 1. First, add the Android: shareduserid = "android. uid. System" attribute to the manifest node in androidmanifest. xml. 2、use eclipseto compile the apk(clocksetting.apk) file, but this file cannot be used. Delete the CERT. SF and cert. RSA files under the META-INF directory. 3. Use the platform key of the current Android system (the Android system may be different) to re-sign the APK file (the user meter may not be used for signature ). First, find the key file. The location in my android source code directory is "build/target/product/security", and the following two files are platform. pk8 and platform. x509.pem. Then, use the signapk tool provided by Android to sign the signapk. The source code of signapk is under "build/tools/signapk". In this case, you have to prepare for the following compilation: <1> compile jar Command line CD to the signapk. Java code directory, Javac signapk. Java Obtain signapk $ signatureoutputstream. Class and signapk. Class Create the directory S/COM/Android/signapk and put the two class files in the directory Jar cvfm signapk. Jar signapk. mf-c s /. Note: there is a space in front of "s/" and "." Generate the signapk. jar file and obtain the signature program signapk. Jar provided by Android. <2> use the target system's platform Key signature Copy the platform. pk8 and platform. x509.pem files to the "D:/myandroid_mx27/build/tools/signapk" directory, that is, the directory where signapk. jar and signapk. MF are located. Java-jar signapk. Jar platform. x509.pem platform. pk8 D:/clocksetting.apk D:/clocksettingsigned.apk My unsigned (clocksetting.apk.pdf and the signed (clocksettingsigned.apk) APK files are all placed on the d disk, so that the files compiled with the android source code are obtained. <3> enable and install the VM: |