Convert Figma logo to code with AI

Meituan-Dianping logowalle

Android Signature V2 Scheme签名下的新一代渠道包打包神器

6,752
1,080
6,752
106

Top Related Projects

17,130

Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.

8,125

A powerful Android Dynamic Component Framework.

1,366

A hotfix library for Android platform, and not just this...

A powerful and lightweight plugin framework for Android

1,667

🔥🔥Qigsaw ['tʃɪɡsɔ] is a dynamic modularization library which is based on Android App Bundles(Do not need Google Play Service). It supports dynamic delivery for split APKs without reinstalling the base one.

Quick Overview

Walle is an open-source Android and iOS mobile application deployment platform developed by Meituan-Dianping. It aims to simplify and streamline the process of building, signing, and distributing mobile applications for both Android and iOS platforms. Walle provides a user-friendly web interface for managing app releases and supports various deployment scenarios.

Pros

  • Supports both Android and iOS app deployment in a single platform
  • Offers a user-friendly web interface for easy management of app releases
  • Provides flexible deployment options, including gradual rollouts and A/B testing
  • Integrates with popular CI/CD tools for automated deployment workflows

Cons

  • Documentation is primarily in Chinese, which may be challenging for non-Chinese speakers
  • Limited community support compared to some other deployment tools
  • May require additional setup and configuration for complex deployment scenarios
  • Learning curve for teams not familiar with the Meituan-Dianping ecosystem

Getting Started

To get started with Walle, follow these steps:

  1. Clone the repository:

    git clone https://github.com/Meituan-Dianping/walle.git
    
  2. Install dependencies:

    cd walle
    pip install -r requirements.txt
    
  3. Configure the database and other settings in config.py.

  4. Run the application:

    python manage.py runserver
    
  5. Access the web interface at http://localhost:5000 and follow the setup wizard to configure your project and deployment settings.

For more detailed instructions and configuration options, refer to the project's documentation (mostly in Chinese).

Competitor Comparisons

17,130

Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.

Pros of tinker

  • More comprehensive hot-fix solution, supporting both resources and code changes
  • Better performance and smaller patch size due to optimized diff algorithm
  • Wider adoption and community support, backed by Tencent

Cons of tinker

  • More complex setup and integration process
  • Steeper learning curve for developers new to hot-fix solutions
  • May require more frequent updates to keep up with Android system changes

Code Comparison

tinker:

TinkerInstaller.onReceiveUpgradePatch(getApplicationContext(), path);

walle:

WalleConfig config = new WalleConfig.Builder()
    .apkPath(apkPath)
    .channelPath(channelPath)
    .build();
Walle.putExtraInfo(config);

While both projects aim to improve Android app development, they serve different purposes. tinker focuses on hot-fixing and patching, while walle primarily deals with channel packaging and information management. tinker offers more advanced features for runtime code and resource updates, but comes with increased complexity. walle, on the other hand, provides a simpler solution for managing app distribution channels and extra information, making it easier to use for its specific purpose.

8,125

A powerful Android Dynamic Component Framework.

Pros of Atlas

  • More comprehensive Android app architecture solution, focusing on dynamic component management and flexible updates
  • Supports multi-process architecture and provides better isolation between components
  • Offers a more robust plugin framework for large-scale applications

Cons of Atlas

  • Steeper learning curve due to its complex architecture and features
  • Requires more setup and configuration compared to Walle
  • May be overkill for smaller projects or simpler app structures

Code Comparison

Atlas (Bundle loading):

Atlas.getInstance().installBundle(bundleFile);
Atlas.getInstance().startBundle(bundleName);

Walle (Channel configuration):

walle {
    apkOutputFolder = new File("${project.buildDir}/outputs/channels")
    apkFileNameFormat = '${appName}-${packageName}-${channel}-${buildType}-v${versionName}-${versionCode}.apk'
    channelFile = new File("${project.getProjectDir()}/channel")
}

Atlas focuses on dynamic component management and bundle loading, while Walle primarily deals with channel packaging and distribution. Atlas provides more flexibility for large-scale app development, but Walle offers a simpler solution for app distribution across multiple channels.

1,366

A hotfix library for Android platform, and not just this...

Pros of Amigo

  • Supports incremental updates, reducing download size and update time
  • Offers more flexible patching options, including resource and native library patching
  • Provides a more comprehensive solution for Android app updates and hotfixes

Cons of Amigo

  • More complex setup and integration process compared to Walle
  • Requires more extensive modifications to the app's codebase
  • May have a steeper learning curve for developers new to advanced patching techniques

Code Comparison

Amigo patch application:

Amigo.work(this);

Walle channel reading:

String channel = WalleChannelReader.getChannel(this);

Key Differences

  • Amigo focuses on comprehensive app updating and hotfixing, while Walle primarily handles channel management and packaging
  • Amigo offers more advanced features but requires more setup, whereas Walle is simpler to integrate but has more limited functionality
  • Amigo is better suited for complex apps requiring frequent updates, while Walle is ideal for apps needing efficient channel management

Use Cases

  • Choose Amigo for apps requiring frequent updates, bug fixes, and feature additions without full app reinstallation
  • Opt for Walle when the primary need is efficient channel management and packaging for app distribution across multiple platforms

A powerful and lightweight plugin framework for Android

Pros of VirtualAPK

  • Supports dynamic loading and running of entire APKs without installation
  • Allows for more complex plugin architectures and modular app designs
  • Provides a more comprehensive solution for app virtualization

Cons of VirtualAPK

  • Higher complexity and steeper learning curve
  • Potential performance overhead due to virtualization
  • May require more maintenance and updates to keep up with Android changes

Code Comparison

VirtualAPK:

PluginManager pluginManager = PluginManager.getInstance(context);
pluginManager.loadPlugin(new File(apkPath));
Intent intent = new Intent();
intent.setClassName(packageName, activityName);
startActivity(intent);

Walle:

WalleConfig config = new WalleConfig.Builder()
    .apkFile(new File(apkPath))
    .channelFile(new File(channelPath))
    .build();
Walle.getChannelInfo(context, config);

VirtualAPK focuses on loading and running entire APKs dynamically, while Walle is primarily used for channel packaging and information retrieval. VirtualAPK's code demonstrates plugin loading and activity launching, whereas Walle's code shows configuration for channel information extraction.

1,667

🔥🔥Qigsaw ['tʃɪɡsɔ] is a dynamic modularization library which is based on Android App Bundles(Do not need Google Play Service). It supports dynamic delivery for split APKs without reinstalling the base one.

Pros of Qigsaw

  • Focuses on dynamic feature delivery for Android apps
  • Supports incremental updates and on-demand loading of features
  • Provides a more modular approach to app development

Cons of Qigsaw

  • More complex setup and integration process
  • Limited to Android platform
  • Requires more careful planning of app architecture

Code Comparison

Qigsaw (Kotlin):

class MyApplication : QigsawApplication() {
    override fun onCreate() {
        super.onCreate()
        Qigsaw.install(this, BuildConfig.DEBUG)
    }
}

Walle (Java):

ChannelInfo channelInfo = WalleChannelReader.getChannelInfo(this);
if (channelInfo != null) {
    String channel = channelInfo.getChannel();
    Map<String, String> extraInfo = channelInfo.getExtraInfo();
}

Summary

Qigsaw is tailored for dynamic feature delivery in Android apps, offering modular development and on-demand loading. It's more complex but provides greater flexibility for large-scale apps. Walle, on the other hand, focuses on channel packaging and reading for Android APKs, making it simpler to use but more limited in scope. The choice between the two depends on the specific needs of the project, with Qigsaw being more suitable for complex, feature-rich applications, while Walle is better for simpler channel management tasks.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Walle

Release Version Build Status PRs Welcome License

Walle(瓦力):Android Signature V2 Scheme签名下的新一代渠道包打包神器

瓦力通过在Apk中的APK Signature Block区块添加自定义的渠道信息来生成渠道包,从而提高了渠道包生成效率,可以作为单机工具来使用,也可以部署在HTTP服务器上来实时处理渠道包Apk的升级网络请求。

Quick Start

为了方便大家的使用,我们提供了2种使用方式:

  • Gradle插件方式,方便快速集成
  • 命令行方式,最大化满足各种自定义需求

Gradle插件使用方式

配置build.gradle

在位于项目的根目录 build.gradle 文件中添加Walle Gradle插件的依赖, 如下:

buildscript {
    dependencies {
        classpath 'com.meituan.android.walle:plugin:1.1.7'
    }
}

并在当前App的 build.gradle 文件中apply这个插件,并添加上用于读取渠道号的AAR

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")

  • 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:包含渠道配置信息的文件路径。 具体内容格式详见:渠道配置文件示例,支持使用#号添加注释。

如何获取渠道信息

在需要渠道等信息时可以通过下面代码进行获取

String channel = WalleChannelReader.getChannel(this.getApplicationContext());

如何生成渠道包

生成渠道包的方式是和assemble${variantName}Channels指令结合,渠道包的生成目录默认存放在 build/outputs/apk/,也可以通过walle闭包中的apkOutputFolder参数来指定输出目录

用法示例:

  • 生成渠道包 ./gradlew clean assembleReleaseChannels
  • 支持 productFlavors ./gradlew clean assembleMeituanReleaseChannels

更多用法

插入额外信息

channelFile只支持渠道写入,如果想插入除渠道以外的其他信息,请在walle配置中使用configFile

walle {
    // 渠道&额外信息配置文件,与channelFile互斥
	configFile = new File("${project.getProjectDir()}/config.json")
}

configFile是包含渠道信息和额外信息的配置文件路径。
配置文件采用json格式,支持为每个channel单独配置额外的写入信息。具体内容格式详见:渠道&额外信息配置文件示例 。

注意:

  • 此配置项与channelFile功能互斥,开发者在使用时选择其一即可,两者都存在时configFile优先执行。
  • extraInfo 不要出现以channel为key的情况

而对应的渠道信息获取方式如下:

ChannelInfo 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

    注意: 这里的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区块进行读写操作的模块进行了封装。

读写模块的使用说明详见:

Q&A

原理介绍

对该工具的原理感兴趣的同学,可以移步美团Android新一代渠道包生成工具进行了解。

注意事项

  • 使用apksigner重新对Apk签名会导致渠道信息丢失,需要再次写入渠道信息
  • 1.1.3版本起,walle支持对含有comment的apk进行渠道写入, 详见issue 52

技术支持

  • Read The Fucking Source Code
  • 通过提交issue来寻求帮助
  • 联系我们寻求帮助

贡献代码

  • 欢迎提交issue
  • 欢迎提交PR

参考

License

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.