-
公开(公告)号:US20250013558A1
公开(公告)日:2025-01-09
申请号:US18762525
申请日:2024-07-02
Applicant: Lemon Inc.
Inventor: Junyu YUE
IPC: G06F11/36
Abstract: The disclosure provides a method, apparatus, device, and medium for modifying a bytecode. The detailed description of the method includes: searching for a bytecode to be tested based on a predetermined annotation and determining a depended object category and a depending object category for dependency injection therefrom; and generating a supplementary bytecode based on the depended object category, inserting the supplementary bytecode into a corresponding part of the depending object category in the bytecode to be tested to obtain a target bytecode. With this method, static dependency injection of code can be implemented in the compilation phase with only a few source code modifications, especially without the need to write a large amount of template code, and the success of the code after dependency injection is guaranteed in the software runtime phase.