CN109597620A - A kind of data processing method, device, equipment and storage medium - Google Patents

A kind of data processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN109597620A
CN109597620A CN201810896882.2A CN201810896882A CN109597620A CN 109597620 A CN109597620 A CN 109597620A CN 201810896882 A CN201810896882 A CN 201810896882A CN 109597620 A CN109597620 A CN 109597620A
Authority
CN
China
Prior art keywords
data
code file
sound code
file
modification information
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
CN201810896882.2A
Other languages
Chinese (zh)
Other versions
CN109597620B (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 ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology 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 ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201810896882.2A priority Critical patent/CN109597620B/en
Publication of CN109597620A publication Critical patent/CN109597620A/en
Application granted granted Critical
Publication of CN109597620B publication Critical patent/CN109597620B/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/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the present disclosure discloses a kind of data processing method, device, equipment and storage medium, which comprises obtains and the associated data modification information of sound code file, wherein the sound code file is binary file;According to the data change type of the data modification information, generate and the matched data processor of data modification information;It calls the data processor to handle the sound code file, is formed and the matched new sound code file of the data modification information.The technical solution of the embodiment of the present disclosure is realized under the premise of not modifying other resources, and the modification packaging efficiency of installation kit is improved, to reinforce the versatility that installation kit modification is packaged.

Description

A kind of data processing method, device, equipment and storage medium
Technical field
The embodiment of the present disclosure be related to computer software application technical field more particularly to a kind of data processing method, device, Equipment and storage medium.
Background technique
For Android system, it is one that application is installed by APK (AndroidPackage, Android installation kit) Kind commonly applies seating means.It is installed by APK in application, can all exist in decompressing files after decompressing APK AndroidManifest.xml file.AndroidManifest.xml is a very important file in Android exploitation, Wherein record the permission stated to system and component etc..AndroidManifest.xml is compiled into compiling packing process Special binary format, and ciphertext, this format are referred to as AXML (Android Binary XML), can both reduce text Part volume, and IO (Input/Output, input/output) speed can be accelerated.
When needing that compiled APK is modified and repacked, the routine of existing modification AndroidManifest Thinking is inversely to compile, and is compiled back again after modification.This modification mode can not only waste the plenty of time, but also right AndroidManifest file can rely on related resource when compiling, to cause quoting resource problem.
Summary of the invention
The embodiment of the present disclosure provides a kind of data processing method, device, equipment and storage medium, and realization is not modifying other Under the premise of resource, the modification packaging efficiency of installation kit is improved, to reinforce the versatility that installation kit modification is packaged.
In a first aspect, the embodiment of the present disclosure provides a kind of data processing method, comprising:
It obtains and the associated data modification information of sound code file, wherein the sound code file is binary file;
According to the data change type of the data modification information, generate at the matched data of data modification information Manage program;
The data processor is called to handle the sound code file, formation is matched with the data modification information New sound code file.
Optionally, according to the data change type of the data modification information, generation is matched with the data modification information Data processor, comprising:
Obtain the data processing basis code for changing sound code file, wherein in the data processing basis code Including at least one and the matched white space of data change type;
In the data processing basis code, sky corresponding with the data change type of the data modification information is searched for White region;
It is corresponding in the white space to fill the data modification information, it is matched with generating with the data modification information Data processor.
Optionally, the sound code file includes: the AndroidManifest.xml configuration file based on android system;
Wherein, the AndroidManifest.xml configuration file include: head, character string area, resource identification area and XML file area.
Optionally, the data change type of the data modification information include: injected in the sound code file it is new Service;
It calls the data processor to handle the sound code file, is formed matched new with the data modification information Sound code file, comprising:
The data processor is called, the character string in the sound code file is written into the service name of the service Area, and record index value corresponding with the service;
Search and the associated root node of service in the XML file area of the sound code file;
Establish corresponding with service service node, and according to the corresponding index value of service and the service Attribute information, update the service node;
The service node is added to the child node of the root node in the XML file area, with formed with it is described The matched new sound code file of data modification information.
Optionally, the data change type of the data modification information includes: to repair the target class in the sound code file It is changed to new class name;
It calls the data processor to handle the sound code file, is formed matched new with the data modification information Sound code file, comprising:
Call the data processor, traversed in the XML file area of the sound code file each class node checks with The corresponding destination node of the target class, and the class name of the destination node found is revised as the new class name;
The matched index value of class name with the target class is obtained in the destination node;
Judge in the character string area of the sound code file whether to include the index value: if so, by character string Qu Zhongyu Described search is worth associated class name and is revised as the new class name;Otherwise, be written in the character string area index value with Corresponding relationship between the new class name.
Optionally, it is calling the data processor to handle the sound code file, is being formed and believed with data change Matched new sound code file is ceased, before, further includes:
Strategy is read according to first, the binary data in the sound code file is read in real time, and memory is written In;
If detecting the coding mode indication field read into the sound code file, referred to according to the coding mode Show that the field value of field determines the second reading strategy;
It reads strategy using described second to continue to read the content in the sound code file in real time, until will be described Content in sound code file is all written in memory;
It calls the data processor to handle the sound code file, is formed matched new with the data modification information Sound code file, specifically include:
The data processor is called to handle data content corresponding with the sound code file in memory, and will Treated, and data content is written back to file again, to be formed and the matched new sound code file of the data modification information.
Optionally, before acquisition with the associated data modification information of sound code file, further includes:
Original source code is compiled, raw data packets corresponding with the original source code are generated;
Processing is unziped it to the raw data packets, obtains decompression result, wherein is wrapped in the decompression result Include the sound code file;
It is calling the data processor to handle the sound code file, is being formed matched with the data modification information After new sound code file, further includes:
After replacing the sound code file in the decompression result using the new sound code file, to the decompression result It is repacked, is obtained and the matched new data packet of the data modification information.
Second aspect, the embodiment of the present disclosure additionally provide a kind of data processing equipment, comprising:
Data obtaining module, for obtaining and the associated data modification information of sound code file, wherein the sound code file is Binary file;
Program generating module generates and becomes with the data for the data change type according to the data modification information The data processor of more information matches;
File forms module, for calling the data processor to handle the sound code file, formation and institute State the matched new sound code file of data modification information.
Optionally, program generating module, specifically for obtaining the data processing basis code for changing sound code file, In, it include at least one and the matched white space of data change type in the data processing basis code;In the number According in processing foundation code, white space corresponding with the data change type of the data modification information is searched for;In the sky It is corresponding in white region to fill the data modification information, to generate and the matched data processor of data modification information.
Optionally, the sound code file includes: the AndroidManifest.xml configuration file based on android system; Wherein, the AndroidManifest.xml configuration file includes: head, character string area, resource identification area and XML file Area.
Optionally, the data change type of the data modification information include: injected in the sound code file it is new Service;File forms module, is specifically used for calling the data processor, and the source is written in the service name of the service Character string area in code file, and record index value corresponding with the service;It is searched in the XML file area of the sound code file Rope and the associated root node of service;Service node corresponding with the service is established, and according to corresponding with the service Index value and the attribute information of the service, update the service node;By the service node in the XML file area It is added to the child node of the root node, to be formed and the matched new sound code file of the data modification information.
Optionally, the data change type of the data modification information includes: to repair the target class in the sound code file It is changed to new class name;File forms module, is specifically used for calling the data processor, in the XML text of the sound code file Traverse each class node checks destination node corresponding with the target class in part area, and by the destination node found Class name is revised as the new class name;The matched index value of class name with the target class is obtained in the destination node;Sentence Whether include the index value: if so, by character string Qu Zhongyu described search value if breaking in the character string area of the sound code file Associated class name is revised as the new class name;Otherwise, the index value and the new class are written in the character string area Corresponding relationship between name.
Optionally, described device further include: Data write. module, for reading strategy according to first, to the source code text Binary data in part is read in real time, and is written in memory;Tactful determining module, if read for detecting to institute The coding mode indication field in sound code file is stated, then the second reading is determined according to the field value of the coding mode indication field Strategy;Content writing module continues to carry out in real time the content in the sound code file for reading strategy using described second It reads, until by the content in the sound code file all write-in memory;File forms module, is specifically used for calling the number Data content corresponding with the sound code file in memory is handled according to processing routine, and will treated data content weight It newly is written back to file, to be formed and the matched new sound code file of the data modification information.
Optionally, described device further include: data packet generation module, for being compiled to original source code, generate with The corresponding raw data packets of the original source code;Decompression module is obtained for unziping it processing to the raw data packets To decompression result, wherein include the sound code file in the decompression result;Data packing block, for described in use After new sound code file replaces the sound code file in the decompression result, the decompression result is repacked, is obtained To with the matched new data packet of the data modification information.
The third aspect, the embodiment of the present disclosure additionally provide a kind of computer equipment, and the computer equipment includes:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processing Device realizes data processing method provided by disclosure any embodiment.
Fourth aspect, the embodiment of the present disclosure additionally provide a kind of computer storage medium, are stored thereon with computer program, Data processing method provided by disclosure any embodiment is realized when the program is executed by processor.
The embodiment of the present disclosure is by acquisition and the associated data modification information of sound code file, according to the number of data modification information According to change type, generate and the matched data processor of data modification information;To call data processor to source code text Part is handled, formation and the matched new sound code file of data modification information, solves existing installation kit modification packing process Present in quoting resource with modification packaging efficiency it is low the problems such as, realize under the premise of not modifying other resources, improve installation The modification packaging efficiency of packet, to reinforce the versatility that installation kit modification is packaged.
Detailed description of the invention
Fig. 1 is a kind of flow chart for data processing method that the embodiment of the present disclosure one provides;
Fig. 2 is a kind of flow chart for data processing method that the embodiment of the present disclosure two provides;
Fig. 3 is a kind of flow chart for data processing method that the embodiment of the present disclosure three provides;
Fig. 4 is a kind of schematic diagram for data processing equipment that the embodiment of the present disclosure four provides;
Fig. 5 is a kind of structural schematic diagram for computer equipment that the embodiment of the present disclosure five provides.
Specific embodiment
The disclosure is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the disclosure, rather than the restriction to the disclosure.
It also should be noted that illustrate only part relevant to the disclosure for ease of description, in attached drawing rather than Full content.It should be mentioned that some exemplary embodiments are described before exemplary embodiment is discussed in greater detail At the processing or method described as flow chart.Although operations (or step) are described as the processing of sequence by flow chart, It is that many of these operations can be implemented concurrently, concomitantly or simultaneously.In addition, the sequence of operations can be by again It arranges.The processing can be terminated when its operations are completed, it is also possible to have the additional step being not included in attached drawing. The processing can correspond to method, function, regulation, subroutine, subprogram etc..
Embodiment one
Fig. 1 is a kind of flow chart for data processing method that the embodiment of the present disclosure one provides, and the present embodiment is applicable to repair Change the case where being packaged installation kit, this method can be executed by data processing equipment, which can be by software and/or hardware Mode can be generally integrated in computer equipment to realize.Correspondingly, as shown in Figure 1, this method includes following operation:
S110, acquisition and the associated data modification information of sound code file, wherein the sound code file is binary file.
Wherein, sound code file refers to the set of source code, and source code, which is then one group, may be implemented spy with certain sense Determine the character of function.In the embodiments of the present disclosure, sound code file can be the file formed by binary code.Data change letter Breath can be the modification information or demand of related data in sound code file, for example, data modification information can be to sound code file In specified data modify, alternatively, data modification information can also be in sound code file increase or delete service etc., appoint What can cause the information of change to can be used as data modification information to the data of sound code file, the embodiment of the present disclosure to this simultaneously It is not limited.
In the embodiments of the present disclosure, before modifying to the data in source file, it is necessary first to obtain and source code text The associated data modification information of part, to be modified according to data modification information to sound code file.
In an alternative embodiment of the disclosure, the sound code file may include: based on android system AndroidManifest.xml configuration file;Wherein, the AndroidManifest.xml configuration file includes: head, word The area Fu Chuan, resource identification area and XML (Extensible Markup Language, extensible markup language) file area.
Wherein, AndroidManifest.xml is necessary file in each Android program, positioned at the root mesh of entire APK Record describes the module information of exposure in APK.
In the embodiments of the present disclosure, optionally, sound code file can be based on android system AndroidManifest.xml configuration file.AndroidManifest.xml configuration file can substantially be drawn according to function division It is divided into four areas, i.e. head, character string area, resource identification area and XML file area, and introduces the concept of Chunk (block). Head mainly includes two fields, is magic number (0x00080003) and document size respectively, and two fields are four bytes.Word The area Fu Chuan mainly stores character string pond, and the character string in character string pond is exactly institute in AndroidManifest.xml configuration file Some character string informations, when multiple places use identical characters string, so that it may be multiplexed, to save space, accelerate IO speed. Character string area generallys use 4 byte-identifiers, such as Chunk Type, Chunk Size or String Count, then can divide The offset of each character string is not identified, to get the content in character string pond.Resource identification area mainly stores multiple The value of ResourceId (resource identification), structure is simple, and reading manner is also relatively easy.XML file area is The core of AndroidManifest.xml configuration file entirety.Contain NameSpace, Tag (label) relevant information with And whole XML tree shape hierarchy information etc..XML file area can be divided into Start Namespace Chunk and (start to name Space block), End Namespace Chunk (terminate NameSpace block), (the beginning label area Start Tag Chunk Block), End Tag Chunk (terminate label pad) and Text Chunk (text block).Wherein, comprising more in Namespace Include the attribute of a name and indefinite quantity in a Tag, each Tag, while may also include multiple lower layer Tag, thus shape At tree structure.And the root node Tag of entire AndroidManifest.xml configuration file is exactly manifest file. The data structure of AndroidManifest.xml configuration file uses the specific format of the prior art, and the embodiment of the present disclosure is no longer It is described in detail.
S120, according to the data change type of the data modification information, generate matched with the data modification information Data processor.
Wherein, data change type refers to the modification type of source file, such as modifies data, increases service or the service of deleting Deng.Data processor is for modifying to the data in sound code file, and independently of the program of sound code file.It needs Illustrate, data processor can be designed according to actual needs, and the embodiment of the present disclosure is not to data processor Particular content be defined.
In the embodiments of the present disclosure, it when modifying to the data in sound code file, does not need directly to sound code file In data searched and modified, but the modification to sound code file is automatically performed by a data processor.Data Processing routine can be generated according to the data change type of data modification information.It should be noted that a data processor The data modification that a plurality of types of sound code files can be completed for different data change types, can also be just for a type The data change type of type completes the data modification of sound code file.That is, a kind of data change type can correspond to and generate one kind Data processor can also generate a kind of data processor by a variety of data change types correspondence.
S130, it calls the data processor to handle the sound code file, is formed and believed with data change Cease matched new sound code file.
In the embodiments of the present disclosure, corresponding data processing journey is generated according to data change type and data modification information After sequence, the data processor of generation can be called to handle the data in sound code file.It should be noted that a source A data processor can be used in code file, also can be used multiple data processors, the embodiment of the present disclosure to this simultaneously It is not limited.Using data processor to the data processing in sound code file after, original sound code file is combined and is repaired Data information after changing is deformed into and the matched new sound code file of data modification information.
The embodiment of the present disclosure is by acquisition and the associated data modification information of sound code file, according to the number of data modification information According to change type, generate and the matched data processor of data modification information;To call data processor to source code text Part is handled, formation and the matched new sound code file of data modification information, solves existing installation kit modification packing process Present in quoting resource with modification packaging efficiency it is low the problems such as, realize under the premise of not modifying other resources, improve installation The modification packaging efficiency of packet, to reinforce the versatility that installation kit modification is packaged.
Embodiment two
Fig. 2 is a kind of flow chart for data processing method that the embodiment of the present disclosure two provides, and the present embodiment is with above-mentioned implementation It is embodied based on each optinal plan in example, in the present embodiment, gives the number according to the data modification information According to change type, generate the specific implementation with the matched data processor of data modification information, meanwhile, for The data change type for the new service injected in the sound code file gives and calls the data processor to the source Code file process, forms the specific implementation with the matched new sound code file of the data modification information.Correspondingly, as schemed Shown in 2, the method for the present embodiment may include:
S210, acquisition and the associated data modification information of sound code file, wherein the sound code file is binary file.
In an alternative embodiment of the disclosure, is obtaining with before the associated data modification information of sound code file, going back It may include: to be compiled to original source code, generate raw data packets corresponding with the original source code;To described original Data packet unzips it processing, obtains decompression result, wherein includes the sound code file in the decompression result.
Wherein, original source code can be using assembler language or high level language, for generating the generation of installation kit Coded program.Raw data packets are after the completion of original source code is write, by compilation run installation kit generated.
It in the embodiments of the present disclosure, can be to original installation kit corresponding original source generation when generating original installation kit Coded program is compiled, to obtain the original installation kit of compressed file form.Original installation kit can pass through decompression Mode related application is installed, may include sound code file in obtained root, i.e., and after original installation kit decompression AndroidManifest.xml configuration file.
S220, according to the data change type of the data modification information, generate matched with the data modification information Data processor.
Optionally, in one embodiment, S220 may include operations described below:
S221, data processing basis code for changing sound code file is obtained, wherein in the data processing basis generation It include at least one and the matched white space of data change type in code.
Wherein, data processing basis code can be the template file for carrying out data modification to sound code file.
In the embodiments of the present disclosure, data processing basis code have modification sound code file (namely AndroidManifest.xml configuration file) data basic function, in order to make data processor have preferably it is general Property, the basic function for modifying sound code file can be first editted in data processor, and in data processing basis generation Corresponding white space is set in code, for filling in corresponding data according to modification demand.
S222, in the data processing basis code, search and the data change type pair of the data modification information The white space answered.
S223, the corresponding filling data modification information in the white space, are believed with generating with data change Cease matched data processor.
Correspondingly, when needing to modify to sound code file, it is only necessary to the blank area in data processing basis code Domain part, which is filled in, needs data modification information to be changed.Then, operation data processing foundation code, which produces, meets change need The data processor asked.
Illustratively, it is assumed that data processing basis code includes the foundation code section of " android:name=" " ".The base Plinth code segment means the title that can modify corresponding application in AndroidManifest.xml configuration file.If needed The Apply Names in sound code file are modified, the title for needing to modify can be added directly in the foundation code section.Such as, It is added at the white space of the foundation code section data modification information " so-and-so is precious ", then it is corresponding in the data processor generated " android:name=" so-and-so is precious " " name modifications of application can be " so-and-so is precious " by data code section.
S230, it calls the data processor to handle the sound code file, is formed and believed with data change Cease matched new sound code file.
Wherein, the data change type of the data modification information can specifically include: inject in the sound code file New service.
Optionally, in one embodiment, S230 may include operations described below:
S231, the data processor is called, the word in the sound code file is written into the service name of the service The area Fu Chuan, and record index value corresponding with the service.
Specifically, if the data change type of data modification information is in AndroidManifest.xml configuration file The new service of middle injection directly the service name of newly-increased service can be then written by data processor Character string area in AndroidManifest.xml configuration file, while also needing to record the corresponding index value of newly-increased service.
S232, search and the associated root node of service in the XML file area of the sound code file.
Correspondingly, after completing data processing to the character string area of AndroidManifest.xml configuration file, it is also necessary to Search and the newly-increased associated root node of service in the corresponding XML file area of AndroidManifest.xml configuration file.
S233, service node corresponding with the service is established, and according to index value corresponding with the service and institute The attribute information for stating service updates the service node.
Meanwhile newly-increased service needs to configure corresponding node in AndroidManifest.xml configuration file, therefore, The corresponding service node of newly-increased service is established in AndroidManifest.xml configuration file, and according to newly-increased service pair The contents such as the index value and relevant attribute information answered are updated newly-increased service node.
S234, the child node that the service node is added to the root node in the XML file area, with formed with The matched new sound code file of data modification information.
Finally, it is also necessary to establish between newly-increased service node and AndroidManifest.xml configuration file root node Connection.Specifically, newly-increased service node can be added in the XML file area of AndroidManifest.xml configuration file It ultimately forms so that the newly-increased service node of foundation and root node directly contact for the child node of root node and data changes and believe Cease matched new AndroidManifest.xml configuration file.
The embodiment of the present disclosure is by acquisition and the associated data modification information of sound code file, according to the number of data modification information According to change type: the new service injected in sound code file generates and its matched data processor of data modification information; To call data processor to handle sound code file, formation and the matched new sound code file of data modification information, Solves the problems such as quoting resource present in existing installation kit modification packing process is low with modification packaging efficiency, realization is not being repaired Under the premise of changing other resources, the modification packaging efficiency of installation kit is improved, to reinforce the versatility that installation kit modification is packaged.
Embodiment three
Fig. 3 is a kind of flow chart for data processing method that the embodiment of the present disclosure three provides, and the present embodiment is with above-mentioned implementation It is embodied based on each optinal plan in example, in the present embodiment, is repaired for by the target class in the sound code file It is changed to the data change type of new class name, gives and the data processor is called to handle the sound code file, is formed With the specific implementation of the matched new sound code file of the data modification information.Correspondingly, as shown in figure 3, the present embodiment Method may include:
S310, acquisition and the associated data modification information of sound code file, wherein the sound code file is binary file.
S320, according to the data change type of the data modification information, generate matched with the data modification information Data processor.
Optionally, in one embodiment, S320 may include operations described below:
S321, data processing basis code for changing sound code file is obtained, wherein in the data processing basis generation It include at least one and the matched white space of data change type in code.
S322, in the data processing basis code, search and the data change type pair of the data modification information The white space answered.
S323, the corresponding filling data modification information in the white space, are believed with generating with data change Cease matched data processor.
S330, it calls the data processor to handle the sound code file, is formed and believed with data change Cease matched new sound code file.
Wherein, the data change type of the data modification information can specifically include: by the mesh in the sound code file Mark class is revised as new class name.
Optionally, in one embodiment, S330 may include operations described below:
S331, the data processor is called, each class node is traversed in the XML file area of the sound code file and is looked into Destination node corresponding with the target class is looked for, and the class name of the destination node found is revised as the new class Name.
Wherein, target class can be the class for needing to carry out relevant data modifications present in XML file area.
Specifically, if the data change type of data modification information is by AndroidManifest.xml configuration file In target class be revised as new class name, can first in AndroidManifest.xml configuration file XML file area carry out Modification, then traces back in character string area again and modifies.When modifying XML file area, the data processor can be called Each class node checks mesh corresponding with target class is traversed in the XML file area of AndroidManifest.xml configuration file Node is marked, and the class name of the destination node found is directly revised as to new class name.
S332, it is obtained and the matched index value of class name of the target class in the destination node.
Likewise, being also required to obtain the matched index value of class name with target class in destination node when modification class name.
S333, judge in the character string area of the sound code file whether to include the index value: if so, executing S334; Otherwise, S335 is executed.
S334, it character string Qu Zhongyu described search is worth associated class name is revised as the new class name.
S335, in the corresponding relationship being written in the character string area between the index value and the new class name.
Finally, need to judge in the character string area of AndroidManifest.xml configuration file whether include and target class The matched index value of class name.If including and target class in the character string area of AndroidManifest.xml configuration file The associated class name of character string Qu Zhongyu search value is then revised as new class name by the matched index value of class name;Otherwise, in character string Write-in and the corresponding relationship between the matched index value of class name and new class name of target class in area, to establish index value and class The direct connection of name.
In an alternative embodiment of the disclosure, the data processor is being called to handle the sound code file, Being formed with the matched new sound code file of the data modification information can also include: before to read strategy according to first, right Binary data in the sound code file is read in real time, and is written in memory;If detecting reading to the source code Coding mode indication field in file then determines the second reading strategy according to the field value of the coding mode indication field; It reads strategy using described second to continue to read the content in the sound code file in real time, until by the sound code file In content all write-in memories in.Correspondingly, the data processor is called to handle the sound code file, formation and institute State the matched new sound code file of data modification information, can specifically include: call the data processor in memory with The corresponding data content of the sound code file is handled, and will treated that data content is written back to file again, to be formed With the matched new sound code file of the data modification information.
Wherein, the first reading strategy can be any type of reading strategy, read 2 bytes or 4 bytes such as primary.The Two, which read strategy, can be for targetedly reading strategy set by the coding mode in sound code file.For example, if source Coding mode indication field instruction sound code file in code file uses ASCII (American Standard Code for Information Interchange, USA standard code for information interchange) mode, due to ASCII character be 7 coding, then may be used To be set as the second reading strategy to read 7 bytes every time.
In the embodiments of the present disclosure, sound code file can be written in memory first, and calls data processor internal Data content processing corresponding with sound code file in depositing.After the completion of processing, then by treated data content stored in memory Again it is written back to sound code file, to be formed and the matched new sound code file of data modification information.That is, in modification source code text When data in part, is not modified directly on sound code file, but the key data in sound code file can be copied into memory In modify.It should be noted that since different sound code files can use different coding modes, if to all Sound code file is all made of same data reading mode, when data reading mode and coding mode mismatch, will cause reading The wrong problem of content.Therefore, it for the sound code file of different coding mode, needs to use corresponding reading data strategy, with Avoid the problem that reading data is wrong.
Specifically, can be read first using first in binary data and the write-in that strategy is read in real time in sound code file In depositing.Because can all have the corresponding indication field of coding mode in sound code file, and in the corresponding instruction word of coding mode Content before section is some inessential contents, and biggish shadow will not be caused to sound code file reading data error It rings.It is therefore possible to use first reads tactful reading data in real-time to detect coding mode indication field.It is encoded when detecting After mode indication field, it can determine that matched second reads strategy according to the field value in coding mode indication field.Make Strategy is read with second to continue to read the remaining content in sound code file in real time, and the content read is written in memory.
In an alternative embodiment of the disclosure, the data processor is being called to handle the sound code file, It can also include: to use the new sound code file after formation and the matched new sound code file of the data modification information After replacing the sound code file in the decompression result, the decompression result is repacked, is obtained and the data The matched new data packet of modification information.
Correspondingly, data processor can be called to handle the data content of the sound code file in write-in memory, And data content is written back to file again by treated, to be formed and the matched new sound code file of data modification information.
The embodiment of the present disclosure is by acquisition and the associated data modification information of sound code file, according to the number of data modification information According to change type: the target class in sound code file being revised as to new class name, is generated and its matched data of data modification information Processing routine;To calling data processor to handle sound code file, formed matched new with data modification information Sound code file solves the problems such as quoting resource present in existing installation kit modification packing process is low with modification packaging efficiency, It realizes under the premise of not modifying other resources, improves the modification packaging efficiency of installation kit, be packaged to reinforce installation kit modification Versatility.
It should be noted that the arbitrary arrangement combination in the above various embodiments between each technical characteristic also belongs to the disclosure Protection scope.
Example IV
Fig. 4 is a kind of schematic diagram for data processing equipment that the embodiment of the present disclosure four provides, as shown in figure 4, described device It include: that data obtaining module 410, program generating module 420 and file form module 430, in which:
Data obtaining module 410, for obtaining and the associated data modification information of sound code file, wherein the source code text Part is binary file;
Program generating module 420 generates and the data for the data change type according to the data modification information The matched data processor of modification information;
File forms module 430, for calling the data processor to handle the sound code file, formed with The matched new sound code file of data modification information.
The embodiment of the present disclosure is by acquisition and the associated data modification information of sound code file, according to the number of data modification information According to change type, generate and the matched data processor of data modification information;To call data processor to source code text Part is handled, formation and the matched new sound code file of data modification information, solves existing installation kit modification packing process Present in quoting resource with modification packaging efficiency it is low the problems such as, realize under the premise of not modifying other resources, improve installation The modification packaging efficiency of packet, to reinforce the versatility that installation kit modification is packaged.
Optionally, program generating module 420, specifically for obtaining the data processing basis generation for changing sound code file Code, wherein include at least one and the matched white space of data change type in the data processing basis code;Institute It states in data processing basis code, searches for white space corresponding with the data change type of the data modification information;Institute The corresponding filling data modification information in white space is stated, to generate and the matched data processing journey of the data modification information Sequence.
Optionally, the sound code file includes: the AndroidManifest.xml configuration file based on android system; Wherein, the AndroidManifest.xml configuration file includes: head, character string area, resource identification area and XML file Area.
Optionally, the data change type of the data modification information include: injected in the sound code file it is new Service;File forms module 430, is specifically used for calling the data processor, and institute is written in the service name of the service The character string area in sound code file is stated, and records index value corresponding with the service;In the XML file area of the sound code file Middle search and the associated root node of service;It establishes corresponding with service service node, and is serviced pair according to described The attribute information of the index value and the service answered, updates the service node;By the service in the XML file area Node is added to the child node of the root node, to be formed and the matched new sound code file of the data modification information.
Optionally, the data change type of the data modification information includes: to repair the target class in the sound code file It is changed to new class name;File forms module 430, is specifically used for calling the data processor, in the XML of the sound code file Each class node checks destination node corresponding with the target class, and the destination node that will be found are traversed in file area Class name be revised as the new class name;The matched index value of class name with the target class is obtained in the destination node; Judge in the character string area of the sound code file whether to include the index value: if so, by character string Qu Zhongyu described search It is worth associated class name and is revised as the new class name;Otherwise, the index value and described new is written in the character string area Corresponding relationship between class name.
Optionally, described device further include: Data write. module, for reading strategy according to first, to the source code text Binary data in part is read in real time, and is written in memory;Tactful determining module, if read for detecting to institute The coding mode indication field in sound code file is stated, then the second reading is determined according to the field value of the coding mode indication field Strategy;Content writing module continues to carry out in real time the content in the sound code file for reading strategy using described second It reads, until by the content in the sound code file all write-in memory;File forms module 430, is specifically used for calling institute It states data processor to handle data content corresponding with the sound code file in memory, and will be in treated data Bulk density is newly written back to file, to be formed and the matched new sound code file of the data modification information.
Optionally, described device further include: data packet generation module, for being compiled to original source code, generate with The corresponding raw data packets of the original source code;Decompression module is obtained for unziping it processing to the raw data packets To decompression result, wherein include the sound code file in the decompression result;Data packing block, for described in use After new sound code file replaces the sound code file in the decompression result, the decompression result is repacked, is obtained To with the matched new data packet of the data modification information.
Data processing method provided by disclosure any embodiment can be performed in above-mentioned data processing equipment, has the side of execution The corresponding functional module of method and beneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to the disclosure is any The data processing method that embodiment provides.
Embodiment five
Fig. 5 is the hardware structural diagram for illustrating the computer equipment according to the embodiment of the present disclosure.Computer equipment can be with Implement in a variety of manners, the computer equipment in the disclosure can include but is not limited to such as mobile phone, smart phone, pen Remember that this computer, digit broadcasting receiver, PDA (personal digital assistant), PAD (tablet computer), PMP (put by portable multimedia broadcasting Device), navigation device, vehicle-mounted terminal equipment, vehicle-mounted display terminal, vehicle electronics rearview mirror etc. mobile computer device and Such as fixed computer equipment of number TV, desktop computer etc..
As shown in figure 5, computer equipment 0 may include wireless communication unit 51, A/V (audio/video) input unit 52, User input unit 53, sensing unit 54, output unit 55, memory 56, interface unit 57, processor 58 and power supply unit 59 Etc..Fig. 5 shows the computer equipment 0 with various assemblies, it should be understood that being not required for implementing all show Component.More or fewer components can alternatively be implemented.
Wherein, wireless communication unit 51 allows the radio between computer equipment 0 and wireless communication system or network logical Letter.A/V input unit 52 is for receiving audio or video signal.The order that user input unit 53 can be inputted according to user is raw The various operations of computer equipment 0 are controlled at key input data.The current state of the detection computer equipment 0 of sensing unit 54, The position of computer equipment 0, user for the presence or absence of touch input of computer equipment 0, computer equipment 0 orientation, calculate The acceleration or deceleration movement of machine equipment 0 and direction etc., and generate order or the letter for controlling the operation of computer equipment 0 Number.Interface unit 57 be used as at least one external device (ED) connect with computer equipment 0 can by interface.55 quilt of output unit It is configured to provide output signal with vision, audio and/or tactile manner.Memory 56, which can store, to be executed by processor 58 The software program etc. of reason and control operation, or can temporarily store oneself data through exporting or will export.Memory 56 may include the storage medium of at least one type.Moreover, computer equipment 0 can execute memory with by network connection The network storage device of 56 store function cooperates.The overall operation of the usually control computer equipment 0 of processor 58.In addition, place Reason device 58 may include for reproducing or the multi-media module of multimedia playback data.Processor 58 can be with execution pattern identification at The handwriting input executed on the touchscreen or picture are drawn input and are identified as character or image by reason.Power supply unit 59 exists Electricity appropriate needed for receiving external power or internal power under the control of processor 58 and each element of operation and component being provided Power.
The program that processor 58 is stored in memory 56 by operation, at various function application and data Reason, such as realize a kind of data processing method provided by the embodiment of the present disclosure, comprising:
It obtains and the associated data modification information of sound code file, wherein the sound code file is binary file;
According to the data change type of the data modification information, generate at the matched data of data modification information Manage program;
The data processor is called to handle the sound code file, formation is matched with the data modification information New sound code file.
Embodiment six
The embodiment of the present disclosure six also provides a kind of computer storage medium for storing computer program, the computer program When being executed by computer processor for executing any data processing method of disclosure above-described embodiment: acquisition and source The data modification information of code file association, wherein the sound code file is binary file;According to the data modification information Data change type generates and the matched data processor of data modification information;Call the data processor pair The sound code file is handled, and is formed and the matched new sound code file of the data modification information.
The computer storage medium of the embodiment of the present disclosure, can be using any of one or more computer-readable media Combination.Computer-readable medium can be computer-readable signal media or computer readable storage medium.It is computer-readable Storage medium for example may be-but not limited to-the system of electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, device or Device, or any above combination.The more specific example (non exhaustive list) of computer readable storage medium includes: tool There are electrical connection, the portable computer diskette, hard disk, random access memory (RAM), read-only memory of one or more conducting wires (Read Only Memory, ROM), erasable programmable read only memory ((Erasable Programmable Read Only Memory, EPROM) or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic Memory device or above-mentioned any appropriate combination.In this document, computer readable storage medium, which can be, any includes Or the tangible medium of storage program, which can be commanded execution system, device or device use or in connection make With.
Computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.
The program code for including on computer-readable medium can transmit with any suitable medium, including --- but it is unlimited In wireless, electric wire, optical cable, radio frequency (Radio Frequency, RF) etc. or above-mentioned any appropriate combination.
Can with one or more programming languages or combinations thereof come write for execute the disclosure operation computer Program code, described program design language include object oriented program language-such as Java, Smalltalk, C++, Further include conventional procedural programming language --- such as " C " language or similar programming language.Program code can Fully to execute, partly execute on the user computer on the user computer, be executed as an independent software package, Part executes on the remote computer or executes on a remote computer or server completely on the user computer for part. In situations involving remote computers, remote computer can pass through the network of any kind --- including local area network (LAN) Or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as utilize Internet service Provider is connected by internet).
Note that above are only the preferred embodiment and institute's application technology principle of the disclosure.It will be appreciated by those skilled in the art that The present disclosure is not limited to specific embodiments described here, be able to carry out for a person skilled in the art it is various it is apparent variation, The protection scope readjusted and substituted without departing from the disclosure.Therefore, although being carried out by above embodiments to the disclosure It is described in further detail, but the disclosure is not limited only to above embodiments, in the case where not departing from disclosure design, also It may include more other equivalent embodiments, and the scope of the present disclosure is determined by the scope of the appended claims.

Claims (10)

1. a kind of data processing method characterized by comprising
It obtains and the associated data modification information of sound code file, wherein the sound code file is binary file;
According to the data change type of the data modification information, generate and the matched data processing journey of the data modification information Sequence;
It calls the data processor to handle the sound code file, is formed matched new with the data modification information Sound code file.
2. the method according to claim 1, wherein according to the data change type of the data modification information, It generates and the matched data processor of data modification information, comprising:
Obtain the data processing basis code for changing sound code file, wherein include in the data processing basis code At least one and the matched white space of data change type;
In the data processing basis code, blank area corresponding with the data change type of the data modification information is searched for Domain;
It is corresponding in the white space to fill the data modification information, to generate and the matched number of data modification information According to processing routine.
3. the method according to claim 1, wherein the sound code file includes: based on android system AndroidManifest.xml configuration file;
Wherein, the AndroidManifest.xml configuration file includes: head, character string area, resource identification area and XML File area.
4. according to the method described in claim 3, it is characterized in that, the data change type of the data modification information includes: The new service injected in the sound code file;
It calls the data processor to handle the sound code file, is formed and the matched new source of the data modification information Code file, comprising:
The data processor is called, the character string area in the sound code file is written into the service name of the service, and Record index value corresponding with the service;
Search and the associated root node of service in the XML file area of the sound code file;
Establish corresponding with service service node, and according to the category of the corresponding index value of service and the service Property information, updates the service node;
The service node is added to the child node of the root node in the XML file area, to be formed and the data The matched new sound code file of modification information.
5. according to the method described in claim 3, it is characterized in that, the data change type of the data modification information includes: Target class in the sound code file is revised as to new class name;
It calls the data processor to handle the sound code file, is formed and the matched new source of the data modification information Code file, comprising:
Call the data processor, traversed in the XML file area of the sound code file each class node checks with it is described The corresponding destination node of target class, and the class name of the destination node found is revised as the new class name;
The matched index value of class name with the target class is obtained in the destination node;
Judge in the character string area of the sound code file whether to include the index value: if so, by character string area with it is described The associated class name of search value is revised as the new class name;Otherwise, be written in the character string area index value with it is described Corresponding relationship between new class name.
6. method according to claim 1-5, which is characterized in that in the calling data processor to described Sound code file processing, formation and the matched new sound code file of the data modification information, before, further includes:
Strategy is read according to first, the binary data in the sound code file is read in real time, and is written in memory;
If detecting the coding mode indication field read into the sound code file, word is indicated according to the coding mode The field value of section determines the second reading strategy;
It reads strategy using described second to continue to read the content in the sound code file in real time, until by the source code Content in file is all written in memory;
It calls the data processor to handle the sound code file, is formed and the matched new source of the data modification information Code file, specifically includes:
The data processor is called to handle data content corresponding with the sound code file in memory, and will processing Data content afterwards is written back to file again, to be formed and the matched new sound code file of the data modification information.
7. method according to claim 1-5, which is characterized in that become obtaining with the associated data of sound code file Before more information, further includes:
Original source code is compiled, raw data packets corresponding with the original source code are generated;
Processing is unziped it to the raw data packets, obtains decompression result, wherein includes institute in the decompression result State sound code file;
It is calling the data processor handle sound code file, is being formed matched newly with the data modification information After sound code file, further includes:
After replacing the sound code file in the decompression result using the new sound code file, the decompression result is carried out It repacks, obtains and the matched new data packet of the data modification information.
8. a kind of data processing equipment characterized by comprising
Data obtaining module, for obtain with the associated data modification information of sound code file, wherein the sound code file be two into File processed;
Program generating module generates and believes with data change for the data change type according to the data modification information Cease matched data processor;
File forms module, for calling the data processor to handle the sound code file, is formed and the number According to the matched new sound code file of modification information.
9. a kind of computer equipment, which is characterized in that the equipment includes:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real The now data processing method as described in any in claim 1-7.
10. a kind of computer storage medium, is stored thereon with computer program, which is characterized in that the program is executed by processor Data processing method of the Shi Shixian as described in any in claim 1-7.
CN201810896882.2A 2018-08-08 2018-08-08 Data processing method, device, equipment and storage medium Active CN109597620B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810896882.2A CN109597620B (en) 2018-08-08 2018-08-08 Data processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810896882.2A CN109597620B (en) 2018-08-08 2018-08-08 Data processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109597620A true CN109597620A (en) 2019-04-09
CN109597620B CN109597620B (en) 2022-04-01

Family

ID=65956788

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810896882.2A Active CN109597620B (en) 2018-08-08 2018-08-08 Data processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109597620B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457021A (en) * 2019-07-12 2019-11-15 招商局金融科技有限公司 Achievement data processing method, device and computer readable storage medium
CN113515269A (en) * 2021-09-13 2021-10-19 腾讯科技(深圳)有限公司 Application package processing method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462959A (en) * 2014-12-04 2015-03-25 北京奇虎科技有限公司 Reinforcement protection method, sever and system for android app
CN105354485A (en) * 2015-10-13 2016-02-24 四川携创信息技术服务有限公司 Data processing method for portable device
CN106055334A (en) * 2016-06-01 2016-10-26 努比亚技术有限公司 Code management system and method
US20180081784A1 (en) * 2016-09-22 2018-03-22 Microsoft Technology Licensing, Llc Method and system for managing code

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462959A (en) * 2014-12-04 2015-03-25 北京奇虎科技有限公司 Reinforcement protection method, sever and system for android app
CN105354485A (en) * 2015-10-13 2016-02-24 四川携创信息技术服务有限公司 Data processing method for portable device
CN106055334A (en) * 2016-06-01 2016-10-26 努比亚技术有限公司 Code management system and method
US20180081784A1 (en) * 2016-09-22 2018-03-22 Microsoft Technology Licensing, Llc Method and system for managing code

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457021A (en) * 2019-07-12 2019-11-15 招商局金融科技有限公司 Achievement data processing method, device and computer readable storage medium
CN113515269A (en) * 2021-09-13 2021-10-19 腾讯科技(深圳)有限公司 Application package processing method and device, computer equipment and storage medium
CN113515269B (en) * 2021-09-13 2021-12-31 腾讯科技(深圳)有限公司 Application package processing method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN109597620B (en) 2022-04-01

Similar Documents

Publication Publication Date Title
CN110825362B (en) Low-code application software development system and method
WO2020119485A1 (en) Page display method and device, apparatus, and storage medium
CN109902255B (en) Page mixed browsing record generation method, device, equipment and storage medium
CN106293664A (en) Code generating method and device
CN113126990B (en) Page development method, device, equipment and storage medium
US20070178968A1 (en) Displaying game asset relationship in a game development environment
CN112560100B (en) Data desensitizing method and device, computer readable storage medium and electronic equipment
CN103927385A (en) Unifying method and device of data model
US6714946B1 (en) Data management system using a plurality of data operating modules
CN113778419B (en) Method and device for generating multimedia data, readable medium and electronic equipment
CN109726217A (en) A kind of database operation method, device, equipment and storage medium
CN109284281A (en) Method and apparatus for migrating data
CN109597620A (en) A kind of data processing method, device, equipment and storage medium
CN111124379A (en) Page generation method and device, electronic equipment and storage medium
CN106293770A (en) The general of a kind of table data leads table system and method
WO2022184077A1 (en) Document editing method and apparatus, and terminal and non-transitory storage medium
CN107391529A (en) A kind of method and device for realizing Object Relation Mapping ORM
US7730388B2 (en) Converting an enhanced metafile into a chronologically independent object property list for conversion into a PDF document
CN102193789B (en) Method and equipment for realizing configurable skip link
CN101000621A (en) Interdynamic access method and tool of IMS data base
CA3203549A1 (en) Unified verification method, device, equipment and storage medium
CN109101429A (en) A kind of method and device of the browser page debugging of set-top box
CN112328841B (en) Document processing method and device, electronic equipment and storage medium
CN110221827B (en) Data processing method and related device
JP4971096B2 (en) Coding support device

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