CN109933350B - Method and device for embedding codes in application and electronic equipment - Google Patents

Method and device for embedding codes in application and electronic equipment Download PDF

Info

Publication number
CN109933350B
CN109933350B CN201910173264.XA CN201910173264A CN109933350B CN 109933350 B CN109933350 B CN 109933350B CN 201910173264 A CN201910173264 A CN 201910173264A CN 109933350 B CN109933350 B CN 109933350B
Authority
CN
China
Prior art keywords
information
file
application
dynamic library
sdk
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201910173264.XA
Other languages
Chinese (zh)
Other versions
CN109933350A (en
Inventor
汪德嘉
华保健
邵根波
钱潇龄
孟啸龙
郑小敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Pay Egis Technology Co ltd
Jiangsu Payegis Information Security Technology Co ltd
Original Assignee
Jiangsu Pay Egis Technology Co ltd
Jiangsu Tongfudun Information Security Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Pay Egis Technology Co ltd, Jiangsu Tongfudun Information Security Technology Co ltd filed Critical Jiangsu Pay Egis Technology Co ltd
Priority to CN201910173264.XA priority Critical patent/CN109933350B/en
Publication of CN109933350A publication Critical patent/CN109933350A/en
Priority to PCT/CN2019/123871 priority patent/WO2020177429A1/en
Priority to ZA2021/00858A priority patent/ZA202100858B/en
Application granted granted Critical
Publication of CN109933350B publication Critical patent/CN109933350B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The invention discloses a method and a device for embedding codes in an application and electronic equipment, wherein the method comprises the following steps: integrating the SDK into the application, and embedding the loading information of the SDK into a dynamic library information list of an executable file of the application according to a preset loading sequence; modifying offset information and length information of dynamic library loading information contained in the executable file according to the file information of the SDK; modifying the loading sequence number information of the original dynamic library contained in the executable file and the offset address information of the code corresponding to the original dynamic library in the executable file, and modifying the sequence number information of the position information of the original dynamic library in the code segment; and generating an updating application file according to the modified executable file. The method can embed the SDK into any application according to the specified loading sequence without the source code, so that the application with the newly added SDK can dynamically call the SDK code according to the specified loading sequence when running, and the compatibility is higher.

Description

Method and device for embedding codes in application and electronic equipment
Technical Field
The invention relates to the technical field of code integration, in particular to a method and a device for embedding codes in an application and electronic equipment.
Background
SDK (Software Development Kit) generally refers to a collection of Development tools used by a Software engineer to build application Software for a particular Software package, Software framework, hardware platform, or operating system. When developing an application program, a technician can access the SDK into the application and directly use the function provided by the SDK. Therefore, the SDK is embedded in the application, which is beneficial to enriching the functions of the application program and meeting various requirements of users.
The prior art (CN 107463359 a) discloses a convenient method of embedding code in an iOS ipa package, specifically: (1) hook script to add SDK: adding a hook script into the engineering code in the iOS engineering source code, and generating an ipa (iPhone application) publishing packet through a packaging tool; (2) implanting a code: decompressing the ipa packet, compiling codes to be introduced into a dynamic library, and adding the dynamic library into a Framework directory; (3) re-signing and repacking into a new ipa; (4) and dynamic calling, wherein when the new ipa package runs, the function of the implanted code is called through dynamic connection of the hook script and the dynamic library. The method can reduce the workload of SDK access.
However, the inventor finds that a scheme capable of embedding the SDK according to the specified loading order so that the application embedded with the SDK can dynamically call the SDK code according to the specified loading order when running is absent in the prior art in the process of implementing the present invention.
Disclosure of Invention
In view of the above, the present invention is proposed to provide a method, an apparatus and an electronic device for embedding code in an application that overcome the above problems or at least partially solve the above problems.
According to an aspect of the present invention, there is provided a method of embedding code in an application, comprising:
integrating the SDK into the application, and embedding the loading information of the SDK into a dynamic library information list of an executable file of the application according to a preset loading sequence;
modifying offset information and length information of dynamic library loading information contained in the executable file according to the file information of the SDK;
modifying the loading sequence number information of the original dynamic library contained in the executable file and the offset address information of the code corresponding to the original dynamic library in the executable file, and modifying the sequence number information of the position information of the original dynamic library in the code segment;
and generating an updating application file according to the modified executable file.
Optionally, the file information of the SDK specifically includes at least one of the following: dynamic library name information, file storage path information, file size information and structure information; the dynamic library loading information specifically includes at least one of: redirection information, static binding information.
Optionally, modifying the sequence number information of the location information of the original dynamic library in the code segment specifically includes:
calculating symbol pointer information according to the paragraph number information and the offset information of the dynamic library, and determining initial position information and calling code position information of the original dynamic library according to the symbol pointer information;
and modifying the initial position information of the original dynamic library and the serial number information of the calling code position information.
Optionally, the loading information of the SDK specifically includes at least one of the following: file path information, name information.
Optionally, the method further comprises:
and performing re-signing authentication processing on the updated application file.
Optionally, the method is applied to an IOS application, and before the method is executed, the method further includes:
decompressing a program application file of the IOS application, and extracting an executable file of the IOS application;
the method further comprises the following steps: and performing re-signing authentication processing on the updated application file.
According to another aspect of the present invention, there is provided an apparatus for embedding code in an application, including:
the integration module is suitable for integrating the SDK into the application and embedding the loading information of the SDK into a dynamic library information list of the executable file of the application according to a preset loading sequence;
the first modification module is suitable for modifying the offset information and the length information of the dynamic library loading information contained in the executable file according to the file information of the SDK;
the second modification module is suitable for modifying the loading sequence number information of the original dynamic library contained in the executable file and the offset address information of the code corresponding to the original dynamic library in the executable file, and modifying the sequence number information of the position information of the original dynamic library in the code segment;
and the application file generation module is suitable for generating an updated application file according to the modified executable file.
Optionally, the file information of the SDK specifically includes at least one of the following: dynamic library name information, file storage path information, file size information and structure information; the dynamic library loading information specifically includes at least one of: redirection information, static binding information.
Optionally, the second modification module is further adapted to:
calculating symbol pointer information according to the paragraph number information and the offset information of the dynamic library, and determining initial position information and calling code position information of the original dynamic library according to the symbol pointer information;
and modifying the initial position information of the original dynamic library and the serial number information of the calling code position information.
Optionally, the loading information of the SDK specifically includes at least one of the following: file path information, name information.
Optionally, wherein the apparatus further comprises:
the extraction module is suitable for decompressing the program application file of the IOS application and extracting the executable file of the IOS application;
and the re-signing module is suitable for performing re-signing authentication processing on the updated application file.
According to still another aspect of the present invention, there is provided an electronic apparatus including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the method for embedding the code in the application.
According to still another aspect of the present invention, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction causes a processor to perform operations corresponding to the method for embedding code in an application as described above.
According to the method, the device and the electronic equipment for embedding the codes in the application, provided by the invention, the method comprises the following steps: integrating the SDK into the application, and embedding the loading information of the SDK into a dynamic library information list of an executable file of the application according to a preset loading sequence; modifying offset information and length information of dynamic library loading information contained in the executable file according to the file information of the SDK; modifying the loading sequence number information of the original dynamic library contained in the executable file and the offset address information of the code corresponding to the original dynamic library in the executable file, and modifying the sequence number information of the position information of the original dynamic library in the code segment; and generating an updating application file according to the modified executable file. The method can embed the SDK into any application according to the specified loading sequence without the source code, so that the application added with the SDK can dynamically call the SDK code according to the specified loading sequence when running, and the compatibility is higher.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 shows a flow diagram of a method of embedding code in an application, according to one embodiment of the invention;
FIG. 2 shows a flow diagram of a method of embedding code in an application, according to another embodiment of the invention;
FIG. 3 shows a schematic structural diagram of an apparatus for embedding code in an application according to another embodiment of the present invention;
fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 shows a flow diagram of a method for embedding code in an application according to an embodiment of the invention, as shown in fig. 1, the method comprising:
step S101, integrating the SDK into the application, and embedding the loading information of the SDK into a dynamic library information list of the executable file of the application according to a preset loading sequence.
The SDK is integrated into the application, a dynamic library information list is searched in a loading command of an executable file of the application, and loading information of the SDK, such as a file path and a name of the SDK, is inserted into the dynamic library information list according to a preset loading sequence. The preset loading order is an execution order of the embedded code, for example, the embedded code may be executed first or executed according to other specified orders, and a person skilled in the art may set the preset loading order according to actual needs.
And step S102, modifying the offset information and the length information of the dynamic library loading information contained in the executable file according to the file information of the SDK.
Firstly, reading dynamic library loading information in an executable file, such as redirection information, static binding information and the like; then, according to the file information of the embedded SDK, such as the name of the dynamic library, the path of storing the file, the size information of the file, the structure information, etc., the offset and the length of the loading information of the dynamic library are modified.
Step S103, modifying the loading sequence number information of the original dynamic library contained in the executable file and the offset address information of the code corresponding to the original dynamic library in the executable file, and modifying the sequence number information of the location information of the original dynamic library in the code segment.
Because the SDK is newly added, the binding information of the dynamic library in the executable file needs to be modified, specifically, the loading sequence number information of the original dynamic library and the offset address information of the code corresponding to the original dynamic library in the file are modified. Meanwhile, the sequence number of the position information of the original dynamic library in the code segment needs to be modified.
And step S104, generating an updating application file according to the modified executable file.
And replacing the original executable file by using the modified executable file, and repackaging the original executable file according to the modified executable file to generate an updated application file. In the subsequent process, when the updating application is started, according to the modified dynamic library information list, the newly added SDK can be implanted with codes according to the preset loading sequence.
According to the code embedded in the application provided by the embodiment, firstly, the SDK is integrated into the application, and the loading information of the SDK is embedded in a dynamic library information list of an executable file of the application according to a preset loading sequence; then, according to the file information of the SDK, modifying the offset information and the length information of the dynamic library loading information contained in the executable file; secondly, modifying the loading sequence number information of the original dynamic library contained in the executable file and the offset address information of the code corresponding to the original dynamic library in the executable file, and modifying the sequence number information of the position information of the original dynamic library in the code segment; and finally generating an updating application file according to the modified executable file. The method can embed the SDK into any application according to the specified loading sequence without the source code, so that the application with the newly added SDK can dynamically call the SDK code according to the specified loading sequence when running, and the compatibility is higher.
Fig. 2 is a flowchart illustrating a method for embedding code in an application according to another embodiment of the present invention, which is described by taking an IOS application as an example in this embodiment, and as shown in fig. 2, the method includes:
step S201, decompressing the program application file of the IOS application, extracting the executable file of the IOS application, and integrating the SDK into the application.
The ipa installation package of the IOS application is decompressed, Mach-o files (executable files) are extracted, and the SDK is integrated in the application.
Step S202, embedding the loading information of the SDK in the dynamic library information list of the executable file of the application according to a preset loading sequence.
The SDK is integrated into the application, a dynamic library information list is searched in a loading command of an executable file of the application, and loading information of the SDK, such as a file path and a name of the SDK, is inserted into the dynamic library information list according to a preset loading sequence. The preset loading order is an execution order of the embedded code, for example, the embedded code may be executed first or executed according to other specified orders, and a person skilled in the art may set the preset loading order according to actual needs.
It is to be noted in particular that: in the prior art, after the SDK is inserted into the system library, the added third-party library of the system library and the application itself are preferentially loaded, which may cause that the newly added SDK part function cannot be normally loaded and cause a flash back. Therefore, a technical solution capable of preferentially loading the newly added SDK is lacking in the prior art. The method provided by the embodiment can load the newly added SDK according to any loading sequence, wherein when the preset loading sequence is specifically the first loading sequence (namely, the first loading sequence), the problem of error crash caused by preferential loading of the system library and the third-party library added by the application itself can be solved.
Specifically, a list of dynamic library information is searched in a loading command of the executable file, and loading information of the SDK is inserted into the list of dynamic library information according to a preset loading sequence, wherein the loading information of the SDK includes at least one of the following: file path information, name information.
Step S203, according to the file information of the SDK, modifying the offset information and the length information of the dynamic library loading information contained in the executable file.
Reading dynamic library loading information in the executable file, and then modifying offset information and length information of the dynamic loading information according to the file information of the SDK, wherein the dynamic library loading information specifically comprises at least one of the following: redirection information, static binding information. The file information of the SDK specifically includes at least one of: dynamic library name information, file storage path information, file size information and structure information.
Frame, wherein the added offset length in the available load command is calculated by file path "@ executable _ path/frames/Payegis SharkIV. frame/Payegis SharkIV", the available redirection information table is added to be 0 by traversing the values of OPCODE and IMMEDIATE in the redirection information and static binding information table, the added length of the static binding information table is 6, and the added length is 16 after filling 0 bit.
Step S204, modifying the loading sequence number information of the original dynamic library contained in the executable file and the offset address information of the code corresponding to the original dynamic library in the executable file.
And traversing the binding information of the dynamic library in the executable file, wherein the loading sequence number of the original dynamic library and the offset address of the code corresponding to the original dynamic library in the executable file need to be modified due to the addition of the SDK.
Taking the preset loading sequence as the first loading sequence as an example, briefly, 10 original dynamic libraries are provided, the serial numbers of the original dynamic libraries are 1, 2 and 3 … … 10, and the dynamic libraries corresponding to the SDK are added before all the original dynamic libraries, so that the serial number of the newly added dynamic library is 1, the serial numbers of the original dynamic libraries are sequentially modified to 2, 3 and 4 … … 11, and meanwhile, the offset addresses of the codes corresponding to the original dynamic libraries in the executable file need to be modified.
Step S205, calculating symbol pointer information according to the paragraph number information and the offset information of the dynamic library, and determining the initial position information and the calling code position information of the original dynamic library according to the symbol pointer information; and modifying the initial position information of the original dynamic library and the serial number information of the calling code position information.
According to the symbol pointer information calculated by the paragraph number information and the offset information of the dynamic library, the initial position information and the calling code position information of the original dynamic library under the code segment can be obtained, and then the initial position information and the serial number of the calling code position information of the original dynamic library are modified.
Step S206, generating an updating application file according to the modified executable file, and performing re-signing authentication processing on the updating application file.
And replacing the modified executable file with the original executable file, repackaging the modified executable file to generate an updated application file, and performing re-signing authentication by using a re-signing tool. In the subsequent process, when the update application is started, the added SDK will call the implanted codes according to the preset loading sequence according to the modified list of dynamic library information.
It can be seen that the method of the present embodiment can be summarized as the following processing stages: (1) and (5) decompressing and extracting. (2) And in the executable file modification processing stage, the loading information, the binding information and the like of the executable file are specifically modified. (3) And in the repacking stage, specifically replacing the original executable file with the modified executable file to generate a new application file, and performing re-signing on the new application file to form a new ipa package.
Therefore, according to the method of the embodiment, the SDK can be embedded into any application according to a specified loading sequence, such as a security component (signature verification, secondary packaging detection, jail-crossing detection, injection prevention and the like), a dynamic monitoring rent, a debugging module and the like, so that the SDK codes can be called according to the specified loading sequence when the application runs, and the application scene is wide. When the preset loading sequence is the first loading sequence, the problem that after the SDK is inserted into a system library, other library information is preferentially loaded, the newly added SDK is wrong or even crashed can be solved, and the compatibility is better.
Fig. 3 is a schematic structural diagram of an apparatus for embedding a code in an application according to another embodiment of the present invention, as shown in fig. 3, the apparatus including: the system comprises an integration module, a first modification module, a second modification module and an application file generation module.
The integration module 31 is adapted to integrate the SDK into the application, and embed the loading information of the SDK in a dynamic library information list of the executable file of the application according to a preset loading order;
the first modification module 32 is adapted to modify offset information and length information of dynamic library loading information included in the executable file according to the file information of the SDK;
the second modification module 33 is adapted to modify the loading sequence number information of the original dynamic library contained in the executable file and the offset address information of the code corresponding to the original dynamic library in the executable file, and modify the sequence number information of the position information of the original dynamic library in the code segment;
an application file generation module 34 adapted to generate an updated application file from the modified executable file.
In an optional manner, the file information of the SDK specifically includes at least one of the following: dynamic library name information, file storage path information, file size information and structure information; the dynamic library loading information specifically includes at least one of: redirection information, static binding information.
In an alternative manner, the second modification module 32 is further adapted to:
calculating symbol pointer information according to the paragraph number information and the offset information of the dynamic library, and determining initial position information and calling code position information of the original dynamic library according to the symbol pointer information;
and modifying the initial position information of the original dynamic library and the serial number information of the calling code position information.
In an optional manner, the loading information of the SDK specifically includes at least one of the following: file path information, name information.
In an optional manner, the apparatus for embedding a code in an application further includes:
the extraction module is suitable for decompressing the program application file of the IOS application and extracting the executable file of the IOS application;
and the re-signing module is suitable for performing re-signing authentication processing on the updated application file.
The specific structure and the working principle of each module may refer to the description of the corresponding step in the method embodiment, and are not described herein again.
The embodiment of the present application provides a non-volatile computer storage medium, where at least one executable instruction is stored in the computer storage medium, and the computer executable instruction may execute the method for embedding codes in an application in any of the above method embodiments.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the electronic device.
As shown in fig. 4, the electronic device may include: a processor (processor)402, a Communications Interface 404, a memory 406, and a Communications bus 408.
Wherein:
the processor 402, communication interface 404, and memory 406 communicate with each other via a communication bus 408.
A communication interface 404 for communicating with network elements of other devices, such as clients or other servers.
The processor 402, configured to execute the program 410, may specifically perform relevant steps in the above-described method embodiment of embedding code in an application.
In particular, program 410 may include program code comprising computer operating instructions.
The processor 402 may be a central processing unit CPU or an application Specific Integrated circuit asic or one or more Integrated circuits configured to implement embodiments of the present invention. The electronic device comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 406 for storing a program 410. Memory 406 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 410 may specifically be adapted to cause the processor 402 to perform a method of embedding code in an application in any of the method embodiments described above. For specific implementation of each step in the program 410, reference may be made to corresponding steps and corresponding descriptions in units in the foregoing method embodiment for embedding a code in an application, which are not described herein again.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in an electronic device according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (12)

1. A method of embedding code in an application, comprising:
integrating the SDK into an application, and embedding the loading information of the SDK into a dynamic library information list of an executable file of the application according to a preset loading sequence; wherein the preset loading sequence is a first loading sequence;
modifying offset information and length information of dynamic library loading information contained in the executable file according to the file information of the SDK;
modifying the loading sequence number information of an original dynamic library contained in the executable file and the offset address information of a code corresponding to the original dynamic library in the executable file, and modifying the sequence number information of the position information of the original dynamic library in a code segment;
and generating an updating application file according to the modified executable file.
2. The method of claim 1, wherein the file information of the SDK specifically includes at least one of: dynamic library name information, file storage path information, file size information and structure information; the dynamic library loading information specifically includes at least one of: redirection information, static binding information.
3. The method according to claim 1, wherein the modifying sequence number information of the location information of the original dynamic library in the code segment specifically comprises:
calculating symbol pointer information according to the paragraph number information and the offset information of the dynamic library, and determining initial position information and calling code position information of the original dynamic library according to the symbol pointer information;
and modifying the initial position information of the original dynamic library and the serial number information of the calling code position information.
4. The method of claim 1, wherein the loading information of the SDK specifically comprises at least one of: file path information, name information.
5. The method of any of claims 1-4, wherein the method is applied to an IOS application, then before the method is executed, further comprising:
decompressing a program application file of the IOS application, and extracting an executable file of the IOS application; the method further comprises: and performing re-signing authentication processing on the updated application file.
6. An apparatus for embedding code in an application, comprising:
the integration module is suitable for integrating the SDK into the application and embedding the loading information of the SDK into a dynamic library information list of the executable file of the application according to a preset loading sequence; wherein the preset loading sequence is a first loading sequence;
the first modification module is suitable for modifying the offset information and the length information of the dynamic library loading information contained in the executable file according to the file information of the SDK;
the second modification module is suitable for modifying the loading sequence number information of an original dynamic library contained in the executable file and the offset address information of a code corresponding to the original dynamic library in the executable file, and modifying the sequence number information of the position information of the original dynamic library in a code segment;
and the application file generation module is suitable for generating an updated application file according to the modified executable file.
7. The apparatus of claim 6, wherein the file information of the SDK specifically includes at least one of: dynamic library name information, file storage path information, file size information and structure information; the dynamic library loading information specifically includes at least one of: redirection information, static binding information.
8. The apparatus of claim 6, wherein the second modification module is further adapted to:
calculating symbol pointer information according to the paragraph number information and the offset information of the dynamic library, and determining initial position information and calling code position information of the original dynamic library according to the symbol pointer information;
and modifying the initial position information of the original dynamic library and the serial number information of the calling code position information.
9. The apparatus of claim 6, wherein the loading information of the SDK specifically comprises at least one of: file path information, name information.
10. The apparatus of any of claims 6-9, wherein the apparatus further comprises:
the extraction module is suitable for decompressing the program application file of the IOS application and extracting the executable file of the IOS application;
and the re-signing module is suitable for performing re-signing authentication processing on the updated application file.
11. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the corresponding operation of the method for embedding the code in the application according to any one of claims 1-5.
12. A computer storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the method of embedding code in an application as claimed in any one of claims 1 to 5.
CN201910173264.XA 2019-03-07 2019-03-07 Method and device for embedding codes in application and electronic equipment Expired - Fee Related CN109933350B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201910173264.XA CN109933350B (en) 2019-03-07 2019-03-07 Method and device for embedding codes in application and electronic equipment
PCT/CN2019/123871 WO2020177429A1 (en) 2019-03-07 2019-12-09 Method and apparatus for embedding codes in application, and electronic device
ZA2021/00858A ZA202100858B (en) 2019-03-07 2021-02-08 A method and apparatus for embedding codes in an application, and an electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910173264.XA CN109933350B (en) 2019-03-07 2019-03-07 Method and device for embedding codes in application and electronic equipment

Publications (2)

Publication Number Publication Date
CN109933350A CN109933350A (en) 2019-06-25
CN109933350B true CN109933350B (en) 2021-07-16

Family

ID=66986651

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910173264.XA Expired - Fee Related CN109933350B (en) 2019-03-07 2019-03-07 Method and device for embedding codes in application and electronic equipment

Country Status (3)

Country Link
CN (1) CN109933350B (en)
WO (1) WO2020177429A1 (en)
ZA (1) ZA202100858B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109933350B (en) * 2019-03-07 2021-07-16 江苏通付盾信息安全技术有限公司 Method and device for embedding codes in application and electronic equipment
CN110750545B (en) * 2019-09-03 2023-07-25 抖音视界有限公司 Dynamic library heat updating method, device, medium and equipment
CN110674474B (en) * 2019-09-19 2021-07-20 大唐高鸿信安(浙江)信息科技有限公司 Operation control method and device for application program
US20230102816A1 (en) * 2021-09-30 2023-03-30 Vmware, Inc. Automatic updating of application functionality
CN114237742B (en) * 2021-12-10 2023-09-01 北京奇艺世纪科技有限公司 Method, device, terminal and storage medium for loading and compiling dynamic library

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101727345B (en) * 2008-10-29 2013-09-04 国际商业机器公司 Method and system for controlling loading state of dynamic link library DLL
CN105094878B (en) * 2014-05-22 2019-02-22 阿里巴巴集团控股有限公司 A kind of method and apparatus of integrated system library file
KR101518420B1 (en) * 2014-11-11 2015-05-07 주식회사 에스이웍스 Apparatus and method for managing apk file in a android platform
CN105511935B (en) * 2015-12-09 2019-07-09 网易(杭州)网络有限公司 The acquisition methods and device of resource index value
CN107305495A (en) * 2016-04-19 2017-10-31 华为技术有限公司 Realize the method and terminal of software installation packet function modification
CN107463359A (en) * 2016-06-02 2017-12-12 深圳市慧动创想科技有限公司 A kind of convenient method in iOS ipa bag code implants
CN108595187A (en) * 2018-03-27 2018-09-28 北京美好人生伙伴信息技术有限公司 Method, device and the storage medium of Android installation kit integrated software development kit
CN109376087A (en) * 2018-10-22 2019-02-22 北京奇艺世纪科技有限公司 A kind of method for testing software, device and electronic equipment
CN109933350B (en) * 2019-03-07 2021-07-16 江苏通付盾信息安全技术有限公司 Method and device for embedding codes in application and electronic equipment

Also Published As

Publication number Publication date
ZA202100858B (en) 2023-11-29
WO2020177429A1 (en) 2020-09-10
CN109933350A (en) 2019-06-25

Similar Documents

Publication Publication Date Title
CN109933350B (en) Method and device for embedding codes in application and electronic equipment
US20160019072A1 (en) Dynamic determination of application server runtime classloading
EP2966566A1 (en) Driver program loading method and embedded device
CN106295370B (en) Method and device for reinforcing Dynamic Link Library (DLL) file of installation package
CN110442327B (en) Application program construction method, device and server
CN104866293B (en) A kind of method and device to Android application extensions for Microsoft Internet Explorer & Microsoft Office
CN109766099B (en) Front-end source code compiling method and device, storage medium and computer equipment
CN108279941B (en) Application program compression method and device
CN106775781B (en) Method and device for reducing application installation packages and electronic equipment
CN112882732A (en) Method and device for updating function codes in Software Development Kit (SDK)
CN111124480A (en) Application package generation method and device, electronic equipment and storage medium
CN109766123B (en) Application program packaging method and device
CN114895935A (en) Method and device for flashing vehicle ECU, electronic equipment and storage medium
CN109934016B (en) Application signature verification method and device and electronic equipment
CN111651169B (en) Block chain intelligent contract operation method and system based on web container
KR102141749B1 (en) APP program execution method and device
CN111625225A (en) Program specified data output method and device
CN109032612B (en) Interface calling method and device of hybrid application and computer readable storage medium
CN107092601B (en) Resource file construction method, resource file application method and device
CN106648788B (en) Application program installation method and device
CN106778270B (en) Malicious application detection method and system
CN110286936B (en) Thermal restoration method, thermal restoration device, electronic equipment and storage medium
CN110457151B (en) Thermal restoration method and device and readable storage medium
CN111475220B (en) Cold start method and device, electronic equipment and computer storage medium
CN114756229A (en) Development page generation method based on micro front end and related device thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210604

Address after: 4f, building C2, Suzhou 2.5 Industrial Park, 88 Dongchang Road, Suzhou Industrial Park, Jiangsu Province, 215000

Applicant after: JIANGSU PAYEGIS INFORMATION SECURITY TECHNOLOGY Co.,Ltd.

Applicant after: JIANGSU PAY EGIS TECHNOLOGY Co.,Ltd.

Address before: 215021 4 building, 2.5 Industrial Park, building 2.5, Dongchang Road, Suzhou Industrial Park, Jiangsu, China, C2

Applicant before: JIANGSU PAYEGIS INFORMATION SECURITY TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210716