Client code injection method and system, storage medium, and electronic device

By storing a pre-coded image of the encrypted access address to be injected with the code in the web server, the problem of code leakage in fault detection is solved, achieving higher security and convenience.

CN119363733BActive Publication Date: 2025-12-05NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411360777.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-12-05
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

In existing technologies, the risk of leakage of fault detection code and activation method code is relatively high, resulting in low security of code injection.

Method used

By storing a pre-defined graphic encoding image of the encrypted access address to be injected with code in the web server, and having a second client obtain the encrypted access address through the graphic encoding image, the system can obtain the code to be injected, thus avoiding the direct publication of the encrypted access address and improving security.

Benefits of technology

It effectively avoids the leakage of the storage address of the code to be injected, improves the security and convenience of code injection, and reduces the risk of code leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363733B_ABST
    Figure CN119363733B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of computers, and provides a client code injection method and system, a computer readable storage medium and an electronic device. The method comprises the following steps: a first client uploads to-be-injected code and a preset graphical encoding image corresponding to the to-be-injected code to a network server; the network server receives and stores the to-be-injected code and the preset graphical encoding image corresponding to the to-be-injected code uploaded by the first client; a second client receives the preset graphical encoding image sent by the network server, obtains an encrypted access address of the to-be-injected code according to the preset graphical encoding image, acquires the to-be-injected code from the network server according to the encrypted access address, configures the to-be-injected code as a current execution file of the second client, executes the current execution file in the second client, and realizes injection of the to-be-injected code into the second client. The present scheme can avoid leakage of the to-be-injected code and improve the security of code injection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a client-side code injection method, a client-side code injection system, a computer-readable storage medium, and an electronic device. Background Technology

[0002] Code injection is the process of injecting code with specific functions into an application to achieve those functions, such as fault detection in the application.

[0003] Taking fault detection as an example, the code injection methods in related technologies require the fault detection code and the application client code to be released together, which poses a risk of leakage of the fault detection code. Moreover, code injection requires special operation methods, such as clicking a hidden area of ​​the client a specified number of times to enable the fault detection function. The enabling method code also needs to be written into the client code and released together, which also poses a risk of leakage. The security of code injection is difficult to guarantee.

[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] The purpose of this disclosure is to provide a client-side code injection method and system, a computer-readable storage medium and an electronic device, thereby at least to some extent avoiding code leakage during client-side code injection and improving the security of code injection.

[0006] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.

[0007] According to a first aspect of this disclosure, a client-side code injection method is provided, comprising: a first client uploading code to be injected and a corresponding preset graphic encoding image to a network server, wherein the preset graphic encoding image is used to store an encrypted access address of the code to be injected; the network server receiving the code to be injected and the corresponding preset graphic encoding image uploaded by the first client, and storing the code to be injected and the corresponding preset graphic encoding image in the network server; a second client receiving the preset graphic encoding image sent by the network server, obtaining the encrypted access address of the code to be injected based on the preset graphic encoding image, retrieving the code to be injected from the network server based on the encrypted access address, configuring the code to be injected as the current executable file of the second client, and executing the current executable file in the second client, thereby injecting the code to be injected into the second client.

[0008] Optionally, the code to be injected includes encrypted bytecode to be injected. The generation method of the encrypted bytecode to be injected and the preset graphic encoding image includes: the first client compiles the newly added source code to obtain new bytecode, encrypts the new bytecode to obtain encrypted bytecode to be injected, the newly added source code includes newly added fault detection source code for fault detection of the second client; the first client generates an access address of the encrypted bytecode to be injected according to the information of the network server, encrypts the access address to obtain an encrypted access address, and converts the encrypted access address into the preset graphic encoding image.

[0009] Optionally, the method further includes: the first client obtaining a fault identifier corresponding to the newly added source code; after converting the encrypted access address of the encrypted bytecode to be injected corresponding to the newly added source code into the preset graphic encoding image, configuring the fault identifier as the image identifier of the preset graphic encoding image; and the first client uploading the preset graphic encoding image configured with the image identifier to the network server.

[0010] Optionally, the second client receiving the preset graphic encoded image sent by the network server includes: in response to a failure occurring in the second client, the second client sends a fault identifier corresponding to the fault to the network server; the network server, based on the matching result between the fault identifier and the image identifier of the preset graphic encoded image in the network server, finds the preset graphic encoded image corresponding to the fault identifier in the network server, and sends the preset graphic encoded image corresponding to the fault identifier to the second client; the second client receives the preset graphic encoded image corresponding to the fault identifier sent by the network server.

[0011] Optionally, the second client obtains the code to be injected from the network server based on the encrypted access address by: the second client decrypting the encrypted access address according to a first preset decryption rule pre-configured in the second client to obtain the decrypted access address of the code to be injected, and obtaining the code to be injected from the network server based on the decrypted access address.

[0012] Optionally, the second client obtains the code to be injected from the network server based on the decrypted access address by: the second client generating an access request to the network server based on the decrypted access address and the second client's Internet Protocol address; the second client sending the access request to the network server through the network server's access interface to access the network server; after receiving the access request from the second client, the network server verifies the Internet Protocol address in the access request, and if the verification is successful, reads the code to be injected from the network server based on the decrypted access address in the access request, and sends the read code to be injected to the second client; the second client receives the code to be injected sent by the network server.

[0013] Optionally, the code to be injected includes encrypted bytecode to be injected; configuring the code to be injected as the current executable file of the second client includes: the second client decrypting the encrypted bytecode to be injected according to a second preset decryption rule pre-configured in the second client to obtain decrypted bytecode to be injected, and configuring the decrypted bytecode to be injected as the current executable file of the second client.

[0014] According to a second aspect of this disclosure, a client-side code injection system is provided, comprising: a first client configured to upload code to be injected and a corresponding preset graphic encoding image to a network server, the preset graphic encoding image being used to store an encrypted access address of the code to be injected; a network server configured to receive the code to be injected and the corresponding preset graphic encoding image uploaded by the first client, and to store the code to be injected and the corresponding preset graphic encoding image in the network server; and a second client configured to receive the preset graphic encoding image sent by the network server, obtain the encrypted access address of the code to be injected based on the preset graphic encoding image, retrieve the code to be injected from the network server based on the encrypted access address, configure the code to be injected as the current executable file of the second client, and execute the current executable file in the second client, thereby injecting the code to be injected into the second client.

[0015] According to a third aspect of this disclosure, a computer program product containing instructions is provided that, when run on a computer, causes the computer to perform the steps of the client code injection method as described in the first aspect.

[0016] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the client code injection method as described in the first aspect of the above embodiments.

[0017] According to a fifth aspect of the present disclosure, an electronic device is provided, including: a processor; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the client code injection method as described in the first aspect of the above embodiments.

[0018] As can be seen from the above technical solutions, the client code injection method, client code injection system, and computer-readable storage medium, computer program product, and electronic device implementing the client code injection method in the exemplary embodiments of this disclosure have at least the following advantages and positive effects:

[0019] In some embodiments of this disclosure, a first client generates the code to be injected and a preset graphic encoding image for storing the encrypted access address of the code to be injected. The code to be injected and the preset graphic encoding image are then stored on a web server. A second client can obtain the encrypted access address of the code to be injected through the preset graphic encoding image, and then retrieve the code to be injected from the web server based on the encrypted access address. The code to be injected is then configured as the current executable file of the second client to inject the code into the second client. Compared with related technologies, this disclosure, on the one hand, stores the encrypted access address of the code to be injected in a preset graphic encoding image and uploads it to a web server, avoiding the direct publication of the encrypted access address. Furthermore, only the encrypted access address of the code to be injected can be obtained through the graphic encoding image, not the actual storage address, thus preventing leakage of the actual storage address and improving the security of code injection. On the other hand, this disclosure achieves client-side code injection simply by disseminating the graphic encoding image, improving the convenience and efficiency of code injection.

[0020] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0022] Figure 1 A schematic diagram of an exemplary system architecture to which embodiments of the present disclosure may be applied is shown;

[0023] Figure 2 A flowchart illustrating a client-side code injection method according to an exemplary embodiment of this disclosure is shown.

[0024] Figure 3 This diagram illustrates a flowchart of a method for a first client to generate encrypted bytecode to be injected and a preset graphic encoded image, according to an exemplary embodiment of this disclosure.

[0025] Figure 4 A flowchart illustrating a method for a second client to receive a preset graphic encoded image according to an exemplary embodiment of the present disclosure is shown.

[0026] Figure 5 This illustration shows a flowchart of a method for a second client to obtain code to be injected based on a decrypted access address, according to an exemplary embodiment of this disclosure.

[0027] Figure 6 This diagram illustrates the structure of a client-side code injection system according to an exemplary embodiment of the present disclosure.

[0028] Figure 7 This diagram illustrates the composition of another client-side code injection system according to an exemplary embodiment of this disclosure.

[0029] Figure 8 A schematic diagram of the structure of an electronic device in an exemplary embodiment of this disclosure is shown. Detailed Implementation

[0030] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0031] The terms “a,” “an,” “the,” and “the” are used in this specification to indicate the presence of one or more elements / components / etc.; the terms “including” and “having” are used to indicate an open-ended inclusion and to mean that there may be other elements / components / etc. in addition to the listed elements / components / etc.; the terms “first” and “second” are used only as markings and are not a limitation on the number of objects.

[0032] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0033] Client-side code injection can detect client-side faults. Taking client-side fault detection as an example, related technologies require that the fault detection code and the client-side code be released together. At the same time, the code for enabling the fault detection function also needs to be released together with the client-side code. This poses a risk of leakage of the fault detection code and the enabling code, resulting in low security for code injection.

[0034] Based on this, this disclosure considers storing the encrypted access address corresponding to the code to be injected using a preset image encoding, and uploading the preset image encoding to a web server. The client requiring code injection can obtain the preset image encoding from the web server, thereby obtaining the encrypted access address of the code to be injected, and then decrypt it to obtain the code to be injected, thus achieving client-side code injection. This avoids the code to be injected being published along with the client-side code, and also avoids the leakage of the storage address of the code to be injected, improving the security of code injection.

[0035] First, this disclosure provides a client-side code injection method, which can be applied to... Figure 1 In the system architecture of the exemplary application environment shown.

[0036] like Figure 1As shown, the system architecture 100 may include a terminal device 110 and a server 120. The terminal device 110 may be a smartphone, tablet, desktop computer, laptop, smart wearable device, or other similar device. The server 120 generally refers to the backend system providing services related to the client-side code injection method in this exemplary embodiment, and may be a single server or a cluster of multiple servers. The terminal 110 and the server 120 can be connected via a wired or wireless communication link for data interaction.

[0037] In one exemplary embodiment, the steps of the method executed by the second client in the above-described client code injection method can be performed by the terminal device 110. For example, when a user is using a client application in the terminal 110, the client application in the terminal device 110 can receive a preset graphic encoded image sent by the server 120, and then obtain the encrypted access address of the code to be injected. The terminal device 110 decrypts the encrypted access address according to the first preset decryption rule in the client application to obtain the real access address, then accesses the real access address to obtain the code to be injected, and configures the code to be injected as the currently executed file in the terminal device 110, thereby injecting the code to be injected into the client application in the terminal device 110.

[0038] It should be understood that Figure 1 The number of terminal devices and servers shown is merely illustrative. Depending on implementation needs, there can be any number of terminal devices and servers. For example, server 120 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0039] Figure 2 This diagram illustrates a flowchart of a client-side code injection method according to an exemplary embodiment of this disclosure. (See reference...) Figure 2 The method includes:

[0040] Step S210: The first client uploads the code to be injected and the corresponding preset graphic encoding image to the network server. The preset graphic encoding image is used to store the encrypted access address of the code to be injected.

[0041] Step S220: The network server receives the code to be injected and the preset graphic encoding image corresponding to the code to be injected uploaded by the first client, and stores the code to be injected and the preset graphic encoding image corresponding to the code to be injected in the network server.

[0042] In step S230, the second client receives a preset graphic encoding image sent by the network server, obtains the encrypted access address of the code to be injected based on the preset graphic encoding image, retrieves the code to be injected from the network server based on the encrypted access address, configures the code to be injected as the current executable file of the second client, and executes the current executable file in the second client to inject the code to be injected into the second client.

[0043] exist Figure 2 In the technical solution provided by the illustrated embodiment, the code to be injected and a preset graphic encoding image for storing the encrypted access address of the code to be injected are generated in the first client. Then, the code to be injected and the preset graphic encoding image are stored through a network server. The second client can obtain the encrypted access address of the code to be injected through the preset graphic encoding image, thereby obtaining the code to be injected from the network server based on the encrypted access address, and configuring the code to be injected as the current executable file of the second client to inject the code into the second client. Compared with related technologies, on the one hand, this disclosure stores the encrypted access address of the code to be injected in a preset graphic encoding image and uploads it to a network server, avoiding the direct publication of the encrypted access address. Furthermore, only the encrypted access address of the code to be injected can be obtained through the graphic encoding image, not the actual storage address of the code to be injected, thus preventing the leakage of the actual storage address of the code to be injected and improving the security of code injection. On the other hand, this disclosure can achieve client-side code injection by disseminating the graphic encoding image, improving the convenience and efficiency of code injection.

[0044] The appendix to this specification will now be described in conjunction with specific embodiments. Figure 2 The steps in the process will be explained.

[0045] First, the specific implementation method of step S210, in which the first client uploads the code to be injected and the preset graphic encoding image corresponding to the code to be injected to the network server, will be described.

[0046] In one exemplary implementation, a preset graphic encoding image is used to store the encrypted access address of the code to be injected. The first client in step S210 may include the client of the R&D personnel, and the network server in step S210 may include an intranet server.

[0047] For example, after the developers have completed writing the code to be injected and generated the corresponding preset graphic encoding image, they can upload the code and the corresponding preset graphic encoding image to the internal network server. The external network server can then access the internal network server using VPN (Virtual Private Network) technology.

[0048] An internal network refers to a computer network established within a relatively limited geographical area (such as a home, office, or school). It connects all computers and network devices within the local area, forming a closed and controlled network environment. An external network refers to a widely covered network, such as the Internet, which connects computers and network devices globally, allowing different internal networks to communicate through a public network.

[0049] In one exemplary embodiment, the code to be injected and the corresponding preset graphic encoding image can be uploaded to the same web server or to different web servers. This exemplary embodiment does not impose any special limitations on this.

[0050] In one exemplary implementation, the code to be injected includes encrypted bytecode to be injected. Based on this, exemplaryly, Figure 3 This diagram illustrates a flowchart of a method for a first client to generate encrypted bytecode to be injected and a preset graphic encoded image, according to an exemplary embodiment of this disclosure. (See reference...) Figure 3 The method may include steps S310 to S320. Wherein:

[0051] In step S310, the first client compiles the newly added source code to obtain new bytecode, and encrypts the new bytecode to obtain encrypted bytecode to be injected.

[0052] In one exemplary implementation, the added source code includes new fault detection source code for fault detection of the second client.

[0053] The second client can include any client application, such as a game client application, a music client application, a video playback client application, etc., and this exemplary embodiment does not impose any special limitations on it.

[0054] For example, developers can generate new source code in the first client at any time. For instance, they can generate environment detection source code for the second client based on requirements, then use this as new source code, compile it to obtain new bytecode, and then encrypt the new bytecode according to a second preset encryption rule to obtain encrypted bytecode to be injected. In other words, the code to be injected in this disclosure can include encrypted bytecode to be injected.

[0055] In step S320, the first client generates the access address of the encrypted bytecode to be injected based on the information of the network server, encrypts the access address to obtain an encrypted access address, and converts the encrypted access address into the preset graphic encoding image.

[0056] For example, the first client can generate an access address for the encrypted bytecode to be injected based on information such as the IP address and port of the web server storing the encrypted bytecode. Then, the access address is encrypted according to a first preset encryption rule to obtain an encrypted access address. A preset graphic encoding image corresponding to this encrypted access address is then generated using a graphic encoding image generation tool.

[0057] For example, the client code injection method in this disclosure may further include: a first client obtaining a fault identifier corresponding to the newly added source code; after converting the encrypted access address of the encrypted bytecode to be injected corresponding to the newly added source code into the preset graphic encoding image, configuring the fault identifier as an image identifier of the preset graphic encoding image; and the first client uploading the preset graphic encoding image configured with the image identifier to a network server.

[0058] For example, the name of the fault that the fault detection code is to detect can be used as the fault identifier corresponding to the newly added source code. If the fault detection code is for runtime environment fault detection, then the fault identifier can be runtime environment fault detection. After the first client converts the encrypted access address of the encrypted bytecode to be injected corresponding to the newly added source code into a preset graphic encoding image, it can obtain the fault identifier corresponding to the newly added source code. Then, it configures the image identifier of the preset graphic encoding image as the fault identifier and uploads the preset graphic encoding image with the image identifier to the first server. In this way, the network server stores the preset graphic encoding images corresponding to the encrypted access addresses of different fault detection codes.

[0059] In one optional implementation, the code to be injected may include any one of the following: source code to be injected, bytecode to be injected, or encrypted source code to be injected. This exemplary implementation does not impose any special limitations on this. The source code is an uncompiled text file written according to a certain programming language specification, while the bytecode is a binary instruction file obtained by compiling the source code.

[0060] In one exemplary implementation, the code to be injected includes fault detection code for detecting faults in the second client. For example, the code to be injected may be fault detection source code, bytecode corresponding to the fault detection source code, encrypted fault detection source code, encrypted bytecode corresponding to the fault detection source code, etc.

[0061] Based on this, the preset graphic encoding image can be used to store the encrypted access address of the source code to be injected, the encrypted access address of the bytecode to be injected, the encrypted access address of the encrypted source code to be injected, and the encrypted access address of the encrypted bytecode to be injected.

[0062] In one exemplary embodiment, the preset graphic encoding image may include barcodes, QR codes, etc., and this exemplary embodiment does not impose any special limitations on it.

[0063] The following describes a specific implementation of step S220, in which the network server receives the code to be injected and the preset graphic encoding image corresponding to the code to be injected uploaded by the first client, and stores the code to be injected and the preset graphic encoding image corresponding to the code to be injected in the network server.

[0064] In one exemplary implementation, the web server can be implemented based on the Flask framework and deployed via uWSGI. The web server needs to provide a code access interface for the second client to obtain the code to be injected. The access interface can parse the storage path of the code to be injected based on the address requested by the client, and read the contents of the code file to be injected and return it to the second client.

[0065] uWSGI (Micro Web Server Gateway Interface) is a server software primarily used for deploying Python applications. It supports the WSGI standard, making it compatible with various Python web frameworks such as Django and Flask. uWSGI supports not only Python (a programming language) but also multiple other programming languages ​​and protocols.

[0066] Taking the following example: the code to be injected is encrypted bytecode, the code to be injected is uploaded to a second network server, and the corresponding preset graphic encoding image is uploaded to a first network server. After writing source code with certain functions according to actual needs, the source code can be compiled using a code compiler to obtain the corresponding bytecode. This bytecode is then encrypted according to a second preset encryption rule, resulting in encrypted bytecode, which is saved as an encrypted bytecode file and uploaded to the second network server. Upon receiving the encrypted bytecode file, the second network server can store it. Simultaneously, the first client can obtain the storage address of the encrypted bytecode file based on its storage path on the second network server, such as "https: / / server address:server port / encrypted bytecode filename". Then, the storage address of the encrypted bytecode file is encrypted according to the first preset encryption rule to obtain the encrypted access address of the encrypted bytecode file, such as "code: / / server address server port bytecode filename". Finally, a graphic encoding image of the encrypted access address of the encrypted bytecode file is generated using a graphic encoding image generation tool. Next, an image identifier is configured for the graphic encoded image. This image identifier can be the filename of the encrypted bytecode file or the function name of the corresponding source code of the encrypted bytecode file. The graphic encoded image with the configured image identifier is then uploaded to the first network server. Upon receiving the graphic encoded image with the configured image identifier, the first network server can store it. In subsequent steps, the corresponding graphic encoded image can be located on the first network server using the image identifier.

[0067] In one exemplary implementation, both the first network server and the second network server can be HTTP (Hypertext Transfer Protocol) servers. That is, the code to be injected and the preset graphic encoding image corresponding to the encrypted access address of the code to be injected can be stored in the HTTP server.

[0068] For example, both the first network server and the second network server can be internal network servers as described above. Since the first network server only stores the preset graphic encoding image corresponding to the encrypted access address of the code to be injected, and the actual code to be injected is stored in the second network server, the first network server can also be an external network server and the second network server can be an internal network server. This exemplary embodiment does not impose any special limitations on this.

[0069] The following describes a specific implementation of step S230, in which the second client receives a preset graphic encoding image sent by the network server, obtains the encrypted access address of the code to be injected based on the preset graphic encoding image, retrieves the code to be injected from the network server based on the encrypted access address, configures the code to be injected as the current executable file of the second client, and executes the current executable file in the second client to inject the code to be injected into the second client.

[0070] For example, Figure 4 This diagram illustrates a flowchart of a method for a second client to receive a preset graphic encoded image, according to an exemplary embodiment of this disclosure. (See reference...) Figure 4 This method is completed through interaction between a second client and a network server, and may include steps S410 to S430. Wherein:

[0071] In step S410, in response to a failure occurring in the second client, the second client sends a fault identifier corresponding to the fault to the network server.

[0072] In one exemplary implementation, when a second client malfunctions, the second client can determine a fault identifier. For example, if the current malfunction of the second client requires runtime environment detection, the second client can send the aforementioned runtime environment fault detection identifier to the network server. For instance, if a user cannot start the game client normally, the game client can send a runtime environment fault detection identifier to the network server.

[0073] In step S420, the network server finds the preset graphic encoding image corresponding to the fault identifier in the network server based on the matching result between the received fault identifier and the image identifier of the preset graphic encoding image in the network server, and sends the preset graphic encoding image corresponding to the fault identifier to the second client.

[0074] As mentioned earlier, the network server stores preset graphic encoded images configured with image identifiers, and these image identifiers are the fault identifiers corresponding to the fault detection codes. In other words, the network server pre-stores graphic encoded images corresponding to the encrypted access addresses of different fault detection codes. For example, graphic encoded image 1 corresponds to encrypted access address 1 for fault detection code 1, and graphic encoded image 2 corresponds to encrypted access address 2 for fault detection code 2, etc.

[0075] For example, after receiving a fault identifier sent by the second client, the network server can match the received fault identifier with the image identifier configured in the preset graphic encoding image stored in the network server, determine the preset graphic encoding image corresponding to the successfully matched image identifier as the preset graphic encoding image corresponding to the fault identifier currently sent by the second client, and then send the preset graphic encoding image to the second client.

[0076] In step S430, the second client receives a preset graphic encoding image corresponding to the fault identifier sent by the network server.

[0077] For example, the second client can receive a preset graphic encoded image sent by the network server, thereby obtaining the preset graphic encoded image corresponding to the encrypted access address of the fault detection code of the current fault of the second client.

[0078] In one optional implementation, preset graphic encoded images corresponding to the encrypted access addresses of fault detection codes for different versions of the second client can be stored in a network server. In this case, the image identifier of the preset graphic encoded image in the network server can be determined based on the client version and the fault identifier. For example, the image identifier of the preset graphic encoded image corresponding to the encrypted access address of the fault detection code can be obtained by concatenating the second client version and the fault identifier of the fault detection code. Thus, when the second client malfunctions, it can send its version and fault identifier to the network server. The network server can then concatenate the received second client version and fault identifier to obtain a matching identifier, and match this identifier with the image identifier of the preset graphic encoded image stored in the network server. Based on the matching result, the corresponding preset graphic encoded image is obtained.

[0079] In another exemplary implementation, when a client malfunctions, a fault detection prompt message can be sent to the second client first to remind the user of the second client whether to confirm enabling fault detection for the client. In response to the user confirming the activation of the fault detection function for the client, the second client version and fault identifier are sent to the network server, and then the preset graphic encoding image corresponding to the client version and fault identifier sent by the network server is received.

[0080] Through steps S410 to S430 above, the second client can obtain the preset graphic encoding image corresponding to the encrypted access address of the fault detection code corresponding to the current fault when a fault occurs. In this way, the fault detection code does not need to be published with the client code of the second client, thereby ensuring the security of the fault detection code.

[0081] In one exemplary implementation, the second client may include a test client, and the code to be injected may include second client test code, which is then encrypted. Thus, during second client testing, preset graphic encoding images corresponding to different second client test codes can be published to the corresponding test clients via an internal network, thereby achieving code injection into the test clients and improving testing efficiency.

[0082] In another exemplary embodiment, the network server may also send a corresponding preset graphic encoding image to the second client according to other requirements, so that the second client can obtain the corresponding code to be injected through the preset graphic encoding image. This exemplary embodiment does not impose any special limitations on this.

[0083] For example, the second client obtains the code to be injected from the network server based on the encrypted access address in the following manner: the second client decrypts the encrypted access address according to a first preset decryption rule pre-configured in the second client to obtain the decrypted access address of the code to be injected, and obtains the code to be injected from the network server based on the decrypted access address.

[0084] For example, a first preset decryption rule can be pre-configured in the client for decrypting encrypted access addresses. This first preset decryption rule corresponds to the first preset encryption rule described above. The first preset decryption rule is used to decrypt the data encrypted by the first preset encryption rule.

[0085] After receiving the preset graphic encoded image from the network server, the second client can scan the image to obtain the encrypted access address stored within it. Then, it decrypts the scanned encrypted access address according to a first preset decryption rule in the second client, obtaining the decrypted access address for the injected code. Finally, it retrieves the injected code from the network server based on the decrypted access address.

[0086] For example, Figure 5 This diagram illustrates a flowchart of a method for a second client to obtain code to be injected based on a decrypted access address, according to an exemplary embodiment of this disclosure. (See reference...) Figure 5 The method may include steps S510 to S540.

[0087] In step S510, the second client generates an access request to the network server based on the decrypted access address and the Internet Protocol address of the second client.

[0088] For example, after the second client decrypts the encrypted access address of the code to be injected, it can generate an access request to the web server based on the decrypted access address obtained after encryption and the Internet Protocol address (IP) address of the second client.

[0089] In step S520, the second client sends the access request to the network server through the network server's access interface to access the network server.

[0090] The second client can send the access request generated in step S510 to the network server through the network server's access interface.

[0091] In step S530, after receiving the access request from the second client, the network server verifies the Internet Protocol address in the access request. If the verification is successful, the network server reads the code to be injected from the network server according to the decryption access address in the access request and sends the read code to be injected to the second client.

[0092] For example, after receiving an access request from a second client, the web server can parse the request to obtain the Internet Protocol address (IPA) and the decrypted access address. Then, the web server can verify the IPA. If the verification is successful, it can parse the decrypted access address to obtain the storage path of the code to be injected on the web server. Finally, it can read the code to be injected from the web server according to the storage path and send it to the second client.

[0093] For example, if the web server fails to verify the Internet Protocol address in the access request, it can send a security warning to the client, indicating that the client was unable to perform code injection due to a security issue with the Internet Protocol address.

[0094] In one exemplary implementation, the method by which the network server verifies the Internet Protocol address in the access request includes: the network server matching the Internet Protocol address in the access request with a secure Internet Protocol address pre-stored in the network server; if the match is successful, the Internet Protocol address in the access request is determined to have passed the verification; if the match fails, the Internet Protocol address in the access request is determined to have failed the verification.

[0095] In one exemplary implementation, when the second client sends a fault identifier to the network server, it can also simultaneously send its Internet Protocol address (IPA) to the network server. The network server then verifies the IPA of the second client. If the verification is successful, the network server then sends the corresponding preset graphic encoding image to the second client. This can also prevent the leakage of the IPA of the code to be injected, thereby improving the security of code injection.

[0096] In step S540, the second client receives the code to be injected from the network server.

[0097] For example, the second client can receive the code to be injected from the web server, and then inject the code into the second client in subsequent steps.

[0098] Through the above steps S510 to S540, the client fault detection code can be injected quickly using a preset graphic encoding image, thereby realizing client fault detection, improving the efficiency of client fault detection, and ensuring the security of client fault detection without causing leakage of client fault detection code.

[0099] Of course, the network server can also send a preset graphic encoding image to the second client in other ways so that the second client can obtain the corresponding preset graphic encoding image. This exemplary embodiment does not impose any special limitations on this. For example, when performing code testing, a preset graphic encoding image corresponding to the encrypted access address of the test code can be sent to the test client at fixed times as needed to achieve convenient and secure injection of the test code and improve the security of code testing.

[0100] In one exemplary implementation, as described above, the code to be injected includes encrypted bytecode to be injected. Based on this, configuring the code to be injected as the current executable file of the second client includes: the second client decrypting the encrypted bytecode to be injected according to a second preset decryption rule pre-configured in the second client to obtain decrypted bytecode to be injected, and configuring the decrypted bytecode to be injected as the current executable file of the second client.

[0101] In another exemplary implementation, as described above, the code to be injected includes encrypted source code to be injected. The second client can also decrypt the obtained encrypted source code to be injected according to the second preset decryption rule to obtain the decrypted source code to be injected, and configure the decrypted source code to be injected as the current executable file of the second client.

[0102] For example, the second client can be pre-configured with a second preset decryption rule, which corresponds to the second preset encryption rule mentioned above. This second preset decryption rule is used to decrypt data encrypted by the first preset encryption rule. Based on the second preset decryption rule, the encrypted code to be injected sent by the network server can be decrypted to obtain the decrypted code to be injected. This decrypted code is then configured as the current executable file of the second client, causing the second client to execute the code to be injected, thereby injecting the code into the second client and enabling fault detection on the second client.

[0103] The first preset decryption rule, the first preset encryption rule, the second preset decryption rule, and the second preset encryption rule can all be customized according to requirements, and this exemplary embodiment does not impose any special limitations on them.

[0104] In one exemplary application scenario, after receiving a preset graphic encoded image, the second client can display the preset graphic encoded image in its graphical user interface and prompt the user to scan the preset graphic encoded image using the second client for client fault detection. After the user triggers the scanning function for the preset graphic encoded image, fault detection code can be injected into the second client according to the client code injection method described in this disclosure to perform fault detection on the second client. The fault detection results can then be displayed on the second client to prompt the user to modify the second client configuration and other information based on the fault detection results to repair the fault.

[0105] In this disclosure, as previously stated, the code to be injected can be bytecode. By injecting the bytecode to be injected into the client, the direct leakage of the source code can be avoided, thereby improving the security of the source code.

[0106] In this disclosure, as mentioned above, the source code can also be encrypted before being released. The source code needs to be decrypted before injection can be performed, which can improve the security of the source code.

[0107] In this disclosure, when the code to be injected is bytecode, it can be encrypted before release. Users obtain the encrypted bytecode via the encrypted access address. The encrypted bytecode must be decrypted according to the second preset decryption rule built into the second client before code injection can be achieved. This prevents the leakage of the bytecode and source code, as well as the leakage of their access addresses, thus improving code injection security. Furthermore, the entire process does not require downloading or installing any code programs, further enhancing code security.

[0108] For example, Figure 6 This diagram illustrates the structure of a client-side code injection system according to an exemplary embodiment of this disclosure. (Reference) Figure 6 The system may include a code server 61 and a second client 62. In an alternative implementation, the code server 61 may include the aforementioned internal network server. An internal network server can be understood as a computer set up within an organization or enterprise for storing, processing, and sharing data.

[0109] Taking the injected code as encrypted bytecode as an example, the encrypted bytecode can be understood as the encrypted bytecode mentioned above. After implementing the source code to be injected and saving it to a source code file, the developer can compile the source code file using a code compiler to obtain bytecode, then encrypt the bytecode to obtain the injected bytecode, and save the injected bytecode to an encrypted bytecode file. Then, based on the desired storage location, an access address for the encrypted bytecode file is generated. This access address can be the storage path of the encrypted bytecode file on the code server 61. This access address is then encrypted to obtain an encrypted access address. A graphic encoding generation tool, such as qrcode (Quick Response code, a method of encoding QR codes), is then used to convert the encrypted access address into a preset graphic encoding image. Finally, the encrypted bytecode file and its encrypted access address are uploaded to the code server 61 to realize the release of the injected code.

[0110] As mentioned earlier, the code server 61 can be an HTTP server. The HTTP server can provide a code access interface for the second client to obtain the preset graphic encoding image corresponding to the encrypted access address of the bytecode to be injected, as well as the bytecode itself. For example, the access interface can find the corresponding preset graphic encoding image based on the image identifier in the access request, such as a fault identifier, and return it to the client. The access interface can also parse the storage path of the bytecode to be injected in the HTTP server based on the access address in the access request, then read the content of the bytecode file to be injected based on the parsed storage path, and return this content to the second client 62 to achieve client-side code injection.

[0111] The second client 62 can scan a preset graphic encoded image using its operating system's API (Application Programming Interface). The second client 62 can scan the preset graphic encoded image at runtime to obtain the encrypted access address of the bytecode to be injected, and then decrypt the encrypted access address to obtain the access address of the bytecode to be injected. Based on this access address, it generates an access request to the code server 61 and accesses the code server 61. The code server 61, upon receiving the access request, searches for the requested bytecode to be injected in its stored code and sends it to the second client 62. The second client 62 can decrypt the received bytecode and configure it as the current executable file, enabling the second client to execute the bytecode and inject it into the second client.

[0112] In this disclosure, the access address of the code to be injected is stored using graphical encoding. The corresponding code is accessed by scanning and then sent to a second client for execution. The code to be injected is stored on an internal network server, and its encrypted access address is stored using graphical encoding. The second client does not store any code or address; it only parses and accesses the address indicated by the graphically encoded image. The second client only needs to parse the address from the graphical encoding information, access the code service, obtain the code content, and configure it as the current executable file for the second client to achieve code injection. Because the code server is an internal network server, inaccessible from the external network, the code injection method is simple, fast, secure, and easy to spread internally. No special operations are required from the client, such as clicking a specified number of times in a hidden area of ​​the client to activate the code injection function, thus improving the convenience of code injection and enhancing the user experience.

[0113] Furthermore, it should be noted that the above figures are merely illustrative representations of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0114] Furthermore, exemplary embodiments of this disclosure also provide another client-side code injection system. (See references) Figure 7As shown, the client-side code injection system 700 may include: a first client 710, configured to upload the code to be injected and a corresponding preset graphic encoding image to a network server, wherein the preset graphic encoding image is used to store the encrypted access address of the code to be injected; a network server 720, configured to receive the code to be injected and the corresponding preset graphic encoding image uploaded by the first client, and store the code to be injected and the corresponding preset graphic encoding image in the network server; and a second client 730, configured to receive the preset graphic encoding image sent by the network server, obtain the encrypted access address of the code to be injected based on the preset graphic encoding image, retrieve the code to be injected from the network server based on the encrypted access address, configure the code to be injected as the current executable file of the second client, execute the current executable file in the second client, and realize the injection of the code to be injected into the second client.

[0115] In one exemplary embodiment, the code to be injected includes encrypted bytecode to be injected. The generation method of the encrypted bytecode to be injected and the preset graphic encoding image includes: a first client compiles the newly added source code to obtain new bytecode, encrypts the new bytecode to obtain encrypted bytecode to be injected, the newly added source code includes newly added fault detection source code for fault detection of the second client; the first client generates an access address of the encrypted bytecode to be injected based on the information of the network server, encrypts the access address to obtain an encrypted access address, and converts the encrypted access address into the preset graphic encoding image.

[0116] In one exemplary embodiment, the system further includes an image identifier configuration module, which can be configured as follows: the first client obtains the fault identifier corresponding to the newly added source code, and after converting the encrypted access address of the encrypted bytecode to be injected corresponding to the newly added source code into the preset graphic encoding image, configures the fault identifier as the image identifier of the preset graphic encoding image; the first client uploads the preset graphic encoding image configured with the image identifier to the network server.

[0117] In one exemplary embodiment, the second client receiving the preset graphic encoded image sent by the network server includes: the second client, in response to a fault occurring in the second client, sending a fault identifier corresponding to the fault to the network server; the network server, based on the matching result between the received fault identifier and the image identifier of the preset graphic encoded image in the network server, finding the preset graphic encoded image corresponding to the fault identifier in the network server, and sending the preset graphic encoded image corresponding to the fault identifier to the second client; and the second client receiving the preset graphic encoded image corresponding to the fault identifier sent by the network server.

[0118] In one exemplary implementation, the method by which the second client obtains the code to be injected from the network server based on the encrypted access address includes: the second client decrypting the encrypted access address according to a first preset decryption rule pre-configured in the second client to obtain the decrypted access address of the code to be injected, and obtaining the code to be injected from the network server based on the decrypted access address.

[0119] In one exemplary implementation, the method by which the second client obtains the code to be injected from the network server based on the decrypted access address includes: the second client generating an access request to the network server based on the decrypted access address and the second client's Internet Protocol address; the second client sending the access request to the network server through the network server's access interface to access the network server; after receiving the access request from the second client, the network server verifies the Internet Protocol address in the access request, and if the verification is successful, reads the code to be injected from the network server based on the decrypted access address in the access request, and sends the read code to be injected to the second client; the second client receiving the code to be injected sent by the network server.

[0120] In one exemplary implementation, the code to be injected includes encrypted bytecode to be injected; configuring the code to be injected as the current executable file of the second client includes: the second client decrypting the encrypted bytecode to be injected according to a second preset decryption rule pre-configured in the second client to obtain decrypted bytecode to be injected, and configuring the decrypted bytecode to be injected as the current executable file of the second client.

[0121] The specific details of each part of the above system have been described in detail in the implementation method section. For any undisclosed details, please refer to the implementation method section, and therefore will not be repeated here.

[0122] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0123] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0124] Exemplary embodiments of this disclosure also provide a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the client-side code injection method described above.

[0125] In one embodiment, the computer program product can be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The readable storage medium can be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory, hard disk drive (HDD), solid-state drive (SSD), etc. For example, the computer program product can be implemented as a non-volatile storage medium storing the computer program, such as read-only memory, NAND flash memory, etc.

[0126] In one implementation, the computer program product can be an intangible product containing a computer program. For example, the computer program product can be implemented as a virtual digital product, such as an executable file, installation package, or other digital file storing the computer program.

[0127] Computer program code can be written in one or more programming languages. Examples of programming languages ​​include C, Java, C++, and Python. Program code can execute entirely on the user's computing device, partially on the user's computing device, or as a standalone software package. It can also execute partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via an internet connection provided by a mobile network operator).

[0128] Computer programs can be carried or transmitted via signals such as electricity, magnetism, light, electromagnetic waves, and infrared radiation. Electronic devices can convert the signals carrying computer programs into digital signals, thereby enabling the computer programs to run. When a computer program runs on an electronic device, its code causes the electronic device to execute (more specifically, the processor of the electronic device to execute) the method steps of various exemplary embodiments of this disclosure, such as the client code injection method described above, which includes the following steps: a first client uploads the code to be injected and a preset graphic encoding image corresponding to the code to be injected to a network server, the preset graphic encoding image being used to store the encrypted access address of the code to be injected; the network server receives the code to be injected and the preset graphic encoding image corresponding to the code to be injected uploaded by the first client, and stores the code to be injected and the preset graphic encoding image corresponding to the code to be injected in the network server; a second client receives the preset graphic encoding image sent by the network server, obtains the encrypted access address of the code to be injected based on the preset graphic encoding image, retrieves the code to be injected from the network server based on the encrypted access address, configures the code to be injected as the current executable file of the second client, executes the current executable file in the second client, and realizes the injection of the code to be injected into the second client.

[0129] By executing the above method steps through a computer program, on the one hand, by storing the encrypted access address of the code to be injected in a preset graphic encoding image and uploading it to a web server, the direct publication of the encrypted access address is avoided. Furthermore, since only the encrypted access address of the code to be injected can be obtained through the graphic encoding image, and the actual access address cannot be directly obtained, the leakage of the actual storage address of the code to be injected can be prevented, thus improving the security of code injection. On the other hand, client-side code injection can be achieved by disseminating the graphic encoding image, improving the convenience and efficiency of code injection.

[0130] Exemplary embodiments of this disclosure also provide an electronic device, such as the terminal device 110 or server 120 described above. The electronic device may include a processor and a memory. The memory stores executable instructions for the processor, such as computer programs. The processor executes these executable instructions to perform the method steps of various exemplary embodiments of this disclosure. Furthermore, the electronic device may also include a display for displaying a graphical user interface.

[0131] The following is for reference. Figure 8 The electronic device is illustrated by way of a general-purpose computing device. It should be understood that... Figure 8 The electronic device 800 shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0132] like Figure 8 As shown, the electronic device 800 may include: a processor 810, a memory 820, a bus 830, an I / O (input / output) interface 840, a network adapter 850, and a display 860.

[0133] Memory 820 may include volatile memory, such as RAM 821 and cache unit 822, and may also include non-volatile memory, such as ROM 823. Memory 820 may also include one or more program modules 824, such program modules 824 including, but not limited to: operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. For example, program module 824 may include various modules in the above-described system.

[0134] The processor 810 may include one or more processing units, such as an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or an NPU (Neural-Network Processing Unit).

[0135] The processor 810 can be used to execute executable instructions stored in the memory 820, such as the client code injection method described above, which includes the following steps: a first client uploads the code to be injected and a corresponding preset graphic encoding image to a network server, wherein the preset graphic encoding image is used to store the encrypted access address of the code to be injected; the network server receives the code to be injected and the corresponding preset graphic encoding image uploaded by the first client, and stores the code to be injected and the corresponding preset graphic encoding image in the network server; a second client receives the preset graphic encoding image sent by the network server, obtains the encrypted access address of the code to be injected based on the preset graphic encoding image, retrieves the code to be injected from the network server based on the encrypted access address, configures the code to be injected as the current executable file of the second client, executes the current executable file in the second client, and realizes the injection of the code to be injected into the second client.

[0136] Implementing the above method through a computer program offers several advantages. Firstly, by storing the encrypted access address of the code to be injected within a pre-defined image encoding and uploading it to a web server, the direct publication of the encrypted access address is avoided. Furthermore, since the image encoding only provides the encrypted access address of the code to be injected, not its actual access address, the leakage of the code's true storage address is prevented, thus enhancing the security of code injection. Secondly, client-side code injection can be achieved simply by disseminating the image encoding, improving the convenience and efficiency of code injection.

[0137] Bus 830 is used to connect different components of electronic device 800 and may include data bus, address bus and control bus.

[0138] Electronic device 800 can communicate with one or more external devices 900 (such as keyboard, mouse, external controller, etc.) through I / O interface 840.

[0139] Electronic device 800 can communicate with one or more networks via network adapter 850. For example, network adapter 850 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. Network adapter 850 can communicate with other modules of electronic device 800 via bus 830.

[0140] Electronic device 800 can display a graphical user interface via display 860, such as displaying a preset graphic encoded image interface.

[0141] although Figure 8As not shown in the diagram, other hardware and / or software modules may also be configured in the electronic device 800, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0142] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0143] As can be seen from the above, the technical solutions disclosed herein can be implemented as methods, systems, computer program products, storage media, electronic devices, etc. Those skilled in the art will understand that various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be referred to as "circuit," "module," or "system," respectively.

[0144] It should be understood that this disclosure is not limited to the specific methods, steps, or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. Those skilled in the art will readily conceive of other embodiments based on the specific implementations provided in this disclosure. Therefore, the specific implementations provided in this disclosure are merely exemplary, and the scope and spirit of this disclosure are indicated by the claims, and should cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary technical means in the art not disclosed in this disclosure.

Claims

1. A client-side code injection method, characterized in that, include: The first client uploads the code to be injected and the corresponding preset graphic encoding image to the network server. The preset graphic encoding image is used to store the encrypted access address of the code to be injected. The network server receives the code to be injected and the preset graphic encoding image corresponding to the code to be injected uploaded by the first client, and stores the code to be injected and the preset graphic encoding image corresponding to the code to be injected in the network server; The second client receives a preset graphic encoding image sent by the network server, obtains the encrypted access address of the code to be injected based on the preset graphic encoding image, retrieves the code to be injected from the network server based on the encrypted access address, configures the code to be injected as the current executable file of the second client, executes the current executable file in the second client, and realizes the injection of the code to be injected into the second client.

2. The client-side code injection method according to claim 1, characterized in that, The code to be injected includes encrypted bytecode to be injected, and the generation methods of the encrypted bytecode to be injected and the preset graphic encoded image include: The first client compiles the newly added source code to obtain new bytecode, and encrypts the new bytecode to obtain encrypted bytecode to be injected. The newly added source code includes newly added fault detection source code for fault detection of the second client. The first client generates the access address of the encrypted bytecode to be injected based on the information of the network server, encrypts the access address to obtain an encrypted access address, and converts the encrypted access address into the preset graphic encoding image.

3. The client-side code injection method according to claim 2, characterized in that, The method further includes: The first client obtains the fault identifier corresponding to the newly added source code, and after converting the encrypted access address of the encrypted bytecode to be injected corresponding to the newly added source code into the preset graphic encoding image, configures the fault identifier as the image identifier of the preset graphic encoding image. The first client uploads the preset graphic-encoded image, which is configured with the image identifier, to the network server.

4. The client-side code injection method according to claim 3, characterized in that, The second client receives a preset graphic encoded image sent by the network server, including: In response to a failure occurring in the second client, the second client sends a fault identifier corresponding to the failure to the network server. The network server, based on the matching result between the received fault identifier and the image identifier of the preset graphic encoding image in the network server, finds the preset graphic encoding image corresponding to the fault identifier in the network server, and sends the preset graphic encoding image corresponding to the fault identifier to the second client. The second client receives a preset graphic encoding image corresponding to the fault identifier sent by the network server.

5. The client-side code injection method according to claim 1, characterized in that, The second client obtains the code to be injected from the network server based on the encrypted access address in the following ways: The second client decrypts the encrypted access address according to the first preset decryption rule pre-configured in the second client to obtain the decrypted access address of the code to be injected, and obtains the code to be injected from the network server according to the decrypted access address.

6. The client-side code injection method according to claim 5, characterized in that, The second client obtains the code to be injected from the network server based on the decryption access address in the following ways: The second client generates an access request to the network server based on the decrypted access address and the second client's Internet Protocol address; The second client sends the access request to the network server through the network server's access interface in order to access the network server through the access request; After receiving the access request from the second client, the network server verifies the Internet Protocol address in the access request. If the verification is successful, the network server reads the code to be injected from the network server according to the decryption access address in the access request and sends the read code to be injected to the second client. The second client receives the code to be injected sent by the network server.

7. The client-side code injection method according to any one of claims 1 to 6, characterized in that, The code to be injected includes encrypted bytecode to be injected; The second client configures the code to be injected as the current executable file of the second client, including: The second client decrypts the encrypted bytecode to be injected according to the second preset decryption rule pre-configured in the second client, and obtains the decrypted bytecode to be injected. The decrypted bytecode to be injected is then configured as the current executable file of the second client.

8. A client-side code injection system, characterized in that, include: The first client is configured to upload the code to be injected and the corresponding preset graphic encoding image to the network server. The preset graphic encoding image is used to store the encrypted access address of the code to be injected. The network server is configured to receive the code to be injected and the preset graphic encoding image corresponding to the code to be injected uploaded by the first client, and to store the code to be injected and the preset graphic encoding image corresponding to the code to be injected in the network server; The second client is configured to receive a preset graphic encoding image sent by the network server, obtain the encrypted access address of the code to be injected based on the preset graphic encoding image, retrieve the code to be injected from the network server based on the encrypted access address, configure the code to be injected as the current executable file of the second client, and execute the current executable file in the second client to inject the code to be injected into the second client.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.

10. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Encryption transmission method and device, decryption method and device, terminal and storage medium

    CN109981648A

  • Proxy service for secure upload of file system tree structures

    CN117642740A