All Projects → bytedance → Bytex

bytedance / Bytex

Licence: apache-2.0
ByteX is a bytecode plugin platform based on Android Gradle Transform API and ASM. 字节码插件开发平台

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects
shell
77523 projects

Projects that are alternatives of or similar to Bytex

Androidautotrack
Android Asm 插桩 教学
Stars: ✭ 378 (-82.34%)
Mutual labels:  gradle, gradle-plugin, asm
Androidanimationexercise
Android 动画各种实现,包括帧动画、补间动画和属性动画的总结分享
Stars: ✭ 1,254 (-41.4%)
Mutual labels:  gradle, gradle-plugin, asm
Laziertracker
本项目通过Android字节码插桩插件实现Android端无埋点(或自动埋点),并且支持根据配置文件实现业务数据的自动采集。
Stars: ✭ 485 (-77.34%)
Mutual labels:  gradle, gradle-plugin, asm
Click Debounce
Using ASM to handle Android's click debounce, specially a quick double click.
Stars: ✭ 175 (-91.82%)
Mutual labels:  gradle, gradle-plugin, asm
Hunter
A fast, incremental, concurrent framework to develop compile plugin for android project to manipulate bytecode
Stars: ✭ 999 (-53.32%)
Mutual labels:  gradle, gradle-plugin, asm
Okbuck
OkBuck is a gradle plugin that lets developers utilize the Buck build system on a gradle project.
Stars: ✭ 1,513 (-29.3%)
Mutual labels:  gradle, gradle-plugin
Methodtraceman
用于快速找到高耗时方法,定位解决Android App卡顿问题。通过gradle plugin+ASM实现可配置范围的方法插桩来统计所有方法的耗时,并提供友好的界面展示,支持耗时筛选、线程筛选、方法名筛选等。(A Tool for Discovering High Time-consuming Methods for Android App)
Stars: ✭ 1,258 (-41.21%)
Mutual labels:  gradle-plugin, asm
Gradle Quality Plugin
Gradle quality plugin for Java and Groovy
Stars: ✭ 97 (-95.47%)
Mutual labels:  gradle, gradle-plugin
Jaop
jaop is a gradle plugin base on javassist&asm for android aop
Stars: ✭ 115 (-94.63%)
Mutual labels:  gradle-plugin, asm
Module Service Manager
Android模块化/组件化通信框架
Stars: ✭ 58 (-97.29%)
Mutual labels:  gradle-plugin, asm
Vertx Gradle Plugin
An opinionated Gradle plugin for Vert.x projects
Stars: ✭ 98 (-95.42%)
Mutual labels:  gradle, gradle-plugin
Gradle Changelog Plugin
Plugin for parsing and managing the Changelog in a "keep a changelog" style.
Stars: ✭ 102 (-95.23%)
Mutual labels:  gradle, gradle-plugin
Gradle Plugins
Gradle Plugin Collection
Stars: ✭ 84 (-96.07%)
Mutual labels:  gradle, gradle-plugin
Gradle Buildconfig Plugin
A plugin for generating BuildConstants for any kind of Gradle projects: Java, Kotlin, Groovy, etc. Designed for KTS scripts.
Stars: ✭ 85 (-96.03%)
Mutual labels:  gradle, gradle-plugin
Gradle Semantic Build Versioning
Gradle plugin to generate version-numbers and tags using semantic versioning
Stars: ✭ 69 (-96.78%)
Mutual labels:  gradle, gradle-plugin
Kordamp Gradle Plugins
A collection of Gradle plugins
Stars: ✭ 100 (-95.33%)
Mutual labels:  gradle, gradle-plugin
Gradle Build Properties Plugin
Keep your secrets secret. External build properties support for your Gradle scripts.
Stars: ✭ 110 (-94.86%)
Mutual labels:  gradle, gradle-plugin
Jenkins Pipeline Shared Libraries Gradle Plugin
Gradle plugin to help with build and test of Jenkins Pipeline Shared Libraries (see https://jenkins.io/doc/book/pipeline/shared-libraries/)
Stars: ✭ 103 (-95.19%)
Mutual labels:  gradle, gradle-plugin
Reckon
Infer a project's version from your Git repository.
Stars: ✭ 124 (-94.21%)
Mutual labels:  gradle, gradle-plugin
Jib
🏗 Build container images for your Java applications.
Stars: ✭ 11,370 (+431.31%)
Mutual labels:  gradle, gradle-plugin

English | 简体中文

ByteX(Infinite Possibilities)

logo

GitHub license

Powered by ByteDance TikTok & Douyin Android team.

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.

Background

If 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

  • Code reuse. The common code sinks to common module and is reused by all plugins, so that each plugin only needs to focus on bytecode operation.

  • Plugin code is isolated and decoupled from each other. Based on ByteX, each feature is independent as a single plugin, and the code of each plugin is isolated from each other, which is conducive to develop a new plugin.

  • Platformization makes Transform more efficient.

    • Class files are processed in multiple threads concurrently, making full use of the CPU resources of your machine.

    • Plugins are automatically and seamlessly integrated into a single Transform to improve the efficiency of processing. During the Transform process, the IO of the class file is time-consuming. Integrating all the plugins into a single transform can avoid the costing time increasing linearly. It makes "1 + 1 = 2" become "1 + 1 <2" or approximately equal to 1.

  • Plugin portability is outstanding. Each plugin can be separated from the ByteX host, working as a transform independently.

Structure

structure

TransformEngine

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 common module and focusing on bytecode operation.

Quick Start

Add 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

抖音 tiktok 今日头条
抖音 Tik Tok 今日头条
火山小视频 lark 多闪
火山小视频 飞书 多闪
FaceU 轻颜 飞聊
FaceU激萌 轻颜 飞聊

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:

  • Performance optimization(SPI...)
  • Optimize apk size(xxx-inline...)
  • Fix Bug
  • Code analysis / security scan
  • AOP(replace SharedPreferences...)
  • and so on

Contribution

If 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.

Thanks

Contact us

If you have any question or advice about ByteX, feel free to join our WeChat group.

WeChat Group

Besides, sending email to [email protected] or [email protected] is also available for you.

Change Log

Change Log

License

Apache 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].