Skip to content
master
Switch branches/tags
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Booster

GitHub Build Status 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 ??什??

Prerequisite | ?决条件

  • JDK (1.8 is recommended)
  • Gradle version 4.1+
  • Android Gradle Plugin version 3.0+

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 Plugin Gradle
3.0.0+ 4.1+
3.1.0+ 4.4+
3.2.0 - 3.2.1 4.6+
3.3.0 - 3.3.3 4.10.1+
3.4.0 - 3.4.3 5.1.1+
3.5.0 - 3.5.4 5.4.1+
3.6.0 - 3.6.4 5.6.4+
4.0.0+ 6.1.1+
4.1.0+ 6.5+
4.2.0+ 6.7.1+

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 = '4.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

Booster3.0.0 开始支? plugins DSL 的方式来?用

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

Here are all the modules of Booster:

Common

  • booster-aapt2 - AAPT2 相关 API

    implementation "com.didiglobal.booster:booster-aapt2:$booster_version"
  • booster-api - Booster 插件开发 API

    this module contains both booster-transform-spi and booster-task-spi

    implementation "com.didiglobal.booster:booster-api:$booster_version"
  • booster-cha - Class Hierarchy Analysis API

    implementation "com.didiglobal.booster:booster-cha:$booster_version"
  • booster-command - SPI for external command discovery

    implementation "com.didiglobal.booster:booster-command:$booster_version"

Performance

Package Size

  • booster-task-compression-cwebp - 采用 cwebp 对资?进行压缩

    classpath "com.didiglobal.booster:booster-task-compression-cwebp:$booster_version"

    The option android.precompileDependenciesResources need to be set on Android Gradle Plugin 3.6 and higher

    android.precompileDependenciesResources=false
  • booster-task-compression-pngquant - 采用 pngquant 对资?进行压缩

    classpath "com.didiglobal.booster:booster-task-compression-pngquant:$booster_version"

    The option android.precompileDependenciesResources need to be set on Android Gradle Plugin 3.6 and higher

    android.precompileDependenciesResources=false

    booster-pngquant-provider could be used for image compressing by pngquant without installation

  • booster-task-compression-processed-res - ap_ 文件压缩

    classpath "com.didiglobal.booster:booster-task-compression-processed-res:$booster_version"
  • booster-task-resource-deredundancy - 去冗余资?

    classpath "com.didiglobal.booster:booster-task-resource-deredundancy:$booster_version"

    The option android.precompileDependenciesResources need to be set on Android Gradle Plugin 3.6 and higher

    android.precompileDependenciesResources=false
  • booster-transform-r-inline - 资?索引内?

    classpath "com.didiglobal.booster:booster-transform-r-inline:$booster_version"
  • booster-transform-br-inline - DataBinding BR索引内?

    classpath "com.didiglobal.booster:booster-transform-br-inline:$booster_version"

System Bug

  • booster-transform-finalizer-watchdog-daemon - 修复 finalizer 导致的 TimeoutException

    classpath "com.didiglobal.booster:booster-transform-finalizer-watchdog-daemon:$booster_version"
  • booster-transform-media-player - 修复 MediaPlayer 崩?

    classpath "com.didiglobal.booster:booster-transform-media-player:$booster_version"
  • booster-transform-res-check - 检查覆盖安装导致的 ResourcesAssets 未加载的 Bug

    classpath "com.didiglobal.booster:booster-transform-res-check:$booster_version"
  • booster-transform-toast - 修复 Toast 在 Android 7.1 上的 Bug

    classpath "com.didiglobal.booster:booster-transform-toast:$booster_version"
  • booster-transform-activity-thread - 处?系统 Crash

    classpath "com.didiglobal.booster:booster-transform-activity-thread:$booster_version"

Utility

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.