ASM
1.1、ASM简介
是什么 ?:an all-purpose Java bytecode manipulation and analysis framework focused on performance. It was designed and implemented to be as small and as fast as possible, it is well suited for use in dynamic systems (but can of course be used in a static way too, e.g. in compilers).
开发语言:Java
官方主页:https://asm.ow2.io
源码仓库:https://gitlab.ow2.org/asm/asm

ASM相比其他Java ByteCode操作框架来说,是比较低级的, 因为你必须对Java ByteCode相当了解。但是,它通常是其他Java ByteCode的底层框架。 如果能直接使用它的话,你会对Java有个相当深的认识。

1.2、引用ASM

Gradle Kotlin DSL

implementation("org.ow2.asm:asm:7.1")

Gradle Groovy DSL

implementation 'org.ow2.asm:asm:7.1'
1.3、ASM的使用场景
1.3.1、使用ASM生成class
1.3.2、使用ASM修改class