Every time a product is released, it needs to hit a multi-channel package. Previously packaged with the per script, and later added custom spatial attributes, it was not possible to hit. The ant script is too cumbersome to package, citing too many projects. The last thing to think of is an anti-compilation.
Rationale: Each channel's package is not the same as the channel ID in the Androidmanifest.xml file. So after the anti-compilation apk, modify the channel ID of Androidmanifest.xml. Finally RePack.
Steps:
1. Decompile the apk that already has the package (it only uses-s, try to add-R, but the Androidmanifest.xml file is not recompiled, it is deleted)
1 java-jar apktool.jar D-Apk_name
2. Modify the channel ID in the Androidmanifest.xml file
3. Generate an 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 S ign_apk unsign_apk Alias_name
5. Optimize your signature apk
1 zipalign-v 4 sign_apk zipalign_apk
The new apk is generated. The above steps need to be configured with JDK and SDK environment variables.
You can write your own Java code, loop to replace the channel ID, you can automatically generate the corresponding channel package
Wrote a short, multi-channel packaging tool. Can be poked here for download. See the README.txt file in the download package for the usage method
Android Multi-channel packaging