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.
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。
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.
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.1.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! 🎉🎉🎉
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.
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
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。
System bugs fix | 系统问题修复
Such as fixing the crash caused by
Toastglobally on Android API 25. About the details, please see booster-transform-toast.Package size reduction | 应用瘦身
Such as r inline, etc.
Other things you can imagine | 其它你能想像得到的
Prerequisite | 先决条件
JDK 1.8,JDK 11is recommended)4.10+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.
Best Practise | 最佳实践
The best practise of using Booster is integrating the specific module to solve the problems you have encountered as following:
Then using the following command in terminal to check if Booster enabled
If transformClassesWithBoosterForDebug can be found in the output, it means Booster is enabled. Congratulations! 🎉🎉🎉
The
pluginsDSL also supported since Booster 3.0.0Migrate 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
Most
Taskbased modules are no longer supported in Booster 5.0.0, however, theTransformbased modules are still supported without breaking changes.About the details, please see Migrate from Booster 4.x to 5.x
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.
Community
License
Booster is licensed under the Apache License 2.0.