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.