字节码插装:该流程将字节码注入到应用程序类中。
Bytecode instrumentation: This is the process of injecting bytecode into the application classes.
在本文的第1部分中,我只讨论基于源代码的插装;您将在第2部分中了解更多关于截取、字节码插装和类包装的信息。
Here in Part 1, I address only source code based instrumentation; you'll read more about interception, bytecode instrumentation, and class wrapping in Part 2.
然后transform方法实现各种修改,并返回一个包含修改的(或插装的)类的字节码的新字节数组。
The transform method can then implement all manner of modifications, and it returns a new byte array containing the bytecode of the modified (or instrumented) class.
应用推荐