在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):bytedance/ByteX开源软件地址(OpenSource Url):https://github.com/bytedance/ByteX开源编程语言(OpenSource Language):Java 83.1%开源软件介绍(OpenSource Introduction):English | 简体中文 ByteX(Infinite Possibilities)
ByteX is a bytecode plugin platform based on Android Gradle Transform Api and ASM. (Maybe you can think of it as a socket with unlimited plugs?) In the apk building process, each plugin is completely independent. It not only can run independently from the ByteX host, but also can be automatically integrated into the host into a single Transform along with other plugins. What's more, each plugin's code is decoupled from one another, as well as their host, which makes it extensible and highly efficient for the development of new plugins. BackgroundIf all features are developed as a separate plugin, each plugin will cost 10+s, and the compilation time will increase linearly. But if the iterative development in only one plugin module will make it more and more cluttered, for the code is deeply coupled. So an idea was raised. It could make sense to build a bytecode plugin platform, and the new feature can be extended based on it as a new plugin. Feature
StructureTransformEngine Reading all the class files in the project and Android SDK, and writing back to the specified directory. base-plugin ByteX host. common Basic code library, including class diagram construction, logs, interfaces provided to various plugins. other plugin modules Depending on Quick StartAdd those configuration code to your build.gradle, and apply your plugins on demand. buildscript {
ext.plugin_version="0.3.0"
repositories {
google()
jcenter()
maven {
url "https://artifact.bytedance.com/repository/byteX/"
}
}
dependencies {
classpath "com.bytedance.android.byteX:base-plugin:${plugin_version}"
// Add bytex plugins' dependencies on demand
classpath "com.bytedance.android.byteX:refer-check-plugin:${plugin_version}"
// ...
}
}
apply plugin: 'com.android.application'
// apply bytex host
apply plugin: 'bytex'
ByteX {
enable true
enableInDebug false
logLevel "DEBUG"
}
// apply bytex plugins on demand...
apply plugin: 'bytex.refer_check'
// ... Note: If ByteX host is not applied, there is no difference between ByteX plugins and ordinary ones, and all of them will run separately. On the contrary, all ByteX plugins can be automatically merged into one single Transform with the help of the ByteX host. Plugins
Apps Using ByteX
What else can the ByteX do?There are more than 25 plugins developed based on ByteX in ByteDance (We only open sourced some of them). You can quickly develop the following related plugins based on ByteX:
ContributionIf you have some creative ideas and demands related to bytecode, come to join us to develop a new bytecode plugin based on ByteX! Please read through our Developer API. ThanksContact usIf you have any question or advice about ByteX, feel free to join our WeChat group. Besides, sending email to [email protected] or [email protected] is also available for you. Change LogLicenseApache 2.0 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论