简体   繁体   中英

What is the Difference between Jar signer and Apk signer?

As ApkSigner is available in revision 24.0.3 and higher of the Android SDK Build Tools. I have a question what is the difference between ApkSigner and JarSigner? Why we need ApkSigner?

Can I sign Apk in the command line for both signers?

jarsigner is designed for signing JAR files and does not know anything about APKs and Android, whereas apksigner is designed for signing APK files and knows what requirements Android places on APK signatures. For example, jarsigner does not produce APK Signature Scheme v2 signatures introduced in Android Nougat, whereas apksigner does. Another example is that jarsigner does not know that APKs which need to run on API Level 17 or lower must not use SHA-256 digests in their signatures, whereas apksigner knows that.

If you want to sign an APK using one of these tools, use apksigner.

EDIT: Here's the official documentation about signing from command-line: https://developer.android.com/studio/publish/app-signing.html#signing-manually

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM