Android7.0 Packaging Installation Issues

Source: Internet
Author: User

I. Description of the problem

Android 7.0 introduces a new application signature scheme apk Signature Scheme v2, first packaged with the APK Signature Scheme v2 signature, and then after using a Python script to hit the channel pack, the following issue occurs on 7.0 phones:

Two. Causes

Unzip the APK directly as a zip, the directory will have a meta-inf directory that does not participate in the signature verification, add different empty files in the Meta-inf directory, can uniquely identify a channel. So Python script channel package is in this way, each dozen a channel package only need to copy an apk, in the Meta-inf to add a channel number named empty file can be. APK Signature Scheme v2 does not allow further changes to the signed application, providing faster app installation time and more protection against unauthorized APK file changes. As a result, the above problem arises.

Three. Workaround

1. Disable the V2 signature by using the V1 signature:
Open the module-level Build.gradle file and add the line v2signingenabled false to your version signature configuration only with the traditional scheme signature:

Android {    ...    Defaultconfig {...}    Signingconfigs {      Release {        storefile file ("Myreleasekey.keystore")        storepassword "Password"        Keyalias "Myreleasekey"        keypassword "password"        v2signingenabled false      }    }  }

or when you are packing:


This problem does not occur when you use the above method to package and then use Python to hit the channel pack.
This method uses the traditional V1 signature, disables the V2 signature, and is not recommended for use.

2. Use the Gradle command to package:
In the terminal window input: Gradlew assemblerelease can play all channel package.
The configuration that is packaged with the Gradle command is no longer described here.
Reference: HTTP://WWW.JIANSHU.COM/P/44D40F8E67C9
Cons: Too many channels, slow speed.
3. Use the Walle Library to pack:
Principle: Add custom channel information to the APK Signature block block in the APK to generate the channel bundle.
Principle See: http://tech.meituan.com/android-apk-v2-signature-scheme.html
To use the method see: Https://github.com/Meituan-Dianping/walle
Which hits the Channel Package command:

gradlew assemble{渠道号}ReleaseChannels

The speed is fast, recommended to use.

Android7.0 Packaging Installation Issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.