How to Enable v3 & v4 App Support for Android APK File

3.5k Views Asked by At

I have pasted the below command in the Terminal / Command Prompt and found the output from the below image file. So how do I enable or set v3 & v4 Signature Scheme to true which is currently getting false

java -jar /Users/Admin/Library/Android/sdk/build-tools/31.0.0/lib/apksigner.jar verify -v --print-certs /Users/Admin/Downloads/TestApp.apk

enter image description here

Questions:

  1. Do I have to change anything inside the app level build.gradle file?
  2. Currently I am referring the below sites for the v3 & v4 Signature Scheme
    2.1 v3 Signature Scheme: https://source.android.com/security/apksigning/v3
    2.2 v4 Signature Scheme: https://source.android.com/security/apksigning/v4
1

There are 1 best solutions below

0
Charlie Abou Moussa On

Try this:

android {
    ...
    signingConfigs {
        release {
            ...
            v1SigningEnabled false
            v2SigningEnabled true
            enableV3Signing = true
            enableV4Signing = true
        }
    }
}

To be able to verify the v4 signature check this: APK signature scheme v4 can't be verified with apksigner