A method, apparatus, device and storage medium for calling an application toolkit
By hardening the application toolkit, generating empty instructions and encrypted files, and decrypting and restoring the original instructions when a specified class function is called, the problem of the SDK being easily reverse-engineered is solved, and code security is improved.
Patent Information
- Application Number
- CN202210279245.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2042-03-21
AI Technical Summary
Existing software development kits (SDKs) are easily reverse engineered and analyzed, making it difficult to guarantee code security.
The application toolkit is hardened by generating empty instruction files and encrypted files. When a specified class function is called, the original instruction is decrypted and restored to avoid directly exposing the code logic.
It effectively prevents the SDK from being reverse-engineered, improves the security of the source code, and ensures that function logic is not stolen.
Smart Images

Figure CN114626028B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data protection technology, and in particular to an application toolkit invocation method, apparatus, device, and storage medium. Background Technology
[0002] To meet the needs of application (APP) development and provide specific functional services, software service providers typically release software development kits (SDKs). By calling the encapsulated application programming interface (API), users can easily configure and integrate these tools to meet their functional requirements.
[0003] While software development kits (SDKs) can provide stable and efficient services for mobile applications, the interpreted nature of programming languages makes them easily reverse-engineered and analyzed, posing significant security risks. Currently, to improve code security during SDK usage, software service providers typically employ code obfuscation techniques during SDK compilation and packaging to increase the difficulty of reverse engineering.
[0004] While obfuscating the code logic can reduce its readability, it only increases the complexity of decryption. Attackers can still analyze and decrypt the SDK, so it cannot fundamentally protect the security of the SDK code. Summary of the Invention
[0005] This invention provides an application toolkit invocation method, apparatus, device, and storage medium to enable secure invocation of application toolkit source code logic.
[0006] According to one aspect of the present invention, an application toolkit invocation method is provided, comprising:
[0007] The application toolkit is hardened to obtain an empty instruction file and an encrypted file. The encrypted file contains encrypted instructions for a specified class of functions, and the empty instruction file contains empty instructions for a specified class of functions.
[0008] When it is determined that a specified class function in the empty instruction file is called, the encrypted file is called to obtain the encrypted instruction;
[0009] The encrypted instructions are decrypted to obtain the original instructions, and the original instructions replace the empty instructions in the empty instruction file to execute the application toolkit.
[0010] According to another aspect of the present invention, an application toolkit invocation device is provided, comprising:
[0011] The application toolkit hardening module is used to harden the application toolkit and obtain an empty instruction file and an encrypted file. The encrypted file contains encrypted instructions for a specified class of functions, and the empty instruction file contains empty instructions for a specified class of functions.
[0012] A specified class function call module is used to call the encrypted file to obtain the encrypted instructions when it is determined that a specified class function in the empty instruction file is called;
[0013] The application toolkit execution module is used to decrypt the encrypted instructions to obtain the original instructions, and replace the empty instructions in the empty instruction file with the original instructions to execute the application toolkit.
[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the method described in any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the method described in any embodiment of the present invention.
[0019] The technical solution of this invention separates and encrypts the instructions of specified functions in the application toolkit, and provides the hardened empty instruction file for users to call. The instructions are restored only when the application toolkit is executed, thus protecting the source code logic in the application toolkit. Since the function bodies in the empty instruction file are empty, the original code logic cannot be obtained, thereby effectively preventing reverse engineering and improving the security of the application toolkit source code.
[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart of the application toolkit providing the method according to Embodiment 1 of the present invention.
[0023] Figure 2 This is a schematic diagram of an application scenario for the application toolkit invocation method provided in Embodiment 1 of the present invention;
[0024] Figure 3 This is a schematic diagram of the input / output results of the reinforcement tool provided according to Embodiment 1 of the present invention;
[0025] Figure 4 This is a schematic diagram illustrating the execution principle of the application toolkit invocation method provided in Embodiment 1 of the present invention;
[0026] Figure 5 This is a flowchart of the application toolkit providing the second embodiment of the present invention calling the method;
[0027] Figure 6 This is a schematic diagram of an application toolkit invocation device according to Embodiment 3 of the present invention;
[0028] Figure 7 This is a schematic diagram of the structure of an electronic device that implements the application toolkit calling method of Embodiment 4 of the present invention. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "comprising" and "having" and any variations thereof in the specification, claims and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products or devices.
[0031] Example 1
[0032] Figure 1 This is a flowchart illustrating an application toolkit invocation method according to Embodiment 1 of the present invention. This embodiment is applicable to situations involving secure invocation of application toolkits. The method can be executed by an application toolkit invocation device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:
[0033] Step S101: Harden the application toolkit to obtain empty instruction files and encrypted files.
[0034] Optionally, the application toolkit is hardened to obtain an empty instruction file and an encrypted file, including: obtaining the original instructions contained in a specified class function in the application toolkit; encrypting the original instructions to obtain encrypted instructions, and obtaining an encrypted file based on the encrypted instructions; replacing the original instructions of the specified class function in the application toolkit with empty instructions, and injecting stub functions into the specified class function to obtain an empty instruction file.
[0035] Specifically, the system used in this embodiment can be the Android system, and the application toolkit used can be the Java SDK. Of course, this embodiment is merely illustrative and does not limit the type of system or application toolkit used. Specifically, the security of the Java SDK source code is improved by extracting the original instructions from the Java SDK package. This is achieved by traversing and extracting all the original instructions of a specified class function in the Java SDK, converting the extracted original instructions into Android Dex bytecode, and storing it encrypted. When the protected specified class function is called by the system, each instruction is decrypted and restored, and then filled into the specified memory offset. This allows the virtual machine in the Android system to execute the specified class function normally, thus ensuring the security of the function code instruction logic without affecting the function's operation.
[0036] Specifically, when hardening the application toolkit, a tool script iterates through specified class functions in the JarSDK, parses the content of each class function, erases the original code logic of the specified functions by filling them with empty instructions, injects static code stub functions into the specified class functions to detect the calls to the specified class functions, and finally generates a processed empty instruction file. For example... Figure 2The diagram illustrates an application scenario of the application toolkit invocation method provided in this embodiment. For example, it retrieves all raw instructions contained in the specified class function Func in the Jar SDK, replaces and fills these raw instructions with null instructions (NOP) to erase them, and injects stub functions into the raw function code of the specified class function to obtain the null instruction file SDK_NOP.jar. Therefore, the null instruction file contains the null instructions of the specified class function. Additionally, the Android DX hardening tool is used to encrypt all raw instructions contained in the specified class function in the application toolkit Jar SDK to obtain encrypted instructions, which are then stored locally to obtain the encrypted file DexCode.dat. Therefore, the encrypted file contains the encrypted instructions of the specified class function.
[0037] Optionally, after hardening the application toolkit to obtain the empty instruction file and the encrypted file, the method further includes: determining the instruction restoration dynamic library based on the empty instruction file and the encrypted file, wherein the instruction restoration dynamic library contains the mapping relationship between specified class functions and encrypted instructions.
[0038] Specifically, in this embodiment, after hardening the application toolkit, the instruction restoration dynamic library libJarLoader.so is determined based on the empty instruction file and the encrypted file. The instruction restoration dynamic library contains a mapping relationship between specified class functions and encrypted instructions; that is, the instruction restoration dynamic library can be used to find the encrypted instructions corresponding to the specified class functions, and to read and restore the encrypted instructions from the encrypted file. For example... Figure 3 The diagram illustrates the input / output of the hardening tool. The input is the application toolkit file SDK.jar containing the original instructions, while the output consists of an empty instruction file SDK_NOP.jar, an encrypted file DexCode.dat, and the instruction restoration dynamic library libJarLoader.so. Therefore, during Android application development, this application imports the obtained empty instruction file SDK_NOP.jar into the compilation tool and adds the obtained encrypted file DexCode.dat and the instruction restoration dynamic library libJarLoader.so to the resource directory. Consequently, when the compiled application is decompiled, only the empty function bodies of the SDK-specified class functions in the empty instruction file can be viewed, making it impossible to obtain the actual SDK logic, thus achieving the effect of hardening protection.
[0039] Step S102: When it is determined that a specified class function in the empty instruction file is called, the encryption file is called to obtain the encryption instruction.
[0040] Optionally, when it is determined that a specified class function in an empty instruction file is called, the encrypted file is invoked to obtain the encrypted instructions, including: when it is determined that a stub function in an empty instruction file is triggered, the specified class function is called; and the encrypted file is invoked by restoring the dynamic library through instructions to obtain the encrypted instructions corresponding to the specified class function.
[0041] Optionally, the encrypted file is called by restoring the dynamic library with instructions to obtain the encryption instructions corresponding to the specified class function. This includes: determining the encryption instruction number that matches the specified class function by restoring the dynamic library with instructions; calling the encrypted file by restoring the dynamic library with instructions, and querying the encrypted file according to the number to obtain the encryption instructions corresponding to the specified class function.
[0042] In a specific implementation, such as Figure 4 The diagram illustrates the execution principle of the application toolkit invocation method in this embodiment. When the App runs, it loads the instruction restoration dynamic library libJarLoader.so to complete initialization and reads the encrypted file DexCode.dat into memory. When a specified class function (i.e., a protected class function) in the application toolkit is called, according to the Java class loading mechanism, the stub function pre-injected in the empty instruction file needs to be triggered first. Therefore, when it is determined that the stub function in the empty instruction file SDK_NOP.jar is triggered, it is determined that the protected specified class function is called. At this time, the instruction restoration dynamic library libJarLoader.so is called based on the stub function, and the encrypted file is called through the instruction restoration dynamic library to obtain the encrypted instruction corresponding to the specified class function. Specifically, when obtaining the encrypted instruction, the mapping relationship of the instruction restoration dynamic library is used to determine the encrypted instruction number matching the specified class function. Then, the encrypted file DexCode.dat is called through the instruction restoration dynamic library, and the encrypted instruction corresponding to the specified class function is retrieved from the encrypted file based on the previously obtained number.
[0043] Step S103: Decrypt the encrypted instructions to obtain the original instructions, and replace the empty instructions in the empty instruction file with the original instructions to execute the application toolkit.
[0044] Optionally, the encrypted instructions are decrypted to obtain the original instructions, and the original instructions replace the empty instructions in the empty instruction file. This includes: decrypting the encrypted instructions according to a preset decryption method to obtain the original instructions; determining the memory offset corresponding to the specified class function, and determining the specified position of the empty instructions based on the offset; and adding the original instructions to the specified position to replace the empty instructions in the empty instruction file.
[0045] Specifically, in this embodiment, after obtaining the encrypted instructions corresponding to the loaded specified class function, the encrypted instructions are decrypted to obtain the original instructions, such as original instruction 1 and original instruction 2. Simultaneously, the memory offset corresponding to the specified class function is determined. For example, if the memory offset corresponding to the protected specified class function is determined to be 1, then the specified positions x1 and x2 of the empty instructions to be filled in the specified class function are determined based on memory offset 1. Original instruction 1 and original instruction 2 are then added sequentially to the specified positions x1 and x2, replacing the empty instructions in the empty instruction file. This ensures that the application toolkit containing the specified class function can be correctly interpreted and executed by the virtual machine in the Android system. Therefore, in this embodiment, the instructions in the specified class function are pre-separated and encrypted. When the specified class function is called and executed, the instructions are restored one by one, thus avoiding reverse engineering methods such as decompilation and memory unpacking to restore the code. Without affecting the original code execution logic, the code security is guaranteed to the greatest extent from the underlying level.
[0046] The technical solution of this invention separates and encrypts the instructions of specified functions in the application toolkit, and provides the hardened empty instruction file for users to call. The instructions are restored only when the application toolkit is executed, thus protecting the source code logic in the application toolkit. Since the function bodies in the empty instruction file are empty, the original code logic cannot be obtained, thereby effectively preventing reverse engineering and improving the security of the application toolkit source code.
[0047] Example 2
[0048] Figure 5 This is a flowchart of an application toolkit invocation method provided in Embodiment 2 of the present invention. After decrypting the encrypted instructions to obtain the original instructions and replacing the empty instructions in the empty instruction file with the original instructions, the method further includes: releasing the memory of specified class functions in the restored application toolkit to delete the original instructions in the restored application toolkit. Explanations of terms that are the same as or corresponding to those in the above embodiments are not repeated here. Figure 5 As shown, the specific steps include:
[0049] Step S201: Harden the application toolkit to obtain empty instruction files and encrypted files.
[0050] Optionally, the application toolkit is hardened to obtain an empty instruction file and an encrypted file, including: obtaining the original instructions contained in a specified class function in the application toolkit; encrypting the original instructions to obtain encrypted instructions, and obtaining an encrypted file based on the encrypted instructions; replacing the original instructions of the specified class function in the application toolkit with empty instructions, and injecting stub functions into the specified class function to obtain an empty instruction file.
[0051] Optionally, after hardening the application toolkit to obtain the empty instruction file and the encrypted file, the method further includes: determining the instruction restoration dynamic library based on the empty instruction file and the encrypted file, wherein the instruction restoration dynamic library contains the mapping relationship between specified class functions and encrypted instructions.
[0052] Step S202: When it is determined that a specified class function in the empty instruction file is called, the encryption file is called to obtain the encryption instruction.
[0053] Optionally, when it is determined that a specified class function in an empty instruction file is called, the encrypted file is invoked to obtain the encrypted instructions, including: when it is determined that a stub function in an empty instruction file is triggered, the specified class function is called; and the encrypted file is invoked by restoring the dynamic library through instructions to obtain the encrypted instructions corresponding to the specified class function.
[0054] Optionally, the encrypted file is called by restoring the dynamic library with instructions to obtain the encryption instructions corresponding to the specified class function. This includes: determining the encryption instruction number that matches the specified class function by restoring the dynamic library with instructions; calling the encrypted file by restoring the dynamic library with instructions, and querying the encrypted file according to the number to obtain the encryption instructions corresponding to the specified class function.
[0055] Step S203: Decrypt the encrypted instructions to obtain the original instructions, and replace the empty instructions in the empty instruction file with the original instructions to execute the application toolkit.
[0056] Optionally, the encrypted instructions are decrypted to obtain the original instructions, and the original instructions replace the empty instructions in the empty instruction file. This includes: decrypting the encrypted instructions according to a preset decryption method to obtain the original instructions; determining the memory offset corresponding to the specified class function, and determining the specified position of the empty instructions based on the offset; and adding the original instructions to the specified position to replace the empty instructions in the empty instruction file.
[0057] Step S204: Release the memory of the specified class functions in the restored application toolkit to delete the original instructions in the restored application toolkit.
[0058] Specifically, in this implementation, the virtual machine in the Android system also has a recycling mechanism. When it is determined that the restored application toolkit has been restored and executed, the memory of the specified class function in the application toolkit will be released and recycled, and the original instruction data will be erased again to delete the original instructions in the restored application toolkit, thereby maximizing the security of the original instructions. Since the original instructions of the specified class function in the application toolkit have been encrypted and stored, there is no need to encrypt the original instructions again after the memory of the specified class function is released this time.
[0059] The technical solution of this invention separates and encrypts the instructions of specified function types in an application toolkit, and provides a hardened empty instruction file for user invocation. The instructions are only restored during execution, protecting the source code logic within the application toolkit. Since the function bodies in the empty instruction file are empty, the original code logic cannot be obtained, effectively preventing reverse engineering and improving the security of the application toolkit source code. Furthermore, after the restored application toolkit is executed, the memory of the specified function types within the restored application toolkit is released, further ensuring the security of the original instruction code within the application toolkit.
[0060] Example 3
[0061] Figure 6 This is a schematic diagram of an application toolkit invocation device provided in Embodiment 3 of the present invention. Figure 6 As shown, the device includes: an application toolkit hardening module 310, a specified class function call module 320, and an application toolkit execution module 330.
[0062] Application toolkit hardening module 310 is used to harden the application toolkit and obtain empty instruction file and encrypted file. The encrypted file contains encrypted instructions of a specified class of functions, and the empty instruction file contains empty instructions of a specified class of functions.
[0063] The specified class function call module 320 is used to call the encrypted file to obtain the encrypted instructions when it is determined that a specified class function in the empty instruction file is called.
[0064] The application toolkit execution module 330 is used to decrypt the encrypted instructions to obtain the original instructions, and replace the empty instructions in the empty instruction file with the original instructions in order to restore and execute the application toolkit.
[0065] Optionally, an application toolkit hardening module is used to obtain the original instructions contained in a specified class function in the application toolkit;
[0066] The original instructions are encrypted to obtain encrypted instructions, and the encrypted file is obtained based on the encrypted instructions.
[0067] The original instructions of the specified class functions in the application toolkit are replaced with empty instructions, and stub functions are injected into the specified class functions to obtain an empty instruction file.
[0068] Optionally, the device further includes an instruction restoration dynamic library determination module, used to determine the instruction restoration dynamic library based on the empty instruction file and the encrypted file, wherein the instruction restoration dynamic library contains a mapping relationship between specified class functions and encrypted instructions.
[0069] Optionally, the specified class function calling module includes:
[0070] The stub function trigger subunit is used to determine when a specified class of function is called when a stub function in an empty instruction file is triggered.
[0071] The specified class function call subunit is used to restore the dynamic library call to the encrypted file through instructions in order to obtain the encrypted instructions corresponding to the specified class function.
[0072] Optionally, a class function call subunit is specified, which is used to restore the dynamic library according to the instructions to determine the encryption instruction number that matches the specified class function;
[0073] The system restores the encrypted file by invoking the dynamic library and then queries the encrypted file by its number to obtain the encrypted instruction corresponding to the specified class function.
[0074] Optionally, the application toolkit execution module is used to decrypt the encrypted instructions according to a preset decryption method to obtain the original instructions;
[0075] Determine the memory offset corresponding to the specified class function, and determine the specified location of the null instruction based on the offset;
[0076] Add the original instructions to the specified location to replace empty instructions in the empty instruction file.
[0077] Optionally, the device also includes a memory release module for releasing memory for specified class functions in the restored application toolkit, so as to delete the original instructions in the restored application toolkit.
[0078] The application toolkit invocation device provided in this embodiment of the invention can execute the application toolkit invocation method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0079] Example 4
[0080] Figure 7 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0081] like Figure 7As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0082] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0083] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 executes the various methods and processes described above, such as application toolkit method invocation.
[0084] In some embodiments, the application toolkit invocation method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the application toolkit invocation method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the application toolkit invocation method by any other suitable means (e.g., by means of firmware).
[0085] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0086] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0087] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0088] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0089] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0090] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0091] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0092] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method of invoking an application toolkit, characterized by: The application comprises the following steps: The application tool kit is hardened to obtain an empty instruction file and an encrypted file, wherein the encrypted file contains encrypted instructions of specified class functions, and the empty instruction file contains empty instructions of the specified class functions and a stub function, wherein the stub function is used to perceive the calling of the specified class functions; When it is determined that the specified class functions in the empty instruction file are called, the encrypted file is called to obtain the encrypted instructions; The encrypted instructions are decrypted to obtain original instructions, and the original instructions are used to replace the empty instructions in the empty instruction file, so that the application tool kit is executed; After the application tool kit is hardened to obtain the empty instruction file and the encrypted file, a dynamic library for restoring instructions is determined according to the empty instruction file and the encrypted file, wherein the dynamic library for restoring instructions contains the mapping relationship between the specified class functions and the encrypted instructions; When it is determined that the specified class functions in the empty instruction file are called, the encrypted file is called to obtain the encrypted instructions, comprising the following steps: when it is determined that the stub function in the empty instruction file is triggered, it is determined that the specified class functions are called; the encrypted file is called through the dynamic library for restoring instructions, so as to obtain the encrypted instructions corresponding to the specified class functions.
2. The method of claim 1, wherein, The application tool kit is hardened to obtain an empty instruction file and an encrypted file, comprising the following steps: Original instructions contained in specified class functions in the application tool kit are obtained; The original instructions are encrypted to obtain encrypted instructions, and the encrypted file is obtained according to the encrypted instructions; The original instructions of the specified class functions in the application tool kit are replaced by empty instructions, and a stub function is injected into the specified class functions, so as to obtain the empty instruction file.
3. The method of claim 1, wherein, The encrypted file is called through the dynamic library for restoring instructions, and the encrypted instructions corresponding to the specified class functions are obtained by querying the encrypted file according to the number, comprising the following steps: The encrypted instruction number matched with the specified class functions is determined according to the dynamic library for restoring instructions; The encrypted file is called through the dynamic library for restoring instructions, and the encrypted instructions corresponding to the specified class functions are obtained by querying the encrypted file according to the number.
4. The method of claim 1, wherein, The encrypted instructions are decrypted to obtain original instructions, and the original instructions are used to replace the empty instructions in the empty instruction file, so that the application tool kit is executed; The encrypted instructions are decrypted to obtain original instructions, and the original instructions are used to replace the empty instructions in the empty instruction file, so that the application tool kit is executed; The specified class functions in the restored application tool kit are released from memory, so that the original instructions in the restored application tool kit are deleted. The application comprises the following steps:
5. The method according to any one of claims 1 to 4, characterized in that, 6. An application toolkit invocation apparatus characterized by comprising: The application tool package reinforcement module is configured to reinforce the application tool package to obtain an empty instruction file and an encrypted file. The encrypted file contains encrypted instructions of a specified class function. The empty instruction file contains empty instructions of the specified class function and a stub function. The stub function is configured to perceive the call of the specified class function. The specified class function call module is configured to call the encrypted file to obtain the encrypted instructions when it is determined that the specified class function in the empty instruction file is called. The application tool package execution module is configured to decrypt the encrypted instructions to obtain original instructions, and replace the empty instructions in the empty instruction file with the original instructions, so as to restore and execute the application tool package. The device further includes an instruction restoration dynamic library determination module configured to determine an instruction restoration dynamic library according to the empty instruction file and the encrypted file. The instruction restoration dynamic library contains a mapping relationship between the specified class function and the encrypted instructions. The specified class function call module is configured to determine that the specified class function is called when it is determined that the stub function in the empty instruction file is triggered. The encrypted file is called through the instruction restoration dynamic library to obtain the encrypted instructions corresponding to the specified class function.
7. An electronic device, comprising: The electronic device includes: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the method of any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to execute the method of any one of claims 1-5 when executed.
Citation Information
Patent Citations
Java SDK code encryption and decryption method based on dynamic loading and terminal
CN111832014A
Application execution method and related device
CN113918285A