CN109783138A - Method for splitting, device, terminal and the medium that application package is constituted - Google Patents
Method for splitting, device, terminal and the medium that application package is constituted Download PDFInfo
- Publication number
- CN109783138A CN109783138A CN201811481866.3A CN201811481866A CN109783138A CN 109783138 A CN109783138 A CN 109783138A CN 201811481866 A CN201811481866 A CN 201811481866A CN 109783138 A CN109783138 A CN 109783138A
- Authority
- CN
- China
- Prior art keywords
- module
- file
- dex
- business
- business module
- 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.)
- Withdrawn
Links
Landscapes
- Stored Programmes (AREA)
Abstract
Method for splitting, device, terminal and the computer constituted the embodiment of the invention provides a kind of application package can storage medium, which comprises determines multiple business modules to subdivision in APP packet;Obtain the dictionary mapping file for being packaged and generating in process;The class indication of each business module in the multiple business module is determined according to the mapping file;Generating corresponding Android virtual machine according to the class indication of each business module can be performed Dex file;All Dex files of generation are repacked, the APP packet of Dex file has been split.In the embodiment of the present invention, it can according to need and decouple Dex in APP packet by the class indication of each business module, final Dex file is generated on demand, and Dex file is repacked, the APP packet of Dex file is split, to subsequent analysis and promotion related service reduced code, strong quantized data is provided.
Description
Technical field
The present invention relates to field of computer technology, a kind of constituted more particularly to application package method for splitting, device,
Terminal and computer readable storage medium.
Background technique
It is well known that the application program (APP, Application) in Android (Android) system is with a kind of Android peace
Dress packet (APK, AndroidPackage) distributed as files and be mounted, with the iteration of APP business, APP packet (i.e. APK
File) volume can accumulate expansion so that application shop distribution APP packet transformation efficiency reduction.It is existing for this volume expansion
Have in technology, be only capable of analyzing the volume accounting of resource and source code (Dex) in APP packet, source code (Dex) can not be calculated
In each service code composition accounting, also just can not each business of long-term monitoring volume increase, can not be to source code portion
Precisely quantization, is unfavorable for the subsequent volume for simplifying APP packet (APK file).Meanwhile after the biggish APP packet of user installation volume
The memory space occupied on its mobile terminal (such as mobile phone etc.) also can be increasing, to reduce the service performance of user.
Therefore, how to determine that the composition of each service code in APP packet (APK file) is quantified, be have at present it is to be solved
The technical issues of.
Summary of the invention
The embodiment of the present invention is the technical problem to be solved is that a kind of method for splitting that application package is constituted is provided, with solution
It, cannot be to the structure of APP packet (APK file) certainly in the prior art due to that can not determine the composition accounting of each service code in APP packet
At being quantified, lead to the technical problem of user's service performance difference.
Correspondingly, the embodiment of the invention also provides detachment device, terminal and computers that a kind of application package is constituted
Readable storage medium storing program for executing, to guarantee the implementation and application of the above method.
To solve the above-mentioned problems, the present invention is achieved through the following technical solutions:
First aspect provides a kind of method for splitting of application package, comprising:
Determine multiple business modules to subdivision in application APP packet;
Obtain the dictionary mapping file for being packaged and generating in process;
The class indication of each business module in the multiple business module is determined according to the mapping file;
Generating corresponding Android virtual machine according to the class indication of each business module can be performed Dex file;
All Dex files of generation are repacked, the APP packet of Dex file has been split.
Optionally, the mapping file includes: the corresponding relationship of whole source code file and byte code files, institute
State the class indication that each business module in the multiple business module is determined according to the mapping file, comprising:
The source code file of each business module in the multiple business module is obtained from the mapping file;
Corresponding byte code files are obtained according to the source code file of each business module;
To the starting point label and end point mark of the corresponding byte code files of business module each in the multiple business module
Label are marked, and obtain the class indication of corresponding business module.
Optionally, before generating corresponding Dex file, the method also includes:
It modifies to the source code of the Dex processing part of Android compiling source code, increases the generation of parsing secondary Dex list tab
Code;
It is described that corresponding Dex file is generated according to the class indication of each business module, it specifically includes: utilizing modification
The class indication of code and each business module afterwards successively parses the corresponding word of each business module in multiple business modules
Save code file, the byte code files of each business module after being parsed;And the byte according to business module each after parsing
Code file, generates corresponding Dex file.
Optionally, before being repacked to all Dex files, further includes:
It modifies to the naming rule of Dex file, obtains the Dex file life for identifying the class indication of each business module
Name rule;
All Dex files of described pair of generation are repacked, and the APP packet of Dex file has been split, specific to wrap
It includes: according to modified Dex file designation rule, to all Dex files of generation according to the class indication of multiple business modules
It is repacked, has been split the APP packet of Dex file.
Second aspect provides a kind of detachment device that application package is constituted, comprising:
First determining module, for determining multiple business modules to subdivision in application APP packet;
Module is obtained, for obtaining the dictionary mapping file for being packaged and generating in process;
Second determining module, for determining each business mould in the multiple business module according to the mapping file
The class indication of block;
Generation module, it is executable for generating corresponding Android virtual machine according to the class indication of each business module
Dex file;
Weight packetization module has been split the APP of Dex file for repacking to all Dex files of generation
Packet.
Optionally, the mapping file for obtaining module acquisition includes: whole source code file and bytecode
The corresponding relationship of file;
Second determining module includes:
Source code file obtains module, each in the multiple business module for obtaining from the mapping file
The source code file of business module;
Byte code files obtain module, for obtaining corresponding bytecode text according to the source code file of each business module
Part;
Class indication module, for being risen to the corresponding byte code files of business module each in the multiple business module
Point label and end point label are marked, and obtain the class indication of corresponding business module.
Optionally, further includes:
Codes Revised module is compiled, for compiling source to Android before the generation module generates corresponding Dex file
The source code of the Dex processing part of code is modified, and the code of parsing secondary Dex list tab is increased.
Optionally, the generation module includes:
Parsing module, for utilizing the modified code of compiling Codes Revised module and each business module
Class indication, successively parse the corresponding byte code files of each business module in multiple business modules, it is each after being parsed
The byte code files of business module;
File generating module generates corresponding Dex text for the byte code files according to business module each after parsing
Part.
Optionally, further includes:
Rules modification module, for before the heavy packetization module repacks all Dex files, to Dex
The naming rule of file is modified, and the Dex file designation rule for identifying the class indication of each business module is obtained;
The heavy packetization module is specifically used for using modified Dex file designation rule, to all Dex text of generation
Part is repacked according to the class indication of multiple business modules, has been split the APP packet of Dex file.
The third aspect provides a kind of terminal, comprising: memory, processor and is stored on the memory and can be described
The computer program run on processor realizes such as above-mentioned application program when the computer program is executed by the processor
Wrap the step in the method for splitting constituted.
Fourth aspect provides a kind of computer readable storage medium, and calculating is stored on the computer readable storage medium
Machine program realizes the step in the method for splitting constituted such as above-mentioned application package when the computer program is executed by processor
Suddenly.
Compared with prior art, the embodiment of the present invention includes following advantages:
In the embodiment of the present invention, multiple business modules to subdivision in APP packet are first determined, then, according in packing process
The dictionary mapping file of generation determines the class indication of each business module in the multiple business module, and according to described
The class indication of each business module generates corresponding Dex file;Finally, all Dex files to generation are repacked,
The APP packet of Dex file is split.That is, can according to need in the embodiment of the present invention and first determine APP (APK text
Part) then business module to be split is decoupled Dex in APP packet by the class indication of each business module in packet, because
A business module is just corresponded to for a Dex file, the size of Dex file represents the size of business module;So according to
The APP packet of Dex file has been split, the volume accounting of each business in APP packet (APK file) can have accurately been calculated, realize
Accurate quantization to source code portion improves the service performance of user, and related to pointedly promotion for subsequent analysis
Business reduced code provides strong quantized data.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
The application can be limited.
Detailed description of the invention
Fig. 1 is the flow chart for the method for splitting that a kind of application package provided in an embodiment of the present invention is constituted;
Fig. 2 is the flow chart for the method for splitting that a kind of application package provided in an embodiment of the present invention is constituted;
Fig. 3 is the structural schematic diagram for the detachment device that a kind of application package provided in an embodiment of the present invention is constituted;
Fig. 4 is another structural schematic diagram for the detachment device that a kind of application package provided in an embodiment of the present invention is constituted;
Fig. 5 is another structural schematic diagram for the detachment device that a kind of application package provided in an embodiment of the present invention is constituted.
Specific embodiment
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real
Applying mode, the present invention is described in further detail.
In the embodiment of the present invention, APP packet (i.e. APK file) generally includes resource and code, for resource (such as picture
Deng) composition, can be analyzed by existing method, and currently, can not also be torn open for the composition of the Dex file of code
Point, it is based on this, the embodiment of the present invention provides the method that the composition of the Dex file in a kind of pair of APP packet is split, specific
Realization process embodiment as described below.
Referring to Fig. 1, for a kind of flow chart of application package composition method for splitting provided in an embodiment of the present invention, specifically
It may include steps of:
Step 101: determining multiple business modules to subdivision in application APP packet;
In the step, multiple business modules may include playing video module, page presentation module (i.e. card), payment
Module etc., these business modules can be divided from different dimensions, be referred to as the corresponding business module of different departments.
That is, user can lead to if user wants to understand or quantify the composition of which business module in APP packet
The application programming interfaces crossed in terminal input the name of business module to be split (such as broadcasting video module, page presentation module etc.)
Claim, and terminal is after the title for receiving user's input, can in APP packet the position of Dex source code generate it is a it is to be configured clearly
Single, each business module decoupled is wished in configuration.And these business modules are just as business module to be split.
Step 102: obtaining the dictionary mapping file for being packaged and generating in process;
In the step, process is normally packaged by Android (Andorid), generates the Android installation kit of a released version
(APK, AndroidPackage) file can also generate dictionary (mapping) file, be referred to as indexing in the process
File, in the mapping file, including whole source code files (i.e. java file), byte code files (i.e. class text
Part) and source code file and byte code files corresponding relationship.
Step 103: the contingency table of each business module in the multiple business module is determined according to the mapping file
Know;
In the step, the source of each business module in the multiple business module is first obtained from the mapping file
Code file, and corresponding byte code files are obtained according to the source code file of each business module;Then, to the multiple
The starting point label of the corresponding byte code files of each business module and end point label are marked in business module, are corresponded to
The class indication of business module.
That is, being closed in the step according to the source code file in mapping file is corresponding with byte code files
System, successively retrieves the source code file (java file) of each business module, then, according to source code file and byte code files
Corresponding relationship, be matched to the byte code files (class file) of corresponding each business module;Later, to each business mould
The starting point label and end point label of the corresponding byte code files of block are identified, and in the embodiment, can be used -- subdex-
Start | far and -- subdex-over | far label identifies.-- subdex-start | far with -- subdex-over | far
Between included byte code files (class file) be the corresponding byte code files of far business.
Step 104: generating corresponding Android virtual machine according to the class indication of each business module can be performed Dex text
Part;
In the step, using the class indication of the code and each business module modified in advance, multiple industry are successively parsed
The corresponding byte code files of each business module, the byte code files of each business module after being parsed in module of being engaged in;According to
The byte code files of each business module after parsing generate corresponding Dex file.
That is, by reading the code modified in advance, to parse -- the configuration item in sub-dexes-list, according to
Classify before -- subdex-start, -- each business module is corresponded to byte code files and successively solved by subdex-over label
It separates out to get the byte code files of each business module to after parsing.
It is each reading -- when subdex-over, just call Android dex generation method, each industry that will be resolved to
The byte code files (class file) for module of being engaged in, Dex file needed for being converted into APK file.
Step 105: all Dex files of generation being repacked, the APP packet of Dex file has been split.
In the step, according to the rule of modified Dex file designation in advance, to all Dex files of generation according to multiple
The class indication of business module is repacked, and the APP packet of Dex file has been split.
Wherein, in the step, default dex naming rule is successively named with classes+ number+" .dex ",
Such as: classes.dex, classes2.dex ... classesN.dex.And the packet stage is being beaten again, it has modified
The source code of getSubDexesPath this part names rule, is named it according to Business Name, obtains modified Dex
File designation rule, later, in the APP packet (APK file) generated by modified dex naming rule, the size of Dex file
It is exactly each business source code size inner in final APP packet (APK file).For example, the size of far.dex file is corresponding just
It is the source code of far business module size shared in final APK file.
In the embodiment of the present invention, multiple business modules to subdivision in APP packet are first determined, then, according in packing process
The dictionary mapping file of generation determines the class indication of each business module in the multiple business module, and according to described
The class indication of each business module generates corresponding Dex file;Finally, all Dex files to generation are repacked,
The APP packet of Dex file is split.That is, can according to need in the embodiment of the present invention and first determine APP (APK text
Part) packet in business module to be split then Dex in APP packet is decoupled by the class indication of each business module,
Because a Dex file just corresponds to a business module, the size of Dex file represents the size of business module;So root
According to the APP packet for having split Dex file, the composition accounting of each business module in APP packet (APK file) can be accurately calculated,
The accurate quantization to source code portion is realized, improves the service performance of user, and push away for subsequent analysis and pointedly
Dynamic related service reduced code, provides strong quantized data.
Also referring to Fig. 2, for a kind of another stream for the method for splitting that application package is constituted provided in an embodiment of the present invention
Cheng Tu, which comprises
Step 201: determining multiple business modules to subdivision in APP packet;
Terminal receive user input after the title for splitting business module, can in APP packet Dex source code position
A inventory to be configured of generation is set, each business module decoupled is wished in configuration.Concrete implementation process and step 101 are same, specifically
It is detailed in above-mentioned, details are not described herein.
Step 202: obtaining the dictionary mapping file for being packaged and generating in process;
The step is identical as the realization process of step 102, is specifically detailed in above-mentioned, and details are not described herein.
Step 203: the contingency table of each business module in the multiple business module is determined according to the mapping file
Know;
In the embodiment, each business module in the multiple business module is being obtained from the mapping file
Source code file, and after obtaining corresponding byte code files according to the source code file of each business module, to each business
The starting point label and end point label of the corresponding byte code files of module are identified, and can be used -- subdex-start | far
With -- subdex-over | far label identifies.In order to make it easy to understand, the mark is known as the contingency table to different business module
Know.For example, by taking the content of underscore meaning in program segment 1 as an example:
Program segment 1
--subdex-over|hostProject
--subdex-start|far
com/example/far/b.class
com/example/far/a.class
com/example/far/FarActivity.class
--subdex-over|far
By the program segment it is found that -- subdex-start | far and -- subdex-over | the byte for being included between far
Code file (class file) is the corresponding byte code files of far business.
Step 204: modifying to the source code of the Dex processing part of Android compiling source code, increase parsing secondary Dex list mark
The code of label;
That is, Dex handles part in modification Android compiling source code (android.tools.build:gradle)
Source code, keep it the same as the main Dex mark for supporting identification Android primary, have and identify secondary Dex list mark in configuration file
The ability of the class indication of label increases the code of parsing secondary Dex list tab.
That is, Android is copied to parse -- main-dex-list label, the source code of modification Dex processing part,
Code is obtained, which supports newly-increased configuration file attribute, for example, main Dex list (-- sub-dexes-
List), the content specific as follows for stating underscore meaning in program segment, in order to make it easy to understand, only by taking the program segment 2 as an example:
Program segment 2
Later, modified source code is gone as parsing Android own main Dex list (- main-dex-list)
Parse secondary Dex list -- sub-dexes-list.For example, the content of the underscore meaning in following program segments, for the ease of reason
Solution, only by taking the program segment 3 as an example:
Program segment 3
Step 205: using the code of modification and the class indication of each business module, successively parsing multiple business modules
In the corresponding byte code files of each business module, the byte code files of each business module after being parsed;
In the embodiment, after reading modified code, parsing -- the configuration item in sub-dexes-list, according to before
Classification -- subdex-start, -- each business module is corresponded to byte code files and is successively solved by subdex-over label
Analysis, the byte code files of each business module after being parsed.Shown in the underscore specific as follows for stating program segment 4, for the ease of
Understand, only by taking the program segment 4 as an example;
Program segment 4
Step 206: according to the byte code files of business module each after parsing, generating corresponding Dex file;
It is each reading in the step -- when subdex-over, Android dex generation method is called, will be resolved to
Each business module byte code files (class file), Dex file needed for being converted into APK file.
Step 207: modifying to the naming rule of Dex file, obtain the class indication for identifying each business module
Dex file designation rule;
In the step, the naming rule of default is successively named with classes+ number+" .dex ", such as:
classes.dex,classes2.dex…classesN.dex.And beating again the packet stage, have modified getSubDexesPath this
The source code of part names rule makes it carry out title according to Business Name, obtains modified Dex file designation rule.
Step 208: according to modified Dex file designation rule, all Dex files of generation are repacked,
The APP packet of Dex file is split.
In the step, in the APP packet (APK file) by the compiling generation of modified dex naming rule, Dex file
Size is exactly each business source code size inner in final APP packet (APK file).Such as it is exactly far industry that far.dex is corresponding
The source code for module of being engaged in size shared in final APK file.
In the embodiment of the present invention, the business module to be split first determined in APP (APK file) packet can according to need,
Then, Dex in APP packet is decoupled by the class indication of each business module, accurately calculates APP packet (APK file)
In each business volume accounting, generate final Dex file on demand, and repack to Dex file, split
The APP packet of Dex file realizes the accurate quantization to source code portion, improves the service performance of user, and is subsequent point
Analysis and pointedly promotion related service reduced code, provide strong quantized data.
It should be noted that for simple description, therefore, it is stated as a series of action groups for embodiment of the method
It closes, but those skilled in the art should understand that, embodiment of that present invention are not limited by the describe sequence of actions, because according to
According to the embodiment of the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art also should
Know, the embodiments described in the specification are all preferred embodiments, and the related movement not necessarily present invention is implemented
Necessary to example.
Referring to Fig. 3, for a kind of structural representation for the detachment device that application package is constituted provided in an embodiment of the present invention
Figure can specifically include following module: the first determining module 31, obtain module 32, the second determining module 33,34 He of generation module
Weight packetization module 35, wherein
First determining module 31, for determining multiple business modules to subdivision in application APP packet;
Module 32 is obtained, for obtaining the dictionary mapping file for being packaged and generating in process;
Second determining module 33, for determining each business in the multiple business module according to the mapping file
The class indication of module;
Generation module 34 can be held for generating corresponding Android virtual machine according to the class indication of each business module
Row Dex file;
Weight packetization module 35 has been split Dex file for repacking to all Dex files of generation
APP packet.
Optionally, in another embodiment, the embodiment is on the basis of the above embodiments, described to obtain what module obtained
The mapping file includes: the corresponding relationship of whole source code file and byte code files;
Second determining module includes: that source code file obtains module and byte code files acquisition module, class indication
Module (not shown), wherein
Source code file obtains module, each in the multiple business module for obtaining from the mapping file
The source code file of business module;
Byte code files obtain module, for obtaining corresponding bytecode text according to the source code file of each business module
Part;
Class indication module, for being risen to the corresponding byte code files of business module each in the multiple business module
Point label and end point label are marked, and obtain the class indication of corresponding business module.
Optionally, in another embodiment, on the basis of the above embodiments, described device can also wrap the embodiment
Include: compiling Codes Revised module 41, structural schematic diagram is as shown in Figure 4, wherein
Codes Revised module 41 is compiled, for being compiled before the generation module generates corresponding Dex file to Android
The source code of the Dex processing part of source code is modified, and the code of parsing secondary Dex list tab is increased;
Optionally, in another embodiment, on the basis of the above embodiments, the generation module includes: the embodiment
Parsing module and file generating module (not shown), wherein
Parsing module, for the contingency table using the compiling modified code of Codes Revised module and each business module
Know, successively parses the corresponding byte code files of each business module in multiple business modules, each business module after being parsed
Byte code files;
File generating module generates corresponding Dex text for the byte code files according to business module each after parsing
Part.
Optionally, in another embodiment, the embodiment is on the basis of the above embodiments, further includes: rules modification mould
Block 51, structural schematic diagram is as shown in Figure 5, wherein
Rules modification module 51 is right for before the heavy packetization module repacks all Dex files
The naming rule of Dex file is modified, and the Dex file designation rule for identifying the class indication of each business module is obtained;
The heavy packetization module 35 is specifically used for according to the modified Dex file designation rule of rules modification module 51, right
All Dex files generated are repacked according to the class indication of multiple business modules, have been split Dex file
APP packet.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple
Place illustrates referring to the part of embodiment of the method.
In the embodiment of the present invention, the business module to be split first determined in APP (APK file) packet can according to need,
Then, Dex in APP packet is decoupled by the class indication of each business module, accurately calculates APP packet (APK file)
In each business volume accounting, generate final Dex file on demand, and repack to Dex file, split
The APP packet of Dex file, and be subsequent analysis and pointedly promotion related service reduced code, strong quantization number is provided
According to.
Optionally, the embodiment of the present invention also provides a kind of terminal, including processor, and memory stores on a memory simultaneously
The computer program that can be run on the processor, the computer program realize above-mentioned application package when being executed by processor
Each process of the method for splitting embodiment of composition, and identical technical effect can be reached, it is no longer superfluous here to avoid repeating
It states.
The embodiment of the present invention also provides a kind of computer readable storage medium, and meter is stored on computer readable storage medium
Calculation machine program, the computer program realize each of the method for splitting embodiment that above-mentioned application package is constituted when being executed by processor
A process, and identical technical effect can be reached, to avoid repeating, which is not described herein again.Wherein, described computer-readable to deposit
Storage media, such as read-only memory (Read-Only Memory, abbreviation ROM), random access memory (RandomAccess
Memory, abbreviation RAM), magnetic or disk etc..
All the embodiments in this specification are described in a progressive manner, the highlights of each of the examples are with
The difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.
All the embodiments in this specification are described in a progressive manner, the highlights of each of the examples are with
The difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.
The embodiment of the present invention referring to according to the method for the embodiment of the present invention, device, terminal and computer program product
Flowchart and/or the block diagram describes.It should be understood that can be realized by computer program instructions every in flowchart and/or the block diagram
The combination of process and/or box in one process and/or box and flowchart and/or the block diagram.It can provide these computers
Program instruction is to the place of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing terminal devices
Device is managed to generate a machine, so that the finger executed by computer or the processor of other programmable data processing terminal devices
It enables and generates to specify in one or more flows of the flowchart and/or one or more blocks of the block diagram
The device of function.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing terminal devices
In computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates packet
The manufacture of command device is included, which realizes in one side of one or more flows of the flowchart and/or block diagram
The function of being specified in frame or multiple boxes.
Although the preferred embodiment of the embodiment of the present invention has been described, once a person skilled in the art knows bases
This creative concept, then additional changes and modifications can be made to these embodiments.So the following claims are intended to be interpreted as
Including preferred embodiment and fall into all change and modification of range of embodiment of the invention.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that process, method, article or terminal device including a series of elements not only wrap
Those elements are included, but also including other elements that are not explicitly listed, or further includes for this process, method, article
Or the element that terminal device is intrinsic.In the absence of more restrictions, being wanted by what sentence "including a ..." limited
Element, it is not excluded that there is also other identical elements in process, method, article or the terminal device for including the element.
Method for splitting, device, terminal and the computer constituted above to a kind of application package provided by the present invention can
Storage medium is described in detail, and specific case used herein explains the principle of the present invention and embodiment
It states, the above description of the embodiment is only used to help understand the method for the present invention and its core ideas;Meanwhile for this field
Those skilled in the art, according to the thought of the present invention, there will be changes in the specific implementation manner and application range, to sum up institute
It states, the contents of this specification are not to be construed as limiting the invention.
Claims (11)
1. a kind of method for splitting of application package characterized by comprising
Determine multiple business modules to subdivision in application APP packet;
Obtain the dictionary mapping file for being packaged and generating in process;
The class indication of each business module in the multiple business module is determined according to the mapping file;
Generating corresponding Android virtual machine according to the class indication of each business module can be performed Dex file;
All Dex files of generation are repacked, the APP packet of Dex file has been split.
2. the method according to claim 1, wherein the mapping file includes: whole source code file
It is described that each business in the multiple business module is determined according to the mapping file with the corresponding relationship of byte code files
The class indication of module, comprising:
The source code file of each business module in the multiple business module is obtained from the mapping file;
Corresponding byte code files are obtained according to the source code file of each business module;
Starting point label and end point label to the corresponding byte code files of business module each in the multiple business module into
Line flag obtains the class indication of corresponding business module.
3. the method according to claim 1, wherein the method is also wrapped before generating corresponding Dex file
It includes:
It modifies to the source code of the Dex processing part of Android compiling source code, increases the code of parsing secondary Dex list tab;
It is described that corresponding Dex file is generated according to the class indication of each business module, it specifically includes: utilizing modified
The class indication of code and each business module successively parses the corresponding bytecode of each business module in multiple business modules
File, the byte code files of each business module after being parsed;And the bytecode text according to business module each after parsing
Part generates corresponding Dex file.
4. method according to any one of claims 1 to 3, which is characterized in that repacked to all Dex files
Before, further includes:
It modifies to the naming rule of Dex file, obtains the Dex file designation rule for identifying the class indication of each business module
Then;
All Dex files of described pair of generation are repacked, and have been split the APP packet of Dex file, specifically included: root
According to modified Dex file designation rule, weight is carried out according to the class indication of multiple business modules to all Dex files of generation
It is new to be packaged, split the APP packet of Dex file.
5. the detachment device that a kind of application package is constituted characterized by comprising
First determining module, for determining multiple business modules to subdivision in application APP packet;
Module is obtained, for obtaining the dictionary mapping file for being packaged and generating in process;
Second determining module, for determining each business module in the multiple business module according to the mapping file
Class indication;
Dex can be performed for generating corresponding Android virtual machine according to the class indication of each business module in generation module
File;
Weight packetization module has been split the APP packet of Dex file for repacking to all Dex files of generation.
6. device according to claim 5, which is characterized in that
The mapping file for obtaining module acquisition includes: that whole source code files is corresponding with byte code files
Relationship;
Second determining module includes:
Source code file obtains module, for obtaining each business in the multiple business module from the mapping file
The source code file of module;
Byte code files obtain module, for obtaining corresponding byte code files according to the source code file of each business module;
Class indication module, for the starting point mark to the corresponding byte code files of business module each in the multiple business module
Label and end point label are marked, and obtain the class indication of corresponding business module.
7. device according to claim 5, which is characterized in that further include:
Codes Revised module is compiled, for compiling source code to Android before the generation module generates corresponding Dex file
The source code of Dex processing part is modified, and the code of parsing secondary Dex list tab is increased.
8. device according to claim 7, which is characterized in that the generation module includes:
Parsing module, for point using the compiling modified code of Codes Revised module and each business module
Class mark successively parses the corresponding byte code files of each business module in multiple business modules, each business after being parsed
The byte code files of module;
File generating module generates corresponding Dex file for the byte code files according to business module each after parsing.
9. according to device described in claim 5 to 8 any one, which is characterized in that further include:
Rules modification module, for before the heavy packetization module repacks all Dex files, to Dex file
Naming rule modify, obtain identifying the Dex file designation rule of the class indication of each business module;
The heavy packetization module is specifically used for pressing all Dex files of generation using modified Dex file designation rule
It is repacked according to the class indication of multiple business modules, has been split the APP packet of Dex file.
10. a kind of terminal characterized by comprising memory, processor and be stored on the memory and can be at the place
The computer program run on reason device is realized when the computer program is executed by the processor as appointed in Claims 1-4
The step in method for splitting that application package described in one is constituted.
11. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium
Program, the computer program realize application package structure according to any one of claims 1 to 4 when being executed by processor
At method for splitting in step.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811481866.3A CN109783138A (en) | 2018-12-05 | 2018-12-05 | Method for splitting, device, terminal and the medium that application package is constituted |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811481866.3A CN109783138A (en) | 2018-12-05 | 2018-12-05 | Method for splitting, device, terminal and the medium that application package is constituted |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109783138A true CN109783138A (en) | 2019-05-21 |
Family
ID=66496783
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811481866.3A Withdrawn CN109783138A (en) | 2018-12-05 | 2018-12-05 | Method for splitting, device, terminal and the medium that application package is constituted |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109783138A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110795143A (en) * | 2019-10-22 | 2020-02-14 | 中国工商银行股份有限公司 | Method, apparatus, computing device, and medium for processing functional module |
CN111399858A (en) * | 2020-02-28 | 2020-07-10 | 平安科技(深圳)有限公司 | Android application package packaging method, equipment, storage medium and device |
CN113377415A (en) * | 2021-06-28 | 2021-09-10 | 郑州阿帕斯数云信息科技有限公司 | Application publishing method and device |
CN113835718A (en) * | 2020-06-23 | 2021-12-24 | 北京字节跳动网络技术有限公司 | Android application package generation method and device, terminal device and medium |
CN114398102A (en) * | 2022-01-18 | 2022-04-26 | 杭州米络星科技(集团)有限公司 | Application package generation method and device, compiling server and computer readable storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103473506A (en) * | 2013-08-30 | 2013-12-25 | 北京奇虎科技有限公司 | Method and device of recognizing malicious APK files |
CN107391223A (en) * | 2017-03-30 | 2017-11-24 | 阿里巴巴集团控股有限公司 | A kind of document handling method and device |
CN108595187A (en) * | 2018-03-27 | 2018-09-28 | 北京美好人生伙伴信息技术有限公司 | Method, device and the storage medium of Android installation kit integrated software development kit |
-
2018
- 2018-12-05 CN CN201811481866.3A patent/CN109783138A/en not_active Withdrawn
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103473506A (en) * | 2013-08-30 | 2013-12-25 | 北京奇虎科技有限公司 | Method and device of recognizing malicious APK files |
CN107391223A (en) * | 2017-03-30 | 2017-11-24 | 阿里巴巴集团控股有限公司 | A kind of document handling method and device |
CN108595187A (en) * | 2018-03-27 | 2018-09-28 | 北京美好人生伙伴信息技术有限公司 | Method, device and the storage medium of Android installation kit integrated software development kit |
Non-Patent Citations (1)
Title |
---|
GAVIN: "dexSplitter 项目简介", 《HTTPS://GITEE.COM/MIRRORS/DEXSPLITTER/》 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110795143A (en) * | 2019-10-22 | 2020-02-14 | 中国工商银行股份有限公司 | Method, apparatus, computing device, and medium for processing functional module |
CN110795143B (en) * | 2019-10-22 | 2023-11-07 | 中国工商银行股份有限公司 | Method, apparatus, computing device, and medium for processing functional modules |
CN111399858A (en) * | 2020-02-28 | 2020-07-10 | 平安科技(深圳)有限公司 | Android application package packaging method, equipment, storage medium and device |
CN111399858B (en) * | 2020-02-28 | 2024-04-02 | 平安科技(深圳)有限公司 | Android application package packaging method, equipment, storage medium and device |
CN113835718A (en) * | 2020-06-23 | 2021-12-24 | 北京字节跳动网络技术有限公司 | Android application package generation method and device, terminal device and medium |
CN113377415A (en) * | 2021-06-28 | 2021-09-10 | 郑州阿帕斯数云信息科技有限公司 | Application publishing method and device |
CN114398102A (en) * | 2022-01-18 | 2022-04-26 | 杭州米络星科技(集团)有限公司 | Application package generation method and device, compiling server and computer readable storage medium |
CN114398102B (en) * | 2022-01-18 | 2023-08-08 | 杭州米络星科技(集团)有限公司 | Application package generation method and device, compiling server and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109783138A (en) | Method for splitting, device, terminal and the medium that application package is constituted | |
CN110580147B (en) | Application program development method and device | |
CN110083806B (en) | Time-translation grammar for language translation | |
CN106293675B (en) | System static resource loading method and device | |
CN112015430A (en) | JavaScript code translation method and device, computer equipment and storage medium | |
US9552348B2 (en) | System and method for operating a computer application with spreadsheet functionality | |
CN107566090B (en) | Fixed-length/variable-length text message processing method and device | |
WO2020259417A1 (en) | Data analysis method and device for block chain | |
TW201308209A (en) | Runtime system | |
CN110019111B (en) | Data processing method, data processing device, storage medium and processor | |
CN109582948A (en) | The method and device that evaluated views extract | |
CN108241720B (en) | Data processing method, device and computer readable storage medium | |
CN110673856A (en) | Data processing method and device and machine-readable storage medium | |
CN111198772A (en) | Method and system for generating application program interface API | |
CN113835692A (en) | Dictionary data processing method and device, electronic equipment and computer storage medium | |
CN106776779B (en) | Method for generating entity file by JSON data based on Mac platform | |
Currier | Protocol buffers | |
CN115098062A (en) | Code generation method and device | |
CN107025233B (en) | Data feature processing method and device | |
US10198426B2 (en) | Method, system, and computer program product for dividing a term with appropriate granularity | |
CN106484375B (en) | Instruction block loading method, soft switch equipment and system | |
CN115293123A (en) | Document template generation method, report online generation method and device | |
WO2014094534A1 (en) | File development tool device and method based on file dictionary assembly | |
EP2535813A1 (en) | Method and device for generating an alert during an analysis of performance of a computer application | |
US9720660B2 (en) | Binary interface instrumentation |
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 | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20190521 |
|
WW01 | Invention patent application withdrawn after publication |