CN109032631B - Application program patch package obtaining method and device, computer equipment and storage medium - Google Patents

Application program patch package obtaining method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN109032631B
CN109032631B CN201810764455.9A CN201810764455A CN109032631B CN 109032631 B CN109032631 B CN 109032631B CN 201810764455 A CN201810764455 A CN 201810764455A CN 109032631 B CN109032631 B CN 109032631B
Authority
CN
China
Prior art keywords
resource
file
updated
full
resource identifier
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.)
Active
Application number
CN201810764455.9A
Other languages
Chinese (zh)
Other versions
CN109032631A (en
Inventor
谭伟林
郭一木
陈琦钿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810764455.9A priority Critical patent/CN109032631B/en
Publication of CN109032631A publication Critical patent/CN109032631A/en
Application granted granted Critical
Publication of CN109032631B publication Critical patent/CN109032631B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

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

Abstract

The invention discloses an application program patch package obtaining method and device, computer equipment and a storage medium, and belongs to the field of information technology. In the process of generating the resource patch package, the embodiment of the invention obtains the resource identifier of the updated resource by fixing the resource identifier in the first resource library, and synthesizes the corresponding file based on the resource identifier of the updated resource, thereby avoiding rewriting the resource identifier and the updated resource identifier in the first resource library, and greatly improving the generation efficiency of the resource patch package.

Description

Application program patch package obtaining method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of information technology, and in particular, to a method and an apparatus for acquiring an application patch package, a computer device, and a storage medium.
Background
With the rapid development of mobile terminals, more and more applications are emerging, and these applications need to be continuously repaired, for example, to improve bug emergence of the applications or to add new functional modules in the applications. Generally, when an application running on an android system has a problem, a computer device at an development end of the application needs to push a repaired complete installation package to a computer device at a user end, and the computer device at the user end receives the installation package and completes the repair of the application, but this way is not good in user experience, so that a scheme for realizing dynamic compilation based on a thermal repair technology is provided.
At present, the existing scheme for implementing dynamic compilation based on the hot repair technology is as follows: the method comprises the steps that a developer injects an Application type onCreate method into a computer device at an initiation end to serve as an entrance of an Application program, a local server is registered in the computer device at the initiation end and used for monitoring a port of the computer device at a user end, the computer device at the initiation end generates a code patch package based on a modified code, the computer device at the user end rewrites a resource identifier of a new full amount of resources based on the modified resource to generate a resource patch package, the code patch package and the resource patch package are pushed to the computer device at the user end, the computer device at the user end receives the code patch package and the resource patch package through the port to update original codes and original resources, and after the computer device at the user end is restarted, the Application program is automatically repaired.
However, based on the above scheme, the process of generating the code patch package by the computer device at the development end is performed by packaging along a pipeline task from top to bottom, each link takes too long, which finally results in too long time for generating the whole code patch package, and when the computer device at the development end generates the resource patch package, the resource identifier of a new total resource needs to be rewritten, which is inefficient.
Disclosure of Invention
The embodiment of the invention provides an application program patch package obtaining method, an application program patch package obtaining device, computer equipment and a storage medium, and can solve the problems that the time for generating a code patch package is too long, and when a resource patch package is generated, resource identification of new total resources needs to be rewritten, so that the efficiency is low. The technical scheme is as follows:
in one aspect, a method for acquiring an application patch package is provided, where the method includes:
acquiring an update code file and an update resource of an application program;
generating a code patch package based on the updated code file;
acquiring a resource identifier of an updated resource based on the updated resource and a first resource library, wherein the first resource library is used for storing an original resource and a resource identifier of the application program;
and generating a resource patch package based on the resource identifier of the updated resource, the first resource library, the first resource identifier mapping file and the new total resource, wherein the first resource identifier mapping file is a file which is obtained based on the first resource library and is used for fixing the resource identifier, and the new total resource comprises the updated resource and the original resource.
In one aspect, an apparatus for acquiring an application patch package is provided, the apparatus including:
the acquisition module is used for acquiring an update code file and an update resource of the application program;
a generation module for generating a code patch package based on the updated code file;
the obtaining module is further configured to obtain a resource identifier of the updated resource based on the updated resource and a first resource library, where the first resource library is used to store an original resource and a resource identifier of the application program;
the generation module is further configured to generate a resource patch package based on the resource identifier of the updated resource, the first resource library, the first resource identifier mapping file, and the new full resource, where the first resource identifier mapping file is a file used for the fixed resource identifier and acquired based on the first resource library, and the new full resource includes the updated resource and the original resource.
In one aspect, a computer device is provided, and the computer device includes a processor and a memory, where at least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to implement the operations performed by the application patch acquisition method.
In one aspect, a server is provided, and the server includes a processor and a memory, where at least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to implement the operations performed by the application patch acquisition method.
In one aspect, a computer-readable storage medium is provided, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the operations performed by the above application patch acquisition method.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the process of generating the resource patch package, the embodiment of the invention obtains the resource identifier of the updated resource by fixing the resource identifier in the first resource library, and synthesizes the corresponding file based on the resource identifier of the updated resource, thereby avoiding rewriting the resource identifier and the updated resource identifier in the first resource library, and greatly improving the generation efficiency of the resource patch package.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is an implementation environment diagram of a method for acquiring an application patch package according to an embodiment of the present invention;
fig. 2 is a flowchart of an application patch package obtaining method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the loading of a code patch package according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a process for generating a resource patch package when a page layout of an application is not changed according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a process for generating a resource patch package when a page layout of an application is changed according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an application patch acquiring apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Fig. 1 is an implementation environment diagram of an application patch package obtaining method according to an embodiment of the present invention. The implementation environment comprises a first computer device 101 and a second computer device 102, wherein the first computer device 101 is a computer device on a user side and is used by a user, a plurality of application programs are installed on the first computer device 101, and the second computer device 102 is a computer device on an development side and is used by a developer and is an application server. The first computer device 101 may be a smartphone, tablet, or other electronic device, and the second computer device 102 may be a desktop computer. The developer can repair the application program through the second computer device 102, and then the second computer device 102 sends the updated installation package of the application program to the first computer device 101. For the second computer device 102, the second computer device 102 may also have at least one database for storing user information, resources, code, etc. of applications.
Fig. 2 is a flowchart of an application patch package obtaining method according to an embodiment of the present invention. Referring to fig. 2, this embodiment specifically includes:
201. the computer device obtains an update code file and an update resource of the application program.
In practical application, in the development and compilation process of an application program, the application program needs to be continuously updated, for example, bug repairing is performed on the application program; or, a new function module is added to the application program. In response to the above problem, the computer device modifies the code logic of the application program and adds or deletes resource files, such as pictures, etc.
In the embodiment of the invention, the computer device introduces blink-plugin. jar into the project engineering corresponding to the Application program, and simultaneously injects an Application type onCreat method to start the blink-plugin. jar of the project engineering, and configures the environment directory of the project engineering, when the computer device needs to change the code file and the resource of the Application program, the "blink" is directly input into the root directory command of the project engineering, and the blink-plugin. jar can be started, so as to compile the updated code file and the updated resource.
202. The computer device generates a corresponding class file based on the update code file.
In the embodiment of the present invention, for an update code file acquired by a computer device, the computer device compiles the update code file into a class file of bytecode through a compiler, for example, a java compiler.
203. And the computer equipment calls the dependent class file of the application program from the class path, and generates the dependent class file of the application program and stores the dependent class file in the class path if the dependent class file of the application program does not exist in the class path.
In practical applications, when the update code file is compiled into a class file by the java compiler, many other already compiled class files may be also repeatedly compiled, and this is because there is a dependency relationship between the other already compiled class files and the class file into which the update code file is compiled, and each time an update code file is compiled into a class file, the other already compiled dependent class files are recompiled.
Therefore, in order to avoid that the other compiled dependent class files are recompiled each time the code file is updated, which causes low efficiency of repeated compilation by the computer device, the embodiment of the present invention caches the other compiled dependent class files, and the computer device stores the dependent class files into a class path, which is set in the java compiler by an option classpath.
In the embodiment of the invention, when the application program needs to be updated again, when the update code file is compiled by the Javac compiler, the stored dependent class file is preferentially searched in the classpath class path, and if the Java compiler successfully searches the dependent class file, the dependent class file is directly called and the update code file is compiled into the class file; if the java compiler does not search the dependent class file, the update code file is compiled into a class file, and the dependent class file is recompiled and stored into a classpath class path for subsequent calling.
204. And packaging the class file corresponding to the update code by the computer equipment to generate the code patch package.
In the embodiment of the present invention, after the update code file is compiled into a class file of byte codes, in order to enable the update code file to function in the android system, the class file needs to be packaged into a dex executable file in a computer device through a dex command, where the dex executable file is an executable file of the android system. Furthermore, after Packaging the class file into a dex executable file, the computer device packages the dex executable file by a Packaging Tool, such as an AAPT (Android Packaging Tool), to generate a code patch package corresponding to the update code file.
Based on step 203, after each compilation, the compiled class files and the dependent class files thereof are cached in the class path, so that only the class files corresponding to the update code file are packaged when the patch package of the application program is generated next time, which greatly reduces the packaging time compared with the packaging of all the class files of the application program together.
It should be noted that, in the case that only the code is updated and the resource is not updated, that is, in the case that the "res" folder that needs to be packed is blank, a configuration file needs to be created, and the configuration file does not contain any resource. For example, a blank android manifest xml file is created, where the android manifest xml file and the "res" file have an interdependence relationship, and the android manifest xml file is a configuration file necessary in an application program of an android system, and the configuration file is located in a root directory of an entire project in a computer device at an development end, and is used for storing configuration information and the like necessary for running the application program. And packaging the blank res folder, the blank android manifest xml file and the update code file together to generate a new installation package.
205. And the computer equipment performs incremental calculation based on the maximum resource identifier in the first resource library and the quantity of the updated resource to obtain the resource identifier of the updated resource.
In the embodiment of the present invention, the resources include, but are not limited to: in the android system, the resources are stored in a res folder, a first resource library automatically records all the resources in the res folder through a compiler, and establishes corresponding resource identifiers according to the resources, for example, each time a new resource is added to the res folder, the first resource library automatically records the resource and generates the resource identifier of the resource. The first resource library refers to a resource library in which original resources of the application program and resource identifiers are stored, wherein one resource identifier is used for uniquely marking one resource in the resource library.
In the embodiment of the invention, the resource identifiers in the first resource library are sequentially increased in an increasing manner, so that a maximum resource identifier exists, and according to the quantity of a certain type of updated resource, every time a resource is added, the resource identifier of the updated resource can be obtained on the basis of the maximum resource identifier plus 1. For example, the maximum resource identifier of a certain type of resource in the first resource pool is 0010, if 1 new resource of the type is added, the resource identifier of the updated resource is 0011, and similarly, if n new resources of the type are added, the resource identifiers of the updated resource are 0011, 0012, and 0013 … 0010+ n, respectively.
It should be noted that, in the related art, after a new resource is added to the first resource library, all resource identifiers in the first resource library are rewritten, which may cause the resource identifier in the updated resource library to be inconsistent with the resource identifier in the original first resource library, thereby causing a resource confusion, even an operation error of the application program. Based on step 205, the present invention solves the problem that after the resource of the application program is updated, the resource identifier in the first resource pool is not changed, so that the resource confusion does not occur.
206. The computer device synthesizes a second resource library based on the resource identification of the updated resource and the first resource library.
In the embodiment of the present invention, based on step 205, the resource identifier of the other updated resource except the page layout resource, for example, the resource identifier of the updated text resource or the updated picture resource, can be obtained quickly, so that the original resource, the resource identifier of the original resource, the updated resource, and the resource identifier of the updated resource in the first resource library are synthesized directly by a synthesis tool, for example, a blinkbuildcache.
207. When the page layout of the application program is not changed, the computer equipment synthesizes a second part of resource identifier mapping file based on the resource identifier of the updated resource and the first part of resource identifier mapping file.
In the embodiment of the present invention, the resource identifier mapping file is used to determine the corresponding relationship between the resource and the resource identifier, and therefore, the resource identifier mapping file also has a function of fixing the resource identifier, and the first part of the resource identifier mapping file is a public. Based on step 205, the resource identifier of the updated resource can be obtained relatively easily, so that the first part of resource identifier mapping file and the resource identifier of the updated resource can be synthesized directly by the synthesis function of the blinkbuilding cache.
It should be noted that the first part of resource identifier mapping file is not a resource identifier mapping file obtained based on the full resources of the first resource repository, but is an original resource identifier file, that is, an original public.xml file, where the public.xml file is used to describe and record the resource identifier of the original resource in the first resource repository. If one new resource is added to a certain type of resource, adding a row of resource identifiers of the newly added resource in the first part of resource identifier mapping file to obtain a second part of resource identifier mapping file.
208. The computer device generates the resource patch package based on the second resource pool, the second partial resource identification mapping file, and the new full resource.
In the embodiment of the present invention, the new full resource includes an updated resource and an original resource. And the computer equipment compiles the second resource library, the second part of resource identifier mapping file and the new full resource through an AAPT tool and packs the second resource library, the second part of resource identifier mapping file and the new full resource into a resource patch package.
In the above steps 206 to 208, referring to fig. 4, the process of generating the resource patch package when the page layout of the application program is not changed may be to combine the resource identifiers of the first resource library and the updated resource into a second resource library through a combining tool, combine the first part of resource identifier mapping file and the resource identifier of the updated resource into a second part of resource identifier mapping file, and compile and package the second resource library, the second part of resource identifier mapping file and the new full resource into the resource patch package. Through the process, the full resource identifier mapping file does not need to be analyzed based on the full resources and the resource identifiers in the first resource library, and only the resource identifiers for updating the resources need to be added on the basis of the first part of resource identifier mapping file, so that the time for analyzing the full resource identifier mapping file is greatly saved, and the compiling efficiency is improved.
209. When the page layout of the application program is changed, the computer equipment analyzes and obtains a first full resource identifier mapping file based on the first resource library.
In the embodiment of the present invention, the blinkbuildcache jar tool further has a function of identifying updated resources, when the page layout is changed, for example, a new layout block is added to the page layout, which may cause an identifier of the new layout block to be added to the page layout, if the method of step 207 is still used, the blinkbuildcache jar tool may only identify resource identifiers of updated text resources or image resources, etc., and cannot identify updated page layout resources, and the resource identifier of the updated resource in the public.xml file corresponding to step 207 is not defined, so that an error report situation may occur in a subsequent operation process.
Jar tool also has a function of analyzing a first full resource identifier, and based on the above situation, under the condition that the page layout is changed, the specific process of acquiring the first full resource identifier mapping file in the embodiment of the present invention is as follows: based on the full resources and the resource identifiers in the first resource library before the resources are updated, a first full resource identifier mapping file is obtained through analysis of an analysis tool, for example, a blinkbuildcache jar tool, where the first full resource identifier mapping file is a first full public.
210. And after obtaining the first full resource identifier mapping file, the computer equipment synthesizes a second full resource identifier mapping file based on the resource identifier of the updated resource and the first full resource identifier mapping file.
In this embodiment of the present invention, the computer device recognizes an updated page layout resource through a recognition tool, for example, a check tool, obtains a resource identifier of the updated page layout resource according to step 205, synthesizes the full public.xml file and the resource identifier of the updated resource through a blinkbuilding cache jar tool, to obtain a second full public.xml file, and synthesizes the full ids.xml file and the resource identifier of the updated resource to obtain a second full ids.xml file, where the second full public.xml file and the second full ids.xml file are the full second resource identifier mapping file.
211. The computer device generates the resource patch package based on the second resource pool, the second full resource identifier mapping file, and the new full resource.
In this embodiment of the present invention, based on steps 209 to 211, the computer device compiles the obtained second repository, the second full public.xml file, the second full ids.xml file, and the new full resource by using an AAPT tool, and packages them into a resource patch package.
The above steps 209 to 211 are a process for generating a resource patch package when the page layout of the application program is changed, and referring to fig. 5, the process may analyze, by using an analysis tool, a first full resource identifier mapping file based on a first resource library before updating resources, synthesize, by using a synthesis tool, a resource identifier of the first resource library and the resource identifier of the updated resources into a second resource library, synthesize the first full resource identifier mapping file and the resource identifier of the updated resources into a second full resource identifier mapping file, and compile and package the second full resource identifier mapping file and the new full resources into the resource patch package based on the second resource library, the second full resource identifier mapping file and the new full resources. Through the process, the corresponding file is only synthesized based on the resource identification of the updated resource, so that the resource identification of the new full resource is prevented from being rewritten, and the compiling efficiency is greatly improved.
In the embodiment of the invention, the generated code patch package and the resource patch package are packaged into the installation package of the application program, namely the apk file, the computer equipment sends the installation package to the application server, and the application server pushes the installation package to the computer equipment at the user end in a wired mode. After receiving the installation package, the computer device at the user end of fig. 3 inserts the installation package into the first position of the array corresponding to the application program. When the application program is restarted, sequentially traversing the dex executable files in the array corresponding to the application program through a class loader of the android system, wherein the class name of the first class file with a problem in the application program is the same as the class name of the second class file corresponding to the updated installation package, so that after the computer equipment of the user end loads the second class file, and subsequently detects the first class file, the first class file is abandoned to be loaded, and the application program is updated based on the process.
In the embodiment of the invention, the compiled dependent file is cached in the process of generating the code patch package, so that repeated compiling of the dependent file is avoided when other code patch packages of the application program are generated subsequently, and the time is greatly saved. In the process of generating the resource patch package, the resource identifier of the updated resource is obtained, and the corresponding file is synthesized based on the resource identifier of the updated resource, so that the rewriting of the original resource identifier and the updated resource identifier is avoided, and the generation efficiency of the resource patch package is greatly improved.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
Fig. 6 is a schematic structural diagram of an application patch acquiring apparatus according to an embodiment of the present invention. Referring to fig. 6, the apparatus includes:
an obtaining module 601, configured to obtain an update code file and an update resource of an application;
a generating module 602, configured to generate a code patch package based on the updated code file;
the obtaining module 601 is further configured to obtain a resource identifier of the updated resource based on the updated resource and a first resource library, where the first resource library is used to store an original resource and a resource identifier of the application program;
the generating module 602 is further configured to generate a resource patch package based on the resource identifier of the updated resource, the first resource library, the first resource identifier mapping file, and the new full resource, where the first resource identifier mapping file is a file for a fixed resource identifier and is acquired based on the first resource library, and the new full resource includes the updated resource and the original resource.
In the process of generating the resource patch package, the embodiment of the invention obtains the resource identifier of the updated resource by fixing the resource identifier in the first resource library, and synthesizes the corresponding file based on the resource identifier of the updated resource, thereby avoiding rewriting the resource identifier and the updated resource identifier in the first resource library, and greatly improving the generation efficiency of the resource patch package.
In some embodiments, the generation module 602 is further configured to:
generating a corresponding class file based on the update code file;
storing the class file into a class path, and packaging the class file to generate the code patch package;
when the code patch package is generated again, the stored class file is preferentially called from the class path.
In some embodiments, the obtaining module 601 is further configured to:
and performing incremental calculation based on the maximum resource identifier in the first resource library and the number of the updated resources to obtain resource identifiers of the updated resources, wherein one resource identifier is used for uniquely marking one resource in the resource library.
In some embodiments, the generation module 602 is further configured to:
when the page layout of the application program is not changed, synthesizing a second resource library based on the resource identifier of the updated resource and the first resource library, wherein the second resource library is used for storing the original resource, the updated resource and the resource identifier of the application program;
synthesizing a second part of resource identifier mapping file based on the resource identifier of the updated resource and the first part of resource identifier mapping file;
and generating the resource patch package based on the second resource library, the second partial resource identifier mapping file and the new full resource.
In some embodiments, the generation module 602 is further configured to:
when the page layout of the application program is changed, synthesizing the second resource library based on the resource identifier of the updated resource and the first resource library;
analyzing based on the first resource library to obtain a first full resource identifier mapping file, wherein the first full resource identifier mapping file is a mapping file of all resource identifiers corresponding to the first resource library;
synthesizing a second full resource identifier mapping file based on the resource identifier of the updated resource and the first full resource identifier mapping file, wherein the second full resource identifier mapping file is a full resource identifier mapping file corresponding to a second resource library;
and generating the resource patch package based on the second resource library, the second full resource identifier mapping file and the new full resource.
It should be noted that: the application patch package obtaining apparatus provided in the above embodiment is only illustrated by the above division of the functional modules when obtaining the application patch package, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the above described functions. In addition, the application patch package obtaining apparatus and the application patch package obtaining method provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 7 is a schematic structural diagram of a computer device 700 according to an embodiment of the present invention, where the computer device 700 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 701 and one or more memories 702, where the memory 702 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 701 to implement the methods provided by the method embodiments. Certainly, the computer device may further have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input and output, and the computer device may further include other components for implementing the functions of the device, which is not described herein again.
In an exemplary embodiment, a computer-readable storage medium, such as a memory, including instructions executable by a processor in a terminal to perform the application patch acquisition method in the above embodiments is also provided. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present invention and should not be taken as limiting the invention, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. An application patch package acquisition method, the method comprising:
acquiring an update code file and an update resource of an application program;
generating a code patch package based on the updated code file;
acquiring a resource identifier of an updated resource based on the updated resource and a first resource library, wherein the first resource library is used for storing an original resource and a resource identifier of the application program;
synthesizing a second resource library based on the resource identifier of the updated resource and the first resource library;
analyzing based on the first resource library to obtain a first full resource identifier mapping file, where the first full resource identifier mapping file is a mapping file of all resource identifiers corresponding to the first resource library and includes a first full public.xml file and a first full ids.xml file;
synthesizing a second full public.xml file based on the resource identifier of the updated resource and the first full public.xml file, and synthesizing a second full ids.xml file based on the resource identifier of the updated resource and the first full ids.xml file;
synthesizing a second full resource identifier mapping file based on the second full public.xml file and the second full ids.xml file, where the second full resource identifier mapping file is all resource identifier mapping files corresponding to the second resource repository;
and generating a resource patch package based on the second resource library, the second full resource identifier mapping file and new full resources, wherein the second full resource identifier mapping file is a file which is obtained based on the second resource library and is used for fixing resource identifiers, and the new full resources comprise updated resources and original resources.
2. The method of claim 1, wherein generating a code patch package based on the updated code file comprises:
generating a corresponding class file based on the update code file;
and storing the class files into a class path, packaging the class files to generate the code patch package, and preferentially calling the stored class files from the class path when the code patch package is generated again.
3. The method of claim 1, wherein obtaining the resource identifier of the updated resource based on the updated resource and the first resource pool comprises:
and performing incremental calculation based on the maximum resource identifier in the first resource library and the number of the updated resources to obtain resource identifiers of the updated resources, wherein one resource identifier is used for uniquely marking one resource in the resource library.
4. The method of claim 1, further comprising:
when the page layout of the application program is not changed, synthesizing the second resource library based on the resource identifier of the updated resource and the first resource library, wherein the second resource library is used for storing the original resource, the updated resource and the resource identifier of the application program;
synthesizing a second part of resource identifier mapping file based on the resource identifier of the updated resource and the first part of resource identifier mapping file;
and generating the resource patch package based on the second resource library, the second partial resource identifier mapping file and the new full resource.
5. An application patch acquisition apparatus, comprising:
the acquisition module is used for acquiring an update code file and an update resource of the application program;
a generation module for generating a code patch package based on the updated code file;
the obtaining module is further configured to obtain a resource identifier of the updated resource based on the updated resource and a first resource library, where the first resource library is used to store an original resource and a resource identifier of the application program;
the generating module is further configured to synthesize a second resource library based on the resource identifier of the updated resource and the first resource library;
the generation module is further configured to obtain a first full resource identifier mapping file based on the first resource library analysis, where the first full resource identifier mapping file is a mapping file of all resource identifiers corresponding to the first resource library, and includes a first full public.xml file and a first full ids.xml file;
the generating module is further configured to synthesize a second full resource identifier mapping file based on the resource identifier of the updated resource and the first full resource identifier mapping file, where the synthesizing includes synthesizing a second full public.xml file based on the resource identifier of the updated resource and the first full public.xml file, synthesizing a second full ids.xml file based on the resource identifier of the updated resource and the first full ids.xml file, and synthesizing a second full resource identifier mapping file based on the second full public.xml file and the second full ids.xml file;
the generation module is further configured to generate a resource patch package based on the second resource library, the second full resource identifier mapping file, and a new full resource, where the second full resource identifier mapping file is a file for a fixed resource identifier and is acquired based on the second resource library, and the new full resource includes an updated resource and an original resource.
6. The apparatus of claim 5, wherein the generating module is configured to:
generating a corresponding class file based on the update code file;
storing the class file into a class path, and packaging the class file to generate the code patch package;
and when the code patch package is generated again, the stored class file is preferentially called from the class path.
7. The apparatus of claim 5, wherein the obtaining module is configured to:
and performing incremental calculation based on the maximum resource identifier in the first resource library and the number of the updated resources to obtain resource identifiers of the updated resources, wherein one resource identifier is used for uniquely marking one resource in the resource library.
8. The apparatus of claim 5, wherein the generating module is further configured to:
when the page layout of the application program is not changed, synthesizing the second resource library based on the resource identifier of the updated resource and the first resource library, wherein the second resource library is used for storing the original resource, the updated resource and the resource identifier of the application program;
synthesizing a second part of resource identifier mapping file based on the resource identifier of the updated resource and the first part of resource identifier mapping file;
and generating the resource patch package based on the second resource library, the second partial resource identifier mapping file and the new full resource.
9. A computer device comprising a processor and a memory, the memory having stored therein at least one instruction that is loaded and executed by the processor to perform operations performed by an application patch acquisition method according to any one of claims 1 to 4.
10. A computer-readable storage medium having stored therein at least one instruction which is loaded and executed by a processor to perform operations performed by an application patch acquisition method according to any one of claims 1 to 4.
CN201810764455.9A 2018-07-12 2018-07-12 Application program patch package obtaining method and device, computer equipment and storage medium Active CN109032631B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810764455.9A CN109032631B (en) 2018-07-12 2018-07-12 Application program patch package obtaining method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810764455.9A CN109032631B (en) 2018-07-12 2018-07-12 Application program patch package obtaining method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109032631A CN109032631A (en) 2018-12-18
CN109032631B true CN109032631B (en) 2020-12-18

Family

ID=64642357

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810764455.9A Active CN109032631B (en) 2018-07-12 2018-07-12 Application program patch package obtaining method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109032631B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108027722A (en) * 2015-11-20 2018-05-11 谷歌有限责任公司 The dynamically renewal application in compiling and deployment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105657191B (en) * 2016-03-29 2020-03-31 Tcl集团股份有限公司 Application increment upgrading method and system based on Android system
US10430166B2 (en) * 2016-03-30 2019-10-01 Airwatch Llc Resource injection for application wrapping
JP6673776B2 (en) * 2016-08-01 2020-03-25 日本電信電話株式会社 Communication device, control method, and control program
CN107729041B (en) * 2017-07-26 2020-10-20 深圳壹账通智能科技有限公司 Application program hot updating method, device, terminal and storage medium
CN107436787B (en) * 2017-07-31 2018-05-22 腾讯科技(深圳)有限公司 Method for processing resource, device, storage medium and electronic device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108027722A (en) * 2015-11-20 2018-05-11 谷歌有限责任公司 The dynamically renewal application in compiling and deployment

Also Published As

Publication number Publication date
CN109032631A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
US7318215B1 (en) Stored procedure interface language and tools
US10331425B2 (en) Automated source code adaption to inject features between platform versions
US20150143348A1 (en) Hybrid dynamic code compiling device, method, and service system thereof
CN103186463B (en) Determine the method and system of the test specification of software
CN109491695A (en) A kind of increment updating method of integrated Android application
CN106648755B (en) Method and device for dynamically loading dex in android art environment
US9411618B2 (en) Metadata-based class loading using a content repository
CN112882718A (en) Compiling processing method, device, equipment and storage medium
CN109597618B (en) Program development method, program development device, computer device, and storage medium
CN109032631B (en) Application program patch package obtaining method and device, computer equipment and storage medium
CN112769706A (en) Componentized routing method and system
CN112380130A (en) Application testing method and device based on call dependency relationship
CN111240772A (en) Data processing method and device based on block chain and storage medium
CN110543427A (en) Test case storage method and device, electronic equipment and storage medium
US9747085B2 (en) Source code generation from prototype source
CN111124872A (en) Branch detection method and device based on difference code analysis and storage medium
US20120330878A1 (en) Conventions for inferring data models
KR101506656B1 (en) System for quality management of application and method therefor
JP3266097B2 (en) Automatic reentrant method and system for non-reentrant program
US9720660B2 (en) Binary interface instrumentation
CN112416362B (en) PDK compiling function implementation method
CN111143790B (en) Code obfuscation method, device, equipment and storage medium
US20200097260A1 (en) Software application developer tools platform
CN114816437A (en) Method, system and equipment for reversely generating Java entity class
CN114327396A (en) Method for developing Andriod system application by deviating from source code compiling environment

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
GR01 Patent grant
GR01 Patent grant