CN114721709A - Program package generation method, device, storage medium and computer equipment - Google Patents
Program package generation method, device, storage medium and computer equipment Download PDFInfo
- Publication number
- CN114721709A CN114721709A CN202210476156.1A CN202210476156A CN114721709A CN 114721709 A CN114721709 A CN 114721709A CN 202210476156 A CN202210476156 A CN 202210476156A CN 114721709 A CN114721709 A CN 114721709A
- Authority
- CN
- China
- Prior art keywords
- file
- compiling
- instrumentation
- intermediate file
- code
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/48—Incremental compilation
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The application discloses a program package generating method, which comprises the following steps: acquiring an inserting file; storing the instrumentation file to an engineering catalog; and responding to a program package generation instruction, and under the project catalogue, performing instrumentation operation on the first compiling intermediate file based on the instrumentation file so as to insert the object code into the first compiling intermediate file and generate an object application program package. The method can directly perform instrumentation operation on the compiling intermediate file in the engineering project compiling process according to the instrumentation file, avoids modifying the source code of the engineering project, generates the target application program package with the instrumentation function, and therefore effectively improves the code instrumentation efficiency.
Description
Technical Field
The present application relates to the field of computer-oriented programming technologies, and in particular, to a method and an apparatus for generating a program package, a storage medium, and a computer device.
Background
Code instrumentation refers to a test method in which a target program is plugged into a test item to acquire program running information, and is also called a dynamic program analysis method. The code instrumentation has important significance for memory monitoring, instruction tracking, error detection and the like during program operation, so the code instrumentation is widely used in the field of computer programming.
Because a new application function program package is generated in the project development process, the function of inserting new codes is often realized in a mode of performing code instrumentation on project source codes, however, when a new version of a project is released, instrumentation plug-in components need to be modified again on the basis of the corresponding source code version, which affects the efficiency of code instrumentation.
Disclosure of Invention
The embodiment of the application provides a program package generation method and device, a storage medium and computer equipment. It is intended to improve the efficiency of code instrumentation.
In one aspect, an embodiment of the present application provides a method for generating a package, where the method includes: acquiring an inserting file; storing the instrumentation file to an engineering catalog; and responding to a program package generation instruction, and under the project catalogue, performing instrumentation operation on the first compiling intermediate file based on the instrumentation file so as to insert the object code into the first compiling intermediate file and generate an object application program package.
On the other hand, an embodiment of the present application further provides a package generation apparatus, including: the acquisition module is used for acquiring the pile inserting file; the storage module is used for storing the instrumentation file to an engineering catalog; and the generation module is used for responding to the program package generation instruction, and performing instrumentation operation on the first compiling intermediate file based on the instrumentation file under the project directory so as to insert the object code into the first compiling intermediate file and generate the object application program package.
On the other hand, the embodiment of the present application further provides a computer readable storage medium, which stores program codes, wherein when the program codes are executed by a processor, the above-mentioned program package generation method is performed.
On the other hand, the embodiment of the present application further provides a computer device, where the computer device includes a processor and a memory, where the memory stores computer program instructions, and the computer program instructions, when called by the processor, execute the above-mentioned program package generation method.
In another aspect, the present application also provides a computer program product or a computer program, where the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a storage medium. The processor of the computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions to make the computer execute the steps in the program package generation method.
The program package generation method provided by the application can acquire the instrumentation file, store the instrumentation file to the engineering catalog, and further perform instrumentation operation on the first compiling intermediate file based on the instrumentation file under the engineering catalog in response to a program package generation instruction, so that the target code is inserted into the first compiling intermediate file to generate the target application program package. Therefore, the instrumentation operation of the compiling intermediate file during the project compiling period can avoid modifying the project source code and generate the target application program package with the corresponding instrumentation function, thereby improving the efficiency of code instrumentation.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows a schematic diagram of an instrumentation method based on modified source codes according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating a method for generating a package according to an embodiment of the present application.
Fig. 3 is a flowchart illustrating another program package generation method according to an embodiment of the present application.
Fig. 4 is a flowchart illustrating a compiling operation according to an embodiment of the present application.
Fig. 5 is a flowchart illustrating another compiling operation provided by the embodiment of the present application.
Fig. 6 shows a block diagram of modules of a package generation apparatus according to an embodiment of the present application.
Fig. 7 is a block diagram of a computer device according to an embodiment of the present disclosure.
Fig. 8 is a block diagram of a computer-readable storage medium according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
In order to make the technical solutions of the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Aspect Oriented Programming (AOP) is a key technology for implementing program functions by means of pre-compilation and dynamic proxy during running for uniform maintenance. The section-oriented programming can dynamically insert codes into a designated class to realize the practical functions of log recording, performance statistics and the like when a program runs. For example, the commonly used program modification programming framework AspectD implements a function of inserting code during compiling, however, the solution needs to modify the source code of Flutter SDK (Software Development Kit), whenever Flutter has a new version to issue, AspectD needs to modify the framework again on the basis of the corresponding source code version, and developers can only use the SDK source code modified by AspectD, which is inconvenient for the use and maintenance of the source code.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a modified source code based instrumentation method according to the present application. When the Flutter Project is packaged to generate an Android Application Package (APK), modifying a source code of the Flutter Project to realize instrumentation, further producing a compiled intermediate file app.dill, generating an app.so file from the compiled intermediate file app.dill, and finally generating the APK.
In order to solve the above problem, the inventors have studied and proposed a package generation method provided in an embodiment of the present application, which may acquire an instrumentation file, store the instrumentation file in an engineering directory, and further perform, in response to a package generation instruction, an instrumentation operation on a first compiled intermediate file based on the instrumentation file under the engineering directory, so as to insert an object code into the first compiled intermediate file, thereby generating an object application package. By performing instrumentation operation on the compiled intermediate file during project compiling, plug-in units used for code instrumentation do not need to be modified when the Flutter SDK source code is upgraded while the Flutter SDK source code is prevented from being modified, so that the efficiency of code instrumentation is improved.
In the present embodiment, a description will be made from the viewpoint of a package generation apparatus as shown in fig. 6, which can be specifically integrated in a computer device 500 (fig. 7) having a storage unit and a microprocessor mounted thereon with an arithmetic capability.
Of course, it can be understood that the computer device applied in this embodiment may be a server or a terminal, and the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, a block chain, and a big data and artificial intelligence platform. The terminal may be, but is not limited to, a tablet computer, a notebook computer, a desktop computer, and the like, and embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 2, fig. 2 is a flowchart illustrating a program package generating method according to an embodiment of the present application. The program package generating method may include the steps of:
step S110: and acquiring the pile inserting file.
A Plug-in (Plug-in) is a program written in an application program interface that follows a certain specification. It can only run under the system platform specified by the program (possibly supporting multiple platforms simultaneously), and cannot run separately from the specified platform, because the plug-in needs to call the function library or data provided by the original pure system. In the actual development process, a developer develops instrumentation plug-ins in order to conveniently perform code instrumentation, and generates corresponding executable files, namely instrumentation files, after compiling.
As an implementation manner, according to the functional requirements of actual development of instrumentation of a project, a functional code block corresponding to the instrumentation is obtained, an instrumentation plug-in is generated based on the functional code block, and then an instrumentation file is generated based on compiling the instrumentation plug-in. For example, for a task of clicking an event buried point, a plug-in of Hook is inserted by using byte codes of an Android method, so that when a method enters and the method exits, all currently running parameters are called back to a fixed interface, and then the method is developed in a slicing mode, and optionally, the plug-in of Hook can be developed by using a custom Hook rule and codes of any method in a Hook project to generate an insertion file.
Step S120: and storing the instrumented file to a project directory.
In the actual development process, in order to effectively manage a large variety and number of source files, a developer stores all the source files under a directory (folder) uniformly, and only stores resources related to the current program under the directory.
Therefore, an Integrated Development Environment (IDE) used for project Development creates a special directory for each program, collects all the files used in the program into the directory, i.e., the project directory, and manages them conveniently, such as renaming, deleting files, editing files, and the like.
As an embodiment, after acquiring the instrumented file, the instrumented file may be stored in a project directory of the project, so that when compiling is performed, the instrumented file under the project directory can be referred to for instrumentation operation. For example, the instrumented file a is stored in the Project directory (HelloFlutter/target/plug/a) of the Flutter Project.
Step S130: and responding to a program package generation instruction, and under the project catalogue, performing instrumentation operation on the first compiling intermediate file based on the instrumentation file so as to insert the object code into the first compiling intermediate file and generate an object application program package.
In view of the fact that the project source code is directly instrumented, the function of inserting new codes is realized, which is not beneficial to project maintenance, and therefore, in the process of generating the application package, the instrumentation operation is performed on the compiling intermediate file. The package generation instruction refers to an instruction for executing APK generation, for example, an instruction for executing Flutter to generate APK. The first compiled file refers to an intermediate file generated at the time of compiling before the instrumentation operation is performed on the project, for example, an app.
As an embodiment, a target item to be instrumented may be compiled to obtain a first compiled intermediate file, the first compiled intermediate file may be instrumented to obtain a second compiled intermediate file, and the second compiled intermediate file may be compiled to generate a target application package. Since the compilation is not performed based on the source code of the target item and the instrumentation operation is not performed to modify the source code of the target item when the compilation operation is performed for the second time, the instrumentation efficiency of the target item can be improved.
In the embodiment of the application, an instrumentation file may be obtained and stored in the engineering directory, and further, in response to a program package generation instruction, an instrumentation operation is performed on the first compiling intermediate file based on the instrumentation file under the engineering directory, so that an object code is inserted into the first compiling intermediate file to generate an object application program package. Therefore, instrumentation operation is carried out on the compiling intermediate file during the project compiling period, modification on project source codes is avoided, and a target application program package with a code insertion function is generated, so that the code instrumentation efficiency is improved.
The method described in connection with the above embodiments will be described in further detail below by way of example.
In this embodiment, a description will be given taking an example in which the package generating apparatus is specifically integrated in a computer device.
As shown in fig. 3, fig. 3 schematically illustrates another package generation method provided in the embodiment of the present application, where the package generation method may include the following steps:
step S210: the computer device obtains the instrumented file.
In the process of project development, related execution steps of the SDK source code need to be tracked sometimes, so as to locate problems occurring when the code runs, however, generally, the debugging difficulty of the SDK source code is high, and if the SDK source code is modified directly, for example, a large amount of code is added to the SDK source code, the method is time-consuming and is not universal.
Therefore, the program steps of the relevant codes can be added by performing instrumentation on the part of the SDK source codes in the compiled intermediate file app.dill product, and the execution process of the corresponding source codes can also be tracked without modifying the SDK source codes. The instrumentation operation is based on an instrumentation file, which is an executable file generated by compiling the developed instrumentation plug-in.
As an embodiment, the step of the computer device obtaining the instrumented file may include:
(1) the computer device obtains an object code.
(2) The computer device generates an instrumented plug-in based on the object code.
(3) And the computer equipment carries out third compiling operation on the instrumentation plug-in unit to generate an instrumentation file.
The target code refers to a function code which is written by a developer and is required by corresponding instrumentation according to the function required by the instrumentation. For example, code that implements journal printing. The third compiling operation refers to compiling the instrumentation plug-in, and the executable instrumentation file can be generated by the instrumentation plug-in through the third compiling operation.
Illustratively, a developer can edit an object code in an Android Studio in an integrated development environment, the object code can be used for a checked class file or method, log printing is added, a computer device can generate a plug-in based on the object code after acquiring the object code, and further, a third compiling operation is performed on the plug-in plug to generate a plug-in file. For example, the investigated class file or method is written in the form of a configuration file and an executable file is generated using the dart instruction.
Step S220: and the computer equipment stores the instrumented file to the project directory.
As an embodiment, when the instrumentation file is obtained, the computer device may store the instrumentation file in the project directory. Illustratively, the intelligent switch terminal cannot store sensitive information such as a password, a birthday, a card number and the like in a log, and at this time, the engineering catalog storing the log in the code can be instrumented through instrumentation, so that the sensitive information can be replaced in advance. Therefore, the instrumentation file can be stored in the project directory for storing the log, so that the log in the project directory is instrumented to replace the sensitive information.
Step S230: and the computer equipment responds to the program package generation instruction, and performs first compiling operation based on the target project under the project directory to obtain a first compiling intermediate file.
The first compiling operation refers to an action of converting the programming language into an executable target program, for example, a Dart compiling operation adopted by the Flutter framework. The first compilation intermediate file refers to a compilation intermediate file generated during execution of the first compilation operation.
In one embodiment, the computer device may execute a packaged script under the engineering catalog in response to the package generation instruction, and after the compiling instruction in the script is successfully executed, the APK package with the inserted code may be generated. Illustratively, as shown in FIG. 4, FIG. 4 shows a flow diagram of a compilation operation. The computer device responds to the Flutter generation APK instruction to perform a first compiling operation, and specifically, the Flutter Project generates a first compiling intermediate file app. Further, the computer device may generate a first link library file app.so and a first application package APK based on the first compiled intermediate file app.dill.
The first library file app.so is a dynamic library file, and the app.so file is a shared library file under Linux, and the file format of the app.so is called an ELF file format. So the app.so file can run on the Android platform, since the bottom layer of the Android operating system is based on the Linux system.
Step S240: and the computer equipment performs instrumentation operation on the first compiling intermediate file according to the instrumentation file so as to insert the object code into the first compiling intermediate file and obtain a second compiling intermediate file.
The instrumentation operation refers to replacement of the first compiled intermediate file, and the object code may be inserted into the first compiled intermediate file when the instrumentation file is executed, so as to obtain the instrumented compiled intermediate file, that is, the second compiled intermediate file. Thus, the function of corresponding inserting pile can be contained in the APK finally generated.
As an embodiment, the computer device performs instrumentation on the first compiled intermediate file according to the instrumentation file, so that the object code is inserted into the first compiled intermediate file, and the step of obtaining the second compiled intermediate file may include:
(1) and executing the instrumentation file by the computer equipment, and inserting the object code into the first compiling intermediate file to obtain the compiling intermediate file into which the object code is inserted.
(2) The computer device takes the compiled intermediate file into which the object code is inserted as a second compiled intermediate file.
(3) The computer device deletes the first link library file and the first application package corresponding to the first compiled intermediate file.
(4) The computer equipment acquires a first information abstract value corresponding to the first compiling intermediate file and updates the first information abstract value to obtain a second information abstract value.
The link library file refers to other intermediate files generated based on the compiled intermediate files in the compiling process. The information Digest value, that is, the MD5(Message-Digest Algorithm) value, can be regarded as a "fingerprint" of the file, and if the original file is modified, the MD5 value changes accordingly, so that whether the file is modified can be determined according to whether the MD5 changes. During the first compiling operation, the computer device generates a first information abstract value corresponding to the first compiling intermediate file and stores the first information abstract value into the cache.
For example, in the process of executing the instrumentation file by the computer device, the target code may be inserted into a first compiled intermediate file app _ all of Flutter to obtain a compiled intermediate file app _ aop.dill into which the target code is inserted, and the compiled intermediate file app _ aop.dill into which the target code is inserted is used as a second compiled intermediate file of Flutter, and the first compiled intermediate file is replaced to obtain a new app.dill.
Further, the computer device may delete the first link library file app.so and the first application package APK generated during the execution of the first compiling operation. And updating the first information abstract value corresponding to the first compiling intermediate file to obtain a second information abstract value. Because the SDK replaces the compiled intermediate file and the information abstract value thereof by relying on the information abstract value of the compiled intermediate file when compiling the compiled intermediate file, the SDK can directly add the replaced compiled intermediate file into the compiling process when carrying out the second compiling operation.
Step S250: and the computer equipment carries out second compiling operation based on the second compiling intermediate file to obtain the target application program package.
And the second compiling operation refers to a compiling operation which is executed again after the computer equipment completes the instrumentation operation, and the compiling operation is repackaged from a second link library file generated by the second compiling intermediate file to generate the APK with the instrumentation function.
As an embodiment, the computer device performing a second compiling operation based on the second compiling intermediate file, and the step of obtaining the target application package may include:
(1) and the computer equipment performs second compiling operation based on the second intermediate file and the second information abstract value to obtain a second link library file.
(2) The computer device generates a target application package based on the second link library file.
Illustratively, as shown in FIG. 5, FIG. 5 shows a flow diagram of another compilation operation. The computer device obtains a compiled intermediate file app _ aop.dill into which the target code is inserted as a second compiled intermediate file, namely a new compiled intermediate file app.dill, after performing instrumentation operation based on the first compiled intermediate file app.dill.
Further, the computer device may perform a second compiling operation based on the second intermediate file app.dill and the second information digest value to obtain a second link library file app.so, and then generate the target application package APK according to the second link library file app.so.
Illustratively, the program generation method can be applied in the scenario of packing Flutter APK. In one embodiment, a code instrumentation plug-in is developed and compiled to generate an executable file, i.e., an instrumentation file, which is placed in the project directory. When the Flutter APK needs to be packaged, the packaging script is executed at a specified position, namely under the project directory, and after the compiling instruction in the script is successfully executed, an APK packet inserted with the code is generated.
Specifically, executing a normal Flutter generation APK instruction, and deleting an APK package app.so file generated in the Flutter project during compilation after generating the APK package. Further, executing the instrumented file in the engineering directory, such as inputting Flutter to compile an intermediate app.dill file, outputting the instrumented app _ aop.dill file, renaming as the app.dill file, and replacing the original intermediate and the cached md5 value thereof.
Further, executing the Flutter again to generate the APK instruction, at this time, because the source code in the Flutter engineering is not changed, based on a cache mechanism during the packing of the Flutter source code, the packing can be repackaged from the app.dill file generation app.so file, because the app.dill file is already instrumented at this time, the new APK strap is generated to have an instrumentation function, and because the instrumentation operation is performed under the condition that the source code is not changed in the Flutter engineering, after the Flutter SDK version is upgraded, the packing script can still be used, and the instrumentation plugin does not need to be changed.
In the embodiment of the application, the instrumentation file can be obtained and stored in the project directory. Furthermore, in response to a program package generation instruction, under the project directory, performing first compiling operation based on the target project to obtain a first compiling intermediate file, and performing instrumentation operation on the first compiling intermediate file according to the instrumentation file, so that the target code is inserted into the first compiling intermediate file to obtain a second compiling intermediate file. And then performing second compiling operation based on the second compiling intermediate file to obtain a target application program package. In this way, modification of project source code is avoided during project compilation, and instrumentation is performed on the compilation intermediate file, so that the newly generated APk has instrumentation functions. Meanwhile, plug-ins used for code instrumentation do not need to be modified even when the project version is updated, and therefore the efficiency of code instrumentation is improved.
Referring to fig. 6, a block diagram of a package generating apparatus 400 according to an embodiment of the present disclosure is shown. The package generation apparatus 400 includes: an acquisition module 410, a storage module 420, and a generation module 430. An obtaining module 410, configured to obtain an instrumentation file; the storage module 420 is used for storing the instrumentation file to the project catalog; the generating module 430 is configured to perform instrumentation on the first compiling intermediate file based on the instrumentation file in response to the program package generating instruction under the engineering directory, so that the target code is inserted into the first compiling intermediate file to generate the target application program package.
In some embodiments, the generation module 430 comprises: the device comprises a first compiling unit, an inserting unit and a second compiling unit. The first compiling unit is used for carrying out first compiling operation based on the target item to obtain a first compiling intermediate file; the instrumentation unit is used for performing instrumentation operation on the first compiling intermediate file according to the instrumentation file so as to insert the object code into the first compiling intermediate file and obtain a second compiling intermediate file; and the second compiling unit is used for carrying out second compiling operation based on the second compiling intermediate file to obtain the target application program package.
In some embodiments, the stake-inserting unit may be specifically configured to: executing the instrumentation file, and inserting the object code into the first compiling intermediate file to obtain a compiling intermediate file into which the object code is inserted; and taking the compiled intermediate file into which the object code is inserted as a second compiled intermediate file.
In some embodiments, the stake inserting unit may be further specifically configured to: deleting a first link library file and a first application package corresponding to the first compiling intermediate file; and acquiring a first information abstract value corresponding to the first compiling intermediate file, and updating the first information abstract value to obtain a second information abstract value.
In some embodiments, the second compiling unit may be specifically configured to: performing a second compiling operation based on the second intermediate file and the second information abstract value to obtain a second link library file; and generating the target application program package based on the second link library file.
In some embodiments, the obtaining module 410 may be specifically configured to: acquiring a target code, wherein the target code is a function code generated based on user input; generating a instrumentation plug-in based on the target code; and performing third compiling operation on the pile inserting plug-in unit to generate a pile inserting file, wherein the pile inserting file is an executable file.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working processes of the above-described devices and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
According to the scheme, the instrumentation file can be obtained and stored in the project directory, and further, in response to a program package generation instruction, instrumentation operation is performed on the first compiling intermediate file based on the instrumentation file under the project directory, so that the object code is inserted into the first compiling intermediate file to generate the target application program package. Therefore, instrumentation operation is carried out on the compiling intermediate file during the project compiling period, modification on project source codes is avoided, and plug-ins used for code instrumentation do not need to be modified even when project versions are updated, so that the code instrumentation efficiency is improved.
As shown in fig. 7, the embodiment of the present application further provides a computer device 500, where the computer device 500 includes a processor 510, a memory 520, a power source 530 and an input unit 540, the memory 520 stores computer program instructions, and the computer program instructions, when called by the processor 510, can implement various method steps provided by the above-mentioned embodiments. Those skilled in the art will appreciate that the configurations of the computer devices illustrated in the figures are not intended to be limiting of computer devices and may include more or less components than those illustrated, or some of the components may be combined, or a different arrangement of components. Wherein:
The Memory 520 may include a Random Access Memory (RAM) 520 and may also include a Read-Only Memory (Read-Only Memory) 520. The memory 520 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 520 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The data storage area may also store data created by the computer device in use, such as a phonebook and audiovisual data, etc. Accordingly, the memory 520 may also include a memory controller to provide the processor 510 with access to the memory 520.
The power supply 530 may be logically coupled to the processor 510 via a power management system, such that the power management system may manage charging, discharging, and power consumption. The power supply 530 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
An input unit 540, the input unit 540 being operable to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs in connection with user settings and function control.
Although not shown, the computer device 500 may further include a display unit and the like, which will not be described in detail herein. Specifically, in this embodiment, the processor 510 in the computer device loads the executable file corresponding to the process of one or more application programs into the memory 520 according to the following instructions, and the processor 510 runs the application programs stored in the memory 520, thereby implementing the various method steps provided by the foregoing embodiments.
As shown in fig. 8, an embodiment of the present application further provides a computer-readable storage medium 600, in which a computer program instruction 610 is stored in the computer-readable storage medium 600, and the computer program instruction 610 can be called by a processor to execute the method described in the above embodiment.
The computer-readable storage medium may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Optionally, the Computer-Readable Storage Medium includes a Non-volatile Computer-Readable Storage Medium (Non-Transitory Computer-Readable Storage Medium). The computer readable storage medium 600 has a storage space for program code for performing any of the method steps of the above-described method. The program code can be read from or written to one or more computer program products. The program code may be compressed, for example, in a suitable form.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations provided by the embodiments described above.
Although the present application has been described with reference to the preferred embodiments, it is to be understood that the present application is not limited to the disclosed embodiments, but rather, the present application is intended to cover various modifications, equivalents and alternatives falling within the spirit and scope of the present application.
Claims (10)
1. A method for generating a package, the method comprising:
acquiring an inserting file;
storing the instrumentation file to an engineering catalog;
and responding to a program package generation instruction, and under an engineering catalogue, performing instrumentation operation on the first compiling intermediate file based on the instrumentation file so as to insert an object code into the first compiling intermediate file and generate an object application program package.
2. The method of claim 1, wherein said instrumenting the first compiled intermediate file based on the instrumented file to cause insertion of object code into the first compiled intermediate file to generate an object application package, comprises;
performing first compiling operation based on the target project to obtain a first compiling intermediate file;
performing instrumentation operation on the first compiling intermediate file according to the instrumentation file so as to insert an object code into the first compiling intermediate file to obtain a second compiling intermediate file;
and performing second compiling operation based on the second compiling intermediate file to obtain a target application program package.
3. The method of claim 2, wherein said instrumenting the first compiled intermediate file according to the instrumented file to cause object code to be inserted into the first compiled intermediate file to obtain a second compiled intermediate file comprises:
executing the instrumentation file, and inserting an object code into the first compiling intermediate file to obtain a compiling intermediate file into which the object code is inserted;
and taking the compiled intermediate file inserted into the object code as a second compiled intermediate file.
4. The method of claim 3, further comprising:
deleting a first link library file and a first application package corresponding to the first compiling intermediate file;
and acquiring a first information abstract value corresponding to the first compiled intermediate file, and updating the first information abstract value to obtain a second information abstract value.
5. The method of claim 4, wherein performing a second compilation operation based on the second compilation intermediate file to obtain a target application package comprises:
performing a second compiling operation based on the second intermediate file and the second information abstract value to obtain a second link library file;
and generating a target application program package based on the second link library file.
6. The method of claim 1, wherein the obtaining an instrumented file comprises:
acquiring an object code, wherein the object code is a function code generated based on user input;
generating a instrumented plug-in based on the target code;
and performing third compiling operation on the pile inserting plug-in unit to generate a pile inserting file, wherein the pile inserting file is an executable file.
7. A package generation apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring the pile inserting file;
the storage module is used for storing the instrumentation file to an engineering catalog;
and the generation module is used for responding to a program package generation instruction, and performing instrumentation operation on the first compiling intermediate file based on the instrumentation file under the project directory so as to insert an object code into the first compiling intermediate file and generate an object application program package.
8. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 6.
9. A computer device, comprising:
a memory;
one or more processors coupled with the memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of any of claims 1-6.
10. A computer program product or computer program, characterized in that the computer program product or computer program comprises computer instructions, which are stored in a storage medium. A processor of a computer device reads the computer instructions from a storage medium, the processor executing the computer instructions causing the computer to perform the method of any of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210476156.1A CN114721709A (en) | 2022-04-29 | 2022-04-29 | Program package generation method, device, storage medium and computer equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210476156.1A CN114721709A (en) | 2022-04-29 | 2022-04-29 | Program package generation method, device, storage medium and computer equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114721709A true CN114721709A (en) | 2022-07-08 |
Family
ID=82245162
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210476156.1A Pending CN114721709A (en) | 2022-04-29 | 2022-04-29 | Program package generation method, device, storage medium and computer equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114721709A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116382775A (en) * | 2023-03-15 | 2023-07-04 | 中电金信软件有限公司 | Hbuilderx plug-in based multi-platform program package generation method |
-
2022
- 2022-04-29 CN CN202210476156.1A patent/CN114721709A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116382775A (en) * | 2023-03-15 | 2023-07-04 | 中电金信软件有限公司 | Hbuilderx plug-in based multi-platform program package generation method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107577475B (en) | Software package management method and system of data center cluster system | |
CN111367510B (en) | Android function module development method and device | |
CN109542461A (en) | Dissemination method, terminal device and the medium of application installation package | |
CN105278996A (en) | Log collection method and device and log service system | |
CN110059456B (en) | Code protection method, code protection device, storage medium and electronic equipment | |
CN111897570A (en) | Multi-dependency file extraction method and device based on Maven plug-in | |
CN111176717B (en) | Method and device for generating installation package and electronic equipment | |
CN114077423A (en) | Airport APP development container architecture based on mobile cross-platform | |
CN110990019A (en) | Java class analysis method and device, storage medium and electronic equipment | |
CN111880987A (en) | Dynamic monitoring method and device of application program, storage medium and electronic device | |
CN112769706B (en) | Componentized routing method and system | |
CN111399840A (en) | Module development method and device | |
CN112214388A (en) | Memory monitoring method, device, equipment and computer readable storage medium | |
CN111290740B (en) | Application program development method and device, computer equipment and storage medium | |
CN114721709A (en) | Program package generation method, device, storage medium and computer equipment | |
CN111562929A (en) | Method, device and equipment for generating patch file and storage medium | |
CN114327484A (en) | Multi-architecture supporting K8S integration and deployment method, system and storage medium | |
CN106775608B (en) | Method and device for realizing independent system process | |
CN114115884A (en) | Management method and related device for programming service | |
CN116578282A (en) | Code generation method, device, electronic equipment and medium | |
CN111352631A (en) | Interface compatibility detection method and device | |
CN110826074A (en) | Application vulnerability detection method and device and computer readable storage medium | |
CN110955415A (en) | Method for adapting projection multi-platform service | |
CN115220873A (en) | Method for running Open Harmony application in Android system | |
CN115705294B (en) | Method, device, electronic equipment and medium for acquiring function call information |
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 |