[go: up one dir, main page]

CN120216008A - Application installation package generation method, device, electronic device and readable storage medium - Google Patents

Application installation package generation method, device, electronic device and readable storage medium Download PDF

Info

Publication number
CN120216008A
CN120216008A CN202510298900.7A CN202510298900A CN120216008A CN 120216008 A CN120216008 A CN 120216008A CN 202510298900 A CN202510298900 A CN 202510298900A CN 120216008 A CN120216008 A CN 120216008A
Authority
CN
China
Prior art keywords
target
configuration information
application
installation package
installation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202510298900.7A
Other languages
Chinese (zh)
Inventor
王绍强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Great Wall Motor Co Ltd
Original Assignee
Great Wall Motor Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Great Wall Motor Co Ltd filed Critical Great Wall Motor Co Ltd
Priority to CN202510298900.7A priority Critical patent/CN120216008A/en
Publication of CN120216008A publication Critical patent/CN120216008A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides an application installation package generation method, an application installation package generation device, electronic equipment and a readable storage medium, wherein the method is applied to the technical field of computers and comprises the steps of responding to a compiling request of a target application program, generating a first installation package of the target application program, wherein the compiling request is used for requesting to generate at least two installation packages, and one installation package corresponds to one function requirement; the method comprises the steps of copying a first installation package to obtain at least two second installation packages, wherein the number of the second installation packages is the same as that of the functional requirements, the at least two second installation packages comprise the first installation package, acquiring application configuration information of the at least two functional requirements corresponding to compiling requests, the application configuration information being used for configuring a target application program to meet the corresponding functional requirements, and writing the application configuration information of the at least two functional requirements into the at least two second installation packages respectively to obtain the at least two target installation packages.

Description

Application installation package generation method and device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of computer technology, and more particularly, to an application installation package generating method and apparatus, an electronic device, and a readable storage medium in the field of electronic device technology.
Background
Engineering compilation is a vital loop in the development work of Android applications. However, as the types of user groups develop more and more, in order to enable Application (APP) to adapt to the demands of different user groups, new configuration information is often added to the APP, so that the APP operates different functions to meet different user groups, but after new configuration information is continuously added to the APP, codes for writing the APP are greatly increased, so that the volume of an installation package of the APP is larger.
Therefore, how to reduce the volume of the APP installation package is a technical problem to be solved at present.
Disclosure of Invention
The application provides an application installation package generation method, an application installation package generation device, electronic equipment and a readable storage medium.
The method comprises the steps of responding to a compiling request of a target application program, generating a first installation package of the target application program, wherein the compiling request is used for requesting to generate at least two installation packages, one installation package corresponds to one functional requirement, copying the first installation package to obtain at least two second installation packages, the number of the second installation packages is the same as that of the functional requirements corresponding to the compiling request, the at least two second installation packages comprise the first installation package, acquiring application configuration information of the at least two functional requirements corresponding to the compiling request, the application configuration information is used for configuring the target application program to meet the corresponding functional requirements, and writing the application configuration information of the at least two functional requirements into the at least two second installation packages respectively to obtain the at least two target installation packages.
According to the technical scheme, when a compiling request for a target application program is received and is used for requesting to generate at least two installation packages, and one installation package corresponds to one functional requirement, a first installation package of the target application program can be generated by compiling and packaging firstly, the first installation package is used as a basic installation package to be copied, at least two second installation packages are obtained, the number of the second installation packages is the same as the number of the functional requirements corresponding to the compiling request, then application configuration information of the at least two functional requirements corresponding to the compiling request is obtained, and the application configuration information of each functional requirement is written into the second installation package respectively to obtain target installation packages corresponding to each functional requirement, namely different target installation packages are used for meeting different functional requirements. In addition, the target installation packages corresponding to the functional requirements are obtained by writing the application configuration information on the basis of the first installation packages, so that the whole target application program does not need to be recompiled, the compiling time of the target installation packages containing different application configuration information can be reduced, and the compiling efficiency of the target installation packages corresponding to different functional requirements is improved.
With reference to the first aspect and the foregoing implementation manner, in some possible implementation manners, generating, in response to a compiling request for a target application program, a first installation package of the target application program includes obtaining source code of the target application program from a source code library in response to the compiling request for the target application program, compiling the source code into an executable file based on a preset compiling environment, wherein the executable file is a file that can be executed by a computer, obtaining a public resource file and public configuration information in the target application program, the public resource file refers to a static resource shared in the target application program, the public configuration information refers to configuration parameters shared in the target application program, and packaging the executable file, the public resource file and the public configuration information based on a packaging tool to obtain the first installation package.
In the technical scheme, in the process of generating the first installation package of the target application program, the public resource file and the public configuration information are packaged, so that the storage and transmission of repeated resources can be reduced, and in addition, the generated first installation package contains necessary resource files and configuration information, so that the first installation package can be smoothly installed and operated in any environment.
With reference to the first aspect and the foregoing implementation manner, in some possible implementation manners, before generating the first installation package of the target application program, the method further includes writing application configuration information corresponding to each function of the target application program into a target directory, and generating a file name, where the target directory is in response to compiling the target application program, acquiring application configuration information of at least two function requirements corresponding to the compiling request, including calling a target function, reading the application configuration information of at least two function requirements corresponding to the compiling request written into the target directory based on the target function and the file name, where the target function is used to locate a position of the application configuration information of the at least two function requirements in the target directory, and reading the application configuration information of the at least two function requirements.
In the technical scheme, before the first installation package of the target application program is generated, the application configuration information corresponding to each function of the target application program can be stored in the target catalog, so that the application configuration information can be managed and modified independently of the source code of the target application program, when different functions are configured for the target application program, only the application configuration information is required to be updated, the source code of the target application program is not required to be modified, maintenance work of a developer is simplified, and in addition, the application configuration information is positioned and read through the target function and the file name, reading efficiency can be improved, and unnecessary searching time is reduced.
With reference to the first aspect and the foregoing implementation manner, in some possible implementation manners, each function requirement corresponds to an identifier, the identifier is associated with application configuration information, before generating the first installation package of the target application program, the method further includes writing application configuration information corresponding to each function of the target application program into a database, and acquiring application configuration information of at least two function requirements corresponding to a compiling request, including determining an identifier of each function requirement, and acquiring application configuration information associated with the identifier of each function requirement from the database based on the identifier of each function requirement to obtain application configuration information of at least two function requirements.
In the above technical solution, by allocating a unique identifier to each function requirement and associating it with the application configuration information, the accuracy of the application configuration information of each function requirement can be ensured.
With reference to the first aspect and the implementation manner, in some possible implementation manners, writing application configuration information of at least two functional requirements into at least two second installation packages respectively to obtain at least two target installation packages, including detecting whether formats of the application configuration information of at least two functional requirements are correct, compressing the application configuration information of each functional requirement based on a compression algorithm to obtain compressed application configuration information of at least two functional requirements under the condition that the formats of the application configuration information of at least two functional requirements are correct, and writing the compressed application configuration information of at least two functional requirements into the second installation packages respectively to obtain at least two target installation packages.
In the technical scheme, when at least two target installation packages are obtained, whether the formats of application configuration information of at least two function requirements are correct or not is detected, the error formats in the application configuration information can be found and corrected in advance, so that the application configuration information of each function requirement meets the expected format, and the generated target installation packages can be ensured to run successfully.
With reference to the first aspect and the foregoing implementation manner, in some possible implementation manners, each target installation package corresponds to an initial digital signature, and the digital signature is used for verifying whether the target installation package is illegally tampered, and the method further includes deleting the initial digital signatures of at least two target installation packages after obtaining at least two target installation packages, performing hash calculation on each file in each target installation package based on a hash algorithm to generate a first hash value for each target installation package, and encrypting each first hash value based on a preset private key to generate a target digital signature for each target installation package again.
It should be noted that, in order to ensure the security of the first installation package, a digital signature is generated for the first installation package based on each file in the first installation package when the first installation package is generated, so as to verify whether the configuration information in the first installation package is tampered, it can be understood that each second installation package obtained based on the first installation copy has the same digital signature, and each target installation package obtained based on the second installation package also has the same digital signature, that is, each target installation package corresponds to an initial digital signature, but after at least two application configuration information required by functions is written into at least two second installation packages respectively, at least two target installation packages are obtained, since the configuration information in the target installation packages is inconsistent with the configuration information in the first installation package, the digital signature generated based on each file in the target installation package is inconsistent with the initial digital signature, so that the target installation package cannot pass verification when the target installation package is installed, that is to avoid that the target installation package cannot pass verification when the target installation package is installed, that at least two target installation packages can pass verification after the initial digital signatures are obtained, each target installation package can be successfully installed when the target installation package is installed.
With reference to the first aspect and the foregoing implementation manner, in some possible implementation manners, after generating a target digital signature for each target installation packet again, the method further includes decrypting the target digital signature of each target installation packet based on a public key corresponding to a private key to obtain a first hash value corresponding to each target installation packet, re-performing hash calculation on each file in each target installation packet based on a hash algorithm to regenerate a second hash value for each target installation packet, comparing each first hash value with each corresponding second hash value, and if the first hash value is the same as the corresponding second hash value, determining that application configuration information in the target installation packet is not tampered or lost in a re-signing process, otherwise, re-generating the target installation packet and re-signing is required.
According to the technical scheme, after a target digital signature is generated for each target installation package again, the regenerated second hash value is compared with the first hash value obtained after the target digital signature is decrypted, so that the target installation package is regenerated and re-signed under the condition that the second hash value is different from the first hash value, namely, under the condition that application configuration information in the target installation package is tampered or lost in the re-signing process, and therefore accuracy of the application configuration information in the finally obtained target installation package is guaranteed, and further the generated target installation package can meet corresponding functional requirements.
In a second aspect, there is provided an application installation package generating apparatus including:
The generation module is used for responding to a compiling request of the target application program, generating a first installation package of the target application program, wherein the compiling request is used for requesting to generate at least two installation packages, and one installation package corresponds to one functional requirement;
The replication module is used for replicating the first installation packages to obtain at least two second installation packages, the number of the second installation packages is the same as the number of the functional requirements corresponding to the compiling request, and the at least two second installation packages comprise the first installation packages;
The acquisition module is used for acquiring application configuration information of at least two functional requirements corresponding to the compiling request, and the application configuration information is used for configuring the target application program to meet the corresponding functional requirements;
And the writing module is used for writing application configuration information of at least two function requirements into at least two second installation packages respectively to obtain at least two target installation packages.
In a third aspect, an electronic device is provided that includes a memory and a processor. The memory is configured to store executable program code, and the processor is configured to invoke and run the executable program code from the memory, so that the electronic device performs the method for generating an application installation package in the first aspect or any of the possible implementation manners of the first aspect.
In a fourth aspect, there is provided a computer program product comprising computer program code which, when run on a computer, causes the computer to perform the method of generating an application installation package of the first aspect or any one of the possible implementation manners of the first aspect.
In a fifth aspect, there is provided a computer readable storage medium storing computer program code which, when run on a computer, causes the computer to perform the application installation package generation method of the first aspect or any one of the possible implementation manners of the first aspect.
Drawings
FIG. 1 is a schematic diagram of an implementation environment of a method for generating an application installation package according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of an application installation package generation method provided by an embodiment of the present application;
FIG. 3 is a schematic flow chart of another method for generating application installation packages provided by an embodiment of the present application;
fig. 4 is a schematic structural diagram of an application installation package generating device according to an embodiment of the present application;
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical scheme of the application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiment of the present application, unless otherwise indicated, "/" means or, for example, a/B may mean a or B, "and/or" in the text is only one association relationship describing the association object, and it means that there may be three relationships, for example, a and/or B, three cases where a exists alone, a and B exist together, and B exists alone, and further, "a plurality" means two or more in the description of the embodiment of the present application.
The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature.
Before describing the application installation package generating method provided by the embodiment of the present application, first, an implementation environment of the application installation package generating method provided by the embodiment of the present application is described, referring to fig. 1, and fig. 1 is a schematic diagram of an implementation environment of the application installation package generating method provided by the embodiment of the present application.
By way of example, as shown in FIG. 1, the implementation environment includes an electronic device 101 and a server 102.
The electronic device 101 may be any device having an installation package generating capability, such as a smart phone, a notebook computer, a desktop computer, or a virtual reality terminal, which is not limited in the embodiment of the present application. The electronic device 101 may be running a variety of different types of applications, for example, the applications run by the electronic device 101 may include one or more of a drawing application, a gaming application, a video application, a telephony application, a social application, a live application, an email application, a digital camera application, a spreadsheet application, and the like.
The server 102 may be an independent physical server, a server cluster or a distributed file system formed by a plurality of physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligence platforms, which are not limited in the embodiment of the present application.
In one possible implementation, the server 102 is directly or indirectly connected to the terminal 101 through a wired or wireless communication manner, which is not limited by the embodiment of the present application.
In one possible implementation manner, when a compiling request for a target application program is received and the compiling request is used for requesting to generate at least two installation packages, when one installation package corresponds to one function requirement, a first installation package of the target application program is generated, the first installation package is copied to obtain at least two second installation packages, the number of the second installation packages is the same as the number of the function requirements corresponding to the compiling request, the at least two second installation packages include the first installation package, then application configuration information of the at least two function requirements corresponding to the compiling request is obtained, the application configuration information is used for configuring the target application program to meet the corresponding function requirements, and finally the application configuration information of the at least two function requirements is written into the at least two second installation packages respectively to obtain the at least two target installation packages.
In one possible implementation, the electronic device 101 may obtain application configuration information of at least two function requirements corresponding to the compiling request from a database of the server 102.
After the implementation environment of the application installation package generating method provided by the embodiment of the present application is introduced, the application installation package generating method provided by the embodiment of the present application is described below.
The method according to an embodiment of the present application is described in detail below with reference to fig. 2.
Fig. 2 is a schematic flowchart of an application installation package generating method according to an embodiment of the present application.
Illustratively, as shown in FIG. 2, taking the electronic device 101 of FIG. 1 as an example of an execution subject, the method 200 includes the following steps 201-204.
In step 201, a first installation package of a target application is generated in response to a compiling request for the target application, the compiling request being used for requesting generation of at least two installation packages, one installation package corresponding to each functional requirement.
Wherein the target application is an application to be run. For example, the target application may be a navigation application to be run, a weather forecast application, a cart interconnection application, a vehicle recorder application, a drawing application, a game application, a video application, a phone application, a social application, a live broadcast application, an email application, a digital camera application, or a spreadsheet application, etc., which embodiments of the present application are not limited.
Each function requirement is used for representing at least one function which the target application program needs to have, for example, the target application program corresponds to two installation packages, wherein the function requirement corresponding to one installation package is used for representing that the target application program needs to support a Chinese interface and has functions of collection and checking, and the function requirement corresponding to the other installation package is used for representing that the target application program needs to support an English interface and has a payment function, namely, each function requirement can be regarded as a function set which the target application program needs to have.
In one possible implementation manner, the compiling request for the target application program may be triggered by a developer on the electronic device, or may be triggered automatically by the electronic device according to a preset triggering rule, which is not limited by the embodiment of the present application.
In one possible implementation, when a developer manually triggers a compilation request for a target application on an electronic device, and the compilation request is used to request generation of at least two installation packages, one installation package corresponding to each functional requirement, the electronic device may generate a first installation package for the target application in response to the compilation request for the target application.
Next, the implementation procedure of the first installation package of the target application program is generated in four steps, which will be described in detail.
And (1) acquiring the source code of the target application program from a source code library.
Wherein the source code library is a centralized or distributed system for storing and managing the source code of the target application.
In one possible implementation, the electronic device may clone the latest source code of the target application from the source code library to the local via a command line tool (e.g., a Git command), thereby obtaining the source code of the target application.
And (2) compiling the source code into an executable file based on a preset compiling environment, wherein the executable file is a file which can be executed by a computer.
Where a compilation environment refers to a set of software tools and configurations that support the compilation process of source code.
The compilation environment typically includes a Compiler, a Linker, and environment variables Environment Variables.
Specifically, the compiler is configured to convert source code (such as C, C ++ or Java) of the target application program into target code, where the target code is usually a binary format code that can be identified by a computer, and generate a target file from the converted target code, and then the linker links the compiled target file and the library file together based on a library path specified by an environment variable, so as to generate a file that can be executed by the computer, that is, an executable file. It will be appreciated that the executable file is a binary file generated after compiling and linking, and may cause a computer to be directly loaded and executed.
And (3) acquiring a public resource file and public configuration information in the target application program.
Wherein the common resource file refers to a static resource shared in the target application. For example, the common resource file may include an image file for displaying icons and background drawings of a user interface, a style sheet for defining a target application appearance style, an audio file for notifying a user of sound effects and background music, and the like.
The common configuration information refers to configuration parameters shared in the target application. For example, the common configuration information may include an API endpoint (API Endpoints) for defining a URL address for the target application to communicate with the backend server, keys and tokens (Keys and Tokens) for ensuring the security of the target application's operation, such as API keys, OAuth tokens, etc., and color information for defining the color theme of the target application, etc.
It will be appreciated that the common resource file and the common configuration information are located under a specific directory, for example, a directory such as resources, assets or config, and in one possible implementation, the locations of the common resource file and the common configuration information, that is, the directory, may be searched in a script manner, and after the locations of the common resource file and the common configuration information are found, the common resource file and the common configuration information are copied to a temporary directory for later packaging.
And (4) packaging the executable file, the public resource file and the public configuration information based on a packaging tool to obtain a first installation package.
The packaging tool may be any tool capable of packaging the execution file, the common resource file and the common configuration information. For example, ZIP, tar, MSI, NSIS or JAR, etc., which are not limiting embodiments of the present application.
Specifically, after the common resource file and the common configuration information in the target application program are acquired, a packaging command corresponding to the packaging tool may be executed based on the packaging tool, and the executable file, the common resource file and the common configuration information may be packaged to obtain the first installation package.
For example, when the packaging tool is a ZIP, after the common resource file and the common configuration information in the target application program are acquired, a packaging command (i.e., a ZIP command) corresponding to the ZIP may be executed based on the ZIP, and the executable file, the common resource file, and the common configuration information may be packaged to obtain the first installation package.
It should be noted that, in order to avoid illegal tampering of the files in the first installation package, ensure the security of the first installation package, after the first installation package is generated, hash calculation may be performed on each file in the first installation package based on a hash algorithm to generate a hash value for the first installation package, and the hash value is encrypted based on a preset private key, so as to generate a digital signature for the first installation package, where the digital signature is used to verify whether the first installation package is illegally tampered.
Among them, a hash algorithm (also referred to as a hash function) is an algorithm that converts data of an arbitrary length into a fixed-length output.
Alternatively, the hash algorithm may be any one of MD5, SHA-256, BLAKE2, RIPEMD-160, etc., and embodiments of the present application are not limited in this regard.
For example, when the hash algorithm is SHA-256 and the first installation package includes file a and file B, the electronic device may use file a and file B as input, and calculate the contents in file a and file B using the hashlib library of Python, thereby obtaining a hash value. For example, the electronic device uses the hashlib library of Python to calculate a hash value of e9c4f7e0a6b.
Further, after obtaining the hash value, the electronic device may encrypt the hash value with a preset private key based on an asymmetric encryption algorithm, such as RSA or ECDSA, and the encrypted output is the digital signature of the first installation packet.
The private key is preset by a developer and is used for generating a digital signature for the installation package. When the developer sets the private key, a public key corresponding to the private key, that is, a public key, is set to verify the authenticity of the digital signature, and may be understood as verifying whether the file in the first installation package is tampered when the first installation package is installed.
Step 202, copying the first installation packages to obtain at least two second installation packages, wherein the number of the second installation packages is the same as the number of the functional requirements corresponding to the compiling request, and the at least two second installation packages comprise the first installation packages.
Wherein a second installation package may be understood as a copy of the installation package that is copied based on the first installation package, which may be identical to the original first installation package.
In one possible implementation, after the executable file, the common resource file, and the common configuration information are packaged based on the packaging tool to obtain the first installation package, the first installation package may be replicated using a command line tool such as xcopy or robocopy to obtain at least two second installation packages.
In another possible implementation manner, after the executable file, the common resource file and the common configuration information are packaged based on the packaging tool to obtain the first installation package, the first installation package may be further copied using a share.
Step 203, obtaining application configuration information of at least two functional requirements corresponding to the compiling request, where the application configuration information is used to configure the target application program to meet the corresponding functional requirements.
Specifically, after the first installation package is copied to obtain at least two second installation packages, application configuration information of at least two functional requirements corresponding to the compiling request can be obtained, so that the application configuration information is written into the second installation packages respectively, and thus a target installation package corresponding to each functional requirement is obtained.
It should be noted that, in order to simplify maintenance work of a developer by only updating the application configuration information and not modifying the source code of the target application when configuring different functions for the target application, in one possible implementation, before generating the first installation package of the target application, the application configuration information corresponding to each function of the target application may be written into the target directory, and a file name may be generated, so that the application configuration information may be managed and modified independently of the source code of the target application, so that when configuring different functions for the target application, only the application configuration information needs to be updated and not modifying the source code of the target application, thereby simplifying maintenance work of the developer.
The target directory is a directory which does not enable written application configuration information to be modified in response to a compiling request of the target application program. For example, the target directory may be a assets directory.
Specifically, before the first installation package of the target application program is generated, application configuration information corresponding to each function of the target application program may be written into the target directory using a Python script or a Bash script, and a unique file name may be generated based on a time stamp, a version number of the target application program, or a specific identifier.
For example, the electronic device may run the following code to write application configuration information corresponding to the respective functions of the target application program into the target directory:
config_file_path='./config'
config_file=open(config file path,'w')
config_file.close()
configs=[configl,config2,config3]
for apk in apks:
apk_split=os.path.splitext(apk)
apk_file namemapk split[0]
apk_file suffix=apk split[1]
config_dir=apks_dir+"/configs_apks/"
if not os.path.exists(config_dir):
os.makedirs(config dir)
For config in configs:
config_apk=config_dir+apk_file_name+"-"+config+apk_file_suffix
shutil.copy(os.path.join(apks dir,apk),config_apk)
config_file=open(config_file_path,'w')
config_file.write(config)
config_file.close()
config_zip_apk=zipfile.2ipFile(config_apk,"a",zipfile.ZIP_DEFLATED)config_zip apk.write(config_file_path,"assets/config")
conf1g_zip apk.close()
further, after application configuration information corresponding to each function of the target application program is written into the target directory, the electronic device may call the target function, and read application configuration information of at least two function requirements corresponding to the compiling request written into the target directory based on the target function and the file name.
The objective function is used for positioning the positions of application configuration information of at least two functional requirements in the objective catalog and reading the application configuration information of the at least two functional requirements.
For example, the electronic device may execute the following code to read application configuration information of at least two functional requirements corresponding to a compilation request written in a target directory:
@Throws(I0Exception::class)
fun readFileFromAssets(context:Context,fileName:string?):string{
val assetManager=context.assets
var inputStream:Inputstream?=null
val stringBuilder=stringBuilder()
try{
inputStream=assetManager.open(fileName!!)
Valreader=BufferedReader(InputStreamReader(inputStream)
varline:string?
While(reader.readLine().also{line=it}!=null){
stringBuilder.append(line)
}
}finally{
inputstream?.close()
}
return stringBuilder.tostring()
}
in another possible embodiment, before the first installation package of the target application program is generated, application configuration information corresponding to each function of the target application program may also be written into the database.
Specifically, before the first installation package of the target application program is generated, application configuration information corresponding to each function of the target application program may also be written into the database using a Python script or SQLALCHEMY script.
In one possible implementation, to ensure accuracy of the application configuration information obtained for each function requirement, each function requirement may be associated with an identifier associated with the application configuration information. For example, the compiling request is used for requesting to generate two installation packages, and the two installation packages respectively correspond to one function requirement, wherein an identifier corresponding to the one function requirement is F001, the identifier 001 is associated with application configuration information of a user payment function, and an identifier corresponding to the other function requirement is F002, and the identifier F001 is associated with application configuration information of a user payment and reconciliation function.
Further, after application configuration information corresponding to each function of the target application program is written into the database, an identifier of each function requirement may be determined first, and then, based on the identifier of each function requirement, application configuration information associated with the identifier of each function requirement is obtained from the database, so as to obtain application configuration information of at least two function requirements.
Specifically, after application configuration information corresponding to each function of the target application program is written into the database, task management tools such as Jira, trello and the like can be used to obtain identifiers of each function requirement, and SQL query sentences are used to query application configuration information associated with the identifiers of each function requirement from the database, so that application configuration information of at least two function requirements is obtained.
And 204, writing application configuration information of at least two function requirements into at least two second installation packages respectively to obtain at least two target installation packages.
Specifically, after the application configuration information of at least two functional requirements corresponding to the compiling request is obtained, the application configuration information of the at least two functional requirements may be written into at least two second installation packages by using a Python script or a Shell script, so as to obtain at least two target installation packages.
Next, an embodiment of obtaining at least two target installation packages is described in detail in three steps.
And (1) detecting whether the formats of the application configuration information of at least two function requirements are correct.
It should be noted that, in order to avoid writing application configuration information in an incorrect format into the second installation package, so that the final destination installation package cannot be successfully operated, that is, in a possible implementation, before writing application configuration information of at least two function requirements into at least two second installation packages respectively, it may be detected whether the format of the application configuration information of at least two function requirements is correct, that is, whether the format of the application configuration information of each function requirement conforms to a predefined format (for example, JSON, XML or YAML format, etc.), so as to avoid writing application configuration information that does not conform to the predefined format into the second installation package, thereby ensuring that the final destination installation package can be successfully operated.
Specifically, before the application configuration information of at least two functional requirements is written into at least two second installation packages, a verification tool such as jsonschema, yamllint, XML Schema, or relay may be used to detect the format of the application configuration information.
And (2) compressing the application configuration information of each function requirement based on a compression algorithm under the condition that the formats of the application configuration information of at least two function requirements are correct, so as to obtain the compressed application configuration information of at least two function requirements.
Specifically, in the case that the formats of the application configuration information of at least two functional requirements are correct, a compression algorithm such as gzip, bzip2, lzma may be used to compress the application configuration information of each functional requirement, so as to obtain the compressed application configuration information of at least two functional requirements.
And (3) writing the compressed application configuration information of at least two function requirements into a second installation package respectively to obtain at least two target installation packages.
Specifically, after obtaining the application configuration information of the at least two compressed functional requirements, the application configuration information of the at least two compressed functional requirements may be written into at least two second installation packages respectively by using a Python script or a Shell script, so as to obtain at least two target installation packages.
In summary, in the method for generating an application installation package according to the embodiment of the present application, when a compiling request for a target application program is received and the compiling request is used for requesting to generate at least two installation packages, when one installation package corresponds to one functional requirement, a first installation package of the target application program may be compiled and packaged first to generate the first installation package of the target application program, so as to copy the first installation package as a basic installation package, to obtain at least two second installation packages, where the number of the second installation packages is the same as the number of the functional requirements corresponding to the compiling request, then obtain application configuration information of at least two functional requirements corresponding to the compiling request, and write the application configuration information of each functional requirement into the second installation package respectively, so as to obtain target installation packages corresponding to each functional requirement, that is, different target installation packages are used to satisfy different functional requirements. In addition, the target installation packages corresponding to the functional requirements are obtained by writing the application configuration information on the basis of the first installation packages, so that the whole target application program is not required to be recompiled, the compiling time of the target installation packages containing different application configuration information can be reduced, the compiling efficiency of the target installation packages corresponding to different functional requirements is improved, and in addition, before the application configuration information of at least two functional requirements is respectively written into at least two second installation packages, whether the format of the application configuration information of at least two functional requirements is correct or not is detected, the writing of the application configuration information which does not conform to a predefined format into the second installation packages can be avoided, the finally generated target installation packages can be ensured to run successfully, and under the condition that the application configuration information is correct, a compression algorithm can be used for compressing the application configuration information to reduce the volume of the application configuration information, so that the volume of the target installation packages can be further generated.
Fig. 3 is a schematic flowchart of another method for generating an application installation package according to an embodiment of the present application.
Illustratively, as shown in FIG. 3, taking the electronic device 101 of FIG. 1 as an example of an execution subject, the method 300 includes the following steps 301-310.
In step 301, a first installation package of a target application is generated in response to a compiling request for the target application, the compiling request being used for requesting generation of at least two installation packages, one installation package corresponding to each functional requirement.
And step 302, copying the first installation package to obtain at least two second installation packages.
Step 303, obtaining application configuration information of at least two functional requirements corresponding to the compiling request.
And step 304, writing application configuration information of at least two function requirements into at least two second installation packages respectively to obtain at least two target installation packages.
Steps 301 to 304 may be referred to the above embodiments, and are not described herein.
Step 305, deleting the initial digital signature of at least two target installation packages.
As can be seen from the foregoing embodiments, after the first installation package is generated, in order to ensure that the security of the first installation package will generate a digital signature for the first installation package, it may be understood that each second installation package obtained by copying the first installation package will have the same digital signature, and each target installation package obtained by copying the second installation package will also have the same digital signature, that is, each target installation package will have an initial digital signature, but after at least two application configuration information required by the function is written into at least two second installation packages respectively, so as to obtain at least two target installation packages, since the configuration information in the target installation packages is inconsistent with the configuration information in the first installation package, the digital signature generated based on each file in the target installation package is inconsistent with the initial digital signature, so that the target installation package cannot pass verification during installation, that is, in order to avoid that the target installation package cannot pass verification during installation, in a possible implementation, after at least two target installation packages are obtained, each initial digital signature of the target installation package may be deleted, and each target installation package may be reinstalled for successful installation script, and each target installation package may be obtained.
At step 306, hash calculations are performed on the files in each target installation package based on a hash algorithm to generate a first hash value for each target installation package.
In step 307, each first hash value is encrypted based on the preset private key to regenerate a target digital signature for each target installation package.
The implementation manners of step 306 and step 307 are the same as those of the first installation package generation method in the above embodiment, and specific reference may be made to the above embodiment, which is not repeated here.
Step 308, decrypting the target digital signature of each target installation package based on the public key corresponding to the private key, to obtain a first hash value corresponding to each target installation package.
It should be noted that, after a target digital signature is generated for each target installation packet, in order to ensure that the application configuration information in the target installation packet is not tampered or lost in the process of re-signing, in one possible implementation, a apksigner tool may be used to decrypt the target digital signature of each target installation packet by using a public key corresponding to a private key, so as to obtain a first hash value corresponding to each target installation packet, so that the first hash value obtained by decryption is compared with a second hash value regenerated for the target installation packet, thereby determining whether the application configuration information in the target installation packet is tampered or lost in the process of re-signing based on the comparison result.
Step 309, re-hashing the files in each target installation package based on the hashing algorithm to re-generate a second hash value for each target installation package.
The implementation of step 309 may be referred to the above examples, and will not be described herein.
And step 310, comparing each first hash value with each corresponding second hash value, if the first hash value is the same as the corresponding second hash value, determining that the application configuration information in the target installation package is not tampered or lost in the re-signing process, otherwise, regenerating the target installation package and re-signing the target installation package.
In this case, it is determined that the application configuration information in the target installation packet is not tampered or lost during the re-signing process because the first hash value is the same as the corresponding second hash value when the first hash value is the e7c2f3e0a6d and the second hash value corresponding to the first hash value is the e7c2f3e0a6d, and it is necessary to re-generate and re-sign the target installation packet in order to ensure that the target installation packet can pass the verification smoothly at this time, since the first hash value is the e7c2f3e0a6d and the second hash value corresponding to the first hash value is the e7c2f3e0a6d, in this case, since the first hash value is different from the corresponding second hash value, the application configuration information in the target installation packet can be determined to be illegally tampered or lost during the re-signing process.
It should be noted that after a target digital signature is generated for each target installation package again, the regenerated second hash value is compared with the decrypted first hash value, so that when the second hash value is different from the first hash value, that is, when the application configuration information in the target installation package is tampered or lost in the re-signing process, the target installation package is regenerated and re-signed, thereby ensuring the accuracy of the application configuration information in the finally obtained target installation package, and further ensuring that the generated target installation package can meet the corresponding functional requirements.
Fig. 4 is a schematic structural diagram of an application installation package generating device according to an embodiment of the present application.
Illustratively, as shown in FIG. 4, the apparatus 400 includes:
A generating module 401, configured to generate a first installation package of a target application program in response to a compiling request of the target application program, where the compiling request is used to request generation of at least two installation packages, and one installation package corresponds to one functional requirement;
The replication module 402 is configured to replicate the first installation package to obtain at least two second installation packages, where the number of the second installation packages is the same as the number of the functional requirements corresponding to the compiling request, and the at least two second installation packages include the first installation package;
The obtaining module 403 is configured to obtain application configuration information of at least two functional requirements corresponding to the compiling request, where the application configuration information is used to configure the target application program to meet the corresponding functional requirements;
And the writing module 404 is configured to write application configuration information of at least two function requirements into at least two second installation packages respectively, so as to obtain at least two target installation packages.
In a possible implementation manner, the obtaining module 403 is further configured to obtain, from a source code library, a source code of the target application program in response to a compiling request of the target application program, the generating module 401 is specifically configured to compile the source code into an executable file based on a preset compiling environment, the executable file is a file that can be executed by a computer, the obtaining module 403 is further configured to obtain a public resource file and public configuration information in the target application program, the public resource file is a static resource shared in the target application program, the public configuration information is a configuration parameter shared in the target application program, and the generating module 401 is specifically further configured to package the executable file, the public resource file and the public configuration information based on a packaging tool to obtain the first installation package.
In a possible implementation manner, the writing module 404 is further configured to write application configuration information corresponding to each function of the target application program into the target directory before generating the first installation package of the target application program, and generate a file name, where the target directory is a directory that does not enable the written application configuration information to be modified in a process of responding to a compiling request for the target application program, and the apparatus further includes a calling module configured to call the target function, and the obtaining module 403 is specifically configured to read, based on the target function and the file name, application configuration information of at least two function requirements corresponding to the compiling request written into the target directory, where the target function is configured to locate a position of the application configuration information of the at least two function requirements in the target directory, and read the application configuration information of the at least two function requirements.
In a possible implementation manner, each function requirement corresponds to an identifier, the identifier is associated with application configuration information, the writing module 404 is further configured to write application configuration information corresponding to each function of the target application program into the database before generating the first installation package of the target application program, the obtaining module 403 is specifically configured to determine the identifier of each function requirement, and based on the identifier of each function requirement, obtain application configuration information associated with the identifier of each function requirement from the database, so as to obtain application configuration information of at least two function requirements.
In a possible implementation manner, the device further comprises a detection module for detecting whether the format of the application configuration information of at least two functional requirements is correct, a compression module for compressing the application configuration information of each functional requirement based on a compression algorithm to obtain compressed application configuration information of at least two functional requirements when the format of the application configuration information of at least two functional requirements is correct, and a writing module 404 specifically for writing the compressed application configuration information of at least two functional requirements into a second installation package respectively to obtain at least two target installation packages.
In a possible implementation manner, each target installation package corresponds to an initial digital signature, the digital signature is used for verifying whether the target installation package is illegally tampered, the device further comprises a deleting module, the generating module 401 is used for deleting the initial digital signatures of at least two target installation packages after the at least two target installation packages are obtained, hash calculation is further performed on each file in each target installation package based on a hash algorithm to generate a first hash value for each target installation package, and encryption is performed on each first hash value based on a preset private key to generate a target digital signature for each target installation package again.
In a possible implementation manner, the device further comprises a decryption module, a generation module 401, a judgment module and a judgment module, wherein the decryption module is used for decrypting the target digital signature of each target installation packet based on the public key corresponding to the private key after the target digital signature is generated again for each target installation packet to obtain a first hash value corresponding to each target installation packet, the generation module 401 is further used for carrying out hash calculation on each file in each target installation packet based on a hash algorithm to regenerate a second hash value for each target installation packet, the judgment module is used for comparing each first hash value with each corresponding second hash value, if the first hash value is the same as the corresponding second hash value, it is determined that application configuration information in the target installation packet is not tampered or lost in the process of re-signing, and otherwise, the target installation packet needs to be regenerated and signed again.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
As shown in fig. 5, the electronic device 500 includes a memory 501 and a processor 502, wherein the memory 501 stores executable program code 503, and the processor 502 is configured to invoke and execute the executable program code 503 to perform an application installation package generating method.
In addition, the embodiment of the application also protects a device, which can comprise a memory and a processor, wherein executable program codes are stored in the memory, and the processor is used for calling and executing the executable program codes to execute the method for generating the application installation package.
In this embodiment, the functional modules of the apparatus may be divided according to the above method example, for example, each functional module may be corresponding to one processing module, or two or more functions may be integrated into one processing module, where the integrated modules may be implemented in a hardware form. It should be noted that, in this embodiment, the division of the modules is schematic, only one logic function is divided, and another division manner may be implemented in actual implementation.
In case of dividing the respective functional modules with the respective functions, the apparatus may further include a first transmitting module. A second send module, a torque zero module, etc. It should be noted that, all relevant contents of each step related to the above method embodiment may be cited to the functional descriptions of the corresponding functional modules, which are not described herein.
It should be understood that the apparatus provided in this embodiment is used to perform the above-described method for generating an application installation package, and thus the same effects as those of the above-described implementation method can be achieved.
In case of an integrated unit, the apparatus may comprise a processing module, a memory module. When the device is applied to the electronic equipment, the processing module can be used for controlling and managing the actions of the electronic equipment. The memory module may be used to support the electronic device in executing associated program code, etc.
Wherein the processing module may be a processor or controller that may implement or execute the various illustrative logical blocks, modules, and circuits described in connection with the present disclosure. A processor may also be a combination of computing functions, including for example one or more microprocessors, digital Signal Processing (DSP) and microprocessor combinations, etc., and a memory module may be a memory.
In addition, the device provided by the embodiment of the application can be a chip, a component or a module, and the chip can comprise a processor and a memory which are connected, wherein the memory is used for storing instructions, and when the processor calls and executes the instructions, the chip can be made to execute the method for generating the application installation package provided by the embodiment.
The present embodiment also provides a computer-readable storage medium having stored therein computer program code which, when run on a computer, causes the computer to execute the above-described related method steps to implement an application installation package generating method provided in the above-described embodiments.
The present embodiment also provides a computer program product, which when run on a computer, causes the computer to perform the above-mentioned related steps to implement an application installation package generating method provided by the above-mentioned embodiments.
The apparatus, the computer readable storage medium, the computer program product, or the chip provided in this embodiment are used to execute the corresponding method provided above, and therefore, the advantages achieved by the apparatus, the computer readable storage medium, the computer program product, or the chip can refer to the advantages of the corresponding method provided above, which are not described herein.
It will be appreciated by those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1.一种应用安装包生成方法,其特征在于,所述方法包括:1. A method for generating an application installation package, characterized in that the method comprises: 响应于对目标应用程序的编译请求,生成所述目标应用程序的第一安装包,所述编译请求用于请求生成至少两个安装包,一个安装包对应于一个功能需求;In response to a compilation request for a target application, generating a first installation package of the target application, wherein the compilation request is used to request generation of at least two installation packages, one installation package corresponding to one functional requirement; 将所述第一安装包进行复制,得到至少两个第二安装包,所述第二安装包的数量与所述编译请求对应的功能需求的数量相同,所述至少两个第二安装包包括所述第一安装包;Copying the first installation package to obtain at least two second installation packages, the number of the second installation packages being the same as the number of functional requirements corresponding to the compilation request, and the at least two second installation packages including the first installation package; 获取所述编译请求对应的至少两个功能需求的应用配置信息,所述应用配置信息用于将所述目标应用程序配置为满足对应的功能需求;Acquire application configuration information of at least two functional requirements corresponding to the compilation request, wherein the application configuration information is used to configure the target application to meet the corresponding functional requirements; 将所述至少两个功能需求的应用配置信息分别写入所述至少两个第二安装包,得到至少两个目标安装包。The application configuration information of the at least two functional requirements is written into the at least two second installation packages respectively to obtain at least two target installation packages. 2.根据权利要求1所述的方法,其特征在于,所述响应于对目标应用程序的编译请求,生成所述目标应用程序的第一安装包,包括:2. The method according to claim 1, wherein generating a first installation package of the target application in response to a compilation request for the target application comprises: 响应于对目标应用程序的编译请求,从源代码库中获取所述目标应用程序的源代码;In response to a compilation request for a target application, obtaining source code of the target application from a source code library; 基于预设的编译环境,将所述源代码编译为可执行文件,所述可执行文件为计算机能够执行的文件;Based on a preset compilation environment, compile the source code into an executable file, where the executable file is a file that can be executed by a computer; 获取所述目标应用程序中的公共资源文件和公共配置信息,所述公共资源文件是指在所述目标应用程序中共享的静态资源,所述公共配置信息是指在所述目标应用程序中共享的配置参数;Acquire common resource files and common configuration information in the target application, wherein the common resource files refer to static resources shared in the target application, and the common configuration information refers to configuration parameters shared in the target application; 基于打包工具将所述可执行文件、所述公共资源文件和所述公共配置信息进行打包,得到所述第一安装包。The executable file, the public resource file, and the public configuration information are packaged based on a packaging tool to obtain the first installation package. 3.根据权利要求1所述的方法,其特征在于,在生成所述目标应用程序的第一安装包之前,所述方法还包括:3. The method according to claim 1, characterized in that before generating the first installation package of the target application, the method further comprises: 将与所述目标应用程序的各个功能对应的应用配置信息写入目标目录,并生成一个文件名,所述目标目录为在响应于对所述目标应用程序的编译请求的过程中,不会使得写入的应用配置信息被修改的目录;Writing application configuration information corresponding to each function of the target application into a target directory and generating a file name, wherein the target directory is a directory that will not cause the written application configuration information to be modified in the process of responding to a compilation request for the target application; 所述获取所述编译请求对应的至少两个功能需求的应用配置信息,包括:The obtaining application configuration information of at least two functional requirements corresponding to the compilation request includes: 调用目标函数,基于所述目标函数和所述文件名,读取写入所述目标目录中的与所述编译请求对应的至少两个功能需求的应用配置信息,所述目标函数用于定位所述至少两个功能需求的应用配置信息在所述目标目录中的位置,并读取所述至少两个功能需求的应用配置信息。Call a target function, and based on the target function and the file name, read application configuration information of at least two functional requirements corresponding to the compilation request written in the target directory, wherein the target function is used to locate the application configuration information of the at least two functional requirements in the target directory and read the application configuration information of the at least two functional requirements. 4.根据权利要求1所述的方法,其特征在于,每个所述功能需求均对应有一个标识符,所述标识符与应用配置信息关联;4. The method according to claim 1, wherein each of the functional requirements corresponds to an identifier, and the identifier is associated with the application configuration information; 在生成所述目标应用程序的第一安装包之前,所述方法还包括:将与所述目标应用程序的各个功能对应的应用配置信息写入数据库;Before generating the first installation package of the target application, the method further includes: writing application configuration information corresponding to each function of the target application into a database; 所述获取所述编译请求对应的至少两个功能需求的应用配置信息,包括:The obtaining application configuration information of at least two functional requirements corresponding to the compilation request includes: 确定每个所述功能需求的标识符,基于每个所述功能需求的标识符,从所述数据库中获取与每个所述功能需求的标识符关联的应用配置信息,以得到所述至少两个功能需求的应用配置信息。An identifier of each of the functional requirements is determined, and based on the identifier of each of the functional requirements, application configuration information associated with the identifier of each of the functional requirements is acquired from the database to obtain application configuration information of the at least two functional requirements. 5.根据权利要求1所述的方法,其特征在于,所述将所述至少两个功能需求的应用配置信息分别写入所述至少两个第二安装包,得到至少两个目标安装包,包括:5. The method according to claim 1, characterized in that the step of writing the application configuration information of the at least two functional requirements into the at least two second installation packages respectively to obtain at least two target installation packages comprises: 检测所述至少两个功能需求的应用配置信息的格式是否正确;Detecting whether the formats of the application configuration information of the at least two functional requirements are correct; 在所述至少两个功能需求的应用配置信息的格式正确的情况下,基于压缩算法对每个所述功能需求的应用配置信息进行压缩,得到压缩后的至少两个功能需求的应用配置信息;When the formats of the application configuration information of the at least two functional requirements are correct, compressing the application configuration information of each functional requirement based on a compression algorithm to obtain compressed application configuration information of the at least two functional requirements; 将压缩后的至少两个功能需求的应用配置信息,分别写入所述第二安装包,得到所述至少两个目标安装包。The compressed application configuration information of at least two functional requirements is written into the second installation package respectively to obtain the at least two target installation packages. 6.根据权利要求1所述的方法,其特征在于,每个所述目标安装包对应有一个初始的数字签名,所述数字签名用于验证所述目标安装包是否被非法篡改,所述方法还包括:6. The method according to claim 1, characterized in that each of the target installation packages corresponds to an initial digital signature, and the digital signature is used to verify whether the target installation package has been illegally tampered with, and the method further comprises: 在得到所述至少两个目标安装包之后,删除所述至少两个目标安装包的初始数字签名;After obtaining the at least two target installation packages, deleting the initial digital signatures of the at least two target installation packages; 基于哈希算法对每个所述目标安装包中的各个文件进行哈希计算,以为每个所述目标安装包生成一个第一哈希值;Performing hash calculation on each file in each of the target installation packages based on a hash algorithm to generate a first hash value for each of the target installation packages; 基于预设私钥对每个所述第一哈希值进行加密,以重新为每个所述目标安装包生成一个目标数字签名。Each of the first hash values is encrypted based on a preset private key to regenerate a target digital signature for each of the target installation packages. 7.根据权利要求6所述的方法,其特征在于,在重新为每个所述目标安装包生成一个所述目标数字签名之后,所述方法还包括:7. The method according to claim 6, characterized in that after regenerating a target digital signature for each target installation package, the method further comprises: 基于与所述私钥对应的公钥对每个所述目标安装包的所述目标数字签名进行解密,得到与每个所述目标安装包对应的第一哈希值;Decrypting the target digital signature of each target installation package based on a public key corresponding to the private key to obtain a first hash value corresponding to each target installation package; 基于所述哈希算法对每个所述目标安装包中的各个文件重新进行哈希计算,以为每个所述目标安装包重新生成一个第二哈希值;Re-calculating the hash value of each file in each target installation package based on the hash algorithm to regenerate a second hash value for each target installation package; 将每个所述第一哈希值与对应的每个所述第二哈希值进行比较,若所述第一哈希值与对应的所述第二哈希值相同,则确定所述目标安装包中的应用配置信息在重新签名过程中没有被篡改或者丢失,否则需要重新生成所述目标安装包,并重新进行签名。Compare each of the first hash values with each of the corresponding second hash values. If the first hash value is the same as the corresponding second hash value, it is determined that the application configuration information in the target installation package has not been tampered with or lost during the re-signing process. Otherwise, the target installation package needs to be regenerated and re-signed. 8.一种应用安装包生成装置,其特征在于,所述装置包括:8. A device for generating an application installation package, characterized in that the device comprises: 生成模块,用于响应于对目标应用程序的编译请求,生成所述目标应用程序的第一安装包,所述编译请求用于请求生成至少两个安装包,一个安装包对应于一个功能需求;A generating module, configured to generate a first installation package of the target application in response to a compilation request for the target application, wherein the compilation request is used to request generation of at least two installation packages, one installation package corresponding to one functional requirement; 复制模块,用于将所述第一安装包进行复制,得到至少两个第二安装包,所述第二安装包的数量与所述编译请求对应的功能需求的数量相同,所述至少两个第二安装包包括所述第一安装包;a copy module, configured to copy the first installation package to obtain at least two second installation packages, the number of the second installation packages being the same as the number of functional requirements corresponding to the compilation request, the at least two second installation packages including the first installation package; 获取模块,用于获取所述编译请求对应的至少两个功能需求的应用配置信息,所述应用配置信息用于将所述目标应用程序配置为满足对应的功能需求;An acquisition module, used to acquire application configuration information of at least two functional requirements corresponding to the compilation request, wherein the application configuration information is used to configure the target application to meet the corresponding functional requirements; 写入模块,用于将所述至少两个功能需求的应用配置信息分别写入所述至少两个第二安装包,得到至少两个目标安装包。The writing module is used to write the application configuration information of the at least two functional requirements into the at least two second installation packages respectively to obtain at least two target installation packages. 9.一种电子设备,其特征在于,所述电子设备包括:9. An electronic device, characterized in that the electronic device comprises: 存储器,用于存储可执行程序代码;A memory for storing executable program codes; 处理器,用于从所述存储器中调用并运行所述可执行程序代码,使得所述电子设备执行如权利要求1至7中任意一项所述的方法。A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the method according to any one of claims 1 to 7. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,当所述计算机程序被执行时,实现如权利要求1至7中任意一项所述的方法。10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.
CN202510298900.7A 2025-03-13 2025-03-13 Application installation package generation method, device, electronic device and readable storage medium Pending CN120216008A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202510298900.7A CN120216008A (en) 2025-03-13 2025-03-13 Application installation package generation method, device, electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202510298900.7A CN120216008A (en) 2025-03-13 2025-03-13 Application installation package generation method, device, electronic device and readable storage medium

Publications (1)

Publication Number Publication Date
CN120216008A true CN120216008A (en) 2025-06-27

Family

ID=96117806

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202510298900.7A Pending CN120216008A (en) 2025-03-13 2025-03-13 Application installation package generation method, device, electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN120216008A (en)

Similar Documents

Publication Publication Date Title
KR102618665B1 (en) Version history management using blockchain
US10338946B1 (en) Composable machine image
RU2759329C2 (en) Sealing data with sealing enclave
CA3046517C (en) Cross-platform enclave identity
AU2017395731B2 (en) Abstract enclave identity
US11949789B2 (en) Blockchain-enabled computing
CN110199285B (en) Slave enclave binary
CN111143869B (en) Application package processing method, device, electronic device and storage medium
US9009840B1 (en) Validating machine images
EP3574438A1 (en) Data unsealing with a sealing enclave
WO2018140162A1 (en) Key vault enclave
EP3574437A1 (en) Cross-platform enclave data sealing
US10853141B2 (en) Resource provisioning in distributed computing environments
CN113051622B (en) Index construction method, device, equipment and storage medium
EP3574441A1 (en) Enclave abstraction model
CN111273920A (en) Method and device for writing data into installation package and storage medium
EP3574433A1 (en) Nested enclave identity
US11954007B2 (en) Tracking usage of common libraries by means of digitally signed digests thereof
CN116723247A (en) Microservice calling methods, devices, equipment and storage media
KR101411181B1 (en) Schema packaging, deployment, and availability
CN120216008A (en) Application installation package generation method, device, electronic device and readable storage medium
CN118012453A (en) Software deployment method, device, electronic device, storage medium and program product
CN113094051B (en) Application program construction method, device, equipment and medium
CN120104144A (en) Image building method, device, electronic device and medium
HK40024808A (en) Method and device for writing data to installation package and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination