Name: apk-channelization
Owner: bilibili
Description: [???v2??]Android???????
Created: 2015-11-05 15:05:44.0
Updated: 2018-04-16 00:48:39.0
Pushed: 2017-07-17 07:22:15.0
Size: 8
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
??????????Android??????????????????????AndroidManifest.xml???????
??????????UTF-16????AndroidManifest.xml?
???????????????https://github.com/wanchouchou/playWithAXML
signingapks.py
? ????apk
repackage.py
??????
???
?????channels
?##########
nnel list#
##########
a-data android:name="UMENG_CHANNEL" android:value="xxxxxxxxxxxxxxxx" />
???
??????source.apk
????"aaa”,“bbb”,“ccc"?out
??????
??????source.apk
????????channels
?????????out
?????
??????zipalign
?android gradle????(1.3.0)?????
?app?build.gradle???task?releaseAllChannels
?
rEvaluate {
oid.applicationVariants.all { variant ->
def output = variant.outputs.get(0).outputFile as File
if ("release".equals(variant.name) && variant.signingConfig != null) {
def task = tasks.findByName("zipalign${variant.name.capitalize()}")
def zipalignExe = task?.zipAlignExe
def repackageTask = tasks.create(name: "releaseAllChannels",
description: "Build all channel apks",
group: "build", type: Exec) {
commandLine 'python', rootProject.file("repackage.py").absolutePath,
'-f', rootProject.file('channels').absolutePath,
'-o', builderOutput.absolutePath,
"--keystore=${variant.signingConfig.storeFile}",
"--keypass=${variant.signingConfig.keyPassword}",
"--storepass=${variant.signingConfig.storePassword}",
"--keyalias=${variant.signingConfig.keyAlias}",
"--zipalignexe=${zipalignExe}",
output.absolutePath
}
repackageTask.dependsOn variant.assemble
}
??task releaseAllChannels
?????????????????build
??