CN109558144B - Executable file redistribution method and device and electronic equipment - Google Patents

Executable file redistribution method and device and electronic equipment Download PDF

Info

Publication number
CN109558144B
CN109558144B CN201710881964.5A CN201710881964A CN109558144B CN 109558144 B CN109558144 B CN 109558144B CN 201710881964 A CN201710881964 A CN 201710881964A CN 109558144 B CN109558144 B CN 109558144B
Authority
CN
China
Prior art keywords
executable file
virtual machine
machine executable
application program
source 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.)
Active
Application number
CN201710881964.5A
Other languages
Chinese (zh)
Other versions
CN109558144A (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.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201710881964.5A priority Critical patent/CN109558144B/en
Publication of CN109558144A publication Critical patent/CN109558144A/en
Application granted granted Critical
Publication of CN109558144B publication Critical patent/CN109558144B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Abstract

The embodiment of the invention provides an executable file redistribution method, an executable file redistribution device and electronic equipment. The method comprises the following steps: determining an application program installation package for executable file rearrangement to be performed; decompressing the application program installation package to obtain a virtual machine executable file; based on a preset configuration file, putting a source code corresponding to each process in the virtual machine executable file into a special virtual machine executable file of the process to obtain a re-layout virtual machine executable file; the configuration file records: the corresponding relation between the process and the source code in the application program corresponding to the application program installation package; and compiling and compressing the executable file of the rearranged virtual machine to obtain the application program installation package after the executable file is rearranged. By applying the embodiment of the invention, the executable file in the application program installation package can be rearranged, so that the memory occupation can be reduced when the process of the application program obtained by installation based on the application program installation package runs.

Description

Executable file redistribution method and device and electronic equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for rearranging executable files, and an electronic device.
Background
At present, it is often necessary to install an APP (Application) to a user terminal through an APK (Android Package), i.e., an Application installation Package. For an APP with a large code amount, the APK corresponding to the APP includes multiple virtual machine executable files, such as classes.
In the prior art, when the source code of the APP is packaged into class. In this layout, when a process of the APP runs, multiple classes.
Disclosure of Invention
An object of the embodiments of the present invention is to provide an executable file re-layout method, an executable file re-layout device, and an electronic device, so as to implement re-layout of an executable file in an application installation package, so that when a process of an application installed based on the application installation package runs, occupation of a memory is reduced.
In a first aspect, an embodiment of the present invention provides an executable file redistribution method, where the method may include the following steps:
determining an application program installation package for executable file rearrangement to be performed;
decompressing the application program installation package to obtain a virtual machine executable file;
based on a preset configuration file, putting a source code corresponding to each process in the virtual machine executable file into a special virtual machine executable file of the process to obtain a re-layout virtual machine executable file; wherein, the configuration file records: the corresponding relation between the process and the source code in the application program corresponding to the application program installation package; each process is as follows: the process in the application program corresponding to the application program installation package; wherein, a process is in one-to-one correspondence with a dedicated virtual machine executable file;
and compiling and compressing the executable file of the rearranged virtual machine to obtain the application program installation package after the executable file is rearranged.
Optionally, the step of, based on a preset configuration file, putting a source code corresponding to each process in the virtual machine executable file into a dedicated virtual machine executable file of the process to obtain a re-layout virtual machine executable file may include:
determining the same public source code corresponding to each process in the application program;
putting the public source code into an executable file of a public source code virtual machine;
based on a preset configuration file, putting source codes except public source codes in source codes corresponding to each process in the virtual machine executable file into a special virtual machine executable file of the process;
and determining the special virtual machine executable file and the public source code virtual machine executable file of each process as the re-layout virtual machine executable file.
Optionally, after the decompressing the application installation package to obtain the virtual machine executable file, before the source code corresponding to each process in the virtual machine executable file is placed in the dedicated virtual machine executable file of the process based on the preset configuration file to obtain the rearranged virtual machine executable file, the method may further include:
reading a source code in the executable file of the virtual machine;
storing the source code into a preset class linked list;
based on a preset configuration file, putting a source code corresponding to each process in the virtual machine executable file into a special virtual machine executable file of the process to obtain a redistribution virtual machine executable file, wherein the redistribution virtual machine executable file comprises the following steps:
and based on a preset configuration file, putting the source code corresponding to each process in the preset class chain table into the special virtual machine executable file of the process to obtain a re-layout virtual machine executable file.
Optionally, in this embodiment of the present invention, the virtual machine executable file may be a classes.
Optionally, the step of decompressing the application installation package to obtain the executable file of the virtual machine may include:
and decompressing the application program installation package by using a ReDex tool to obtain the executable file of the virtual machine.
In a second aspect, an embodiment of the present invention provides an executable file rearrangement apparatus, where the apparatus may include:
the determining unit is used for determining the application program installation package of executable file rearrangement to be performed;
the decompression unit is used for decompressing the application program installation package to obtain the executable file of the virtual machine;
the first obtaining unit is used for putting the source code corresponding to each process in the virtual machine executable file into the special virtual machine executable file of the process based on the preset configuration file to obtain a re-layout virtual machine executable file; wherein, the configuration file records: the corresponding relation between the process and the source code in the application program corresponding to the application program installation package; each process is as follows: the process in the application program corresponding to the application program installation package; wherein, a process is in one-to-one correspondence with a dedicated virtual machine executable file;
and the second obtaining unit is used for compiling and compressing the executable file of the re-layout virtual machine to obtain the application program installation package after the executable file is re-arranged.
Alternatively, in an embodiment of the present invention, the first obtaining unit may include:
the first determining subunit is used for determining the same common source code corresponding to each process in the application program;
the first transfer subunit is used for putting the public source code into the executable file of the public source code virtual machine;
the second transfer subunit is used for putting source codes, except the public source code, in the source code corresponding to each process in the virtual machine executable file into the special virtual machine executable file of the process based on the preset configuration file;
and the second determining subunit is used for determining the special virtual machine executable file and the common source code virtual machine executable file of each process as the re-layout virtual machine executable file.
Optionally, in an embodiment of the present invention, the apparatus may further include:
the reading unit is used for reading the source codes in the virtual machine executable file before the source codes corresponding to each process in the virtual machine executable file are placed into the special virtual machine executable file of the process based on the preset configuration file and the virtual machine executable file is rearranged after the application program installation package is decompressed to obtain the virtual machine executable file;
the storage unit is used for storing the source codes into a preset class linked list;
the first obtaining unit is specifically configured to:
and based on a preset configuration file, putting the source code corresponding to each process in the preset class chain table into the special virtual machine executable file of the process to obtain a re-layout virtual machine executable file.
Optionally, in this embodiment of the present invention, the virtual machine executable file may be a classes.
Optionally, in this embodiment of the present invention, the decompression unit may specifically be configured to:
and decompressing the application program installation package by using a ReDex tool to obtain the executable file of the virtual machine.
In a third aspect, an embodiment of the present invention provides an electronic device, which may include a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor configured to implement the method steps of the executable file rearrangement method according to any one of the first aspect when executing a program stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method steps of the executable file rearrangement method according to any one of the above-mentioned first aspect are implemented.
In a fifth aspect, an embodiment of the present invention provides a computer program product including instructions, which when run on an electronic device, cause the electronic device to perform: the method steps of the executable file rearrangement method provided by any of the above method embodiments.
In the embodiment of the invention, the executable files in the existing application program installation package can be rearranged. Specifically, the application program installation package may be decompressed to obtain the executable file of the virtual machine. Then, based on a preset configuration file, the source code corresponding to each process in the virtual machine executable file is placed into a dedicated virtual machine executable file of the process, that is, one dedicated virtual machine executable file only contains the source code of one process. In this way, a re-layout virtual machine executable file is obtained. And then compiling and compressing the executable file of the rearranged virtual machine to obtain the application program installation package after the executable file is rearranged. Therefore, when the process of the application program corresponding to the application program installation package after the executable file is rearranged runs, only the special virtual machine executable file of the process needs to be loaded into the memory, and the occupation of the memory is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of an executable file rearrangement method according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an executable file rearrangement apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the 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 invention.
In order to solve the problems in the prior art, embodiments of the present invention provide an executable file redistribution method, an executable file redistribution device, and an electronic device.
The executable file rearrangement method provided by the embodiment of the invention is explained first.
Referring to fig. 1, the executable file rearrangement method provided in the embodiment of the present invention may include the following steps:
s101: determining an application program installation package for executable file rearrangement to be performed;
s102: decompressing the application program installation package to obtain a virtual machine executable file;
s103: based on a preset configuration file, putting a source code corresponding to each process in the virtual machine executable file into a special virtual machine executable file of the process to obtain a re-layout virtual machine executable file; wherein, the configuration file records: the corresponding relation between the process and the source code in the application program corresponding to the application program installation package; each process is as follows: the process in the application program corresponding to the application program installation package; wherein, a process is in one-to-one correspondence with a dedicated virtual machine executable file;
s104: and compiling and compressing the executable file of the rearranged virtual machine to obtain the application program installation package after the executable file is rearranged.
The inventor finds that the layout mode of an executable file in the conventional APK (Android Package) is as follows: each virtual machine executable file in the APK, such as class. Therefore, when one process of multiple processes of the APP corresponding to the APK runs, multiple virtual machine executable files need to be loaded into the memory, and each virtual machine executable file loaded into the memory contains source codes of other processes in addition to the source code of the process, so that the memory is meaningless occupied by the source codes of other processes. In particular, when a part of processes of the APP are all running, all the virtual machine executable files in the APK need to be loaded into the memory, which results in excessive memory usage and even insufficient memory.
In addition, in the process of obtaining the APK, the class file is converted into a virtual machine executable file with higher storage efficiency through a dx command in the prior art: when class. In the embodiment of the invention, the executable files in the existing application program installation package can be rearranged. Specifically, the application program installation package may be decompressed to obtain the executable file of the virtual machine. Then, based on a preset configuration file, the source code corresponding to each process in the virtual machine executable file is placed into a dedicated virtual machine executable file of the process, that is, one dedicated virtual machine executable file only contains the source code of one process. In this way, a re-layout virtual machine executable file is obtained. And then compiling and compressing the executable file of the rearranged virtual machine to obtain the application program installation package after the executable file is rearranged. Therefore, when the process of the application program corresponding to the application program installation package after the executable file is rearranged runs, only the special virtual machine executable file of the process needs to be loaded into the memory, and the occupation of the memory is reduced.
The virtual machine executable file may be an executable file running in a Dalvik virtual machine, or may be an executable file running in an ART (Android Run Time) virtual machine.
The executable file rearrangement method provided by the embodiment of the invention is described in detail below with reference to specific examples.
It is assumed that executable file rearrangement is performed on the virtual machine executable files in the application installation package APK1, and that APP1 corresponding to the APK1 has multiple processes, and the APK1 includes virtual machine executable files class 1.dex, class 2.dex, and class 3. dex.
The ReDex tool can be used for decompressing the APK1, so that the virtual machine executable files classses 1.dex, classses 2.dex and classses 3.dex can be decompressed. Then, the source codes in class 1.dex, class 2.dex, and class 3.dex can be read. For convenience of reading, the source codes obtained by reading can be stored in a preset class linked list.
Then, based on a preset configuration file recorded with a correspondence relationship between each process and a source code of the APP1, the source code corresponding to each process in the preset class chain table may be placed in a dedicated virtual machine executable file of the process, that is, one dedicated virtual machine executable file only contains a source code required by the process to run. Thus, when the APP1 has N (N ≧ 2) processes, N private virtual machine executables are available, which are the re-layout virtual machine executables. When the source code amount in a certain special virtual machine executable file is too large, the special virtual machine executable file can be split into a plurality of special virtual machine executable subfiles, which is reasonable.
Thus, after obtaining the rearranged virtual machine executable file, the rearranged virtual machine executable file may be compiled and compressed, resulting in an executable file rearranged APK 1'. Therefore, when a process of the application program APP1 corresponding to the APK 1' runs, only the special virtual machine executable file corresponding to the process and only containing the source code of the process needs to be loaded, and the occupation of the memory is reduced.
The virtual machine executable files class 1.dex, class 2.dex and class 3.dex included in the APK1 are merely examples, and are not limited thereto.
In addition, multiple processes of the APP1 may correspond to the same common source code. Therefore, in order to avoid that the memory is excessively occupied due to the fact that the common source code is loaded once every time one process is run, the common source codes corresponding to the processes can be determined. And then, putting the common source code corresponding to the processes into the executable file of the common source code virtual machine.
And then, based on a preset configuration file, putting source codes except public source codes in the source codes corresponding to each process in the virtual machine executable files classses 1.dex, classses 2.dex and classses 3.dex into the special virtual machine executable file of the process. And determining the obtained special virtual machine executable file of each process and the common source code virtual machine executable file as a re-layout virtual machine executable file. It is also reasonable to compile and compress the rearranged virtual machine executable to obtain an executable rearranged APK1 ".
Thus, when a process (e.g., process a) of the application APP1 corresponding to the APK1 "is first run, only the private virtual machine executable file of the process a and the common source code virtual machine executable file need to be loaded. When another process (for example, the process B) of the APP1 runs, only the dedicated virtual machine executable file of the process B needs to be loaded, so that the memory occupation is reduced.
The APK1 includes the virtual machine executable files class 1.dex, class 2.dex and class 3.dex, and the process a and the process B are merely examples, but are not limited thereto.
In addition, the inventors found, after carrying out a large number of experiments: by the executable file rearrangement method provided by the embodiment of the invention, after the executable file in the existing application program compression package is rearranged, the memory consumption of the application program corresponding to the rearranged application program compression package during the operation is reduced by 16% compared with the memory consumption without the rearrangement. In addition, the executable file re-layout method provided by the embodiment of the invention can re-layout the executable files in the application installation packages of all android versions.
In summary, by applying the embodiment of the present invention, the executable file in the application installation package can be rearranged, so that when the process of the application installed based on the application installation package runs, the memory usage is reduced.
Corresponding to the above method embodiment, an embodiment of the present invention further provides an executable file rearrangement apparatus, and referring to fig. 2, the apparatus may include:
a determining unit 201, configured to determine an application installation package for executable file rearrangement to be performed;
the decompression unit 202 is configured to decompress the application program installation package to obtain a virtual machine executable file;
a first obtaining unit 203, configured to put a source code corresponding to each process in the virtual machine executable file into a dedicated virtual machine executable file of the process based on a preset configuration file, so as to obtain a re-layout virtual machine executable file; wherein, the configuration file records: the corresponding relation between the process and the source code in the application program corresponding to the application program installation package; each process is as follows: the process in the application program corresponding to the application program installation package; wherein, a process is in one-to-one correspondence with a dedicated virtual machine executable file;
a second obtaining unit 204, configured to compile and compress the executable file of the re-arranged virtual machine, so as to obtain an application installation package after the executable file is re-arranged.
The executable file rearrangement device provided by the embodiment of the invention can rearrange the executable file in the existing application program installation package. Specifically, the application program installation package may be decompressed to obtain the executable file of the virtual machine. Then, based on a preset configuration file, the source code corresponding to each process in the virtual machine executable file is placed into a dedicated virtual machine executable file of the process, that is, one dedicated virtual machine executable file only contains the source code of one process. In this way, a re-layout virtual machine executable file is obtained. And then compiling and compressing the executable file of the rearranged virtual machine to obtain the application program installation package after the executable file is rearranged. Therefore, when the process of the application program corresponding to the application program installation package after the executable file is rearranged runs, only the special virtual machine executable file of the process needs to be loaded into the memory, and the occupation of the memory is reduced.
Optionally, in this embodiment of the present invention, the first obtaining unit 203 may include:
the first determining subunit is used for determining the same common source code corresponding to each process in the application program;
the first transfer subunit is used for putting the public source code into the executable file of the public source code virtual machine;
the second transfer subunit is used for putting source codes, except the public source code, in the source code corresponding to each process in the virtual machine executable file into the special virtual machine executable file of the process based on the preset configuration file;
and the second determining subunit is used for determining the special virtual machine executable file and the common source code virtual machine executable file of each process as the re-layout virtual machine executable file.
Optionally, in an embodiment of the present invention, the apparatus may further include:
the reading unit is used for reading the source codes in the virtual machine executable file before the source codes corresponding to each process in the virtual machine executable file are placed into the special virtual machine executable file of the process based on the preset configuration file and the virtual machine executable file is rearranged after the application program installation package is decompressed to obtain the virtual machine executable file;
the storage unit is used for storing the source codes into a preset class linked list;
accordingly, the first obtaining unit 203 may specifically be configured to:
and based on a preset configuration file, putting the source code corresponding to each process in the preset class chain table into the special virtual machine executable file of the process to obtain a re-layout virtual machine executable file.
Optionally, in this embodiment of the present invention, the virtual machine executable file may be a classes.
Optionally, in this embodiment of the present invention, the decompression unit 202 may specifically be configured to:
and decompressing the application program installation package by using a ReDex tool to obtain the executable file of the virtual machine.
Corresponding to the above method embodiment, the embodiment of the present invention further provides an electronic device, referring to fig. 3, including a processor 301, a communication interface 302, a memory 303, and a communication bus 304, where the processor 301, the communication interface 302, and the memory 303 complete mutual communication via the communication bus 304,
a memory 303 for storing a computer program;
the processor 301 is configured to implement the method steps of the executable file rearrangement method provided in any one of the above-described method embodiments when executing the program stored in the memory 303.
The electronic equipment provided by the embodiment of the invention can perform rearrangement on the executable file in the existing application program installation package. Specifically, the application program installation package may be decompressed to obtain the executable file of the virtual machine. Then, based on a preset configuration file, the source code corresponding to each process in the virtual machine executable file is placed into a dedicated virtual machine executable file of the process, that is, one dedicated virtual machine executable file only contains the source code of one process. In this way, a re-layout virtual machine executable file is obtained. And then compiling and compressing the executable file of the rearranged virtual machine to obtain the application program installation package after the executable file is rearranged. Therefore, when the process of the application program corresponding to the application program installation package after the executable file is rearranged runs, only the special virtual machine executable file of the process needs to be loaded into the memory, and the occupation of the memory is reduced.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a readable storage medium, where a computer program is stored in the readable storage medium, and when the computer program is executed by a processor, the computer program implements the method steps of the executable file rearrangement method provided in any of the above method embodiments.
After the computer program stored in the readable storage medium provided by the embodiment of the invention is executed by the processor of the electronic device, the executable file in the existing application program installation package can be rearranged. Specifically, the application program installation package may be decompressed to obtain the executable file of the virtual machine. Then, based on a preset configuration file, the source code corresponding to each process in the virtual machine executable file is placed into a dedicated virtual machine executable file of the process, that is, one dedicated virtual machine executable file only contains the source code of one process. In this way, a re-layout virtual machine executable file is obtained. And then compiling and compressing the executable file of the rearranged virtual machine to obtain the application program installation package after the executable file is rearranged. Therefore, when the process of the application program corresponding to the application program installation package after the executable file is rearranged runs, only the special virtual machine executable file of the process needs to be loaded into the memory, and the occupation of the memory is reduced.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a computer program product including instructions, which, when run on an electronic device, cause the electronic device to perform: the method steps of the executable file rearrangement method provided by any of the above method embodiments.
The computer program product containing the instructions provided by the embodiment of the invention enables the electronic equipment to perform rearrangement on the executable file in the existing application program installation package when the computer program product runs on the electronic equipment. Specifically, the application program installation package may be decompressed to obtain the executable file of the virtual machine. Then, based on a preset configuration file, the source code corresponding to each process in the virtual machine executable file is placed into a dedicated virtual machine executable file of the process, that is, one dedicated virtual machine executable file only contains the source code of one process. In this way, a re-layout virtual machine executable file is obtained. And then compiling and compressing the executable file of the rearranged virtual machine to obtain the application program installation package after the executable file is rearranged. Therefore, when the process of the application program corresponding to the application program installation package after the executable file is rearranged runs, only the special virtual machine executable file of the process needs to be loaded into the memory, and the occupation of the memory is reduced.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to the description, reference may be made to some of the description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. An executable file rearrangement method, the method comprising:
determining an application program installation package for executable file rearrangement to be performed;
decompressing the application program installation package to obtain a virtual machine executable file;
based on a preset configuration file, putting a source code corresponding to each process in the virtual machine executable file into a special virtual machine executable file of the process to obtain a re-layout virtual machine executable file; wherein, the configuration file records: the corresponding relation between the process and the source code in the application program corresponding to the application program installation package; each process is as follows: the process in the application program corresponding to the application program installation package; wherein, a process is in one-to-one correspondence with a dedicated virtual machine executable file;
compiling and compressing the executable file of the rearrangement virtual machine to obtain an application program installation package after the executable file is rearranged;
the step of, based on the preset configuration file, putting the source code corresponding to each process in the virtual machine executable file into the dedicated virtual machine executable file of the process to obtain a re-layout virtual machine executable file includes:
determining the same public source code corresponding to each process in the application program;
putting the public source code into a public source code virtual machine executable file;
based on a preset configuration file, putting source codes except the public source code in the source codes corresponding to each process in the virtual machine executable file into a special virtual machine executable file of the process;
and determining the special virtual machine executable file and the public source code virtual machine executable file of each process as the re-layout virtual machine executable file.
2. The method according to claim 1, wherein after the decompressing the application installation package to obtain the virtual machine executable file, before the source code corresponding to each process in the virtual machine executable file is placed in the dedicated virtual machine executable file of the process based on the preset configuration file to obtain the re-layout virtual machine executable file, the method further comprises:
reading a source code in the executable file of the virtual machine;
storing the source code into a preset class linked list;
the step of, based on the preset configuration file, putting the source code corresponding to each process in the virtual machine executable file into the dedicated virtual machine executable file of the process to obtain a re-layout virtual machine executable file includes:
and based on a preset configuration file, putting the source codes corresponding to each process in the preset class chain table into the special virtual machine executable file of the process to obtain a re-layout virtual machine executable file.
3. The method of claim 1, wherein the virtual machine executable file is a classes.
4. The method of claim 3, wherein the step of decompressing the application installation package to obtain the virtual machine executable file comprises:
and decompressing the application program installation package by using a ReDex tool to obtain the executable file of the virtual machine.
5. An executable file rearrangement apparatus, characterized in that the apparatus comprises:
the determining unit is used for determining the application program installation package of executable file rearrangement to be performed;
the decompression unit is used for decompressing the application program installation package to obtain a virtual machine executable file;
a first obtaining unit, configured to put a source code corresponding to each process in the virtual machine executable file into a dedicated virtual machine executable file of the process based on a preset configuration file, so as to obtain a re-layout virtual machine executable file; wherein, the configuration file records: the corresponding relation between the process and the source code in the application program corresponding to the application program installation package; each process is as follows: the process in the application program corresponding to the application program installation package; wherein, a process is in one-to-one correspondence with a dedicated virtual machine executable file;
the second obtaining unit is used for compiling and compressing the executable file of the rearrangement virtual machine to obtain the application program installation package after the executable file is rearranged;
the first obtaining unit includes:
the first determining subunit is used for determining the same common source code corresponding to each process in the application program;
the first transfer subunit is used for putting the public source code into a public source code virtual machine executable file;
a second transfer subunit, configured to, based on a preset configuration file, place, in the virtual machine executable file, a source code, other than the common source code, in a source code corresponding to each process in the virtual machine executable file into a dedicated virtual machine executable file of the process;
and the second determining subunit is configured to determine the dedicated virtual machine executable file and the common source code virtual machine executable file of each process as the re-layout virtual machine executable file.
6. The apparatus of claim 5, further comprising:
the reading unit is used for reading the source codes in the virtual machine executable file before the source codes corresponding to each process in the virtual machine executable file are placed into the special virtual machine executable file of the process based on a preset configuration file and the virtual machine executable file is redistributed after the application program installation package is decompressed to obtain the virtual machine executable file;
the storage unit is used for storing the source codes into a preset class linked list;
the first obtaining unit is specifically configured to:
and based on a preset configuration file, putting the source codes corresponding to each process in the preset class chain table into the special virtual machine executable file of the process to obtain a re-layout virtual machine executable file.
7. The apparatus of claim 5, wherein the virtual machine executable file is a classes.
8. The apparatus according to claim 7, wherein the decompression unit is specifically configured to:
and decompressing the application program installation package by using a ReDex tool to obtain the executable file of the virtual machine.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 4 when executing a program stored in the memory.
10. A readable storage medium, characterized in that a computer program is stored in the readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1-4.
CN201710881964.5A 2017-09-26 2017-09-26 Executable file redistribution method and device and electronic equipment Active CN109558144B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710881964.5A CN109558144B (en) 2017-09-26 2017-09-26 Executable file redistribution method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710881964.5A CN109558144B (en) 2017-09-26 2017-09-26 Executable file redistribution method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109558144A CN109558144A (en) 2019-04-02
CN109558144B true CN109558144B (en) 2022-03-22

Family

ID=65862204

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710881964.5A Active CN109558144B (en) 2017-09-26 2017-09-26 Executable file redistribution method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109558144B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636172A (en) * 2015-03-09 2015-05-20 联想(北京)有限公司 Application upgrading method and device
CN106648863A (en) * 2016-12-08 2017-05-10 武汉斗鱼网络科技有限公司 Live keeping method and system of Android application installation package and application target process
CN106708554A (en) * 2016-06-29 2017-05-24 腾讯科技(深圳)有限公司 Program running method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10296323B2 (en) * 2016-02-02 2019-05-21 ZeroTurnaround AS System and method for fast initial and incremental deployment of apps

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636172A (en) * 2015-03-09 2015-05-20 联想(北京)有限公司 Application upgrading method and device
CN106708554A (en) * 2016-06-29 2017-05-24 腾讯科技(深圳)有限公司 Program running method and device
CN106648863A (en) * 2016-12-08 2017-05-10 武汉斗鱼网络科技有限公司 Live keeping method and system of Android application installation package and application target process

Also Published As

Publication number Publication date
CN109558144A (en) 2019-04-02

Similar Documents

Publication Publication Date Title
WO2019001335A1 (en) Application program packaging method and device and terminal device
WO2014206024A1 (en) Method and device for realizing embedded application, and computer storage medium
CN109857454B (en) Method, device, electronic equipment and storage medium for generating and caching installation package
CN110928802A (en) Test method, device, equipment and storage medium based on automatic generation of case
CN111124480B (en) Method and device for generating application program package, electronic equipment and storage medium
CN108279941A (en) A kind of compression method and device of application program
CN111443939A (en) Configuration method and device of software development kit and storage medium
CN112804097A (en) Private cloud deployment method and device and server
CN113645308B (en) Mobile terminal TCP communication, device, equipment and storage medium
CN109558144B (en) Executable file redistribution method and device and electronic equipment
WO2019237239A1 (en) Data test method and apparatus, device/terminal/server and computer readable storage medium
CN107463423B (en) Verification method, storage medium, electronic device and system depending on package tool
CN107092601B (en) Resource file construction method, resource file application method and device
CN105045664A (en) Information processing device and information processing method
CN110083344B (en) Software development tool package modification method and device and electronic equipment
CN107291439B (en) Target incremental data construction method and device
CN110347471B (en) Hierarchical display component system, display component calling method and device
CN110633083A (en) Code file processing method and device, electronic equipment and computer readable medium
CN106326310B (en) Resource encryption updating method for mobile phone client software
CN111367512B (en) Method and device for creating Android library module dependency relationship in application development
US20140019950A1 (en) Information processing apparatus and method for determining whether a modified program is to be applied
CN113641643A (en) File writing method and device
CN113296781A (en) Application program installation package file compiling and constructing method and device and electronic equipment
WO2019157891A1 (en) Application installation method and application installer generating method
CN103246524A (en) Dynamic loading method for simultaneous operation of a plurality of program segments on basis of advanced reduced instruction set computer (RISC) machine (ARM) chip

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