WalleAndroid Signature V2 Scheme
ApkAPK Signature Block
HTTPApk
2
build.gradle
Walle Gradle
buildscript {
dependencies {
classpath 'com.meituan.android.walle:plugin:1.1.7'
}
}
App build.gradle
applyAAR
apply plugin: 'walle'
dependencies {
compile 'com.meituan.android.walle:library:1.1.7'
}
walle {
//
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")
apkFileNameFormatAPK, '${appName}-${buildType}-${channel}.apk'
:
projectName -
appName - App
packageName - applicationId (ApppackageName)
buildType - buildType (release/debug)
channel - channel ()
versionName - versionName ()
versionCode - versionCode ()
buildTime - buildTime ()
fileSHA1 - fileSHA1 (APKSHA1)
flavorName - productFlavors
String channel = WalleChannelReader.getChannel(this.getApplicationContext());
assemble${variantName}Channels
build/outputs/apk/``walle``apkOutputFolder
./gradlew clean assembleReleaseChannels
./gradlew clean assembleMeituanReleaseChannels
channelFile
walleconfigFile
walle {
// &channelFile
configFile = new File("${project.getProjectDir()}/config.json")
}
configFile
jsonchannel&
channelFile``configFile
channel
keyChannelInfo channelInfo= WalleChannelReader.getChannelInfo(this.getApplicationContext());
if (channelInfo != null) {
String channel = channelInfo.getChannel();
Map<String, String> extraInfo = channelInfo.getExtraInfo();
}
// key
String 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
: extraInfokey:value``,
channelFile: ./gradlew clean assembleReleaseChannels -PchannelFile=/Users/xx/Documents/channel
configFile: ./gradlew clean assembleReleaseChannels -PconfigFile=/Users/xx/Documents/config.json
-PchannelFile/configFile
-PchannelList
,-PchannelFile
, -PconfigFile
APK Signing Block
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.