Analyzing method of application installation package and terminal
By reading and analyzing the tail area identifier of the application installation package, the calculated length of the application installation package is calculated, and the readable installation package is reconstructed based on the real length, which solves the problem that the existing technology cannot parse the non-standard application installation package, and realizes the information acquisition and analysis of the non-standard format application installation package.
Patent Information
- Application Number
- CN202510026202.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art cannot parse non-standard application installation packages that add extended information to application files, especially in areas with high security requirements, such as financial terminals.
By reading the tail area identifier of the application installation package to be tested, the front length, the fixed length of the tail area and the variable length of the tail area are determined, and the calculated length of the application installation package is calculated. Then, the real length of the application installation package is read through the length acquisition function. If the two are inconsistent, the application installation package will be refactored, the non-standard part will be removed, and the readable installation package that meets the standard format will be regenerated, and then the native application installation package analysis instructions will be parsed.
It realizes the acquisition of non-standard format application installation packages, expands the scope of application installation package analysis methods, and can effectively analyze and process modified installation packages in areas with high security requirements.
Smart Images

Figure CN119883301A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software development, and in particular to a method and a terminal for parsing an application installation package. Background Art
[0002] The installation package of an application usually exists in the form of a compressed package with a fixed format, such as OpenHarmony's .hap suffix file and Android's .apk suffix file. In many cases, there is a need to parse the information of the application's program file to obtain the application's package name, icon, application name, version number and other information. For example, in the application market, it is necessary to parse the application file uploaded by the user to obtain the application information uploaded by the user and perform security verification or source verification and other judgments. In the application installation PC tool, the tool needs to parse the application file to obtain the corresponding information and display it.
[0003] Android and OpenHarmony often provide native executable programs for parsing applications, such as Android's aapt.exe. Users can parse application files through the specified instructions provided by aapt to obtain a series of information such as the application package name, name, version, icon, etc. However, the native tools provided are only applicable to applications whose application files comply with native specifications. However, in actual applications, especially in some fields with higher security requirements, such as the financial terminal field, some customers need to add some extended information to the application files, such as signature information, file permission information, file identification information, etc. At this time, the use of native aapt does not support the parsing of application information for such application files. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method and a terminal for parsing an application installation package, so as to expand the application scope of the method for parsing an application installation package.
[0005] A method for parsing an application installation package, the method comprising: Obtaining a tail area identifier of the application installation package to be tested, obtaining a leading length before the tail area identifier, and accumulating a fixed length of the tail area starting from the tail area identifier; Continue reading the variable length of the tail area after the fixed length of the tail area; Obtaining a calculated length of the application installation package according to the prefix length, the fixed length of the tail area, and the variable length of the tail area; Reading the actual length of the application installation package through a length acquisition function, and if the actual length is inconsistent with the calculated length, regenerating a readable installation package corresponding to the application installation package through the calculated length; The readable installation package is parsed using native application installation package parsing instructions.
[0006] In order to solve the above technical problems, another technical solution adopted by the present invention is: A terminal for parsing an application installation package, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the following steps when executing the computer program: Obtaining a tail area identifier of the application installation package to be tested, obtaining a leading length before the tail area identifier, and accumulating a fixed length of the tail area starting from the tail area identifier; Continue reading the variable length of the tail area after the fixed length of the tail area; Obtaining a calculated length of the application installation package according to the prefix length, the fixed length of the tail area, and the variable length of the tail area; Reading the actual length of the application installation package through a length acquisition function, and if the actual length is inconsistent with the calculated length, regenerating a readable installation package corresponding to the application installation package through the calculated length; The readable installation package is parsed using native application installation package parsing instructions.
[0007] The beneficial effect of the present invention is that: for the problem that the native application installation package parsing instruction cannot parse the modified installation package, by reading the tail area identifier of the application installation package to be tested, the leading length, the fixed length of the tail area and the variable length of the tail area are determined according to the tail area identifier, and the calculated length corresponding to the standard installation package is obtained; then the real length of the application installation package is read through the length acquisition function, if the two are inconsistent, it means that the application installation package is not in a standard format and cannot be parsed by the native application installation package parsing instruction, then the non-standard part in the application installation package is removed by reconstruction, and a readable installation package that conforms to the standard format is reconstructed only according to the calculated length, then the information in the readable installation package can be obtained through the native application installation package parsing instruction, thereby realizing the information acquisition of the application installation package in the non-standard format. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 A flowchart of a method for parsing an application installation package provided by an embodiment of the present invention; Figure 2 A system architecture diagram for implementing a method for parsing an application installation package provided by an embodiment of the present invention; Figure 3 A schematic diagram of the structure of a parsing terminal for an application installation package provided by an embodiment of the present invention; Description of labels: 1. A terminal for parsing an application installation package; 2. A processor; 3. A memory. DETAILED DESCRIPTION
[0009] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in conjunction with the implementation modes and the accompanying drawings.
[0010] Please refer to Figure 1 , a method for parsing an application installation package, the method comprising: Obtaining a tail area identifier of the application installation package to be tested, obtaining a leading length before the tail area identifier, and accumulating a fixed length of the tail area starting from the tail area identifier; Continue reading the variable length of the tail area after the fixed length of the tail area; Obtaining a calculated length of the application installation package according to the prefix length, the fixed length of the tail area, and the variable length of the tail area; Reading the actual length of the application installation package through a length acquisition function, and if the actual length is inconsistent with the calculated length, regenerating a readable installation package corresponding to the application installation package through the calculated length; The readable installation package is parsed using native application installation package parsing instructions.
[0011] From the above description, it can be seen that the beneficial effects of the present invention are: for the problem that the native application installation package parsing instruction cannot parse the modified installation package, by reading the tail area identifier of the application installation package to be tested, the leading length, the fixed length of the tail area and the variable length of the tail area are determined according to the tail area identifier, and the calculated length corresponding to the standard installation package is obtained; then the actual length of the application installation package is read through the length acquisition function. If the two are inconsistent, it means that the application installation package is not in a standard format and cannot be parsed by the native application installation package parsing instruction. Then, the non-standard part in the application installation package is removed by reconstruction, and a readable installation package that conforms to the standard format is reconstructed only according to the calculated length. Then, the information in the readable installation package can be obtained through the native application installation package parsing instruction, thereby realizing the information acquisition of the application installation package in the non-standard format.
[0012] Further, the step of obtaining the tail area identifier of the installation package of the application to be tested includes: The byte length of the tail area identifier is obtained, and a traversal length greater than or equal to the byte length is used to cyclically read and record an offset from the tail of the application installation package until the tail area identifier is obtained.
[0013] From the above description, it can be seen that the packaging method of the application installation package has corresponding formats in different systems, so that the application installation package can be parsed and installed normally during the installation process. Therefore, different formats will have corresponding byte lengths of the tail area identifier. In the process of looking for the tail area identifier, traversal is performed in a manner greater than or equal to the byte length. This can ensure that the tail area identifier will not be disassembled in multiple traversal processes, thereby balancing the number of traversals and the amount of data that needs to be processed in a single traversal process, thereby improving the efficiency of the traversal.
[0014] Furthermore, the step of accumulating the fixed length of the tail area starting from the tail area identifier includes: A standard format corresponding to the application installation package is obtained, and a fixed length of the tail area is accumulated starting from the tail area identifier according to the standard format.
[0015] From the above description, it can be seen that according to the standard format of the application installation package, after determining the tail area identifier, the fixed length of the tail area begins to be accumulated. The other parts in the standard format can be determined through the fixed tail area identifier, thereby obtaining the fixed length of each part in the standard format.
[0016] Further, regenerating a readable installation package corresponding to the application installation package by calculating the length includes: Copying the application installation package, and intercepting the copied application installation package according to the calculated length to obtain a readable installation package; The method of parsing the readable installation package by using the native application installation package parsing instruction includes: Delete the readable installation package.
[0017] From the above description, it can be seen that after the application installation package is copied, the copied application installation package is truncated according to the calculated length to obtain a readable installation package, and the original application installation package is retained. The installation package is parsed through the additionally generated readable installation package, and the readable installation package is deleted after parsing. The readable installation package is deleted after completing the role of assisting in reading the installation package information, and will not affect the installation process of the original application installation package.
[0018] Further, parsing the readable installation package by using the native application installation package parsing instruction includes: Parsing the readable installation package using a native application installation package parsing instruction to obtain a parsing result; The parsing result is associated with the application installation package and stored.
[0019] From the above description, it can be seen that after the application installation package is transformed into a readable installation package, since the parts that are inconsistent with the standard format are removed, the readable installation package can be parsed through the native application installation package parsing instructions to obtain relevant information of the installation package. Since the readable installation package is the installation package in the standard format transformed by the application installation package, the information obtained from the readable installation package is the information of the corresponding application installation package, which can be directly associated and stored for use as the information of the application installation package.
[0020] Please refer to Figure 3 , a parsing terminal for an application installation package, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the following steps when executing the computer program: Obtaining a tail area identifier of the application installation package to be tested, obtaining a leading length before the tail area identifier, and accumulating a fixed length of the tail area starting from the tail area identifier; Continue reading the variable length of the tail area after the fixed length of the tail area; Obtaining a calculated length of the application installation package according to the prefix length, the fixed length of the tail area, and the variable length of the tail area; Reading the actual length of the application installation package through a length acquisition function, and if the actual length is inconsistent with the calculated length, regenerating a readable installation package corresponding to the application installation package through the calculated length; The readable installation package is parsed using native application installation package parsing instructions.
[0021] The beneficial effect of the present invention is that: for the problem that the native application installation package parsing instruction cannot parse the modified installation package, by reading the tail area identifier of the application installation package to be tested, the leading length, the fixed length of the tail area and the variable length of the tail area are determined according to the tail area identifier, and the calculated length corresponding to the standard installation package is obtained; then the real length of the application installation package is read through the length acquisition function, if the two are inconsistent, it means that the application installation package is not in a standard format and cannot be parsed by the native application installation package parsing instruction, then the non-standard part in the application installation package is removed by reconstruction, and a readable installation package that conforms to the standard format is reconstructed only according to the calculated length, then the information in the readable installation package can be obtained through the native application installation package parsing instruction, thereby realizing the information acquisition of the application installation package in the non-standard format.
[0022] Further, the step of obtaining the tail area identifier of the installation package of the application to be tested includes: The byte length of the tail area identifier is obtained, and a traversal length greater than or equal to the byte length is used to cyclically read and record an offset from the tail of the application installation package until the tail area identifier is obtained.
[0023] From the above description, it can be seen that the packaging method of the application installation package has corresponding formats in different systems, so that the application installation package can be parsed and installed normally during the installation process. Therefore, different formats will have corresponding byte lengths of the tail area identifier. In the process of looking for the tail area identifier, traversal is performed in a manner greater than or equal to the byte length. This can ensure that the tail area identifier will not be disassembled in multiple traversal processes, thereby balancing the number of traversals and the amount of data that needs to be processed in a single traversal process, thereby improving the efficiency of the traversal.
[0024] Furthermore, the step of accumulating the fixed length of the tail area starting from the tail area identifier includes: A standard format corresponding to the application installation package is obtained, and a fixed length of the tail area is accumulated starting from the tail area identifier according to the standard format.
[0025] From the above description, it can be seen that according to the standard format of the application installation package, after determining the tail area identifier, the fixed length of the tail area begins to be accumulated. The other parts in the standard format can be determined through the fixed tail area identifier, thereby obtaining the fixed length of each part in the standard format.
[0026] Further, regenerating a readable installation package corresponding to the application installation package by calculating the length includes: Copying the application installation package, and intercepting the copied application installation package according to the calculated length to obtain a readable installation package; The method of parsing the readable installation package by using the native application installation package parsing instruction includes: Delete the readable installation package.
[0027] From the above description, it can be seen that after the application installation package is copied, the copied application installation package is truncated according to the calculated length to obtain a readable installation package, and the original application installation package is retained. The installation package is parsed through the additionally generated readable installation package, and the readable installation package is deleted after parsing. The readable installation package is deleted after completing the role of assisting in reading the installation package information, and will not affect the installation process of the original application installation package.
[0028] Further, parsing the readable installation package by using the native application installation package parsing instruction includes: Parsing the readable installation package using a native application installation package parsing instruction to obtain a parsing result; The parsing result is associated with the application installation package and stored.
[0029] From the above description, it can be seen that after the application installation package is transformed into a readable installation package, since the parts that are inconsistent with the standard format are removed, the readable installation package can be parsed through the native application installation package parsing instructions to obtain relevant information of the installation package. Since the readable installation package is the installation package in the standard format transformed by the application installation package, the information obtained from the readable installation package is the information of the corresponding application installation package, which can be directly associated and stored for use as the information of the application installation package.
[0030] The above-mentioned method and terminal for parsing an application installation package of the present invention can be applied to scenarios where the application installation package needs to be parsed to obtain basic information, especially scenarios where the application installation package is not completely in a standard format, such as an installation package with signature data added in a financial terminal, which is explained below through a specific implementation method.
[0031] Please refer to the figure, the first embodiment of the present invention is: A method for parsing an application installation package, comprising the steps of: S1. Obtain the tail area identifier of the application installation package to be tested, obtain the leading length before the tail area identifier, and accumulate the fixed length of the tail area starting from the tail area identifier. It can be seen that the tail area identifier is an identifier that the main part of the application installation package has ended, so obtaining the tail area identifier can determine the length of the main part before the tail area identifier, which is usually the main content of the application installation package. Usually, changes in this part of the content will not affect the parsing of the application installation package by the native application installation package parsing instruction.
[0032] In an optional implementation, obtaining the tail area identifier of the application installation package to be tested in S1 includes: obtaining the byte length of the tail area identifier, starting from the tail of the application installation package with a traversal length greater than or equal to the byte length, cyclically reading and recording the offset until the tail area identifier is obtained. In this way, there will be no problem that the byte length of a single traversal is too short, so that multiple splicing is required to determine whether the tail area identifier is obtained. Since the length of a single traversal is greater than or equal to the tail area identifier, the tail area identifier will only exist in two adjacent traversal results at most, so that the part where the tail area identifier is not retrieved can be discarded in time to avoid excessive occupation of storage space. If the number of bytes in a single traversal is small, multiple traversal results need to be retained to avoid omissions.
[0033] In an optional implementation, accumulating the fixed length of the tail area from the tail area identifier in S1 includes: obtaining the standard format corresponding to the application installation package, and accumulating the fixed length of the tail area from the tail area identifier according to the standard format. It can be seen that different systems have different format regulations for application installation packages. The application installation package can be normally installed during the installation process only if it is packaged according to the format regulations. Therefore, the format regulations will have the length of each identifier, that is, the fixed length of the tail area specified in the standard format can be obtained according to the standard format.
[0034] S2, continue to read the variable length of the tail area after the fixed length of the tail area. Usually, the standard format provides a comment area at the end of the application installation package, in which there is a flag to record the length of the comment area, that is, the variable length of the tail area.
[0035] S3, obtaining the calculated length of the application installation package according to the prefix length, the fixed length of the tail area, and the variable length of the tail area, that is, performing statistics on the application installation packages according to the standard format, and obtaining the length that the application installation package should have if it complies with the standard format, that is, the calculated length.
[0036] S4, read the real length of the application installation package through the length acquisition function, if the real length is inconsistent with the calculated length, execute S5, if they are consistent, directly execute S6. It can be seen that since the calculated length is obtained according to the standard format, after obtaining the actual real length of the application installation package, if it is inconsistent with the calculated length, it means that the application installation package has additional settings outside the standard format. For example, the application installation package that needs to be installed in the financial terminal usually also includes a signature part or other permission verification part, which cannot be parsed by the native application installation package parsing instruction.
[0037] S5. Regenerate a readable installation package corresponding to the application installation package according to the calculated length.
[0038] In an optional implementation, S5 includes: copying the application installation package, and intercepting the copied application installation package according to the calculated length to obtain a readable installation package. In this way, when it is confirmed that the application installation package is inconsistent with the standard format, the application installation package is reassembled according to the calculated length to obtain a readable installation package. Because the calculated length is the length that the application installation package should correspond to in the standard format obtained according to the standard format, intercepting the application installation package according to the calculated length can cut off the part that does not conform to the standard format, leaving only the part that conforms to the standard format, thereby supporting native application installation package parsing instructions.
[0039] S6. Parsing the readable installation package using a native application installation package parsing instruction.
[0040] In an optional implementation, S6 includes S61-S62.
[0041] S61. Parse the readable installation package using a native application installation package parsing instruction to obtain a parsing result.
[0042] S62: Store the analysis result in association with the application installation package.
[0043] In an optional implementation, S6 includes: deleting the readable installation package.
[0044] Please refer to Figure 2 , Embodiment 2 of the present invention is: The above-mentioned method for parsing an application installation package is applied to an actual scenario, and the Android scenario is taken as an example in this embodiment.
[0045] Please refer to Figure 2 , which is an architectural diagram of the process of implementing a method for parsing an application installation package in this embodiment. APP Parser is to implement the above-mentioned method for parsing an application installation package as a program, and provide it as a whole module to the background service or PC client for use, providing the server or client with the ability to package and parse the application installation package information. For example, the above-mentioned method for parsing an application installation package can be compiled into a function library, such as a jar package, and other systems can implement the above-mentioned method for parsing an application installation package by calling the jar package, or other compilation methods can be used at the code level, which are not limited here. The ProcessBuilder module is an instruction processing module, which calls the aapt module through the command command to perform parsing of the application installation package (target APP). Among them, the appt module is the native application installation package parsing instruction. The RealAppAnalysis module implements the parsing analysis of the target application installation package and constructs a readable installation package (temporary APP) that can be parsed by aapt for application information. The AppInfo Container module implements the packaging, storage and provision of the parsed APP information to the caller.
[0046] Execute through the RealAppAnalysis module: (1) Get the tail area identifier of the APP is "0x06054b50", the corresponding length is 4 bytes, then start from the end of the application installation package, and search for the tail area identifier in groups of 4 bytes or more. The tail area identifier is the identifier of the tail area recorded in the central directory of the APP file.
[0047] (2) After finding the trailer area identifier, the fixed length of the trailer area can be accumulated. According to the APP format, the fixed length of the trailer area is accumulated starting from the trailer area identifier, including the trailer area identifier (4 bytes), the current disk number (2 bytes), the directory start disk number (2 bytes), the number of directories on the current disk (2 bytes), the total number of directory structures (2 bytes), the directory size (4 bytes), the relative offset of the directory start position (4 bytes) and the comment length (2 bytes). Adding them together, it can be obtained that in the APP format of the Android system, the fixed length of the trailer area is 22 bytes.
[0048] (3) After confirming the position of the tail area marker, the file length before the tail area marker can be obtained as the leading length.
[0049] (4) After the fixed length of the tail area, the variable length of the tail area is read. According to the APP format, after the relative offset of the directory start position, there are the comment length and comment content. By reading the 2-byte comment length, the length n of the comment content can be known, and n is the variable length of the tail area.
[0050] (5) The calculated length of the application installation package is obtained by adding the prefix length, the fixed length of the tail area, and the variable length of the tail area.
[0051] In an optional implementation, a 4-byte unit is passed in from the end of the file through the RandomAccessFile class for cyclic reading, while recording the query offset until the identifier 0x06054b50 is obtained. At this time, the file size before the identifier 0x06054b50 can be known, for example, it is recorded as applenthfront here, and the calculated length is applenthfront+(4+2+2+2+2+4+4+variable length) bytes.
[0052] (6) The actual length of the application installation package is obtained through the length acquisition function (for example, the file.length() method of the File class in Java). Other common file length reading methods can also be used here.
[0053] (7) Determine whether the actual length is consistent with the calculated length. If they are consistent, it means that the application installation package meets the standards and can be directly parsed using the native application installation package parsing instructions. If they are inconsistent, it means that the application installation package has been expanded and cannot be directly parsed using the native application installation package parsing instructions. You need to continue with the subsequent steps.
[0054] In an optional implementation, it is possible to first determine whether the application installation package can be successfully parsed through the native application installation package parsing instructions. If the parsing fails, step (1) is executed again, and in step (7), the default length is inconsistent, thereby simplifying the steps when there are a large number of application installation packages that meet the standards, thereby improving the efficiency of parsing the application installation packages.
[0055] (8) Regenerate a readable installation package corresponding to the application installation package by calculating the length, that is, only retain the content included in the calculated length of the application installation package in (1)-(5) to generate a readable installation package.
[0056] (9) Parse the readable installation package through the native application installation package parsing instruction. For example, through the command command in the ProcessBuilder module: command(mAaptPath, "d", "badging",tempAppPath), a BufferedReader with application information is obtained; mAaptPath represents the path of the appt tool; "d" and "badging" represent instruction parameters, where "d" means dump, indicating that the acquired data is output to an external storage medium, and "badging" information refers to the metadata contained in the application installation package APK file, which includes the application version number, permission declaration, component information, etc.; tempAppPath represents the temporary storage location of the query result, which can be read through BufferedReader. By passing in "d" and "badging", aapt can be triggered to perform application information parsing and store the parsed results in a preset location.
[0057] The content obtained from the BufferedReader is parsed line by line. The parsed content includes the information field corresponding to the application installation package, which is set to the corresponding storage location of the application installation package, for example, it can be set to the AppInfoContainer, so as to be encapsulated and saved for use by the caller.
[0058] Please refer to Figure 3 , Embodiment 3 of the present invention is: A terminal 1 for parsing an application installation package includes a memory 3, a processor 2, and a computer program stored in the memory 3 and running on the processor 2. When the processor 2 executes the computer program, each step in the first or second embodiment is implemented.
[0059] In summary, the present invention provides a method and terminal for parsing an application installation package, which determines whether the application installation package can be directly parsed by a native application installation package parsing instruction. If not, a readable installation package is formed after the portion that conforms to the standard format is cut out according to the native application installation package, and then the readable installation package is parsed by the native application installation package parsing instruction to obtain relevant information, that is, the relevant information of the application installation package. Among them, after calculating the calculated length of the application installation package according to the standard format, the actual real length of the application installation package can be obtained. If the calculated length is consistent with the real length, it means that the application installation package conforms to the standard format and can be directly parsed by the native application installation package parsing instruction; if the calculated length is inconsistent with the real length, it means that the application installation package does not conform to the standard format and cannot be parsed by the native application installation package parsing instruction, and a corresponding readable installation package needs to be generated. It is also possible to directly try to parse through the native application installation package parsing instruction to determine whether a normal parsing result can be obtained. If not, it means that the application installation package is not in a standard format. Therefore, by transforming the application installation package that does not conform to the standard format into a standard format, the native application installation package parsing instruction can read the information therein, and store the read information in association with the application installation package, so that the application installation package that does not conform to the standard format can also be parsed.
[0060] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for parsing an application installation package, characterized in that: The method comprises: Obtaining a tail area identifier of the application installation package to be tested, obtaining a leading length before the tail area identifier, and accumulating a fixed length of the tail area starting from the tail area identifier; Continue reading the variable length of the tail area after the fixed length of the tail area; Obtaining a calculated length of the application installation package according to the prefix length, the fixed length of the tail area, and the variable length of the tail area; Reading the actual length of the application installation package through a length acquisition function, and if the actual length is inconsistent with the calculated length, regenerating a readable installation package corresponding to the application installation package through the calculated length; The readable installation package is parsed using native application installation package parsing instructions.
2. The method for parsing an application installation package according to claim 1, characterized in that: The step of obtaining the tail area identifier of the installation package of the application to be tested includes: The byte length of the tail area identifier is obtained, and a traversal length greater than or equal to the byte length is used to cyclically read and record an offset from the tail of the application installation package until the tail area identifier is obtained.
3. The method for parsing an application installation package according to claim 1, characterized in that: The step of accumulating the fixed length of the tail area starting from the tail area identifier includes: A standard format corresponding to the application installation package is obtained, and a fixed length of the tail area is accumulated starting from the tail area identifier according to the standard format.
4. The method for parsing an application installation package according to claim 1, characterized in that: The regenerating a readable installation package corresponding to the application installation package by calculating the length includes: Copying the application installation package, and intercepting the copied application installation package according to the calculated length to obtain a readable installation package; The method of parsing the readable installation package by using the native application installation package parsing instruction includes: Delete the readable installation package.
5. The method for parsing an application installation package according to claim 1, characterized in that: Parsing the readable installation package using the native application installation package parsing instruction includes: Parsing the readable installation package using a native application installation package parsing instruction to obtain a parsing result; The parsing result is associated with the application installation package and stored.
6. A terminal for parsing an application installation package, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: Obtaining a tail area identifier of the application installation package to be tested, obtaining a leading length before the tail area identifier, and accumulating a fixed length of the tail area starting from the tail area identifier; Continue reading the variable length of the tail area after the fixed length of the tail area; Obtaining a calculated length of the application installation package according to the prefix length, the fixed length of the tail area, and the variable length of the tail area; Reading the actual length of the application installation package through a length acquisition function, and if the actual length is inconsistent with the calculated length, regenerating a readable installation package corresponding to the application installation package through the calculated length; The readable installation package is parsed using native application installation package parsing instructions.
7. The application installation package parsing terminal according to claim 6, characterized in that: The step of obtaining the tail area identifier of the installation package of the application to be tested includes: The byte length of the tail area identifier is obtained, and a traversal length greater than or equal to the byte length is used to cyclically read and record an offset from the tail of the application installation package until the tail area identifier is obtained.
8. The application installation package parsing terminal according to claim 6, characterized in that: The step of accumulating the fixed length of the tail area starting from the tail area identifier includes: A standard format corresponding to the application installation package is obtained, and a fixed length of the tail area is accumulated starting from the tail area identifier according to the standard format.
9. The application installation package parsing terminal according to claim 6, characterized in that: The regenerating a readable installation package corresponding to the application installation package by calculating the length includes: Copying the application installation package, and intercepting the copied application installation package according to the calculated length to obtain a readable installation package; The method of parsing the readable installation package by using the native application installation package parsing instruction includes: Delete the readable installation package.
10. The application installation package parsing terminal according to claim 6, characterized in that: Parsing the readable installation package using the native application installation package parsing instruction includes: Parsing the readable installation package using a native application installation package parsing instruction to obtain a parsing result; The parsing result is associated with the application installation package and stored.