How to use signature in Android
This article mainly introduces the relevant knowledge of "how to use signatures in Android". Xiaobian shows you the operation process through actual cases. The operation method is simple, fast and practical. I hope this article "how to use signatures in Android" can help you solve the problem.
Use of Pem Signature
(i) APK Signature Command
java -jar signapk.jar [-w] publickey.x509[.pem] privatekey.pk8 Hello.apk Hello_signed.apk
-w is the parameter used to sign ROM.
publickey.x509[.pem] sign the public key file, for example platform.x509.pem, under build\target\product\security
privatekey.pk8 sign the private key file, e.g. platform.pk8, under build\target\product\security
Hello.apk Apk or rom to sign
Hello_signed.apk The apk or rom generated after signing
signapk.jar signature tool, after compilation can be/out/host/linux-x86/framework/directory, source address/platform/build/tools/signapk/
Use platform signature commands that generally require system privileges
java -jar signapk.jar platform.x509.pem platform.pk8 Hello.apk Hello_signed.apk
(II) About configuring sharedUserId in AndroidManifest
Configure sharedUserId in AndroidManifest.xml to enable apk to obtain the user uid of the response and to use the permissions associated with the user. Commonly used sharedUserId include system, media, shared.
android:sharedUserId="android.uid.system" android:sharedUserId="android.uid.shared" android:sharedUserId="android.media"
At this point the application cannot be installed without a response signature.
II. Use keystore signature
jarsigner -verbose -keystore Android.keystore -signedjar android_signed.apk android.keystore The content of "How to use signatures in Android" is introduced here. Thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the industry information channel. Xiaobian will update different knowledge points for you every day.