Application installation file generation method, device and storage medium

By identifying and compiling changed third-party source code library files in the application, and combining caching and automated processes, the problem of low compilation efficiency and cumbersome generation process in existing technologies is solved, achieving efficient application installation file generation.

CN114153457BActive Publication Date: 2026-02-03WANGXU TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111414979.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-25
Publication Date
2026-02-03
Estimated Expiration
2041-11-25

AI Technical Summary

Technical Problem

In existing technologies, application updates require recompiling all files, resulting in low compilation efficiency. Furthermore, the process of packaging, signing, and notarizing the application files after compilation is cumbersome, impacting development efficiency.

Method used

By identifying changes in the SHA1 values ​​of third-party source code library files between released and unreleased versions of the application, only the changed library files are compiled, and the cached, unchanged files are retrieved, automatically generating the application installation files, including the signing and notarization process.

Benefits of technology

It improves compilation efficiency, reduces repetitive compilation, simplifies manual operations, and enhances the efficiency of generating application installation files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114153457B_ABST
    Figure CN114153457B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of data processing, and discloses an application program installation file generation method, which comprises the following steps: obtaining source code files and a plurality of third-party source code library files of an application program to-be-released version; identifying target library files changed in the library files based on sha1 values in a first version file of third-party source code of a released version of the application program and sha1 values in a second version file of third-party source code of the to-be-released version of the application program; performing code compilation on the target library files to obtain a new version of compiled files; updating the compiled files corresponding to the released version of the application program stored in a preset cache based on the new version of the compiled files; generating application program files of the to-be-released version based on the source code files and the to-be-released version of the compiled files in the preset cache; and generating application program installation files after processing the application program files of the to-be-released version after being packaged. The application program installation file generation method improves the compiling efficiency by partially recompiling the files.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method for generating application installation files, an electronic device, and a computer-readable storage medium. Background Technology

[0002] After application code is updated, it needs to be recompiled and packaged. Current technologies typically require recompiling all files instead of incrementally, leading to numerous repetitive compilations and reduced compilation efficiency. Existing methods for accelerating compilation utilize the binary artifacts generated by pods, saving and reading these artifacts to improve overall compilation speed. However, this method can cause runtime crashes even when files change, despite successful compilation. Furthermore, manually packaging, signing, notarizing, and stamping the generated application after compilation requires waiting for each step to be explicitly completed before proceeding to the next, which is extremely time-consuming and cumbersome, severely impacting development efficiency. Summary of the Invention

[0003] In view of the above, it is necessary to provide a method for generating application installation files, which can automatically and efficiently package application files.

[0004] The application installation file generation method provided by this invention includes:

[0005] Obtain the source code file of the application to be released and the library files of multiple third-party source codes; obtain the first version file of the third-party source code of the application already released; obtain the second version file of the third-party source code of the application to be released based on the source code file of the application to be released; the first version file and the second version file store the SHA1 value of each library file of the corresponding version.

[0006] Based on the SHA1 value in the first version file of the third-party source code of the released version of the application and the SHA1 value in the second version file of the third-party source code to be released, the target library file that has changed in the library file is identified, and the target library file is compiled to obtain the new version of the compiled file.

[0007] Based on the new version of the compilation file, the compilation files corresponding to the released version of the application stored in the preset cache are updated to obtain the compilation file of the application to be released, and the compilation output path of the application is modified to the folder in the preset cache where the application compilation files are stored;

[0008] Based on the compiled file of the version to be released obtained from the preset cache, the application file of the version to be released is generated together with the source code file, and the application file of the version to be released is packaged to obtain a package file. The package file is then processed to generate an application installation file.

[0009] Optionally, before obtaining the source code files of the application's release version and multiple third-party source code library files, the method further includes:

[0010] The third-party source code dependency library of the application is built using CocoaPods to store library files of multiple third-party source code for released versions of the application;

[0011] A third-party source code project for an application created using Xcode, the source code file used to install and run the application;

[0012] When installing and running the application's source code files, Xcodebuild is used to compile the source code files of the released version of the application to obtain the first version file of the third-party source code of the released version of the application;

[0013] The library files of multiple third-party source codes in the already released version of the application are compiled to obtain the compiled files of the released version and stored in the preset cache.

[0014] Optionally, the step of identifying the target library file that has changed based on the SHA1 value in the first version file of the third-party source code of the released version of the application and the SHA1 value in the second version file of the third-party source code to be released includes:

[0015] Compare the SHA1 values ​​of each third-party source code library file in the first version file with the SHA1 values ​​of each third-party source code library file in the second version file;

[0016] If the SHA1 value in the first version file is different from the corresponding SHA1 value in the second version file, then the third-party source code library file corresponding to the SHA1 value is identified as a modified third-party source code library file.

[0017] If the SHA1 value in the first version file does not have a corresponding SHA1 value in the second version file, then the third-party source code library file corresponding to the SHA1 value is identified as a deleted third-party source code library file;

[0018] If the SHA1 value in the second version file does not have a corresponding SHA1 value in the first version file, then the third-party source code library file corresponding to the SHA1 value is identified as a newly added third-party source code library file.

[0019] Optionally, updating the released version compilation files of the application stored in the preset cache based on the new version compilation files includes:

[0020] Identify the corresponding published version compilation files of third-party source code library files that have been changed or deleted in the preset cache and delete them;

[0021] The compiled file of the new version is stored in the preset cache.

[0022] Optionally, modifying the compilation output path of the application to the folder in the preset cache where the compiled files of the application are stored includes:

[0023] By modifying the compilation output path of the application to the folder in the preset cache where the compiled files of the application are stored through the organization configuration file of the third-party source code project, the application's third-party source code dependency projects are deleted.

[0024] Optionally, processing the packaged file to generate the application installation file includes:

[0025] Obtain the signature instruction, and write the signature information into the packaged file according to the signature instruction;

[0026] The notarized packaged file containing the signature information is notarized.

[0027] The application installation file is obtained by writing the signature information into the notarized package file.

[0028] Optionally, notarytool can be used to notarize the packaged file containing the signature information.

[0029] In addition, to achieve the above objectives, the present invention also provides an electronic device comprising: a memory and a processor, the processor being electrically connected to the memory, the memory storing an application installation file generation program that can run on the processor, the application installation file generation program being executed by the processor to implement the application installation file generation method as described above.

[0030] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing an application installation file generation program, which can be executed by one or more processors to implement the application installation file generation method described above.

[0031] Furthermore, to achieve the above objectives, the present invention also provides an application installation file generation apparatus, the apparatus comprising:

[0032] File Acquisition Module: Used to acquire the source code file of the application to be released and the library files of multiple third-party source code, acquire the first version file of the third-party source code of the application already released, and acquire the second version file of the third-party source code of the application to be released based on the source code file of the application to be released. The first version file and the second version file store the SHA1 value of each library file of the corresponding version.

[0033] Compilation module: Used to identify target library files that have changed in the library files based on the SHA1 value in the first version file of the third-party source code of the released version of the application and the SHA1 value in the second version file of the third-party source code of the to-be-released version, and to compile the target library files to obtain the new version of the compiled file;

[0034] Cache module: Based on the new version of the compilation file, update the compilation file corresponding to the released version of the application stored in the preset cache to obtain the compilation file of the application to be released, and modify the compilation output path of the application to the folder in the preset cache where the compilation file of the application is stored;

[0035] Packaging module: used to generate a release version application file based on the release version compilation file obtained from the preset cache and the source code file, and to package the release version application file to obtain a package file, and to process the package file to generate an application installation file. Attached Figure Description

[0036] Figure 1 This is a flowchart of an embodiment of the application installation file generation method of the present invention;

[0037] Figure 2 This is a schematic diagram of an embodiment of the electronic device of the present invention;

[0038] Figure 3 This is a schematic diagram of a module of an embodiment of the application installation file generation device of the present invention.

[0039] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0041] It should be noted that the descriptions involving "first," "second," etc., in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.

[0042] like Figure 1 The diagram shown is a flowchart of an embodiment of the application installation file generation method of the present invention, which includes steps S1-S3.

[0043] S1. Obtain the source code file of the application to be released and the library files of multiple third-party source codes. Obtain the first version file of the third-party source code of the application to be released. Obtain the second version file of the third-party source code of the application to be released based on the source code file of the application to be released. The first version file and the second version file store the SHA1 value of each library file of the corresponding version.

[0044] Specifically, the system receives a packaging instruction sent by the user via a terminal. This instruction includes an application file identifier. Based on the file identifier, the system retrieves the source code file of the application's release version, multiple third-party source code library files, and a first version file of the third-party source code of a released version from a database. The application version file records the version information and dependencies of each installed version of the application's source code file. The first version file is the corresponding version file obtained by compiling the source code file of a released version of the application using Xcodebuild, and the second version file is the corresponding version file obtained by compiling the source code file of the application's release version using Xcodebuild.

[0045] Specifically, the database manages the corresponding files of the application based on the file identifier, including the source code files of the application's unreleased and released versions, as well as the library files of multiple third-party source code corresponding to each version.

[0046] S2. Based on the SHA1 value in the first version file of the third-party source code of the released version of the application and the SHA1 value in the second version file of the third-party source code to be released, identify the target library file that has changed in the library file, and compile the target library file to obtain the new version of the compiled file.

[0047] Specifically, the third-party source code dependency library of the application is established through CocoaPods to store the library files of multiple third-party source code of the released versions of the application; a third-party source code project of the application is created through Xcode, which is used to install and run the source code files of the application; when the source code files of the application are installed and run, the source code files of the released versions of the application are compiled using Xcodebuild to obtain the first version file of the third-party source code of the released versions of the application; the library files of multiple third-party source code of the released versions of the application are compiled to obtain the compiled files of the released versions and stored in the preset cache.

[0048] Specifically, identifying the changed target library file based on the SHA1 value in the first version file of the third-party source code of the released version of the application and the SHA1 value in the second version file of the third-party source code of the to-be-released version includes: comparing the SHA1 values ​​corresponding to each third-party source code library file in the first version file with the SHA1 values ​​corresponding to each third-party source code library file in the second version file; if the SHA1 value in the first version file is different from the corresponding SHA1 value in the second version file, then the third-party source code library file corresponding to that SHA1 value is identified as a changed third-party source code library file; if the SHA1 value in the first version file does not have a corresponding SHA1 value in the second version file, then the third-party source code library file corresponding to that SHA1 value is identified as a deleted third-party source code library file; if the SHA1 value in the second version file does not have a corresponding SHA1 value in the first version file, then the third-party source code library file corresponding to that SHA1 value is identified as a newly added third-party source code library file. The SHA1 value is the secure hash algorithm value corresponding to the application source code library file.

[0049] Specifically, updating the published version of the application's compiled files stored in the preset cache based on the new version of the compiled files includes: identifying the published version of the compiled files corresponding to the changed or deleted third-party source code library files in the preset cache and deleting them, and storing the new version of the compiled files in the preset cache.

[0050] S3. Based on the new version of the compilation file, update the compilation file corresponding to the released version of the application stored in the preset cache to obtain the compilation file of the application to be released, and modify the compilation output path of the application to the folder in the preset cache where the compilation file of the application is stored.

[0051] Specifically, the compilation output path of the application is pre-modified to the folder in the preset cache where the application's compiled files are stored through the organization configuration file of the third-party source code project. This allows the compilation files of the third-party source code library files corresponding to the application to be retrieved from the cache and the corresponding application files to be generated. The organization configuration file of the third-party source code project modifies the compilation output path of the application by changing the values ​​of PODS_CONFIGURATION_BUILD_DIR and BUILT_PRODUCTS_DIR, and deletes the application's third-party source code dependency projects to prevent the third-party source code dependency projects from performing a full compilation of the application every time the compilation files are retrieved, thus preventing duplicate compilation.

[0052] S4. Based on the compiled file of the version to be released obtained from the preset cache, generate the application file of the version to be released with the source code file, and package the application file of the version to be released to obtain a package file, and process the package file to generate the application installation file.

[0053] Specifically, processing the packaged file to generate the application installation file includes: obtaining a signature instruction, writing signature information into the packaged file according to the signature instruction, notarizing the packaged file containing the signature information, and writing the seal information into the notarized packaged file to obtain the application installation file.

[0054] Specifically, notarytool is used to notarize the packaged file containing the signature information. When the notarization is completed, it automatically proceeds to the next step, reducing the number of notarization query steps.

[0055] Specifically, the application installation file is tested, and after the test is passed, the file package is uploaded to the server. The terminal obtains the distribution object sent by the user, obtains the server address of the file package from the server, and sends it to the distribution object.

[0056] As can be seen from the above embodiments, the application installation file generation method proposed in this invention identifies and recompiles modified third-party source code library files by detecting the SHA1 values ​​in the files of the first version of the released application and the second version of the application to be released. That is, only some modified third-party source code library files are recompiled, and the compilation files corresponding to the unmodified third-party source code library files are obtained through caching, which improves the compilation efficiency. At the same time, the manual process is automated by running a computer program, which reduces the possibility of human error and improves the efficiency of packaging application installation files.

[0057] like Figure 2 The diagram shown is a schematic representation of an embodiment of the electronic device 1 of the present invention. The electronic device 1 is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. The electronic device 1 can be a computer, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing, which is a type of distributed computing consisting of a super virtual computer composed of a group of loosely coupled computers.

[0058] In this embodiment, the electronic device 1 includes, but is not limited to, a memory 11, a processor 12, and a network interface 13 that can be interconnected via a system bus. The memory 11 stores an application installation file generation program 10, which can be executed by the processor 12. Figure 1 Only the electronic device 1, which includes components 11-13 and the application installation file generator 10, is shown. Those skilled in the art will understand that... Figure 1 The structure shown does not constitute a limitation on electronic device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0059] The memory 11 includes RAM and at least one type of readable storage medium. The RAM provides a cache for the operation of the electronic device 1; the readable storage medium can be volatile or non-volatile. Specifically, the readable storage medium can be a storage medium such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the readable storage medium can be an internal storage unit of the electronic device 1, such as the hard disk of the electronic device 1; in other embodiments, the storage medium can also be an external storage device of the electronic device 1, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the electronic device 1. In this embodiment, the readable storage medium of the memory 11 mainly includes a program storage area and a data storage area. The program storage area is typically used to store the operating system and various application software installed on the electronic device 1, such as storing the code of the application installation file generation program 10 in one embodiment of the present invention. The data storage area can store data created based on the use of blockchain nodes, such as various types of data that have been output or will be output.

[0060] In some embodiments, processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. Processor 12 is typically used to control the overall operation of the electronic device 1, such as performing control and processing related to data interaction or communication with other devices. In this embodiment, processor 12 is used to run program code stored in memory 11 or process data, such as running application installation file generation program 10.

[0061] The network interface 13 may include a wireless network interface or a wired network interface, which is used to establish a communication connection between the electronic device 1 and a client (not shown in the figure).

[0062] Optionally, the electronic device 1 may further include a user interface, which may include a display, an input unit such as a keyboard, and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an organic light-emitting diode (OLED) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device 1 and to display a visual user interface.

[0063] In one embodiment of the present invention, when the application installation file generation program 10 is executed by the processor 12, the following steps S1-S3 are performed.

[0064] S1. Obtain the source code file of the application to be released and the library files of multiple third-party source codes. Obtain the first version file of the third-party source code of the application to be released. Obtain the second version file of the third-party source code of the application to be released based on the source code file of the application to be released. The first version file and the second version file store the SHA1 value of each library file of the corresponding version.

[0065] Specifically, the system receives a packaging instruction sent by the user via a terminal. This instruction includes an application file identifier. Based on the file identifier, the system retrieves the source code file of the application's release version, multiple third-party source code library files, and a first version file of the third-party source code of a released version from a database. The application version file records the version information and dependencies of each installed version of the application's source code file. The first version file is the corresponding version file obtained by compiling the source code file of a released version of the application using Xcodebuild, and the second version file is the corresponding version file obtained by compiling the source code file of the application's release version using Xcodebuild.

[0066] Specifically, the database manages the corresponding files of the application based on the file identifier, including the source code files of the application's unreleased and released versions, as well as the library files of multiple third-party source code corresponding to each version.

[0067] S2. Based on the SHA1 value in the first version file of the third-party source code of the released version of the application and the SHA1 value in the second version file of the third-party source code to be released, identify the target library file that has changed in the library file, and compile the target library file to obtain the new version of the compiled file.

[0068] Specifically, the third-party source code dependency library of the application is established through CocoaPods to store the library files of multiple third-party source code of the released versions of the application; a third-party source code project of the application is created through Xcode, which is used to install and run the source code files of the application; when the source code files of the application are installed and run, the source code files of the released versions of the application are compiled using Xcodebuild to obtain the first version file of the third-party source code of the released versions of the application; the library files of multiple third-party source code of the released versions of the application are compiled to obtain the compiled files of the released versions and stored in the preset cache.

[0069] Specifically, identifying the changed target library file based on the SHA1 value in the first version file of the third-party source code of the released version of the application and the SHA1 value in the second version file of the third-party source code of the to-be-released version includes: comparing the SHA1 values ​​corresponding to each third-party source code library file in the first version file with the SHA1 values ​​corresponding to each third-party source code library file in the second version file; if the SHA1 value in the first version file is different from the corresponding SHA1 value in the second version file, then the third-party source code library file corresponding to that SHA1 value is identified as a changed third-party source code library file; if the SHA1 value in the first version file does not have a corresponding SHA1 value in the second version file, then the third-party source code library file corresponding to that SHA1 value is identified as a deleted third-party source code library file; if the SHA1 value in the second version file does not have a corresponding SHA1 value in the first version file, then the third-party source code library file corresponding to that SHA1 value is identified as a newly added third-party source code library file. The SHA1 value is the secure hash algorithm value corresponding to the application source code library file.

[0070] Specifically, updating the published version of the application's compiled files stored in the preset cache based on the new version of the compiled files includes: identifying the published version of the compiled files corresponding to the changed or deleted third-party source code library files in the preset cache and deleting them, and storing the new version of the compiled files in the preset cache.

[0071] S3. Based on the new version of the compilation file, update the compilation file corresponding to the released version of the application stored in the preset cache to obtain the compilation file of the application to be released, and modify the compilation output path of the application to the folder in the preset cache where the compilation file of the application is stored.

[0072] Specifically, the compilation output path of the application is pre-modified to the folder in the preset cache where the application's compiled files are stored through the organization configuration file of the third-party source code project. This allows the compilation files of the third-party source code library files corresponding to the application to be retrieved from the cache and the corresponding application files to be generated. The organization configuration file of the third-party source code project modifies the compilation output path of the application by changing the values ​​of PODS_CONFIGURATION_BUILD_DIR and BUILT_PRODUCTS_DIR, and deletes the application's third-party source code dependency projects to prevent the third-party source code dependency projects from performing a full compilation of the application every time the compilation files are retrieved, thus preventing duplicate compilation.

[0073] S4. Based on the compiled file of the version to be released obtained from the preset cache, generate the application file of the version to be released with the source code file, and package the application file of the version to be released to obtain a package file, and process the package file to generate the application installation file.

[0074] Specifically, processing the packaged file to generate the application installation file includes: obtaining a signature instruction, writing signature information into the packaged file according to the signature instruction, notarizing the packaged file containing the signature information, and writing the seal information into the notarized packaged file to obtain the application installation file.

[0075] Specifically, notarytool is used to notarize the packaged file containing the signature information. When the notarization is completed, it automatically proceeds to the next step, reducing the number of notarization query steps.

[0076] Specifically, the application installation file is tested, and after the test is passed, the file package is uploaded to the server. The terminal obtains the distribution object sent by the user, obtains the server address of the file package from the server, and sends it to the distribution object.

[0077] As can be seen from the above embodiments, the electronic device 1 proposed in this invention identifies and recompiles third-party source code library files that have changed by detecting the SHA1 values ​​in the files of the first version of the released application and the second version of the application to be released. That is, it only recompiles some of the modified third-party source code library files, and obtains the corresponding compiled files of the unchanged third-party source code library files through caching, thereby improving compilation efficiency. At the same time, it automates the manual process through a computer program, reducing the possibility of human error and improving the efficiency of packaging application installation files.

[0078] In other embodiments, the application installation file generator 10 may be divided into one or more modules, which are stored in the memory 11 and executed by one or more processors (processor 12 in this embodiment) to complete the present invention. The module referred to in the present invention refers to a series of computer program instruction segments that can perform specific functions and are used to describe the execution process of the application installation file generator 10 in the electronic device 1.

[0079] like Figure 3 The diagram shown is a schematic representation of a module of an embodiment of the application installation file generation device 10 of the present invention.

[0080] In one embodiment of the present invention, the application installation file generation device 10 includes a file acquisition module 110, a compilation module 120, a caching module 130, and a packaging module 140, as exemplarily:

[0081] The file acquisition module 110 is used to acquire the source code file of the application to be released and the library files of multiple third-party source code, acquire the first version file of the third-party source code of the application already released, and acquire the second version file of the third-party source code of the application to be released based on the source code file of the application to be released. The first version file and the second version file store the SHA1 value of each library file of the corresponding version.

[0082] The compilation module 120 is used to identify the target library file that has changed in the library file based on the SHA1 value in the first version file of the third-party source code of the released version of the application and the SHA1 value in the second version file of the third-party source code of the to-be-released version, and to compile the target library file to obtain a new version of the compiled file.

[0083] The caching module 130 is used to update the compilation files corresponding to the released version of the application stored in the preset cache based on the new version of the compilation files, to obtain the compilation files of the application to be released, and to modify the compilation output path of the application to the folder in the preset cache where the compilation files of the application are stored.

[0084] The packaging module 140 is used to generate a release version application file based on the release version compilation file obtained from the preset cache and the source code file, and to package the release version application file to obtain a package file, and to process the package file to generate an application installation file.

[0085] The functions or operation steps implemented by the above-mentioned file acquisition module 110, compilation module 120, caching module 130 and packaging module 140 are largely the same as those in the above embodiments, and will not be repeated here.

[0086] Furthermore, this invention also proposes a computer-readable storage medium, which can be volatile or non-volatile. Specifically, the computer-readable storage medium can be any one or any combination of several of the following: hard disk, multimedia card, SD card, flash memory card, SMC, read-only memory (ROM), erasable programmable read-only memory (EPROM), portable compact disc read-only memory (CD-ROM), USB memory, etc. The computer-readable storage medium includes an application installation file generation program 10, which, when executed by a processor, performs the following operations:

[0087] A1. Obtain the source code file of the application to be released and the library files of multiple third-party source codes. Obtain the first version file of the third-party source code of the application already released. Based on the source code file of the application to be released, obtain the second version file of the third-party source code of the application to be released. The first version file and the second version file store the SHA1 value of each library file of the corresponding version.

[0088] A2. Based on the SHA1 value in the first version file of the third-party source code of the released version of the application and the SHA1 value in the second version file of the third-party source code to be released, identify the target library file that has changed in the library file, and compile the target library file to obtain the new version of the compiled file;

[0089] A3. Based on the new version of the compilation file, update the compilation file corresponding to the released version of the application stored in the preset cache to obtain the compilation file of the application to be released, and modify the compilation output path of the application to the folder in the preset cache where the application compilation file is stored;

[0090] A4. Based on the compiled file of the version to be released obtained from the preset cache, generate the application file of the version to be released with the source code file, and package the application file of the version to be released to obtain a package file, and process the package file to generate the application installation file.

[0091] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0092] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0093] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0094] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for generating an application installation file, characterized in that, include: Obtain the source code file of the application to be released and the library files of multiple third-party source codes; obtain the first version file of the third-party source code of the application already released; obtain the second version file of the third-party source code of the application to be released based on the source code file of the application to be released; the first version file and the second version file store the SHA1 value of each library file of the corresponding version. The target library files that have changed are identified based on the SHA1 value in the first version file of the third-party source code of the released version of the application and the SHA1 value in the second version file of the third-party source code of the to-be-released version. The target library files that have changed include third-party source code library files that have been modified, deleted and / or added. The code of the target library files is then compiled to obtain a new version of the compiled file. Identify the corresponding released version compilation files of the modified or deleted third-party source code library files in the preset cache and delete them. Store the new version compilation files in the preset cache to obtain the release version compilation files of the application. Modify the compilation output path of the application to the folder in the preset cache where the application compilation files are stored by changing the parameters of the organization configuration file of the third-party source code project, and delete the third-party source code dependency projects of the application. Based on the compiled file of the version to be released obtained from the preset cache, the application file of the version to be released is generated together with the source code file, and the application file of the version to be released is packaged to obtain a package file. The package file is then processed to generate an application installation file.

2. The application installation file generation method as described in claim 1, characterized in that, Before obtaining the source code files of the application's release version and multiple third-party source code library files, the process also includes: The third-party source code dependency library of the application is built using CocoaPods to store library files of multiple third-party source code for released versions of the application; A third-party source code project for an application created using Xcode, the source code file used to install and run the application; When installing and running the application's source code files, Xcodebuild is used to compile the source code files of the released version of the application to obtain the first version file of the third-party source code of the released version of the application; The library files of multiple third-party source codes in the already released version of the application are compiled to obtain the compiled files of the released version and stored in the preset cache.

3. The application installation file generation method as described in claim 1, characterized in that, The method of identifying the target library files that have changed based on the SHA1 value in the first version file of the third-party source code of the released version of the application and the SHA1 value in the second version file of the third-party source code to be released includes: Compare the SHA1 values ​​of each third-party source code library file in the first version file with the SHA1 values ​​of each third-party source code library file in the second version file; If the SHA1 value in the first version file is different from the corresponding SHA1 value in the second version file, then the third-party source code library file corresponding to the SHA1 value is identified as a modified third-party source code library file. If the SHA1 value in the first version file does not have a corresponding SHA1 value in the second version file, then the third-party source code library file corresponding to the SHA1 value is identified as a deleted third-party source code library file; If the SHA1 value in the second version file does not have a corresponding SHA1 value in the first version file, then the third-party source code library file corresponding to the SHA1 value is identified as a newly added third-party source code library file.

4. The application installation file generation method as described in claim 1, characterized in that, Processing the packaged file to generate the application installation file includes: Obtain the signature instruction, and write the signature information into the packaged file according to the signature instruction; The notarized packaged file containing the signature information is notarized. The application installation file is obtained by writing the signature information into the notarized package file.

5. The application installation file generation method as described in claim 4, characterized in that, The notarytool is used to notarize the packaged file containing the signature information.

6. An electronic device, characterized in that, The electronic device includes: a memory and a processor, the processor being electrically connected to the memory, the memory storing an application installation file generation program that can run on the processor, the application installation file generation program being executed by the processor to implement the application installation file generation method as described in any one of claims 1-5.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an application installation file generation program, which can be executed by one or more processors to implement the application installation file generation method as described in any one of claims 1-5.

8. An application installation file generation device, characterized in that, The device includes: File Acquisition Module: Used to acquire the source code file of the application to be released and the library files of multiple third-party source code, acquire the first version file of the third-party source code of the application already released, and acquire the second version file of the third-party source code of the application to be released based on the source code file of the application to be released. The first version file and the second version file store the SHA1 value of each library file of the corresponding version. The compilation module is used to identify target library files that have changed based on the SHA1 value in the first version file of the third-party source code of the released version of the application and the SHA1 value in the second version file of the third-party source code of the to-be-released version. The target library files that have changed include third-party source code library files that have been modified, deleted and / or added, and the module compiles the target library files to obtain a new version of the compiled file. Cache module: Used to identify the corresponding released version compilation file of a third-party source code library file that has been changed or deleted in the preset cache and delete it, store the new version compilation file in the preset cache, obtain the application's release version compilation file, modify the compilation output path of the application to the folder in the preset cache where the application's compilation file is stored by changing the parameters of the organization configuration file of the third-party source code project, and delete the application's third-party source code dependency projects; Packaging module: used to generate a release version application file based on the release version compilation file obtained from the preset cache and the source code file, and to package the release version application file to obtain a package file, and to process the package file to generate an application installation file.

Citation Information

Patent Citations

  • Method and device for upgrading application software

    CN103647816A

  • Increment upgrade backup method and device

    CN105550060A

  • Method and device for constructing, publishing and downloading incremental files

    CN110032388A