The Wayback Machine - https://web.archive.org/web/20200930201727/https://github.com/didi/booster
Skip to content
master
Go to file
Code

Files

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

README.md

Booster

GitHub Travis (.org) 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, please see booster-task-analyser.

    使用 Booster �?�以�?�现潜在的性能问题,例如,在应用中调用�?�能阻塞 UI 线程或者主线程的 API,如:I/O API 等。详情请�?��?: booster-task-analyser。

  • 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 and booster-transform-shared-preferences.

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

  • Package size reduction | 应用瘦身

    Such as image resources compression, r inline, etc.

    如:资�?压缩�?�冗余资�?删除�?资�?索引内�?�。

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

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.2 4.10.1+
3.4.0 - 3.4.1 5.1.1+
3.5.0 - 3.5.3 5.4.1+
3.6.0 - 3.6.2 5.6.4+
4.0.0+ 6.1.1+

Best Practise | 最佳实践

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

集�? Booster 的最佳方�?是集�?真正需�?的模�?��?�解决项目中�?�到的特定问题。

buildscript {
    ext.booster_version = '2.4.0'
    repositories {
        google()
        mavenCentral()
        jcenter()
        
        // 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()
        jcenter()
        
        // 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' // â‘¢

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

  • booster-task-analyser - �?��?分�?工具

    classpath "com.didiglobal.booster:booster-task-analyser:$booster_version"
  • booster-transform-thread - 多线程优化

    classpath "com.didiglobal.booster:booster-transform-thread:$booster_version"
  • booster-transform-webview - WebView 预加载

    classpath "com.didiglobal.booster:booster-transform-webview:$booster_version"
  • booster-transform-shared-preferences - SharedPreferences 优化

    classpath "com.didiglobal.booster:booster-transform-shared-preferences:$booster_version"

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 - 检查覆盖安装导致的 Resources å’Œ Assets 未加载的 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

  • booster-task-check-snapshot - 检查 SNAPSHOT 版本

    classpath "com.didiglobal.booster:booster-task-check-snapshot:$booster_version"
  • booster-task-list-permission - 显示 AAR 使用的�?��?清�?�

    classpath "com.didiglobal.booster:booster-task-list-permission:$booster_version"
  • booster-task-list-shared-library - 显示 AAR 包�?�的动�?库清�?�

    classpath "com.didiglobal.booster:booster-task-list-shared-library:$booster_version"

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.

You can’t perform that action at this time.