Please select at least one of the signature versions to use in Android Studio 2.3
Now while generating a signed APK in Android Studio, it\'s showing
It is written here that "By default, Android Studio 2.2 and the Android Plugin for Gradle 2.2 sign your app using both APK Signature Scheme v2 and the traditional signing scheme, which uses JAR signing."
As it seems that these new checkboxes appeared with Android 2.3, I understand that my previous versions of Android Studio (at least the 2.2) did sign with both signatures. So, to continue as I did before, I think that it is better to check both checkboxes.
EDIT March 31st, 2017 : submitted several apps with both signatures => no problem :)
It is a new signing mechanism introduced in Android 7.0, with additional features designed to make the APK signature more secure.
It is not mandatory. You should check BOTH of those checkboxes if possible, but if the new V2 signing mechanism gives you problems, you can omit it.
So you can just leave V2 unchecked if you encounter problems, but should have it checked if possible.
UPDATED: This is now mandatory when targeting Android 11.
According to this link: signature help
APK Signature Scheme v2 offers:
Android 7.0 introduces APK Signature Scheme v2, a new app-signing scheme that offers faster app install times and more protection against unauthorized alterations to APK files. By default, Android Studio 2.2 and the Android Plugin for Gradle 2.2 sign your app using both APK Signature Scheme v2 and the traditional signing scheme, which uses JAR signing.
It is recommended to use APK Signature Scheme v2 but is not mandatory.
Although we recommend applying APK Signature Scheme v2 to your app, this new scheme is not mandatory. If your app doesn't build properly when using APK Signature Scheme v2, you can disable the new scheme.
Should I use(or both) for signing apk for play store release? An answer is YES.
As per https://source.android.com/security/apksigning/v2.html#verification :
In Android 7.0, APKs can be verified according to the APK Signature Scheme v2 (v2 scheme) or JAR signing (v1 scheme). Older platforms ignore v2 signatures and only verify v1 signatures.
I tried to generate build with checking V2(Full Apk Signature) option. Then when I tried to install a release build in below 7.0 device and I am unable to install build in the device.
After that I tried to build by checking both version checkbox and generate release build. Then able to install build.
I think this represents a good answer.
APK Signature Scheme v2 verification
APK Signing Block
and verify that:
APK Signing Block
contain the same value.ZIP Central Directory
is immediately followed by ZIP End of Central Directory
record.ZIP End of Central Directory
is not followed by more data.APK Signature Scheme v2 Block
inside the APK Signing Block
. If the v2 Block if present, proceed to step 3. Otherwise, fall back to verifying the APK using v1 scheme.APK Signature Scheme v2 Block
:
SubjectPublicKeyInfo
of the first certificate of certificates is identical to public key.Note: APK must not be verified using the v1 scheme if a failure occurs in step 3 or 4.
JAR-signed APK verification (v1 scheme)
The JAR-signed APK is a standard signed JAR, which must contain exactly the entries listed in META-INF/MANIFEST.MF
and where all entries must be signed by the same set of signers. Its integrity is verified as follows:
META-INF/<signer>.SF
and META-INF/<signer>.(RSA|DSA|EC)
JAR entry.<signer>.(RSA|DSA|EC)
is a PKCS #7 CMS ContentInfo
with SignedData structure whose signature is verified over the <signer>.SF
file.<signer>.SF
file contains a whole-file digest of the META-INF/MANIFEST.MF
and digests of each section of META-INF/MANIFEST.MF
. The whole-file digest of the MANIFEST.MF
is verified. If that fails, the digest of each MANIFEST.MF
section is verified instead.META-INF/MANIFEST.MF
contains, for each integrity-protected JAR entry, a correspondingly named section containing the digest of the entry’s uncompressed contents. All these digests are verified.MANIFEST.MF
and are not part of JAR signature.
The protection chain is thus <signer>.(RSA|DSA|EC)
→ <signer>.SF
→ MANIFEST.MF
→ contents of each integrity-protected JAR entry.