CN109558144A - 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
CN109558144A
CN109558144A CN201710881964.5A CN201710881964A CN109558144A CN 109558144 A CN109558144 A CN 109558144A CN 201710881964 A CN201710881964 A CN 201710881964A CN 109558144 A CN109558144 A CN 109558144A
Authority
CN
China
Prior art keywords
executable file
virtual machine
machine executable
source code
application program
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.)
Granted
Application number
CN201710881964.5A
Other languages
Chinese (zh)
Other versions
CN109558144B (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)

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

A kind of executable file remapping method, apparatus and electronic equipment
Technical field
The present invention relates to field of computer technology, more particularly to a kind of executable file remapping method, apparatus and electricity Sub- equipment.
Background technique
At present, it is often necessary to, will by APK (Android Package, Android installation kit), i.e. application program installation kit APP (Application, application program) is installed to user terminal.Wherein, for APP biggish for size of code, this APP pairs It can include multiple virtual machine executable files in the APK answered, such as classes.dex file, and each classes.dex file Middle can include the source code of the APP.
Since in the prior art, when the source code of the APP is encapsulated as classes.dex file, meeting is the more of the APP The source code of each process is distributed in multiple classes.dex files in a process, so that meeting in each classes.dex file Source code comprising multiple processes.Under this layout scenarios, when the operation of a process of the APP, need to load multiple Classes.dex file causes memory by excessive occupancy into memory.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of executable file remapping method, apparatus and electronic equipment, with It realizes and remapping is carried out to the executable file in application program installation kit, so that being mounted so as to when based on the application program installation kit When the process operation of the application program arrived, the occupancy to memory is reduced.
In a first aspect, the embodiment of the invention provides a kind of executable file remapping method, this method may include as Lower step:
Determine the application program installation kit of pending executable file remapping;
Application program installation kit is decompressed, virtual machine executable file is obtained;
Based on preset configuration file, by the corresponding source code of in virtual machine executable file, each process be put into this into In the dedicated virtual machine executable file of journey, remapping virtual machine executable file is obtained;Wherein, there is record in configuration file: The corresponding relationship of process and source code in the corresponding application program of application program installation kit;Each process are as follows: application program installation Wrap the process in corresponding application program;Wherein, a process is corresponded with a dedicated virtual machine executable file;
Counterweight placement of dummy machine executable file is compiled and compresses, the application journey after obtaining executable file remapping Sequence installation kit.
Optionally, it is based on preset configuration file, the corresponding source code of in virtual machine executable file, each process is put The step of entering in the dedicated virtual machine executable file of the process, obtaining remapping virtual machine executable file may include:
Determine that each process in application program is corresponding, identical public source code;
Common source is piled up into public source code virtual machine executable file;
Based on preset configuration file, by the corresponding source code of in virtual machine executable file, each process in addition to public affairs Source code outside common source code is put into the dedicated virtual machine executable file of the process;
By the dedicated virtual machine executable file of each process and public source code virtual machine executable file, cloth of attaching most importance to is determined Office's virtual machine executable file.
Optionally, it is decompressed to application program installation kit, after obtaining virtual machine executable file, based on default Configuration file, the dedicated virtual machine that the corresponding source code of in virtual machine executable file, each process is put into the process can It executes in file, before obtaining remapping virtual machine executable file, method can also include:
Read the source code in virtual machine executable file;
Source code is stored into default class chained list;
Based on preset configuration file, by the corresponding source code of in virtual machine executable file, each process be put into this into In the dedicated virtual machine executable file of journey, the step of obtaining remapping virtual machine executable file, comprising:
Based on preset configuration file, by default class chained list, the corresponding source code of each process be put into the dedicated of the process In virtual machine executable file, remapping virtual machine executable file is obtained.
Optionally, in embodiments of the present invention, virtual machine executable file can be classes.dex file.
Optionally, the step of decompressing to application program installation kit, obtaining virtual machine executable file may include:
Application program installation kit is decompressed using ReDex tool, obtains virtual machine executable file.
Second aspect, the embodiment of the invention provides a kind of executable file remapping device, the apparatus may include:
Determination unit, for determining the application program installation kit of pending executable file remapping;
Decompression units obtain virtual machine executable file for decompressing to application program installation kit;
First obtains unit, for being based on preset configuration file, by process pair in virtual machine executable file, each The source code answered is put into the dedicated virtual machine executable file of the process, obtains remapping virtual machine executable file;Wherein, match Setting record in file has: the corresponding relationship of process and source code in the corresponding application program of application program installation kit;Each process Are as follows: the process in the corresponding application program of application program installation kit;Wherein, a process and the executable text of a dedicated virtual machine Part corresponds;
Second obtaining unit is compiled and compresses for counterweight placement of dummy machine executable file, obtains executable text Application program installation kit after part remapping.
It may be selected, in embodiments of the present invention, first obtains unit may include:
First determines subelement, for determining that each process in application program is corresponding, identical public source code;
First transfer subelement, for piling up common source into public source code virtual machine executable file;
Second transfer subelement, for being based on preset configuration file, by process in virtual machine executable file, each Source code in corresponding source code other than public source code is put into the dedicated virtual machine executable file of the process;
Second determines subelement, for can by the dedicated virtual machine executable file of each process and public source code virtual machine File is executed, remapping virtual machine executable file is determined as.
It may be selected, in embodiments of the present invention, which can also include:
Reading unit, for being decompressed to application program installation kit, after obtaining virtual machine executable file, in base In preset configuration file, the corresponding source code of in virtual machine executable file, each process is put into the dedicated void of the process In quasi- machine executable file, before obtaining remapping virtual machine executable file, the source code in virtual machine executable file is read;
Storage unit, for storing source code into default class chained list;
First obtains unit is specifically used for:
Based on preset configuration file, by default class chained list, the corresponding source code of each process be put into the dedicated of the process In virtual machine executable file, remapping virtual machine executable file is obtained.
Optionally, in embodiments of the present invention, virtual machine executable file can be classes.dex file.
Optionally, in embodiments of the present invention, decompression units specifically can be used for:
Application program installation kit is decompressed using ReDex tool, obtains virtual machine executable file.
The third aspect, the embodiment of the invention provides a kind of electronic equipment, which may include processor, communication Interface, memory and communication bus, wherein processor, communication interface, memory complete mutual lead to by communication bus Letter;
Memory, for storing computer program;
Processor, when for executing the program stored on memory, realizing that above-mentioned first aspect is described in any item can Execute the method and step of file remapping method.
Fourth aspect is stored with meter in the readable storage medium storing program for executing the embodiment of the invention provides a kind of readable storage medium storing program for executing Calculation machine program realizes above-mentioned first aspect described in any item executable file remappings when computer program is executed by processor The method and step of method.
5th aspect, the embodiment of the invention provides a kind of computer program products comprising instruction, when it sets in electronics When standby upper operation, so that electronic equipment executes: the side for the executable file remapping method that any of the above-described embodiment of the method provides Method step.
In embodiments of the present invention, remapping can be carried out to the executable file in existing application program installation kit.Tool Body, which can be decompressed, obtain virtual machine executable file.Then, it is based on preset configuration The dedicated virtual machine that the corresponding source code of in the virtual machine executable file, each process is put into the process can be performed file In file, it is, only including the source code of a process in a dedicated virtual machine executable file.By this kind of mode, obtain To remapping virtual machine executable file.Later, which is compiled and is compressed, can obtained Application program installation kit after obtaining executable file remapping.In this way, the application program after executable file remapping is pacified When dress wraps the process operation of corresponding application program, it is only necessary to load the dedicated virtual machine executable file of the process to memory In, reduce the occupancy to memory.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of executable file remapping method flow diagram provided in an embodiment of the present invention;
Fig. 2 is a kind of structural schematic diagram of executable file remapping device provided in an embodiment of the present invention;
Fig. 3 is the structural schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
In order to solve prior art problem, the embodiment of the invention provides a kind of executable file remapping method, apparatus And electronic equipment.
Executable file remapping method provided in an embodiment of the present invention is illustrated first below.
Referring to Fig. 1, executable file remapping method provided in an embodiment of the present invention be may include steps of:
S101: the application program installation kit of pending executable file remapping is determined;
S102: decompressing application program installation kit, obtains virtual machine executable file;
S103: being based on preset configuration file, and the corresponding source code of in virtual machine executable file, each process is put into In the dedicated virtual machine executable file of the process, remapping virtual machine executable file is obtained;Wherein, it is recorded in configuration file Have: the corresponding relationship of process and source code in the corresponding application program of application program installation kit;Each process are as follows: application program peace Dress wraps the process in corresponding application program;Wherein, a process is corresponded with a dedicated virtual machine executable file;
S104: counterweight placement of dummy machine executable file is compiled and compresses, after obtaining executable file remapping Application program installation kit.
Inventors have found that in existing APK (Android Package, Android installation kit) executable file layout side Formula are as follows: each virtual machine executable file in the APK, such as can include the source of multiple processes in classes.dex file Code.It will lead in this way, when the process operation in multiple processes of the corresponding APP of the APK, need to load multiple virtual machines Executable file into memory, and due in each virtual machine executable file for being loaded into memory in addition to the source comprising the process Code is outer, also includes the source code of other processes, results in memory by the meaningless occupancy of the source code of other processes in this way.In particular, When a part of process in multiple processes of the APP is all run, all virtual machines for almost needing to load in the APK are executable File causes memory by excessive occupancy into memory, or even the case where low memory occurs.
In addition .class file during obtaining APK, is being converted to storage efficiency by dx order by the prior art Higher virtual machine executable file: when classes.dex file, can not carry out remapping to the executable file in the APK, Can not remapping be carried out to the source code in classes.dex file and classes.dex file, and then lead to memory quilt Excessive the case where occupying, is unable to get solution.And in embodiments of the present invention, can in existing application program installation kit can It executes file and carries out remapping.Specifically, which can be decompressed, obtains the executable text of virtual machine Part.Then, it is based on preset configuration file, the corresponding source code of in the virtual machine executable file, each process is put into this In the dedicated virtual machine executable file of process, it is, only including a process in a dedicated virtual machine executable file Source code.By this kind of mode, remapping virtual machine executable file is obtained.Later, to the executable text of the remapping virtual machine Part is compiled and compresses, the application program installation kit after can be obtained executable file remapping.In this way, when the executable text When the process operation of the corresponding application program of application program installation kit after part remapping, it is only necessary to load the dedicated void of the process Quasi- machine executable file reduces the occupancy to memory into memory.
Wherein, virtual machine executable file can be the executable file run in Dalvik virtual machine, or Operate in the executable file in ART (Android Run Time, when Android is run) virtual machine.
Executable file remapping method provided in an embodiment of the present invention is described in detail below with reference to specific example.
Assuming that carrying out executable file remapping to the virtual machine executable file in application program installation kit APK1, and false If the corresponding APP1 of the APK1 have multiple processes, in the APK1 comprising virtual machine executable file classes1.dex, Classes2.dex and classes3.dex.
Wherein it is possible to be decompressed using ReDex tool to APK1, so as to decompress to obtain virtual machine executable file Classes1.dex, classes2.dex and classes3.dex.It is then possible to read the classes1.dex, Source code in classes2.dex and classes3.dex.Wherein, it reads for convenience, can will read obtained source code and store Into default class chained list.
Later, there can be the configuration file of each process of the APP1 and the corresponding relationship of source code based on preset, record, This is preset in class chained list, the corresponding source code of each process is put into the dedicated virtual machine executable file of the process, i.e., one Only comprising source code needed for a process operation in dedicated virtual machine executable file.In this way, when the APP1 has N (N >=2) a When process, available N number of dedicated virtual machine executable file, and N number of dedicated virtual machine executable file is remapping void Quasi- machine executable file.It wherein, can also be by the dedicated void when source code amount is too big in some dedicated virtual machine executable file Quasi- machine executable file, which is split as multiple dedicated virtual machines, can be performed subfile, this is reasonable.
In this way, after obtaining remapping virtual machine executable file, it can be to the remapping virtual machine executable file It is compiled and compresses, to obtain the APK1 ' after executable file remapping.In this way, working as the corresponding application program of the APK1 ' When the process operation of APP1, it is only necessary to load that the process is corresponding, only the dedicated virtual machine of source code comprising the process can File is executed, the occupancy to memory is reduced.
Wherein, in above-mentioned APK1 comprising virtual machine executable file classes1.dex, classes2.dex and Classes3.dex is merely illustrative, is not limited thereto certainly.
In addition, since multiple processes of APP1 may be corresponding with identical public source code.Therefore, in order to avoid every operation one A process is loaded with primary public source code, causes memory by excessive occupancy, can determine the corresponding common source of multiple process Code.Then, the corresponding common source of multiple processes is piled up into public source code virtual machine executable file.
Later, be based on preset configuration file, by virtual machine executable file classes1.dex, classes2.dex and Source code in the corresponding source code of in classes3.dex, each process other than public source code, is put into the dedicated void of the process In quasi- machine executable file.And by the dedicated virtual machine executable file of process obtain, each and the public source code virtual machine Executable file is determined as remapping virtual machine executable file.Then, which is compiled It translates and compresses, to obtain the APK1 " after executable file remapping, this is also rational.
In this way, only being needed when a process (such as process A) of the corresponding application APP 1 of the APK1 " runs for the first time Load the dedicated virtual machine executable file and the public source code virtual machine executable file of process A.And when the APP1's When another process (such as process B) is run, it is only necessary to load the dedicated virtual machine executable file of process B, reduce To the occupancy of memory.
Wherein, in above-mentioned APK1 comprising virtual machine executable file classes1.dex, classes2.dex and Classes3.dex and process A and process B are merely illustrative, are not limited thereto certainly.
In addition, inventor has found after carrying out many experiments: the executable file weight cloth provided through the embodiment of the present invention Office's method, the application program pressure after carrying out remapping to the executable file in existing application program compressed package, after remapping The consumption of the process of corresponding application program memory at runtime is wrapped in contracting, is reduced compared to the memory consumption for not carrying out remapping 16%.Also, executable file remapping method provided in an embodiment of the present invention, can be to the application program of all Android versions Executable file in installation kit carries out remapping.
To sum up, using the embodiment of the present invention, remapping can be carried out to the executable file in application program installation kit, made When the process operation of the proper application program installed based on the application program installation kit, the occupancy to memory is reduced.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of executable file remapping device, ginsengs See Fig. 2, the apparatus may include:
Determination unit 201, for determining the application program installation kit of pending executable file remapping;
Decompression units 202 obtain virtual machine executable file for decompressing to application program installation kit;
First obtains unit 203, for being based on preset configuration file, by virtual machine executable file, Mei Gejin The corresponding source code of journey is put into the dedicated virtual machine executable file of the process, obtains remapping virtual machine executable file;Its In, there is record in configuration file: the corresponding relationship of process and source code in the corresponding application program of application program installation kit;Each Process are as follows: the process in the corresponding application program of application program installation kit;Wherein, a process can be held with a dedicated virtual machine Part of composing a piece of writing corresponds;
Second obtaining unit 204 is compiled and compresses for counterweight placement of dummy machine executable file, can be performed Application program installation kit after file remapping.
Executable file remapping device provided in an embodiment of the present invention, can in existing application program installation kit can It executes file and carries out remapping.Specifically, which can be decompressed, obtains the executable text of virtual machine Part.Then, it is based on preset configuration file, the corresponding source code of in the virtual machine executable file, each process is put into this In the dedicated virtual machine executable file of process, it is, only including a process in a dedicated virtual machine executable file Source code.By this kind of mode, remapping virtual machine executable file is obtained.Later, to the executable text of the remapping virtual machine Part is compiled and compresses, the application program installation kit after can be obtained executable file remapping.In this way, when the executable text When the process operation of the corresponding application program of application program installation kit after part remapping, it is only necessary to load the dedicated void of the process Quasi- machine executable file reduces the occupancy to memory into memory.
Optionally, in embodiments of the present invention, first obtains unit 203 may include:
First determines subelement, for determining that each process in application program is corresponding, identical public source code;
First transfer subelement, for piling up common source into public source code virtual machine executable file;
Second transfer subelement, for being based on preset configuration file, by process in virtual machine executable file, each Source code in corresponding source code other than public source code is put into the dedicated virtual machine executable file of the process;
Second determines subelement, for can by the dedicated virtual machine executable file of each process and public source code virtual machine File is executed, remapping virtual machine executable file is determined as.
Optionally, in embodiments of the present invention, which can also include:
Reading unit, for being decompressed to application program installation kit, after obtaining virtual machine executable file, in base In preset configuration file, the corresponding source code of in virtual machine executable file, each process is put into the dedicated void of the process In quasi- machine executable file, before obtaining remapping virtual machine executable file, the source code in virtual machine executable file is read;
Storage unit, for storing source code into default class chained list;
Correspondingly, first obtains unit 203 specifically can be used for:
Based on preset configuration file, by default class chained list, the corresponding source code of each process be put into the dedicated of the process In virtual machine executable file, remapping virtual machine executable file is obtained.
Optionally, in embodiments of the present invention, virtual machine executable file can be classes.dex file.
Optionally, in embodiments of the present invention, decompression units 202 specifically can be used for:
Application program installation kit is decompressed using ReDex tool, obtains virtual machine executable file.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of electronic equipment, referring to Fig. 3, including place Manage device 301, communication interface 302, memory 303 and communication bus 304, wherein processor 301, communication interface 302, memory 303 complete mutual communication by communication bus 304,
Memory 303, for storing computer program;
Processor 301 when for executing the program stored on memory 303, realizes that any of the above-described embodiment of the method mentions The method and step of the executable file remapping method of confession.
The electronic equipment provided in the embodiment of the present invention, can to the executable file in existing application program installation kit into Row remapping.Specifically, which can be decompressed, obtains virtual machine executable file.Then, it is based on The corresponding source code of in the virtual machine executable file, each process is put into the dedicated void of the process by preset configuration file In quasi- machine executable file, it is, only including the source code of a process in a dedicated virtual machine executable file.By this Kind mode, obtains remapping virtual machine executable file.Later, which is compiled and is pressed Contracting, the application program installation kit after can be obtained executable file remapping.In this way, answering after the executable file remapping When being run with the process of the corresponding application program of program installation kit, it is only necessary to load the dedicated virtual machine executable file of the process Into memory, reduce the occupancy to memory.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete Door or transistor logic, discrete hardware components.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of readable storage medium storing program for executing, the readable storages Dielectric memory contains computer program, which realizes what any of the above-described embodiment of the method provided when being executed by processor The method and step of executable file remapping method.
The computer program stored in readable storage medium storing program for executing provided in an embodiment of the present invention is held by the processor of electronic equipment After row, remapping can be carried out to the executable file in existing application program installation kit.It specifically, can be to the application program Installation kit is decompressed, and virtual machine executable file is obtained.Then, it is based on preset configuration file, which can be performed The corresponding source code of in file, each process is put into the dedicated virtual machine executable file of the process, it is, one dedicated It only include the source code of a process in virtual machine executable file.By this kind of mode, the executable text of remapping virtual machine is obtained Part.Later, which is compiled and is compressed, after can be obtained executable file remapping Application program installation kit.In this way, the corresponding application program of application program installation kit after the executable file remapping into When Cheng Yunhang, it is only necessary to load the dedicated virtual machine executable file of the process into memory, reduce the occupancy to memory.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of, and the computer program comprising instruction is produced Product, when it runs on an electronic device, so that electronic equipment executes: the executable file that any of the above-described embodiment of the method provides The method and step of remapping method.
Computer program product provided in an embodiment of the present invention comprising instruction makes when it runs on an electronic device Remapping can be carried out to the executable file in existing application program installation kit by obtaining electronic equipment.Specifically, this can be answered It is decompressed with program installation kit, obtains virtual machine executable file.Then, it is based on preset configuration file, by the virtual machine The corresponding source code of in executable file, each process is put into the dedicated virtual machine executable file of the process, it is, one It only include the source code of a process in a dedicated virtual machine executable file.By this kind of mode, obtaining remapping virtual machine can Execute file.Later, which is compiled and is compressed, can be obtained executable file weight cloth Application program installation kit after office.In this way, the application program installation kit after executable file remapping is corresponding using journey When the process operation of sequence, it is only necessary to load the dedicated virtual machine executable file of the process into memory, reduce to memory It occupies.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device, For electronic equipment, readable storage medium storing program for executing and computer program product embodiments, since it is substantially similar to the method embodiment, institute To be described relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (10)

1. a kind of executable file remapping method, which is characterized in that the described method includes:
Determine the application program installation kit of pending executable file remapping;
The application program installation kit is decompressed, virtual machine executable file is obtained;
Based on preset configuration file, by the corresponding source code of in the virtual machine executable file, each process be put into this into In the dedicated virtual machine executable file of journey, remapping virtual machine executable file is obtained;Wherein, it is recorded in the configuration file Have: the corresponding relationship of process and source code in the corresponding application program of the application program installation kit;Each process are as follows: institute State the process in the corresponding application program of application program installation kit;Wherein, a process and the executable text of a dedicated virtual machine Part corresponds;
The remapping virtual machine executable file is compiled and is compressed, the application journey after obtaining executable file remapping Sequence installation kit.
2. the method according to claim 1, wherein described be based on preset configuration file, by the virtual machine The corresponding source code of in executable file, each process is put into the dedicated virtual machine executable file of the process, obtains weight cloth The step of office's virtual machine executable file, comprising:
Determine that each process in the application program is corresponding, identical public source code;
The common source is piled up into public source code virtual machine executable file;
Based on preset configuration file, by the corresponding source code of in the virtual machine executable file, each process in addition to institute The source code outside public source code is stated, is put into the dedicated virtual machine executable file of the process;
By the dedicated virtual machine executable file of each process and the public source code virtual machine executable file, it is determined as Remapping virtual machine executable file.
3. the method according to claim 1, wherein decompressed described to the application program installation kit, After obtaining virtual machine executable file, it is being based on preset configuration file, it will be in the virtual machine executable file, each The corresponding source code of process is put into the dedicated virtual machine executable file of the process, obtain remapping virtual machine executable file it Before, the method also includes:
Read the source code in the virtual machine executable file;
The source code is stored into default class chained list;
It is described to be based on preset configuration file, the corresponding source code of in the virtual machine executable file, each process is put into In the dedicated virtual machine executable file of the process, the step of obtaining remapping virtual machine executable file, comprising:
Based on preset configuration file, by the default class chained list, the corresponding source code of each process be put into the dedicated of the process In virtual machine executable file, remapping virtual machine executable file is obtained.
4. the method according to claim 1, wherein the virtual machine executable file is classes.dex text Part.
5. according to the method described in claim 4, obtaining it is characterized in that, described decompress the application program installation kit The step of to virtual machine executable file, comprising:
The application program installation kit is decompressed using ReDex tool, obtains virtual machine executable file.
6. a kind of executable file remapping device, which is characterized in that described device includes:
Determination unit, for determining the application program installation kit of pending executable file remapping;
Decompression units obtain virtual machine executable file for decompressing to the application program installation kit;
First obtains unit, for being based on preset configuration file, by process pair in the virtual machine executable file, each The source code answered is put into the dedicated virtual machine executable file of the process, obtains remapping virtual machine executable file;Wherein, institute Stating in configuration file record has: the corresponding relationship of process and source code in the corresponding application program of the application program installation kit; Each process are as follows: the process in the corresponding application program of the application program installation kit;Wherein, process with one specially It is corresponded with virtual machine executable file;
Second obtaining unit obtains executable text for the remapping virtual machine executable file to be compiled and compressed Application program installation kit after part remapping.
7. device according to claim 6, which is characterized in that the first obtains unit, comprising:
First determines subelement, for determining that each process in the application program is corresponding, identical public source code;
First transfer subelement, for piling up the common source into public source code virtual machine executable file;
Second transfer subelement, for being based on preset configuration file, by process in the virtual machine executable file, each Source code in corresponding source code other than the public source code, is put into the dedicated virtual machine executable file of the process;
Second determines subelement, for the dedicated virtual machine executable file of each process and the public source code is virtual Machine executable file is determined as remapping virtual machine executable file.
8. device according to claim 6, which is characterized in that described device further include:
Reading unit, for being decompressed to the application program installation kit, after obtaining virtual machine executable file, in base In preset configuration file, the corresponding source code of in the virtual machine executable file, each process is put into the special of the process With before in virtual machine executable file, obtaining remapping virtual machine executable file, the virtual machine executable file is read In source code;
Storage unit, for storing the source code into default class chained list;
The first obtains unit is specifically used for:
Based on preset configuration file, by the default class chained list, the corresponding source code of each process be put into the dedicated of the process In virtual machine executable file, remapping virtual machine executable file is obtained.
9. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any method and step of claim 1-5.
10. a kind of readable storage medium storing program for executing, which is characterized in that be stored with computer program, the meter in the readable storage medium storing program for executing Claim 1-5 any method and step is realized when calculation machine program is executed by processor.
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 true CN109558144A (en) 2019-04-02
CN109558144B 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 (4)

* 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
US20170220335A1 (en) * 2016-02-02 2017-08-03 ZeroTurnaround AS System and Method for Fast Initial and Incremental Deployment of Apps

Patent Citations (4)

* 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
US20170220335A1 (en) * 2016-02-02 2017-08-03 ZeroTurnaround AS System and Method for Fast Initial and Incremental Deployment of Apps
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
CN109558144B (en) 2022-03-22

Similar Documents

Publication Publication Date Title
US10908925B2 (en) Dynamic loading method, and target file creation method and apparatus
EP3540594A1 (en) Packaging method, device, and terminal employing plugin format, and storage medium
WO2012052336A2 (en) Methods and devices for reducing compressed page loading time on page fault
US20170235473A1 (en) Method and Apparatus for Loading Application Program View, and Electronic Terminal
CN108121556A (en) EMMC compatibilities upgrade method, intelligent terminal and readable storage medium storing program for executing
CN105138333A (en) APK file compression method and system based on Android system
CN111209736A (en) Text file analysis method and device, computer equipment and storage medium
CN111491169B (en) Digital image compression method, device, equipment and medium
US20140258247A1 (en) Electronic apparatus for data access and data access method therefor
US7853742B2 (en) System and method to conditionally shrink an executable module
CN106610828B (en) Android system-based GIF animation playing method and device
JP5431497B2 (en) Method and device for storing and transferring page data, in particular page codes in a virtual memory mechanism
CN109976751A (en) Model manipulation method, relevant apparatus and computer-readable medium
CN109558144A (en) Executable file redistribution method and device and electronic equipment
CN108958755A (en) A kind of generation method, device and the electronic equipment of application program installation kit
CN112306507A (en) Picture resource processing method, device, terminal and storage medium
CN110955601A (en) Android platform stability-based automatic testing method and device and electronic equipment
CN110532032A (en) A kind of booting file system detection method and relevant device
CN114090070A (en) Application program installation package file processing method and electronic equipment
CN113641643A (en) File writing method and device
CN105930137A (en) Data processing method and apparatus for cross-terminal device platform
CN112445525B (en) Data processing method, related equipment and computer readable medium
CN109814843A (en) A kind of object-based page assignment method and system
CN105094865A (en) Method and device for loading customized IE (Internet Explorer) kernel
CN102375674A (en) Information processing apparatus

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