Android multi-channel packaging and Android Packaging

Source: Internet
Author: User

Android multi-channel packaging and Android Packaging

Each time a product is released, many channel packages are required. Previously, we used the per script to package the package. After we added the custom space attribute, we couldn't press it. It is troublesome to pack the Ant script, and there are too many referenced projects. The last method is decompilation.

 

Principle: only the channel IDs in the AndroidManifest. xml file are different for each channel package. After decompiling the APK, modify the channel ID of AndroidManifest. xml. Finally, package again.

 

Steps:

1. decompile the package-ready APK (Here we only use-s and try to add-r, but the AndroidManifest. xml file is deleted if it is not decompiled)

1 java -jar apktool.jar  d -s APK_NAME

2. Modify the channel ID in the AndroidManifest. xml file

3. Generate unsigned APK

1 java -jar apktool.jar  b FILE_DIR UNSIGN_APK_NAME

4. Sign the unsigned APK

1 jarsigner -verbose -keystore KEY_FILE_NAME -storepass PASSWORD -sigalg SHA1withRSA -digestalg SHA1 -signedjar SIGN_APK UNSIGN_APK ALIAS_NAME

5. Optimize the signed APK.

1 zipalign -v 4 SIGN_APK ZIPALIGN_APK

The new APK is generated. Configure the JDK and SDK environment variables in the preceding steps.

You can write a java code and replace the channel ID cyclically to automatically generate the corresponding channel package.

 

A multi-channel packaging tool is briefly written. You can click here to download it. Use intellij idea to see the readme.txt file in the downloaded package

 


Android multi-channel Packaging

Channel packaging is divided into different markets, such as the Android Market, Baidu market, Google market, and 360 market. There are too many. Multi-channel packaging aims to make different statistics, data analysis, and collect user information for different markets. For details, see umeng provides some open-source statistical services for free class libraries.

Android ant multi-channel batch packaging source code, if you can use it, add 100 points

No. Thank you.
 

Related Article

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.