Top Related Projects
A powerful Android Dynamic Component Framework.
A bytecode optimizer for Android apps
Matrix is a plugin style, non-invasive APM system developed by WeChat.
Android Signature V2 Scheme签名下的新一代渠道包打包神器
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
- 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'
- Enabling specific optimizations:
booster {
enableRTL = true
enableMultiDex = true
enableResourceIndexInline = true
}
- 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:
- 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'
- Configure Booster in your app's
build.gradle
:
booster {
enableRTL = true
enableMultiDex = true
// Add more optimizations as needed
}
- Build your project, and Booster will automatically apply optimizations during the build process.
Competitor Comparisons
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.
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.
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.
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.
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 designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
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 Plugin | Gradle | Booster |
---|---|---|
8.5 | 8.7+ | N/A |
8.4 | 8.6+ | N/A |
8.3 | 8.4+ | N/A |
8.2 | 8.2+ | 5.0.0+ |
8.1 | 8.0+ | 5.0.0+ |
8.0 | 8.0+ | 5.0.0+ |
7.4 | 7.5+ | 4.16.3+ |
7.3 | 7.4+ | 4.15.0+ |
7.2 | 7.3.3+ | 4.10.0+ |
7.1 | 7.1+ | 4.10.0+ |
7.0 | 7.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.4 | 5.6.4+ | 1.0.0+ |
3.5.0 - 3.5.4 | 5.4.1+ | 1.0.0+ |
3.4.0 - 3.4.3 | 5.1.1+ | 1.0.0+ |
3.3.0 - 3.3.3 | 4.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
License
Booster is licensed under the Apache License 2.0.
Top Related Projects
A powerful Android Dynamic Component Framework.
A bytecode optimizer for Android apps
Matrix is a plugin style, non-invasive APM system developed by WeChat.
Android Signature V2 Scheme签名下的新一 代渠道包打包神器
ByteX is a bytecode plugin platform based on Android Gradle Transform API and ASM. 字节码插件开发平台
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot