### Configure Direct Multi-Channel APK Generation (Gradle) Source: https://github.com/tencent/vasdolly/blob/master/README.md This Groovy snippet illustrates the configuration options for directly generating multi-channel APKs using VasDolly. It covers specifying the channel file, output directory, APK naming format, fast mode, build time format, and low memory mode. These settings control how APKs are built and named. ```groovy 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 } ``` -------------------------------- ### Apply VasDolly Plugin (App Gradle) Source: https://github.com/tencent/vasdolly/blob/master/README.md This Groovy snippet demonstrates how to apply the VasDolly plugin in the main application module's `build.gradle` file. This activates the plugin's functionalities for the app. ```groovy apply plugin: 'com.tencent.vasdolly' ``` -------------------------------- ### Add VasDolly Plugin Dependency (Root Gradle) Source: https://github.com/tencent/vasdolly/blob/master/README.md This Groovy snippet shows how to add the VasDolly Gradle plugin dependency to the root project's `build.gradle` file. This is the first step to enable VasDolly's multi-channel packaging capabilities. ```groovy dependencies { classpath 'com.android.tools.build:gradle:7.0.3' classpath 'com.tencent.vasdolly:plugin:3.0.6' } ``` -------------------------------- ### Configure Rebuilding Multi-Channel APKs from Base (Gradle) Source: https://github.com/tencent/vasdolly/blob/master/README.md This Groovy snippet details the configuration for rebuilding multi-channel APKs from an existing base APK. It includes specifying the channel file, the path to the base APK, the output directory, fast mode, and low memory mode. This method is useful for generating channel-specific APKs without recompiling the entire application. ```groovy 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 } ``` -------------------------------- ### Configure Channel File Path in build.gradle Source: https://github.com/tencent/vasdolly/blob/master/README.md This Groovy snippet demonstrates an alternative way to specify the channel file path directly within the `channel` or `rebuildChannel` block in the `build.gradle` file. This allows for more flexible path specification. ```groovy channel{    //指定渠道文件    channelFile = file("/Users/leon/Downloads/testChannel.txt") } rebuildChannel{    //指定渠道文件    channelFile = file("/Users/leon/Downloads/testReChannel.txt") } ``` -------------------------------- ### Configure Android Signing for VasDolly (Gradle) Source: https://github.com/tencent/vasdolly/blob/master/README.md This Groovy snippet demonstrates how to configure Android signing settings within a Gradle build script, specifically enabling V1 signing and disabling V2 signing for both release and debug build types. This is relevant for compatibility with VasDolly's automatic signature detection. ```groovy signingConfigs { release { ... v1SigningEnabled true v2SigningEnabled false } debug { ... v1SigningEnabled true v2SigningEnabled false } } ``` -------------------------------- ### Read Channel Information from APK (Java) Source: https://github.com/tencent/vasdolly/blob/master/README.md This Java snippet demonstrates how to programmatically read the channel information embedded in an APK using the `ChannelReaderUtil` helper class provided by VasDolly. It returns the channel string or `null` if no channel information is found. ```java String channel = ChannelReaderUtil.getChannel(getApplicationContext()); ``` -------------------------------- ### Configure Channel File Path in gradle.properties Source: https://github.com/tencent/vasdolly/blob/master/README.md This snippet shows how to specify the channel file name in the `gradle.properties` file. The specified file must be located in the root project directory, with each line containing one channel name. ```groovy channel_file=channel.txt ``` -------------------------------- ### Add VasDolly Helper Library Dependency (App Gradle) Source: https://github.com/tencent/vasdolly/blob/master/README.md This Groovy snippet shows how to add the VasDolly helper library dependency to the main application module's `build.gradle` file. This library provides utilities, such as `ChannelReaderUtil`, for reading channel information from the packaged APK. ```groovy dependencies {    api 'com.tencent.vasdolly:helper:3.0.6' } ``` -------------------------------- ### Add VasDolly Reader Module Dependency Source: https://github.com/tencent/vasdolly/blob/master/reader/README.md This snippet demonstrates how to include the VasDolly Reader module as a dependency in your project's `build.gradle` file, typically within the `dependencies` block. ```Groovy dependencies { compile 'com.tencent.vasdolly:reader:3.0.4' } ``` -------------------------------- ### ChannelReader Class API Overview Source: https://github.com/tencent/vasdolly/blob/master/reader/README.md The `ChannelReader` class provides low-level interfaces for reading channel information based on V1 and V2 signatures. It also includes functionalities to determine the presence of V1 and V2 signatures within an application. ```APIDOC Class: ChannelReader Purpose: Provides interfaces for reading channel information and checking for V1/V2 signatures. Key functionalities: - Read channel information based on V1 signatures - Read channel information based on V2 signatures - Check for V1 signature presence - Check for V2 signature presence ``` -------------------------------- ### IdValueReader Class API Overview Source: https://github.com/tencent/vasdolly/blob/master/reader/README.md The `IdValueReader` class offers interfaces specifically designed for reading all or arbitrary custom ID-Value pairs, primarily based on V2 signatures, allowing for flexible custom data extraction. ```APIDOC Class: IdValueReader Purpose: Provides interfaces for reading custom ID-Value pairs based on V2 signatures. Key functionalities: - Read all custom ID-Value pairs (V2 signature) - Read arbitrary custom ID-Value pairs (V2 signature) ``` -------------------------------- ### Add VasDolly Writer Module Dependency Source: https://github.com/tencent/vasdolly/blob/master/writer/README.md This snippet shows how to include the VasDolly writer module as a dependency in a Gradle-based Android project. It specifies version 3.0.4 of the writer library, allowing access to its functionalities for channel and ID-Value manipulation. ```Gradle dependencies { compile 'com.tencent.vasdolly:writer:3.0.4' } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.