Convert Figma logo to code with AI

didi logobooster

🚀Optimizer for mobile applications

4,867
579
4,867
43

Top Related Projects

8,125

A powerful Android Dynamic Component Framework.

6,019

A bytecode optimizer for Android apps

11,610

Matrix is a plugin style, non-invasive APM system developed by WeChat.

6,752

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

3,126

ByteX is a bytecode plugin platform based on Android Gradle Transform API and ASM. 字节码插件开发平台

Quick Overview

Booster is an open-source optimization toolkit designed to improve mobile apps. It focuses on optimizing app size, performance, and stability, making it particularly useful for Android app development. Booster aims to solve common mobile development pain points without requiring changes to existing code.

Pros

  • Improves app performance and reduces APK size without code modifications
  • Supports various optimization techniques, including resource shrinking and code optimization
  • Integrates easily with existing build processes (Gradle)
  • Actively maintained with regular updates and improvements

Cons

  • Primarily focused on Android development, limiting its use for other platforms
  • May require careful configuration to avoid unintended side effects
  • Learning curve for understanding all available optimizations and their impacts
  • Some advanced features may require in-depth knowledge of Android internals

Code Examples

  1. Basic Booster integration in build.gradle:
buildscript {
    dependencies {
        classpath "com.didiglobal.booster:booster-gradle-plugin:4.16.3"
    }
}

apply plugin: 'com.android.application'
apply plugin: 'com.didiglobal.booster'
  1. Enabling specific optimizations:
booster {
    enableRTL = true
    enableMultiDex = true
    enableResourceIndexInline = true
}
  1. Custom transformation using Booster API:
@AutoService(Transformer::class)
class CustomTransformer : Transformer {
    override fun transform(context: TransformContext) {
        context.artifacts.get(ArtifactManager.CLASSES).forEach { artifact ->
            artifact.transform {
                // Custom transformation logic here
            }
        }
    }
}

Getting Started

To start using Booster in your Android project:

  1. Add Booster to your project's build.gradle:
buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.didiglobal.booster:booster-gradle-plugin:4.16.3"
    }
}

apply plugin: 'com.android.application'
apply plugin: 'com.didiglobal.booster'
  1. Configure Booster in your app's build.gradle:
booster {
    enableRTL = true
    enableMultiDex = true
    // Add more optimizations as needed
}
  1. Build your project, and Booster will automatically apply optimizations during the build process.

Competitor Comparisons

8,125

A powerful Android Dynamic Component Framework.

Pros of Atlas

  • More comprehensive Android app architecture solution, including dynamic component management and hot fixes
  • Larger community and more extensive documentation due to Alibaba's backing
  • Supports both Java and Kotlin development

Cons of Atlas

  • Steeper learning curve due to its more complex architecture
  • Less frequent updates compared to Booster
  • Heavier framework that may not be suitable for smaller projects

Code Comparison

Atlas example (Java):

Atlas.getInstance().manifestBinder().addBundleListener(new BundleListener() {
    @Override
    public void onBundleInstalled(Bundle bundle) {
        // Handle bundle installation
    }
});

Booster example (Kotlin):

Booster.initialize(this)
Booster.onAppCreate {
    // Perform optimizations on app creation
}

Atlas focuses on modular development and dynamic loading, while Booster emphasizes performance optimization and build acceleration. Atlas provides a more comprehensive solution for large-scale apps, whereas Booster offers simpler integration for quick performance gains. The choice between them depends on project size, complexity, and specific optimization needs.

6,019

A bytecode optimizer for Android apps

Pros of Redex

  • More mature project with longer development history and wider adoption
  • Extensive documentation and detailed usage guides
  • Supports a broader range of Android optimization techniques

Cons of Redex

  • Primarily focused on Android, while Booster supports both Android and iOS
  • More complex setup and configuration process
  • Slower development cycle and less frequent updates

Code Comparison

Redex configuration example:

{
  "passes": [
    "RemoveUnreachableCode",
    "ShortenSrcStrings",
    "RenameClassesV2"
  ],
  "keep_packages": [
    "com.facebook.redex.test.instr"
  ]
}

Booster usage example:

dependencies {
    implementation("com.didiglobal.booster:booster-api:4.16.3")
    implementation("com.didiglobal.booster:booster-transform-r-inline:4.16.3")
}

booster {
    transform {
        rInline {
            enabled = true
        }
    }
}

Both tools aim to optimize mobile applications, but Redex focuses more on bytecode optimization for Android, while Booster offers a wider range of performance improvements for both Android and iOS. Redex provides more granular control over optimization passes, while Booster integrates more seamlessly into the build process with simpler configuration.

11,610

Matrix is a plugin style, non-invasive APM system developed by WeChat.

Pros of Matrix

  • More comprehensive performance monitoring, including memory, battery, and I/O
  • Stronger focus on issue detection and troubleshooting
  • Supports both Android and iOS platforms

Cons of Matrix

  • More complex setup and integration process
  • Heavier resource footprint due to extensive monitoring features
  • Steeper learning curve for developers

Code Comparison

Matrix (initialization):

Matrix.Builder builder = new Matrix.Builder(application);
builder.patchListener(new TestPluginListener(this));
Matrix.init(builder.build());

Booster (gradle configuration):

dependencies {
    implementation 'com.didiglobal.booster:booster-api:4.0.0'
}

Key Differences

  • Booster focuses on build-time optimizations, while Matrix emphasizes runtime monitoring
  • Booster is primarily for Android, whereas Matrix supports both Android and iOS
  • Matrix offers more detailed performance insights, while Booster aims for lightweight, targeted optimizations

Use Cases

  • Choose Matrix for comprehensive app performance monitoring and troubleshooting
  • Opt for Booster when looking for easy-to-implement build-time optimizations on Android

Both tools can be valuable for improving app performance, with Matrix being more suited for in-depth analysis and Booster for quick, targeted enhancements.

6,752

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

Pros of Walle

  • Focuses specifically on Android app packaging and channel distribution
  • Provides a user-friendly GUI for easier management of app packaging
  • Supports custom channel information and package naming conventions

Cons of Walle

  • Limited to Android platform, while Booster supports both Android and iOS
  • Less comprehensive optimization features compared to Booster's wide range of performance enhancements
  • May require more manual configuration for complex packaging scenarios

Code Comparison

Walle (Channel writing):

ChannelWriter.put(new File("/path/to/your_apk.apk"), "channel_name", "channel_id");

Booster (Performance optimization):

class SampleTransformer : Transformer {
    override fun transform(context: TransformContext) {
        // Implement performance optimizations
    }
}

While both projects aim to improve mobile app development, they serve different primary purposes. Walle focuses on simplifying Android app packaging and distribution, offering a user-friendly interface for managing channel information. Booster, on the other hand, provides a more comprehensive toolkit for optimizing app performance across both Android and iOS platforms, with features like code analysis, resource optimization, and build acceleration.

Developers should choose between Walle and Booster based on their specific needs: Walle for streamlined Android app packaging and distribution, or Booster for broader performance optimization across multiple platforms.

3,126

ByteX is a bytecode plugin platform based on Android Gradle Transform API and ASM. 字节码插件开发平台

Pros of ByteX

  • More comprehensive feature set, including code optimization, resource shrinking, and security enhancements
  • Actively maintained with frequent updates and contributions from the ByteDance team
  • Extensive documentation and examples for easier integration and usage

Cons of ByteX

  • Steeper learning curve due to its broader scope and more complex configuration options
  • Potentially higher overhead and longer build times for smaller projects that don't require all features
  • Less focus on specific performance optimizations compared to Booster's targeted approach

Code Comparison

ByteX configuration example:

bytex {
    enable true
    enableInDebug false
    logLevel "DEBUG"
    // Additional plugin-specific configurations
}

Booster configuration example:

booster {
    enableInDebug = false
    // Specific optimizations and transformations
}

Both projects aim to improve Android app performance and development efficiency, but ByteX offers a more comprehensive toolkit at the cost of increased complexity, while Booster focuses on targeted optimizations with a simpler setup.

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

Booster

GitHub GitHub Release

Overview | 概览

Booster is an easy-to-use, lightweight, powerful and extensible quality optimization toolkit designed specially for mobile applications. The primary goal is to solve quality problems with the increase of APP complexity, such as performance, stability, and package size, etc.

Booster provides a collection of modules for performance detection, multithreading optimization, resources index inline, redundant resources reduction, resources compression, system bug fixing, etc. Using booster, the stability of application can be increased by 15% ~ 25%, and the package size can be reduced by 1MB ~ 10MB.

Booster 是一款专门为移动应用设计的易用、轻量级且可扩展的质量优化框架,其目标主要是为了解决随着 APP 复杂度的提升而带来的性能、稳定性、包体积等一系列质量问题。

Booster 提供了性能检测、多线程优化、资源索引内联、资源去冗余、资源压缩、系统 Bug 修复等一系列功能模块,可以使得稳定性能够提升 15% ~ 25%,包体积可以减小 1MB ~ 10MB。

What can Booster be used for? | Booster 能做什么?

  • Performance detection | 性能检测

    Potential performance issues could be found by using Booster, for example, calling APIs that may block the UI thread or main thread, such as I/O APIs. About the details

    使用 Booster 可以发现潜在的性能问题,例如,在应用中调用可能阻塞 UI 线程或者主线程的 API,如:I/O API 等。

  • Performance optimization | 性能优化

    Thread management has always been a problem for developers, especially the threads started by third-party SDKs, starting too many threads may cause OOM, fortunately, these issues can be solved by Booster. About the details, please see booster-transform-thread。

    对于开发者来说,线程管理一直是个头疼的问题,特别是第三方 SDK 中的线程,过多的线程可能会导致内存不足,然而幸运的是,这些问题都能通过 Booster 来解决。

  • System bugs fix | 系统问题修复

    Such as fixing the crash caused by Toast globally on Android API 25. About the details, please see booster-transform-toast.

    例如全局性地修复 Android API 25 版本中 Toast 导致的崩溃。详情请参见:booster-transform-toast.

  • Package size reduction | 应用瘦身

    Such as r inline, etc.

    如:资源索引内联。

  • Other things you can imagine | 其它你能想像得到的

Prerequisite | 先决条件

  • JDK (minimum version required is JDK 1.8, JDK 11 is recommended)
  • Gradle version 4.10+
  • Android Gradle Plugin version 3.3+

The following table lists which version of Gradle is required for each version of the Android Gradle plugin. For the best performance, please use the latest possible version of both Gradle and the plugin.

下表列出了各个 Android Gradle 插件版本所需的 Gradle 版本。要获得最佳性能,请使用 Gradle 和插件这两者的最新版本。

Android Gradle PluginGradleBooster
8.58.7+N/A
8.48.6+N/A
8.38.4+N/A
8.28.2+5.0.0+
8.18.0+5.0.0+
8.08.0+5.0.0+
7.47.5+4.16.3+
7.37.4+4.15.0+
7.27.3.3+4.10.0+
7.17.1+4.10.0+
7.07.0+4.0.0+
4.2.0+6.7.1+3.2.0+
4.1.0+6.5+3.0.0+
4.0.0+6.1.1+2.0.0+
3.6.0 - 3.6.45.6.4+1.0.0+
3.5.0 - 3.5.45.4.1+1.0.0+
3.4.0 - 3.4.35.1.1+1.0.0+
3.3.0 - 3.3.34.10.1+0.1.0+

Best Practise | 最佳实践

The best practise of using Booster is integrating the specific module to solve the problems you have encountered as following:

集成 Booster 的最佳方式是集成真正需要的模块来解决项目中遇到的特定问题。

buildscript {
    ext.booster_version = '5.0.0'
    repositories {
        google()
        mavenCentral()

        // OPTIONAL If you want to use SNAPSHOT version, sonatype repository is required.
        maven { url 'https://oss.sonatype.org/content/repositories/public' }
    }
    dependencies {
        classpath "com.didiglobal.booster:booster-gradle-plugin:$booster_version" // ① 
        // ② figure out the features you really need, then choose the right module for integration
        // ② 弄清楚真正需要的特性,然后从下面的模块列表中选择正确的模块进行集成
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()

        // OPTIONAL If you want to use SNAPSHOT version, sonatype repository is required.
        maven { url 'https://oss.sonatype.org/content/repositories/public' }
    }
}

apply plugin: 'com.android.application'
apply plugin: 'com.didiglobal.booster' // ③

Then using the following command in terminal to check if Booster enabled

然后在终端用如下命令来确认 Booster 是否启用:

./gradlew assembleDebug --dry-run

If transformClassesWithBoosterForDebug can be found in the output, it means Booster is enabled. Congratulations! 🎉🎉🎉

如果在命令行输出中能搜到 transformClassesWithBoosterForDebug 说明 Booster 已经启用了,那么恭喜你! 🎉🎉🎉

The plugins DSL also supported since Booster 3.0.0

Booster 从 3.0.0 开始支持 plugins DSL 的方式来启用

plugins {
    id 'com.didiglobal.booster' version '5.0.0'
}

Migrate from Booster 4.x to 5.x | 从 Booster 4.x 迁移到 5.x

Due to AGP 8's incompatible changes, AGP 7.x and below are no longer supported, if you are still using AGP 7.x, please use Booster 4.x

由于 AGP 8 的不兼容性变更,AGP 7.x 及以下版本已经不再支持,如果你仍在使用 AGP 7.x,请使用 Booster 4.x

Most Task based modules are no longer supported in Booster 5.0.0, however, the Transform based modules are still supported without breaking changes.

大部分基于 Task 的模块在 Booster 5.0.0 中已经不再支持,但是基于 Transform 的模块仍然支持且没有破坏性变更。

About the details, please see Migrate from Booster 4.x to 5.x

详情请参见 [从 Booster 4.x 迁移到 5.x](https://booster.johnsonlee.io/zh/migration

Samples | 示例

Documentation | 文档

About the details, please see Booster Inside(深入理解 Booster)

API Reference

About the API reference, please see Booster API Reference

Contributing

Welcome to contribute by creating issues or sending pull requests. See Contributing Guideline.

欢迎大家以 issue 或者 pull request 的形式为本项目作贡献。详见 Contributing Guideline。

Community

Booster交流群

License

Booster is licensed under the Apache License 2.0.