Client code injection method and system, storage medium and electronic equipment
By using the preset graphic image storage and encrypted access address in the code injection, the code leakage and security problems are solved, and the efficient and convenient code injection is achieved.
Patent Information
- Application Number
- CN202411360777.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-09-26
AI Technical Summary
In the prior art, there are problems such as code leakage and security difficulties when injecting code.
By generating the preset graphic encoding image, the encrypted access address to be injected into the code is stored and uploaded and stored through the network server. The second client obtains the access address by receiving the image to obtain and inject the injection code.
Effectively avoid the leakage of the real storage address to be injected, improve the security of code injection, and at the same time realize the convenient and efficient code injection through the transmission of graphic coding images.
Smart Images

Figure CN119363733A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a client code injection method, a client code injection system, a computer-readable storage medium, and an electronic device. Background Art
[0002] Code injection is the process of injecting code with certain functions into an application to implement related functions, such as fault detection of the application.
[0003] Taking fault detection as an example, the code injection method in the related technology needs to release the fault detection code and the application client code together, which poses a risk of fault detection code leakage, and requires code injection through 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. The enabling method code also has the risk of leakage, and the security of code injection is difficult to guarantee.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a client code injection method and system, a computer-readable storage medium and an electronic device, thereby avoiding code leakage during client code injection at least to a certain extent and improving the security of code injection.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to a first aspect of the present disclosure, a client code injection method is provided, comprising: a first client uploads a code to be injected and a preset graphic coding image corresponding to the code to be injected to a network server, wherein the preset graphic coding image is used to store an encrypted access address of the code to be injected; the network server receives the code to be injected and the preset graphic coding image corresponding to the code to be injected uploaded by the first client, and stores the code to be injected and the preset graphic coding image corresponding to the code to be injected in the network server; a second client receives the preset graphic coding image sent by the network server, obtains the encrypted access address of the code to be injected according to the preset graphic coding image, obtains the code to be injected from the network server according to the encrypted access address, configures the code to be injected as a current execution file of the second client, executes the current execution file in the second client, and injects the code to be injected into the second client.
[0008] Optionally, the code to be injected includes an encrypted bytecode to be injected, and the generation method of the encrypted bytecode to be injected and the preset graphic coding image includes: the first client compiles the newly added source code to obtain the newly added bytecode, and encrypts the newly added bytecode to obtain the encrypted bytecode to be injected, and the newly added source code includes a newly added fault detection source code for performing fault detection on 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 the encrypted access address, and converts the encrypted access address into the preset graphic coding image.
[0009] Optionally, the method also includes: the first client obtains a 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 coding image, configures the fault identifier as an image identifier of the preset graphic coding image; the first client uploads the preset graphic coding image configured with the image identifier to the network server.
[0010] Optionally, the second client receives the preset graphic coded image sent by the network server, including: the second client sends a fault identifier corresponding to the fault to the network server in response to a fault occurring in the second client; the network server searches for the preset graphic coded image corresponding to the fault identifier in the network server based on a matching result between the fault identifier and the image identifier of the preset graphic coded image in the network server, and sends the preset graphic coded image corresponding to the fault identifier to the second client; the second client receives the preset graphic coded image corresponding to the fault identifier sent by the network server.
[0011] Optionally, the method in which the second client obtains the code to be injected from the network server according to the encrypted access address includes: 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 according to the decrypted access address.
[0012] Optionally, the method in which the second client obtains the code to be injected from the network server according to the decrypted access address includes: the second client generates an access request to the network server according to the decrypted access address and the Internet Protocol address of the second client; the second client sends the access request to the network server through the access interface of the network server to access the network server through the access request; after receiving the access request from the second client, the network server reviews the Internet Protocol address in the access request, and if the review is passed, reads the code to be injected from the network server according to 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; the second client configures the code to be injected as the current execution file of the second client, including: the second client decrypts the encrypted bytecode to be injected according to a second preset decryption rule pre-configured in the second client to obtain the decrypted bytecode to be injected, and configures the decrypted bytecode to be injected as the current execution file of the second client.
[0014] According to a second aspect of the present disclosure, a client code injection system is provided, comprising: a first client, configured to upload a code to be injected and a preset graphic coding image corresponding to the code to be injected to a network server, wherein the preset graphic coding image is 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 preset graphic coding image corresponding to the code to be injected uploaded by the first client, and store the code to be injected and the preset graphic coding image corresponding to the code to be injected in the network server; a second client, configured to receive the preset graphic coding image sent by the network server, obtain the encrypted access address of the code to be injected according to the preset graphic coding image, obtain the code to be injected from the network server according to the encrypted access address, configure the code to be injected as a current execution file of the second client, execute the current execution file in the second client, and inject the code to be injected into the second client.
[0015] According to a third aspect of the present disclosure, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the steps of the client code injection method as described in the first aspect.
[0016] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the client code injection method as described in the first aspect of the above embodiment is implemented.
[0017] According to a fifth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a storage device for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the client code injection method as described in the first aspect of the above embodiment.
[0018] It can be seen from the above technical solutions that the client code injection method, the client code injection system, and the computer-readable storage medium, computer program product, and electronic device for implementing the client code injection method in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
[0019] In the technical solutions provided by some embodiments of the present disclosure, a code to be injected and a preset graphic coding image for storing the encrypted access address of the code to be injected are generated in the first client, and then the code to be injected and the preset graphic coding 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 coding image, thereby obtaining the code to be injected from the network server according to the encrypted access address, and configuring the code to be injected as the current execution file of the second client to inject the code to be injected into the second client. Compared with the related art, on the one hand, the present disclosure stores the encrypted access address of the code to be injected in the preset graphic coding image and uploads it to the network server, avoiding the direct release of the encrypted access address. At the same time, only the encrypted access address of the code to be injected can be obtained through the graphic coding image, and the real storage address of the code to be injected cannot be directly obtained, which can avoid the leakage of the real storage address of the code to be injected and improve the security of code injection; on the other hand, the present disclosure can realize client code injection by spreading the graphic coding image, which improves the convenience and efficiency of code injection.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0022] Figure 1 A schematic diagram showing an exemplary system architecture to which embodiments of the present disclosure may be applied;
[0023] Figure 2 A schematic diagram showing a process flow of a client code injection method in an exemplary embodiment of the present disclosure;
[0024] Figure 3 A schematic flow chart showing a method for a first client to generate an encrypted bytecode to be injected and a preset graphic coding image in an exemplary embodiment of the present disclosure;
[0025] Figure 4 A schematic flow chart showing a method for a second client to receive a preset graphic coding image in an exemplary embodiment of the present disclosure;
[0026] Figure 5 A flow chart showing a method for a second client to obtain a code to be injected according to a decrypted access address in an exemplary embodiment of the present disclosure;
[0027] Figure 6 A schematic diagram showing the structure of a client code injection system in an exemplary embodiment of the present disclosure is shown;
[0028] Figure 7 A schematic diagram showing the composition of another client code injection system in an exemplary embodiment of the present disclosure;
[0029] Figure 8 A schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0030] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0031] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0032] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0033] Client code injection can detect client faults. Taking client fault detection as an example, in related technologies, the fault detection code needs to be released together with the client code, and the code for enabling the fault detection function also needs to be released together with the client code. There is a risk of leakage of the fault detection code and the enabling code, and the security of code injection is relatively low.
[0034] Based on this, the present disclosure considers storing the encrypted access address corresponding to the code to be injected through a preset graphic coding image, and uploading the preset graphic coding image to the network server. The client that needs to inject the code can obtain the preset graphic coding image from the network server, thereby obtaining the encrypted access address of the code to be injected, and then decrypt it to obtain the code to be injected, thereby realizing the client code injection. In this way, it is possible to avoid the code to be injected and the client code from being released together, and it is also possible to avoid the storage address of the code to be injected from being leaked, thereby improving the security of code injection.
[0035] First, the present disclosure provides a client 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 terminal device such as a smart phone, a tablet computer, a desktop computer, a laptop computer, a smart wearable device, etc. The server 120 generally refers to a background system that provides related services of the client code injection method in this exemplary embodiment, and may be a server or a cluster formed by multiple servers. The terminal 110 and the server 120 may be connected via a wired or wireless communication link to perform data exchange.
[0037] In an exemplary embodiment, the steps of the method performed by the second client in the above-mentioned client code injection method can be performed by the terminal device 110. For example, when the user uses the client application in the terminal 110, the preset graphic coding image sent by the server 120 can be received through the client application in the terminal device 110, and then the encrypted access address of the code to be injected is obtained. 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, and then accesses the real access address to obtain the code to be injected, and configures the code to be injected as the current execution file in the terminal device 110, so as to inject 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 in the example is only illustrative. Any number of terminal devices and servers may be provided as required. For example, the server 120 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0039] Figure 2 A schematic diagram showing a flow chart of a client code injection method in an exemplary embodiment of the present disclosure is shown. Figure 2 , the method comprising:
[0040] Step S210, the first client uploads the code to be injected and a preset graphic coding image corresponding to the code to be injected to a network server, wherein the preset graphic coding 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 coding image corresponding to the code to be injected uploaded by the first client, and stores the code to be injected and the preset graphic coding image corresponding to the code to be injected in the network server;
[0042] In step S230, the second client receives the preset graphic coding image sent by the network server, obtains the encrypted access address of the code to be injected according to the preset graphic coding image, obtains the code to be injected from the network server according to the encrypted access address, configures the code to be injected as the current execution file of the second client, executes the current execution file in the second client, and injects the code to be injected into the second client.
[0043] exist Figure 2 In the technical solution provided by the illustrated embodiment, a code to be injected and a preset graphic coding image for storing the encrypted access address of the code to be injected are generated in the first client, and then the code to be injected and the preset graphic coding 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 coding image, thereby obtaining the code to be injected from the network server according to the encrypted access address, and configuring the code to be injected as the current execution file of the second client to inject the code to be injected into the second client. Compared with the related art, on the one hand, the present disclosure stores the encrypted access address of the code to be injected in the preset graphic coding image and uploads it to the network server, avoiding the direct release of the encrypted access address. At the same time, only the encrypted access address of the code to be injected can be obtained through the graphic coding image, and the real storage address of the code to be injected cannot be directly obtained, which can avoid the leakage of the real storage address of the code to be injected and improve the security of code injection; on the other hand, the present disclosure can realize client code injection by spreading the graphic coding image, which improves the convenience and efficiency of code injection.
[0044] Below, the attached drawings of this specification are described in conjunction with specific embodiments. Figure 2 The various steps in are described below.
[0045] First, the specific implementation manner of step S210, in which the first client uploads the code to be injected and the preset graphic coding image corresponding to the code to be injected to the network server, is described.
[0046] In an exemplary embodiment, the preset graphic coding image is used to store the encrypted access address of the code to be injected, the first client in step S210 may include a client of a developer, and the network server in step S210 may include an intranet server.
[0047] For example, after the R&D personnel have completed the code to be injected and generated the preset graphic coding image corresponding to the code to be injected, they can upload the code to be injected and the preset graphic coding image corresponding to the code to be injected to the internal network server. The external network server can access the internal network server through VPN (Virtual Private Network) technology.
[0048] An internal network is a computer network established within a relatively limited geographical area (such as a home, office, school, etc.). It connects all computers and network devices within the local area to form a closed and controlled network environment. An external network is a widely covered network, such as the Internet, which connects computers and network devices worldwide and allows different internal networks to communicate through a public network.
[0049] In an exemplary embodiment, the code to be injected and the preset graphic coding image corresponding to the code to be injected can be uploaded to the same network server or uploaded to different network servers, and this exemplary embodiment does not specifically limit this.
[0050] In an exemplary embodiment, the code to be injected includes encrypted bytecode to be injected. Based on this, exemplary, Figure 3 A schematic flow chart of a method for a first client to generate an encrypted bytecode to be injected and a preset graphic coding image in an exemplary embodiment of the present disclosure is shown. 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 the newly added bytecode, and encrypts the newly added bytecode to obtain the encrypted bytecode to be injected.
[0052] In an exemplary implementation, the newly added source code includes a newly added fault detection source code for performing fault detection on the second client.
[0053] The second client includes any client application, such as a game client application, a music client application, a video player client application, etc., which is not particularly limited in this exemplary embodiment.
[0054] For example, the developer can generate new source code in the first client at any time, for example, generate environment detection source code for environment detection of the second client according to the demand, and then use it as the new source code, compile it to obtain new bytecode, and then encrypt the new bytecode according to the second preset encryption rule to obtain the encrypted bytecode to be injected. In other words, the code to be injected in the present disclosure may include the encrypted bytecode to be injected.
[0055] In step S320, the first client generates the encrypted access address of the 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 coding image.
[0056] Exemplarily, the first client can generate an access address of the encrypted bytecode to be injected based on the IP (Internet Protocol) address and port information of the network server storing the encrypted bytecode to be injected. Then, the access address is encrypted according to the first preset encryption rule to obtain an encrypted access address. A preset graphic coding image corresponding to the encrypted access address is generated by a graphic coding image generation tool.
[0057] Exemplarily, the client code injection method in the present disclosure may also include: the first client obtains a 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 coding image, configures the fault identifier as an image identifier of the preset graphic coding image; the first client uploads the preset graphic coding image configured with the image identifier to the network server.
[0058] For example, the name of the fault to be detected by the fault detection code can be used as the fault identifier corresponding to the newly added source code. If the fault detection code is used to detect an operating environment fault, the fault identifier can be an operating 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 coding image, it can obtain the fault identifier corresponding to the newly added source code, and then configure the image identifier of the preset graphic coding image as the fault identifier, and upload the preset graphic coding image configured with the image identifier to the first server. In this way, the network server stores the preset graphic coding images corresponding to the encrypted access addresses of different fault detection codes.
[0059] In an optional implementation, the code to be injected may also include any one of the source code to be injected, the bytecode to be injected, and the encrypted source code to be injected, which is not specifically limited in this exemplary implementation. The source code is an uncompiled text file written in accordance with a certain programming language specification, and the bytecode is a binary instruction file obtained by compiling the source code.
[0060] In an exemplary embodiment, the code to be injected includes a fault detection code for performing fault detection on the second client. For example, the code to be injected can be a fault detection source code, a bytecode corresponding to the fault detection source code, an encrypted fault detection source code, an encrypted bytecode corresponding to the fault detection source code, etc.
[0061] Based on this, the preset graphic coding 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 encrypted access address of the source code to be injected, and the encrypted encrypted access address of the bytecode to be injected.
[0062] In an exemplary embodiment, the preset graphic code image may include a barcode, a QR code, etc., which is not particularly limited in this exemplary embodiment.
[0063] Next, a specific implementation manner of step S220, in which the network server receives the code to be injected and the preset graphic coding image corresponding to the code to be injected uploaded by the first client, and stores the code to be injected and the preset graphic coding image corresponding to the code to be injected in the network server is described.
[0064] In an exemplary embodiment, the network server can be implemented based on the Flask framework and deployed through uWSGI. The network 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 according to the address requested by the client, and read the content of the code file to be injected and return it to the second client.
[0065] Among them, uWSGI (Micro Web Server Gateway Interface) is a server software mainly used to deploy Python applications. It supports the WSGI standard, which makes it compatible with various Python web frameworks (such as Django and Flask). uWSGI supports not only Python (a programming language), but also multiple programming languages and protocols.
[0066] Taking the example that the code to be injected is the encrypted bytecode to be injected, the code to be injected is uploaded to the second network server, and the preset graphic coding image corresponding to the code to be injected is uploaded to the first network server, after the source code with certain functions is written according to actual needs, the source code can be compiled by a code compiler to obtain the bytecode corresponding to the source code, and the bytecode is encrypted according to the second preset encryption rule to obtain the encrypted bytecode and save it as an encrypted bytecode file, and the encrypted bytecode file is uploaded to the second network server. After the second network server receives the encrypted bytecode file, it can store the encrypted bytecode file. At the same time, the first client can obtain the storage address of the encrypted bytecode file according to the storage path of the encrypted bytecode file in the second network server, such as "https: / / server address: server port / encrypted bytecode file name". 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 file name". The graphic coding image of the encrypted access address of the encrypted bytecode file is generated according to the graphic coding image generation tool. Then, an image identifier is configured for the graphic code image, wherein the image identifier can be the file name of the encrypted bytecode file or the function name of the source code corresponding to the encrypted bytecode file, etc., and then the graphic code image configured with the image identifier is uploaded to the first network server. After receiving the graphic code image configured with the image identifier, the first network server can store it. In this way, in the subsequent steps, the corresponding graphic code image can be found in the first network server through the image identifier.
[0067] In an exemplary embodiment, the first network server and the second network server can both be http (Hypertext Transfer Protocol) servers, that is, the code to be injected and the preset graphic coding image corresponding to the encrypted access address of the code to be injected can both be stored in the http server.
[0068] Exemplarily, 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 coding image corresponding to the encrypted access address of the code to be injected, and the real 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, and this exemplary embodiment does not make any special limitation on this.
[0069] Next, for step S230, the second client receives the preset graphic coding image sent by the network server, obtains the encrypted access address of the code to be injected according to the preset graphic coding image, obtains the code to be injected from the network server according to the encrypted access address, configures the code to be injected as the current execution file of the second client, executes the current execution file in the second client, and describes the specific implementation method of injecting the code to be injected into the second client.
[0070] For example, Figure 4 A schematic flow chart showing a method for a second client to receive a preset graphic coding image in an exemplary embodiment of the present disclosure is shown. Figure 4 The method is completed by the interaction between the second client and the network server, and the method may include steps S410 to S430. Among them:
[0071] In step S410, in response to a failure of the second client, the second client sends a failure identifier corresponding to the failure to the network server.
[0072] In an exemplary implementation, when a fault occurs in the second client, the second client can determine a fault identifier of the fault. For example, if the current fault of the second client requires an operating environment detection, the second client can send the above-mentioned operating environment fault detection fault identifier to the network server. For example, if the user cannot normally start the game client, the game client can send the operating environment fault detection identifier to the network server.
[0073] In step S420, the network server searches for the preset graphic coded 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 coded image in the network server, and sends the preset graphic coded image corresponding to the fault identifier to the second client.
[0074] As mentioned above, the network server stores a preset graphic coding image configured with an image identifier, and the configured image identifier is the fault identifier corresponding to the corresponding fault detection code. In other words, the network server pre-stores graphic coding images corresponding to the encrypted access addresses of different fault detection codes. For example, the encrypted access address 1 of fault detection code 1 corresponds to graphic coding image 1, the encrypted access address 2 of fault detection code 2 corresponds to graphic coding image 2, and so on.
[0075] For example, after receiving the fault identifier sent by the second client, the network server can match the received fault identifier with the image identifier of the preset graphic coding image configuration stored in the network server, determine the preset graphic coding image corresponding to the successfully matched image identifier as the preset graphic coding image corresponding to the fault identifier currently sent by the second client, and then send the preset graphic coding image to the second client.
[0076] In step S430, the second client receives a preset graphic coding image corresponding to the fault identification sent by the network server.
[0077] For example, the second client may receive a preset graphic code image sent by the network server, thereby obtaining the preset graphic code image corresponding to the encrypted access address of the fault detection code of the current fault of the second client.
[0078] In an optional implementation, the preset graphic coding images corresponding to the encrypted access addresses of the fault detection codes of different versions of the second client can be stored in the network server. In this case, the image identifier of the preset graphic coding image in the network server can be determined according to the client version and the fault identifier, such as after splicing the second client version and the fault identifier of the fault detection code, the image identifier of the preset graphic coding image corresponding to the encrypted access address of the fault detection code is obtained. In this way, when the second client fails, the second client can send the second client version and the fault identifier to the network server. Then the network server can splice the received second client version and the fault identifier to obtain the identifier to be matched, match the identifier to be matched with the image identifier of the preset graphic coding image stored in the network server, and obtain the corresponding preset graphic coding image according to the matching result.
[0079] In another exemplary embodiment, when a fault occurs on the client, a fault detection prompt message may be first sent to the second client to remind the user of the second client whether to confirm to enable fault detection on the client. In response to the user confirming to enable the fault detection function on the client, the second client version and fault identifier are sent to the network server, and then a preset graphic coded image corresponding to the client version and fault identifier sent by the network server is received.
[0080] Through the above-mentioned steps S410 to S430, the second client can obtain the preset graphic coded 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 together with the client code of the second client, thereby ensuring the security of the fault detection code.
[0081] In an exemplary embodiment, the second client may include a test client, and the code to be injected may also include a second client test code and an encrypted second client test code. In this way, when performing a second client test, preset graphic coding images corresponding to different second client test codes may be published to the corresponding test client through an internal network, thereby implementing code injection into the test client and improving test efficiency.
[0082] In another exemplary embodiment, the network server may also send the corresponding preset graphic coding image to the second client according to other requirements, so that the second client obtains the corresponding code to be injected through the preset graphic coding image, and this exemplary embodiment does not specifically limit this.
[0083] Exemplarily, the method in which the second client obtains the code to be injected from the network server according to the encrypted access address includes: 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 according to the decrypted access address.
[0084] For example, a first preset decryption rule for decrypting the encrypted access address may be pre-configured in the client, the first preset decryption rule corresponding to the first preset encryption rule described above, and the first preset decryption rule is used to decrypt data encrypted by the first preset encryption rule.
[0085] After the second client receives the preset graphic code image sent by the network server, it can scan the preset graphic code image and obtain the encrypted access address stored in the preset graphic code image in the background. Then, the scanned encrypted access address is decrypted according to the first preset decryption rule in the second client to obtain the decrypted access address of the code to be injected. Then, the code to be injected is obtained from the network server according to the decrypted access address.
[0086] For example, Figure 5 A flow chart showing a method for a second client to obtain a code to be injected according to a decrypted access address in an exemplary embodiment of the present disclosure is shown. 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 according to 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 network server according to the encrypted decrypted access address and the Internet Protocol address of the second client, ie, the IP (Internet Protocol Address).
[0089] In step S520, the second client sends the access request to the network server through the access interface of the network server, so as to access the network server through the access request.
[0090] The second client may send the access request generated in step S510 to the network server through the access interface of the network server to send the access request to the network server.
[0091] In step S530, after receiving the access request from the second client, the network server reviews the Internet Protocol address in the access request. If the review passes, the network server reads the code to be injected from the network server according to the decrypted access address in the access request, and sends the read code to be injected to the second client.
[0092] For example, after receiving the access request from the second client, the network server can parse the received access request to obtain the Internet Protocol address and the decrypted access address in the access request. Then, the network server can review the parsed Internet Protocol address, and if the review is passed, parse the decrypted access address to obtain the storage path of the code to be injected in the network server, and then read the code to be injected from the network server according to the storage path, and send the read code to be injected to the second client.
[0093] For example, when the network server fails to pass the review of the Internet Protocol address in the access request, a security prompt message may be sent to the client, prompting the client that the code injection could not be implemented because of a security issue with its Internet Protocol address.
[0094] In an exemplary embodiment, the way in which the network server reviews the Internet Protocol address in the access request includes: the network server matches the Internet Protocol address in the access request with a secure Internet Protocol address pre-stored in the network server, and if the match is successful, determines that the Internet Protocol address in the access request has passed the review; if the match fails, determines that the Internet Protocol address in the access request has failed the review.
[0095] In an exemplary embodiment, when the second client sends the fault identification to the network server, the Internet Protocol address of the second client can also be sent to the network server at the same time, and the network server will review the Internet Protocol address of the second client. If the review is passed, the network server will send the corresponding preset graphic code image to the second client. In this way, the Internet Protocol address of the code to be injected can be prevented from being leaked, thereby improving the security of code injection.
[0096] In step S540, the second client receives the code to be injected sent by the network server.
[0097] For example, the second client may receive the code to be injected sent by the network server, so that the code to be injected is injected into the second client in a subsequent step.
[0098] Through the above-mentioned steps S510 to S540, the client fault detection code can be quickly injected through the preset graphic coding image to realize client fault detection, improve the efficiency of client fault detection, and will not cause the leakage of the client fault detection code, thereby ensuring the security of client fault detection.
[0099] Of course, the network server can also send the preset graphic code image to the second client in other ways so that the second client can obtain the corresponding preset graphic code image, and this exemplary embodiment does not specifically limit this. For example, when performing code testing, the preset graphic code image corresponding to the encrypted access address of the test code can be sent to the test client at a fixed time according to the needs, so as to realize the convenient and safe injection of the test code and improve the security of the code testing.
[0100] In an exemplary embodiment, as described above, the code to be injected includes an encrypted bytecode to be injected. Based on this, the second client configures the code to be injected as the current execution file of the second client, including: the second client decrypts the encrypted bytecode to be injected according to a second preset decryption rule pre-configured in the second client to obtain the decrypted bytecode to be injected, and configures the decrypted bytecode to be injected as the current execution file of the second client.
[0101] In another exemplary embodiment, as described above, the code to be injected includes encrypted source code to be injected, and the second client can also decrypt the obtained encrypted source code to be injected according to a 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 may be pre-configured with a second preset decryption rule, which corresponds to the second preset encryption rule, and is used to decrypt data encrypted by the first preset encryption rule. The encrypted code to be injected received from the network server may be decrypted according to the second preset decryption rule to obtain the decrypted code to be injected, and then the decrypted code to be injected may be configured as the current execution file of the second client, so that the second client executes the code to be injected, thereby injecting the code to be injected into the second client to implement fault detection of the second client.
[0103] Among them, 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 needs, and this exemplary embodiment does not make any special limitations on this.
[0104] In an exemplary application scenario, after the second client receives the preset graphic coding image, the preset graphic coding image can be displayed in the graphical user interface of the second client, and the user can be prompted to scan the preset graphic coding image through the second client to perform client fault detection. After the user triggers the scanning function of the preset graphic coding image, the fault detection code can be injected into the second client according to the client code injection method in the present disclosure, and the second client can be fault-detected to obtain the fault detection result. The fault detection result can be displayed in the second client to prompt the user to modify the second client configuration and other information according to the fault detection result to repair the fault.
[0105] In the present disclosure, as mentioned above, the code to be injected may be a bytecode. By injecting the bytecode to be injected into the client, direct leakage of the source code can be avoided, thereby improving the security of the source code.
[0106] In the present disclosure, as mentioned above, the source code may also be encrypted and then released, and the source code needs to be decrypted before code injection, which can improve the security of the source code.
[0107] In the present disclosure, when the code to be injected is a bytecode to be injected, the bytecode to be injected can also be encrypted before being released. What the user obtains through the encrypted access address is the encrypted bytecode to be injected. The encrypted bytecode to be injected needs to be decrypted according to the second preset decryption rule built into the second client before code injection can be realized, thereby avoiding the leakage of the bytecode to be injected and the source code to be injected, and also avoiding the leakage of the access address of the bytecode to be injected and the source code to be injected, thereby improving the security of code injection. In addition, in the whole process, it is not necessary to download or install any code program, thereby further improving the security of the code.
[0108] For example, Figure 6 A schematic diagram of the structure of a client code injection system in an exemplary embodiment of the present disclosure is shown. Figure 6 The system may include a code server 61 and a second client 62. In an optional embodiment, the code server 61 may include the internal network server mentioned above. The internal service server may be understood as a computer set up within an organization or enterprise for storing, processing and sharing data.
[0109] Take the case where the code to be injected is the encrypted bytecode to be injected as an example, wherein the encrypted bytecode to be injected can be understood as the encrypted bytecode to be injected mentioned above. After the developer implements the source code to be injected and saves it to the source code file, the developer can compile the source code file through the code compiler to obtain the bytecode, and then encrypt the bytecode to obtain the bytecode to be injected, and save the bytecode to be injected into the encrypted bytecode file to be injected. Then, according to the storage location where the encrypted bytecode file to be injected is desired to be stored, the access address of the encrypted bytecode file to be injected is generated, and the access address can be the storage path of the encrypted bytecode file to be injected in the code server 61. Then, the access address is encrypted to obtain the encrypted access address. Then, a graphic coding generation tool, such as QRcode (Quick Response code, a coding method for encoding a two-dimensional code), is used to convert the encrypted access address into a preset graphic coding image. Then, according to the preset graphic coding image corresponding to the encrypted bytecode file to be injected and its encrypted access address, it is uploaded to the code server 61 to realize the release of the code to be injected.
[0110] As mentioned above, the code server 61 can be an http server, and the http server can provide a code access interface for the second client to obtain the preset graphic coding image corresponding to the encrypted access address of the encrypted bytecode to be injected and the encrypted bytecode itself to be injected. For example, the access interface can find the corresponding preset graphic coding image according to the image identifier in the access request, such as the fault identifier, and return it to the client. The access interface can also parse the storage path of the encrypted bytecode to be injected in the http server according to the access address in the access request, and then read the content of the encrypted bytecode file to be injected according to the parsed storage path, and return the content to the second client 62 to realize the injection of the client code.
[0111] The second client 62 can realize the scanning function of the preset graphic code image through the API (Application Programming Interface) of the operating system of the second client. The second client 62 can scan the preset graphic code image at runtime to obtain the encrypted access address of the encrypted bytecode to be injected, and decrypt the encrypted access address to obtain the access address of the encrypted bytecode to be injected, generate an access request to the code server 61 according to the access address, access the code server 61 based on the access request, and the code server 61 finds the encrypted bytecode to be injected requested by the access request from the code to be injected stored in the code server 61 according to the received access request, so as to send the encrypted bytecode to be injected to the second client 62. The second client 62 can decrypt the received encrypted bytecode to be injected, and configure the decrypted bytecode to be injected obtained after decryption as the current execution file of the second client, so that the second client executes the bytecode to be injected, thereby injecting the bytecode to be injected into the second client.
[0112] In the present disclosure, the access address of the code to be injected is stored in the form of graphic coding, and the corresponding code to be injected is accessed by scanning, and the corresponding code to be injected is sent to the second client for execution. The code to be injected is stored in an internal network server, and the encrypted access address of the code to be injected is stored by graphic coding. No code to be injected and address are stored in the second client, and only the function of parsing and accessing the address indicated by the graphic coding image is realized. The second client only needs to parse the address and access the code service through the graphic coding information, obtain the code content and configure it as the current execution file of the second client, so as to realize code injection. Since the code server is an internal network server and cannot be accessed by the external network, the code injection method is simple, fast, safe and easy to spread internally. The customer does not need to perform other special operations, such as clicking the number of times specified in the hidden area of the client to enable the code injection function, etc., so the convenience of code injection is improved and the user experience is improved.
[0113] In addition, it should be noted that the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0114] Furthermore, the exemplary embodiment of the present disclosure also provides another client code injection system. Figure 7As shown, the client code injection system 700 may include: a first client 710, configured to upload the code to be injected and a preset graphic coding image corresponding to the code to be injected to a network server, wherein the preset graphic coding 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 preset graphic coding image corresponding to the code to be injected uploaded by the first client, and store the code to be injected and the preset graphic coding image corresponding to the code to be injected in the network server; a second client 730, configured to receive the preset graphic coding image sent by the network server, obtain the encrypted access address of the code to be injected according to the preset graphic coding image, obtain the code to be injected from the network server according to the encrypted access address, configure the code to be injected as the current execution file of the second client, execute the current execution file in the second client, and inject the code to be injected into the second client.
[0115] In an exemplary embodiment, the code to be injected includes an encrypted bytecode to be injected, and the generation method of the encrypted bytecode to be injected and the preset graphic coding image includes: the first client compiles the newly added source code to obtain the newly added bytecode, encrypts the newly added bytecode to obtain the encrypted bytecode to be injected, and the newly added source code includes a newly added fault detection source code for performing fault detection on 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 the encrypted access address, and converts the encrypted access address into the preset graphic coding image.
[0116] In an exemplary embodiment, the system also includes an image identification configuration module, which can be configured as follows: the first client obtains a fault identification 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 coding image, configures the fault identification as the image identification of the preset graphic coding image; the first client uploads the preset graphic coding image configured with the image identification to the network server.
[0117] In an exemplary embodiment, the second client receives the preset graphic coded image sent by the network server, including: the second client sends a fault identifier corresponding to the fault to the network server in response to a fault occurring in the second client; the network server searches for the preset graphic coded image corresponding to the fault identifier in the network server based on a matching result between the received fault identifier and the image identifier of the preset graphic coded image in the network server, and sends the preset graphic coded image corresponding to the fault identifier to the second client; the second client receives the preset graphic coded image corresponding to the fault identifier sent by the network server.
[0118] In an exemplary embodiment, the method in which the second client obtains the code to be injected from the network server according to the encrypted access address includes: 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 according to the decrypted access address.
[0119] In an exemplary embodiment, the method in which the second client obtains the code to be injected from the network server according to the decrypted access address includes: the second client generates an access request to the network server according to the decrypted access address and the Internet Protocol address of the second client; the second client sends the access request to the network server through the access interface of the network server to access the network server through the access request; after receiving the access request from the second client, the network server reviews the Internet Protocol address in the access request, and if the review is passed, reads the code to be injected from the network server according to 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.
[0120] In an exemplary embodiment, the code to be injected includes an encrypted bytecode to be injected; the second client configures the code to be injected as the current execution file of the second client, including: the second client decrypts the encrypted bytecode to be injected according to a second preset decryption rule pre-configured in the second client to obtain the decrypted bytecode to be injected, and configures the decrypted bytecode to be injected as the current execution 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 of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.
[0122] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present 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 into multiple modules or units to be embodied.
[0123] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0124] The exemplary embodiments of the present disclosure also provide a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the client code injection method described above is implemented.
[0125] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may 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 (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.
[0126] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0127] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, Python, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).
[0128] Computer programs can be carried or transmitted through electrical, magnetic, optical, electromagnetic, infrared, etc. Electronic devices can convert signals carrying computer programs into digital signals and then run the computer programs. When a computer program is running on an electronic device, its code is used to enable the electronic device to execute (more specifically, can enable the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned client code injection method, which includes the following steps: a first client uploads the code to be injected and a preset graphic coding image corresponding to the code to be injected to a network server, and the preset graphic coding 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 coding image corresponding to the code to be injected uploaded by the first client, and stores the code to be injected and the preset graphic coding image corresponding to the code to be injected in the network server; a second client receives the preset graphic coding image sent by the network server, obtains the encrypted access address of the code to be injected according to the preset graphic coding image, obtains the code to be injected from the network server according to the encrypted access address, configures the code to be injected as the current execution file of the second client, executes the current execution file in the second client, and injects 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 coding image and uploading it to a network server, the direct release of the encrypted access address is avoided. At the same time, only the encrypted access address of the code to be injected can be obtained through the graphic coding image, and the real access address of the code to be injected cannot be directly obtained, which can avoid the leakage of the real storage address of the code to be injected and improve the security of code injection. On the other hand, client code injection can be achieved by spreading the graphic coding image, which improves the convenience and efficiency of code injection.
[0130] The exemplary embodiments of the present disclosure also provide an electronic device, such as the terminal device 110 or the server 120 described above. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as a computer program. The processor executes the method steps of various exemplary embodiments of the present disclosure by executing the executable instructions. In addition, the electronic device may also include a display for displaying a graphical user interface.
[0131] Reference below Figure 8 , the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Figure 8 The electronic device 800 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[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] The memory 820 may include a volatile memory, such as a RAM 821, a cache unit 822, and may also include a non-volatile memory, such as a ROM 823. The memory 820 may also include one or more program modules 824, such program modules 824 include but are not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. For example, the program module 824 may include each module in the above system.
[0134] The processor 810 may include one or more processing units. For example, the processor 810 may include 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), etc.
[0135] The processor 810 can be used to execute executable instructions stored in the memory 820, such as the above-mentioned client code injection method, which includes the following steps: the first client uploads the code to be injected and the preset graphic coding image corresponding to the code to be injected to the network server, and the preset graphic coding 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 coding image corresponding to the code to be injected uploaded by the first client, and stores the code to be injected and the preset graphic coding image corresponding to the code to be injected in the network server; the second client receives the preset graphic coding image sent by the network server, obtains the encrypted access address of the code to be injected according to the preset graphic coding image, obtains the code to be injected from the network server according to the encrypted access address, configures the code to be injected as the current execution file of the second client, executes the current execution file in the second client, and realizes the injection of the code to be injected into the second client.
[0136] The above method is implemented through a computer program. On the one hand, by storing the encrypted access address of the code to be injected in a preset graphic coding image and uploading it to a network server, the direct release of the encrypted access address is avoided. At the same time, only the encrypted access address of the code to be injected can be obtained through the graphic coding image, and the real access address of the code to be injected cannot be directly obtained, which can avoid the leakage of the real storage address of the code to be injected and improve the security of code injection. On the other hand, client code injection can be achieved by spreading the graphic coding image, which improves the convenience and efficiency of code injection.
[0137] The bus 830 is used to realize the connection between different components of the electronic device 800, and may include a data bus, an address bus, and a control bus.
[0138] The electronic device 800 can communicate with one or more external devices 900 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 840 .
[0139] The electronic device 800 can communicate with one or more networks through the network adapter 850. For example, the network adapter 850 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. The network adapter 850 can communicate with other modules of the electronic device 800 through the bus 830.
[0140] The electronic device 800 may display a graphical user interface through the display 860 , such as displaying a preset graphical coding image interface.
[0141] although Figure 8Not shown, other hardware and / or software modules may also be provided 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, etc.
[0142] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0143] As can be seen from the above, the technical solution of the present disclosure can be implemented as a method, a system, a computer program product, a storage medium, an electronic device, etc. Those skilled in the art can understand that various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, such as being respectively referred to as a "circuit", "module" or "system".
[0144] It should be understood that the present disclosure is not limited to the specific method steps or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. Those skilled in the art will easily think of other embodiments based on the specific embodiments provided by the present disclosure. Therefore, the specific embodiments provided by the present disclosure are only exemplary, and the scope and spirit of the present disclosure are indicated by the claims, and any variations, uses or adaptive changes of the present disclosure should be covered, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the present disclosure.
Claims
1. A client code injection method, characterized in that: include: The first client uploads the code to be injected and a preset graphic coding image corresponding to the code to be injected to a network server, wherein the preset graphic coding 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 coding image corresponding to the code to be injected uploaded by the first client, and stores the code to be injected and the preset graphic coding image corresponding to the code to be injected in the network server; The second client receives the preset graphic coding image sent by the network server, obtains the encrypted access address of the code to be injected according to the preset graphic coding image, obtains the code to be injected from the network server according to the encrypted access address, configures the code to be injected as the current execution file of the second client, executes the current execution file in the second client, and injects the code to be injected into the second client.
2. The client code injection method according to claim 1, characterized in that: The code to be injected includes the encrypted bytecode to be injected, and the generation method of the encrypted word code to be injected and the preset graphic coding image includes: The first client compiles the newly added source code to obtain a newly added bytecode, and encrypts the newly added bytecode to obtain an encrypted bytecode to be injected, wherein the newly added source code includes a newly added fault detection source code for performing fault detection on the second client; The first client generates the encrypted access address of the bytecode to be injected according to the information of the network server, encrypts the access address to obtain the encrypted access address, and converts the encrypted access address into the preset graphic coding image.
3. The client code injection method according to claim 2, characterized in that: The method further comprises: The first client obtains a 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 coding image, configures the fault identifier as an image identifier of the preset graphic coding image; The first client uploads the preset graphic coding image configured with the image identifier to the network server.
4. The client code injection method according to claim 3, characterized in that: The second client receiving the preset graphic coding image sent by the network server includes: In response to a fault occurring on the second client, the second client sends a fault identifier corresponding to the fault to the network server; The network server searches for the preset graphic coded image corresponding to the fault identifier in the network server according to the matching result between the received fault identifier and the image identifier of the preset graphic coded image in the network server, and sends the preset graphic coded image corresponding to the fault identifier to the second client; The second client receives a preset graphic coding image corresponding to the fault identification sent by the network server.
5. The client code injection method according to claim 1, characterized in that: The method in which the second client obtains the code to be injected from the network server according to the encrypted access address includes: The second client decrypts the encrypted access address according to a first preset decryption rule preconfigured in the second client to obtain a 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 code injection method according to claim 5, characterized in that: The method in which the second client obtains the code to be injected from the network server according to the decrypted access address includes: The second client generates an access request to the network server according to the decrypted access address and the Internet Protocol address of the second client; The second client sends the access request to the network server through the access interface of the network server, so as to access the network server through the access request; After receiving the access request from the second client, the network server reviews the Internet Protocol address in the access request, and if the review is passed, reads the code to be injected from the network server according to 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.
7. The client code injection method according to any one of claims 1 to 6, characterized in that: The code to be injected includes the encrypted bytecode to be injected; The second client configuring the code to be injected as the current execution file of the second client includes: The second client decrypts the encrypted bytecode to be injected according to a second preset decryption rule preconfigured in the second client to obtain the decrypted bytecode to be injected, and configures the decrypted bytecode to be injected as the current execution file of the second client.
8. A client code injection system, characterized in that: include: A first client is configured to upload the code to be injected and a preset graphic coding image corresponding to the code to be injected to a network server, wherein the preset graphic coding image is used to store an encrypted access address of the code to be injected; A network server is configured to receive the code to be injected and the preset graphic coding image corresponding to the code to be injected uploaded by the first client, and store the code to be injected and the preset graphic coding image corresponding to the code to be injected in the network server; The second client is configured to receive a preset graphic coding image sent by the network server, obtain the encrypted access address of the code to be injected according to the preset graphic coding image, obtain the code to be injected from the network server according to the encrypted access address, configure the code to be injected as the current execution file of the second client, execute the current execution file in the second client, and realize injecting 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 a processor, the method according to any one of claims 1 to 7 is implemented.
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 the one or more processors, enables the one or more processors to implement the method according to 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
Automatic script code coverage measurements for software scripts
US10560539B1