Name: walle
Owner: ????
Description: Android Signature V2 Scheme??????????????
Created: 2017-01-10 03:39:25.0
Updated: 2018-01-18 12:28:38.0
Pushed: 2018-01-12 08:07:55.0
Homepage: null
Size: 2064
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Walle?????Android Signature V2 Scheme??????????????
?????Apk??APK Signature Block
??????????????????????????????????????????????????HTTP????????????Apk????????
???????????????2??????
????????? build.gradle
?????Walle Gradle?????? ???
dscript {
dependencies {
classpath 'com.meituan.android.walle:plugin:1.1.6'
}
????App? build.gradle
???apply?????????????????AAR
y plugin: 'walle'
ndencies {
compile 'com.meituan.android.walle:library:1.1.6'
e {
// ??????????
apkOutputFolder = new File("${project.buildDir}/outputs/channels");
// ??????APK?????
apkFileNameFormat = '${appName}-${packageName}-${channel}-${buildType}-v${versionName}-${versionCode}-${buildTime}.apk';
// ??????
channelFile = new File("${project.getProjectDir()}/channel")
????????
apkOutputFolder???????????? ????new File("${project.buildDir}/outputs/apk")
apkFileNameFormat???????APK?????, ????'${appName}-${buildType}-${channel}.apk'
???????:
projectName - ????
appName - App????
packageName - applicationId (App??packageName)
buildType - buildType (release/debug?)
channel - channel?? (????????????)
versionName - versionName (???????)
versionCode - versionCode (?????)
buildTime - buildTime (????????)
fileSHA1 - fileSHA1 (??APK???SHA1???)
flavorName - ???? productFlavors ?
channelFile??????????????? ??????????????????????#??????
?????????????????????
ng channel = WalleChannelReader.getChannel(this.getApplicationContext());
??????????assemble${variantName}Channels
?????????????????? build/outputs/apk/
??????walle
????apkOutputFolder
?????????
?????
./gradlew clean assembleReleaseChannels
./gradlew clean assembleMeituanReleaseChannels
channelFile
??????????????????????????walle?????configFile
e {
// ??&??????????channelFile??
configFile = new File("${project.getProjectDir()}/config.json")
configFile
????????????????????
??????json????????channel???????????????????????&?????????? ?
???
channelFile
?????????????????????????configFile
?????channel
?key??????????????????
nelInfo channelInfo= WalleChannelReader.getChannelInfo(this.getApplicationContext());
channelInfo != null) {
tring channel = channelInfo.getChannel();
ap<String, String> extraInfo = channelInfo.getExtraInfo();
????????key??
ng value = WalleChannelReader.get(context, "buildtime");
??????channelFile/configFile?????????????????????????????????
???????: ./gradlew clean assembleReleaseChannels -PchannelList=meituan
???????: ./gradlew clean assembleReleaseChannels -PchannelList=meituan,dianping
?????&??????:
./gradlew clean assembleReleaseChannels -PchannelList=meituan -PextraInfo=buildtime:20161212,hash:xxxxxxx
??: ???extraInfo?key:value
????????,
???
????channelFile?????: ./gradlew clean assembleReleaseChannels -PchannelFile=/Users/xx/Documents/channel
????configFile?????: ./gradlew clean assembleReleaseChannels -PconfigFile=/Users/xx/Documents/config.json
????-P????????channelFile/configFile????????????????
-PchannelList
,-PchannelFile
, -PconfigFile
?????????
??????????????????????????????Walle CLI ????
??????????????????????APK Signing Block
?????????????????
????????????
????????????????????Android???????????????
Copyright 2017 Meituan-Dianping
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.