All Projects → Tencent → Vasdolly

Tencent / Vasdolly

Licence: other
Android V1 and V2 Signature Channel Package Plugin

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Vasdolly

Pancakeswap-sniping-bot-demo
Pancakeswap v1 and v2 sniping bot demo. Contact @aviddotsupports for full version on telegram or contact AviddotSupport#8131 on Discord
Stars: ✭ 146 (-94.02%)
Mutual labels:  v2, v1
Acgn Community
A community app for news,animation,music and novels developed material design style.
Stars: ✭ 193 (-92.09%)
Mutual labels:  gradle
Click Debounce
Using ASM to handle Android's click debounce, specially a quick double click.
Stars: ✭ 175 (-92.83%)
Mutual labels:  gradle
Kotlin Multiplatform Template
Kotlin Multiplatform Template
Stars: ✭ 185 (-92.42%)
Mutual labels:  gradle
Gradle Launch4j
A gradle-plugin to create windows executables with launch4j
Stars: ✭ 177 (-92.75%)
Mutual labels:  gradle
Ddd Java
Spring Boot + Java [ DDD Sample ]
Stars: ✭ 191 (-92.18%)
Mutual labels:  gradle
Gradlewiki
关于Gradle编译你需要知道的一切
Stars: ✭ 174 (-92.87%)
Mutual labels:  gradle
Autoplay
Gradle plugin for publishing Android artifacts to Google Play.
Stars: ✭ 201 (-91.77%)
Mutual labels:  gradle
Gradledoc
Gradle 中文文档
Stars: ✭ 192 (-92.13%)
Mutual labels:  gradle
Mvvmtemplate
An Android Template with MVVM and Clean Architecture
Stars: ✭ 182 (-92.54%)
Mutual labels:  gradle
Qmbform
Create simple Android forms
Stars: ✭ 184 (-92.46%)
Mutual labels:  gradle
Maven Git Versioning Extension
This extension will virtually set project versions, based on current git branch or tag.
Stars: ✭ 178 (-92.71%)
Mutual labels:  gradle
Micromodule
Rebuild multiple complete module structures within the module.
Stars: ✭ 192 (-92.13%)
Mutual labels:  gradle
Gradle 3 User Guide
Gradle 3 User Guide 中文翻译《Gradle 3 用户指南》
Stars: ✭ 177 (-92.75%)
Mutual labels:  gradle
Mxisd
Federated Matrix Identity Server
Stars: ✭ 194 (-92.05%)
Mutual labels:  gradle
Netbeans Gradle Project
This project is a NetBeans plugin able to open Gradle based Java projects. The implementation is based on Geertjan Wielenga's plugin.
Stars: ✭ 175 (-92.83%)
Mutual labels:  gradle
Stubbornjava
Unconventional Java code for building web servers / services without a framework. Think dropwizard but as a seed project instead of a framework. If this project had a theme it would be break the rules but be mindful of your decisions.
Stars: ✭ 184 (-92.46%)
Mutual labels:  gradle
Richeditor
基于原生EditText+span实现的Android富文本编辑器
Stars: ✭ 191 (-92.18%)
Mutual labels:  gradle
Worldwindandroid
The NASA WorldWind Java SDK for Android (WWA) includes the library, examples and tutorials for building 3D virtual globe applications for phones and tablets.
Stars: ✭ 204 (-91.64%)
Mutual labels:  gradle
Xian
reactive风格的微服务框架
Stars: ✭ 196 (-91.97%)
Mutual labels:  gradle

license Release Version PRs Welcome wiki

简介

VasDolly是一种快速多渠道打包工具,同时支持基于V1签名和V2签名进行多渠道打包。插件本身会自动检测Apk使用的签名类别,并选择合适的多渠道打包方式,对使用者来说完全透明。 V3.0.3版本已支持Android Gradle Plugin 4.2.0以上版本,欢迎使用!

目前Gradle Plugin 2.2以上默认开启V2签名,所以如果想关闭V2签名,可将下面的v2SigningEnabled设置为false。 关于应用签名说明:见官方文档

signingConfigs {
        release {
            ...
            v1SigningEnabled true
            v2SigningEnabled false
        }

        debug {
            ...
            v1SigningEnabled true
            v2SigningEnabled false
        }
    }

接入流程

添加对VasDolly Plugin的依赖

在根工程的build.gradle中,添加对打包Plugin的依赖:

dependencies {
        classpath 'com.android.tools.build:gradle:7.0.3'
        classpath 'com.tencent.vasdolly:plugin:3.0.3'
}

引用VasDolly Plugin

在主App工程的build.gradle中,添加对VasDolly Plugin的引用:

apply plugin: 'com.tencent.vasdolly'

添加对VasDolly helper类库的依赖

在主App工程的build.gradle中,添加读取渠道信息的helper类库依赖:

dependencies {
    api 'com.tencent.vasdolly:helper:3.0.3'
}

配置渠道列表

目前有两种方式配置渠道列表,最终的渠道列表是两者的累加之和:

  1. gradle.properties文件指定渠道文件名称,该渠道文件必须位于根工程目录下,一行一个渠道信息。
channel_file=channel.txt
  1. channel或者rebuildChannel属性中通过channelFile属性指定渠道文件,一行一个渠道信息。
channel{
    //指定渠道文件
    channelFile = file("/Users/leon/Downloads/testChannel.txt")
}
rebuildChannel{
    //指定渠道文件
    channelFile = file("/Users/leon/Downloads/testReChannel.txt")
}

通过Gradle生成多渠道包

直接编译生成多渠道包

若是直接编译生成多渠道包,首先要配置渠道文件、渠道包的输出目录和渠道包的命名规则:

channel{
    //指定渠道文件
    channelFile = file("/Users/leon/Downloads/testChannel.txt")
     //多渠道包的输出目录,默认为new File(project.buildDir,"channel")
    outputDir = new File(project.buildDir,"xxx")
    //多渠道包的命名规则,默认为:${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}-${buildTime}
    apkNameFormat ='${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}'
    //快速模式:生成渠道包时不进行校验(速度可以提升10倍以上,默认为false)
    fastMode = false
    //buildTime的时间格式,默认格式:yyyyMMdd-HHmmss
    buildTimeDateFormat = 'yyyyMMdd-HH:mm:ss'
    //低内存模式(仅针对V2签名,默认为false):只把签名块、中央目录和EOCD读取到内存,不把最大头的内容块读取到内存,在手机上合成APK时,可以使用该模式
    lowMemory = false
}

其中,多渠道包的命名规则中,可使用以下字段:

  • appName : 当前project的name
  • versionName : 当前Variant的versionName
  • versionCode : 当前Variant的versionCode
  • buildType : 当前Variant的buildType,即debug or release
  • flavorName : 当前的渠道名称
  • appId : 当前Variant的applicationId
  • buildTime : 当前编译构建日期时间,时间格式可以自定义,默认格式:yyyyMMdd-HHmmss

然后,通过gradle channelDebuggradle channelRelease命令分别生成Debug和Release的多渠道包。

为了方便临时生成渠道包进行测试,我们从v2.0.0开始支持添加渠道参数:gradle channelDebug(channelRelease) -Pchannels=yingyongbao,gamecenter,这里通过属性channels指定的渠道列表拥有更高的优先级,且和原始的文件方式是互斥的。

根据已有基础包重新生成多渠道包

若是根据已有基础包重新生成多渠道包,首先要配置渠道文件、基础包的路径和渠道包的输出目录:

rebuildChannel {
  //指定渠道文件
  channelFile = file("/Users/leon/Downloads/testReChannel.txt")
  // 已有APK文件地址(必填),如new File(project.rootDir, "/baseApk/app_base.apk"),文件名中的base将被替换为渠道名
  baseApk = 已有APK文件地址(必填)
  //默认为new File(project.buildDir, "rebuildChannel")
  outputDir = 渠道包输出目录
  //快速模式:生成渠道包时不进行校验(速度可以提升10倍以上,默认为false)
  fastMode = false
  //低内存模式(仅针对V2签名,默认为false):只把签名块、中央目录和EOCD读取到内存,不把最大头的内容块读取到内存,在手机上合成APK时,可以使用该模式
  lowMemory = false
}

然后,通过gradle rebuildChannel命令生成多渠道包。

为了方便临时生成渠道包进行测试,我们从v2.0.0开始支持添加渠道参数:gradle rebuildChannel -Pchannels=yingyongbao,gamecenter,这里通过属性channels指定的渠道列表拥有更高的优先级,且和原始的文件方式是互斥的。

通过命令行生成渠道包、读取渠道信息

V1.0.5版本开始支持命令行,具体使用文档可参考command目录下的README

读取渠道信息

通过helper类库中的ChannelReaderUtil类读取渠道信息。

String channel = ChannelReaderUtil.getChannel(getApplicationContext());

如果没有渠道信息,那么这里返回null,开发者需要自己判断。

Demo参考

详细的接入范式,可参考Demo

实现原理

具体原理可参考VasDolly实现原理

问题反馈

遇到任何问题或者有好的建议,欢迎提issues,或者QQ(1031747903)联系。

TODO

  1. 增加单元测试
  2. 防渠道信息篡改
  3. 提供Python脚本

License

VasDolly is under the BSD license. See the LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].