CN111240738B - File processing method, device, equipment and medium - Google Patents

File processing method, device, equipment and medium Download PDF

Info

Publication number
CN111240738B
CN111240738B CN202010065717.XA CN202010065717A CN111240738B CN 111240738 B CN111240738 B CN 111240738B CN 202010065717 A CN202010065717 A CN 202010065717A CN 111240738 B CN111240738 B CN 111240738B
Authority
CN
China
Prior art keywords
file
files
class
executable
calling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010065717.XA
Other languages
Chinese (zh)
Other versions
CN111240738A (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 Youzhuju Network Technology Co Ltd
Original Assignee
Beijing Youzhuju 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 Youzhuju Network Technology Co Ltd filed Critical Beijing Youzhuju Network Technology Co Ltd
Priority to CN202010065717.XA priority Critical patent/CN111240738B/en
Publication of CN111240738A publication Critical patent/CN111240738A/en
Application granted granted Critical
Publication of CN111240738B publication Critical patent/CN111240738B/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/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the disclosure discloses a file processing method, device, equipment and medium. The method comprises the following steps: determining calling information of at least two class files in an executable file of an application installation file; reconfiguring storage information between class files in the at least two class files and the executable files according to calling information of the at least two class files to obtain new executable files; and repackaging the new executable file to generate a new application installation file. By adopting the scheme, the storage positions of the class files with the calling relationship can be adjusted, and function definitions and function calls of the same functions in different executable files are integrated into the same executable file, so that the size of the application installation file is reduced.

Description

File processing method, device, equipment and medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a file processing method, a device, equipment and a medium.
Background
At present, terminal application programs all exist in the form of application installation files, and the application installation files mainly comprise code file parts and resource file parts. After the Android project or ios project is developed, the Android project or ios project can be packaged into a corresponding application installation file, and downloading and running are performed.
However, the application functions of the application installation file are continuously updated and continuously enriched, and as the code files and the resource files in the application installation file are continuously updated, the redundant information in the code files and the resource files is correspondingly increased, so that the volume of the application installation file is increased. Therefore, the application installation file with larger volume not only needs larger storage space, but also needs to consume more flow and transmission time to download the application installation file when the user upgrades the application program, thereby affecting the retention rate of the application installation file for the user.
Disclosure of Invention
The embodiment of the disclosure provides a file processing method, device, equipment and medium, so as to reduce the volume of an application installation file and reduce the file transmission time and transmission flow when downloading the application installation file.
In a first aspect, an embodiment of the present disclosure provides a file processing method, including:
determining calling information of at least two class files in an executable file of an application installation file;
reconfiguring storage information between class files in the at least two class files and the executable files according to calling information of the at least two class files to obtain new executable files;
And repackaging the new executable file to generate a new application installation file.
In a second aspect, an embodiment of the present disclosure further provides a file processing apparatus, including:
the calling information determining module is used for determining calling information of at least two class files in the executable files of the application installation file;
the storage information configuration module is used for reconfiguring storage information between class files in the at least two class files and the executable files according to calling information of the at least two class files to obtain new executable files;
and the file packaging generating module is used for repackaging the new executable file to generate a new application installation file.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, including:
one or more processing devices;
a storage means for storing one or more programs;
when the one or more programs are executed by the one or more processing devices, the one or more processing devices are caused to implement a file processing method as provided in any embodiment of the present disclosure.
In a fourth aspect, there is also provided in an embodiment of the present disclosure a computer readable medium having stored thereon a computer program which, when executed by a processing device, implements a file processing method as provided in any embodiment of the present disclosure.
The embodiment of the disclosure provides a file processing scheme, wherein a plurality of class files are stored in a plurality of executable files of an application installation file, the storage relationship between each class file and the executable file is reconfigured by determining the calling relationship between each class file, and the class files with the calling relationship are stored in the same executable file, so that at least one new executable file is obtained, and the new executable file can be repackaged to obtain a new application installation file. By adopting the scheme, the storage positions of the class files with the calling relationship can be adjusted, and function definitions and function calls of the same functions in different executable files are integrated into the same executable file, so that the size of the application installation file is reduced.
The foregoing disclosure is merely an overview of the technical solutions of the present disclosure, and may be implemented according to the content of the specification in order to make the technical means of the present disclosure more clearly understood, and in order to make the above and other objects, features and advantages of the present disclosure more clearly understood, the following specific embodiments of the present disclosure are specifically described.
Drawings
Other features, objects and advantages of the present disclosure will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale. In the drawings:
FIG. 1 illustrates a flow chart of a method of file processing provided in an embodiment of the present disclosure;
FIG. 2 illustrates a flow chart of another file processing method provided in an embodiment of the present disclosure;
FIG. 3 illustrates a flow chart of yet another file processing method provided in an embodiment of the present disclosure;
FIG. 4 shows a block diagram of a file processing apparatus provided in an embodiment of the present disclosure;
fig. 5 shows a block diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "comprising" and variations thereof as used in this disclosure are open ended terms that include, but are not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Fig. 1 shows a flowchart of a file processing method provided in an embodiment of the present disclosure, which may be applicable to a case of optimizing a volume of an application installation file. The method may be performed by a file processing device, which may be implemented in software and/or hardware, which may be configured in an electronic device having network communication functionality. The electronic device may be a terminal device or a server.
As shown in fig. 1, the file processing method provided in the embodiment of the present disclosure includes the following steps:
s110, determining calling information of at least two class files in the executable files of the application installation file.
In this embodiment, the application installation file may be an Android application installation package APK in an APK form applicable to the Android system; alternatively, a software installation package supporting the IOS system may be provided; or, a software installation package supporting other operating systems, is not limited thereto. The application installation file may include a plurality of executable files, and each executable file may store one or more class files. The class file is a corresponding function method, and the function method is divided into a method id and a specific implementation. Because the relation between the call and the called function method exists, the call relation also exists between class files containing the function method, and therefore the call information of at least two class files in the executable files of the application installation file can be determined.
Illustratively, taking android application installation package APK as an example, the application installation file may be essentially a compressed file in ZIP format, except that the suffix name of the file is "APK". The executable file is a dex file in an android application installation file APK, and the class file is a class file.
S120, reconfiguring storage information between class files and executable files in at least two class files according to calling information of the at least two class files to obtain new executable files.
In this embodiment, there is a problem in developing multiple executable files in the completed and packaged application installation file, for example, executable file 1 and executable file 2, the definition of function a is in executable file 2, and the call of function a is in executable file 1. At this time, the function a may keep two copies in the executable file 1 and the executable file 2, resulting in an increase in the volume of the application installation file.
In the following description, an Android application installation package APK is taken as an example to illustrate that an APK generated by packing an Android system includes a plurality of dex files, wherein a Class B in a dex2 file stores a specific implementation of a function method f (), and a Class a in a dex1 file invokes the function method f (), of the Class B. The dex1 file would be redundant to store the information of Class B and the method id of function method f (). On the basis, when the dex1 file needs to call the function method f (), searching is carried out according to Class information of the Class B and the method id of the function method f (), the Class B is found in the dex2 file firstly, and then the specific implementation of the function method f () in the Class B is found. It can be seen that the dex1 file would save Class information of Class B and method id of function method f () in excess, whereas such dex file is not in minority in APK, resulting in an increase of APK volume.
Based on the above, it can be seen that if two class files having a calling relationship are respectively stored in different executable files, it may be caused that additional storage of class information of the called class file and method ids of function methods in the called class file is required in the class files for performing the calling operation, and these additionally stored class information and method ids belong to redundant information. Considering that the number of class files with calling relations in the application installation files is not small, and corresponding redundant information is stored in each class file, the gradual accumulation can cause the volume of the application installation files to be increased. Therefore, the storage information between each class file of the at least two class files and the corresponding executable file can be reconfigured according to the calling information of the at least two class files corresponding to the executable file of the application installation file, so that the class files with calling relation can be stored in the same executable file as much as possible, and one or more new executable files can be obtained after the reconfiguration is performed on each class file.
S130, repackaging the new executable file to generate a new application installation file.
In this embodiment, the application installation file generally includes an executable file and a resource file, and a new executable file is obtained after the original executable file in the application installation file is optimized. And further, repackaging the new executable file and the original resource file to form a new application installation file. Class files with calling relations in the new application installation file are stored in the same executable file, but different groups of class files with calling relations stored in one executable file can not have calling relations.
In this embodiment, optionally, a storage mapping relationship between an executable file and a class file in the original application installation file is saved in the new application installation file, so as to restore a new executable file in the new application installation file according to the mapping relationship. Optionally, the resource file may include at least one of: text strings, colors, arrays, animations, layouts, images and icons, audio video, and of course other types of resource files, without limitation.
The embodiment of the disclosure provides a file processing scheme, wherein a plurality of class files are stored in a plurality of executable files of an application installation file, the storage relationship between each class file and the executable file is reconfigured by determining the calling relationship between each class file, and the class files with the calling relationship are stored in the same executable file. By adopting the technical scheme, after two class files with calling relations are stored in the same executable file, only one class information and method id need to be stored in the two class files instead of the two class information and method ids. For example, since the function a is used in the dex1 file, the definition and the specific implementation of the function a are both placed in the dex1 file, so that the corresponding function copy information is not reserved in the dex2 file, and the APK packet volume is reduced.
Fig. 2 illustrates a flow chart of another method of file processing provided in an embodiment of the present disclosure, which is further optimized based on the above embodiments, which may be combined with various alternatives in one or more of the embodiments described above. As shown in fig. 2, the file processing method provided in the embodiment of the present disclosure includes the following steps:
s210, acquiring at least two corresponding class files from at least two executable files of the application installation files generated by first packaging.
In this embodiment, the class files with calling relationship are not put together in the executable files in the application installation files generated by default first package in the Android system, so that redundancy of class information and method ids of the class files exists. For this purpose, at least two class files contained in at least two executable files of the application installation file need to be acquired first. Optionally, at least two executable files are obtained by decompiling the application installation file generated by the first package, and at least two class files are obtained from the obtained at least two executable files. Wherein at least some of the at least two class files are derived from different executable files.
In an optional manner of this embodiment, at least two corresponding class files are obtained from at least two executable files of the application installation file, and specifically includes steps A1 to A2:
and A1, mapping the application installation file to a shared memory, and decompiling the application installation file in the shared memory to obtain at least two executable files.
And A2, for each executable file of the at least two executable files, confusing and compiling the executable files to obtain corresponding class files so as to obtain the at least two class files.
In this embodiment, the mmap function is called to map the application installation file to the shared memory, decompilation is performed on the application installation file in the shared memory to obtain at least two executable files, and decompilation speed can be increased by decompilation in the memory, so that time is saved. In an alternative example, the application installation file is decompiled by a decompiling tool of the android application, so as to obtain at least two corresponding executable files.
In this embodiment, one or more class files may be stored in each executable file, and the class files contained in each executable file may be obtained by obfuscating and compiling the executable files. Further, at least two class files can be obtained by obfuscating and compiling each executable file. In addition, the class files obtained from each executable file are confusing and compiled files, and the calling relationship among the class files is reserved although the logic in each class file cannot be combed out.
Taking an application installation file as an android application installation file APK as an example, decompiling the APK by adopting an APKtool tool to obtain one or more dex files contained in the APK, and then obtaining a plurality of class files corresponding to each dex file by using a dex2jar tool. Although the logic in the class files cannot be carded out, call relations between class files can be obtained. For example, the onCreate method of the TestA class calls the onResume method of the TestB class, the a method which becomes the A class after confusion and compiling calls the B method of the B class, and the calling relation between the TestA class and the TestB class is reserved although the logic of codes cannot be read, so that the calling relation between all classes can be obtained well later.
S220, analyzing the calling relation between functions in at least two class files through a class file calling relation analysis tool, and obtaining calling information of the at least two class files according to analysis results; the calling relation between functions comprises calling and called relations between functions in different class files.
In this embodiment, after obtaining at least two class files, each function included in the at least two class files may be traversed, and a relationship analysis tool is invoked through the class files to analyze a relationship between calls and invoked functions. Because the function scheme is stored in the class file, the calling and called relations existing between the class files can be obtained after the calling and called relations between the functions are determined. Optionally, after the analysis obtains the calling relationship between the two class files, the class file calling relationship analysis tool can be continuously called with the two class files as indexes respectively until the class files with the calling relationship with the class files cannot be found; and by analogy, continuing to search the next index to obtain a relation diagram between the calling and called of at least two class files.
S230, reconfiguring storage information between class files and executable files in at least two class files according to calling information of the at least two class files to obtain new executable files.
S240, repackaging the new executable file to generate a new application installation file.
The embodiment of the disclosure provides a file processing scheme, which can be used for confusing and compiling a plurality of executable files of an application installation file to obtain a plurality of class files capable of keeping calling relations among the class files, and the storage relations among the class files and the executable files are reconfigured by determining the calling relations among the class files, so that the class files with the calling relations are stored in the same executable file. By adopting the technical scheme, after two class files with calling relations are stored in the same executable file, only one class information and method id need to be stored in the two class files instead of the two class information and method ids. For example, since the function a is used in the dex1 file, the definition and the specific implementation of the function a are both placed in the dex1 file, so that the corresponding function copy information is not reserved in the dex2 file, and the APK packet volume is reduced.
Fig. 3 illustrates a flow chart of yet another method of file processing provided in an embodiment of the present disclosure, which is further optimized based on the above-described embodiments, which may be combined with various alternatives in one or more of the above-described embodiments. As shown in fig. 3, the file processing method provided in the embodiment of the present disclosure includes the following steps:
s310, determining calling information of at least two class files in the executable files of the application installation file.
S320, generating a corresponding class file configuration file according to the calling information of at least two class files.
In this embodiment, the call information of at least two class files indicates the call and called relationship between the class files. The calling information can be used for obtaining the calling relation among class files, and grouping the class files from a plurality of class files, wherein the class files in each group belong to the class files with the calling relation. Further, it may be determined in which executable file each class file needs to be stored, i.e. the storage information may be encapsulated in one file to generate a class file configuration file. In an alternative example, the application installation file is an android application installation file APK, the class file configuration file indicates which class files are stored in the dex1 file, which class files are stored in the dex2 file, and so on, and in which dex file a specific class file is stored depends on the calling relationship between the class files.
S330, based on the class file configuration file, class files with calling relations in at least two class files are stored in the same executable file, and a new executable file is obtained.
In this embodiment, the same executable file is allocated to the class file with the calling relationship in at least two class files by calling a preset class file reconfiguration function, and then the class file with the calling relationship is stored in the allocated executable file, so that the class file with the calling relationship is stored in the same executable file; and so on, a plurality of new executable files can be obtained.
The class file reconfiguration function is an orderems function integrated by a dex.jar tool, and the number positions of the obtained at least two class files in the executable files can be reconfigured based on the class file configuration file by calling the orderems function, and each class file is stored in the executable file indicated by the class file configuration file, so that a plurality of reconfigured new executable files containing the class files are obtained.
In this embodiment, it is considered that when the application installation file is started, different class files need to be used in different stages, so when the corresponding class file configuration file is generated according to the call information of at least two class files, not only the call information between the class files needs to be referred, but also which class files need to be used in starting, and further the class files used in starting and the class files with call relations are placed in the main dex file, so that a new executable file is obtained.
S340, repackaging the new executable file to generate a new application installation file.
The embodiment of the disclosure provides a file processing scheme, by adopting the technical scheme, after two class files with calling relations are stored in the same executable file, only one class information and method id need to be stored in the two class files instead of the two class information and method ids. For example, since the function a is used in the dex1 file, the definition and the specific implementation of the function a are both placed in the dex1 file, so that the corresponding function copy information is not reserved in the dex2 file, and the APK packet volume is reduced.
Fig. 4 shows a block diagram of a file processing apparatus provided in an embodiment of the present disclosure, which may be applied to a case of optimizing the volume of an application installation file. The apparatus may be implemented in software and/or hardware, and the apparatus may be configured in an electronic device having a network communication function. As shown in fig. 4, a file processing apparatus provided in an embodiment of the present disclosure includes: call information determination module 410, deposit information configuration module 420, and file package generation module 430. Wherein:
A call information determining module 410, configured to determine call information of at least two class files in an executable file of an application installation file;
the storage information configuration module 420 is configured to reconfigure storage information between a class file in the at least two class files and the executable file according to call information of the at least two class files, so as to obtain a new executable file;
and the file packaging generating module 430 is configured to repackage the new executable file to generate a new application installation file.
On the basis of the above embodiment, optionally, the call information determining module 410 includes:
the class file acquisition unit is used for acquiring at least two corresponding class files from at least two executable files of the application installation file;
the calling information determining unit is used for analyzing the calling relation between functions in the at least two class files through a class file calling relation analysis tool and obtaining the calling information of the at least two class files according to analysis results; the calling relation among the functions comprises calling and called relations among the functions in different class files.
On the basis of the above embodiment, optionally, the class file acquisition unit includes:
Mapping the application installation file to a shared memory, and decompiling the application installation file in the shared memory to obtain at least two executable files;
and for each executable file of the at least two executable files, confusion and compiling are carried out on the executable files to obtain corresponding class files so as to obtain at least two class files.
On the basis of the above embodiment, optionally, the executable file is a dex file in an android application installation file APK, and the class file is a class file.
On the basis of the above embodiment, optionally, the storage information configuration module 420 includes:
a class file configuration information generating unit, configured to generate a corresponding class file configuration file according to the calling information of the at least two class files;
and the storage information reconfiguration unit is used for storing the class files with calling relations in the same executable file based on the class file configuration file to obtain a new executable file.
On the basis of the above embodiment, optionally, the deposit information reconfiguration unit includes:
and distributing the same executable file to the class files with calling relations in the at least two class files by calling a preset class file reconfiguration function so as to store the class files with calling relations in the same executable file.
The file processing device provided in the embodiments of the present disclosure may perform the file processing method provided in any of the embodiments of the present disclosure, and have corresponding functions and beneficial effects of performing the file processing method, and technical details not described in detail in the foregoing embodiments may be referred to the file processing method provided in any of the embodiments of the present disclosure.
Fig. 5 shows a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. Referring now in particular to fig. 5, a schematic diagram of an electronic device 500 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device 500 in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 5, the electronic device 500 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 501, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage 506 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
In general, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 506 including, for example, magnetic tape, hard disk, etc.; and communication means 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 shows an electronic device 500 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or from the storage means 506, or from the ROM 502. When the computer program is executed by the processing device 501, the above-described functions defined in the file processing method of the embodiment of the present disclosure are performed.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperTextTransfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: determining calling information of at least two class files in an executable file of an application installation file; reconfiguring storage information between class files in the at least two class files and the executable files according to calling information of the at least two class files to obtain new executable files; and repackaging the new executable file to generate a new application installation file.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit is not limited to the unit itself in some cases, for example, the text broadcasting module may also be described as "a module for broadcasting the text to be processed in a voice broadcasting manner to prompt the dictation processing of the text to be processed".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, example 1 provides a file processing method, including:
determining calling information of at least two class files in an executable file of an application installation file;
reconfiguring storage information between class files in the at least two class files and the executable files according to calling information of the at least two class files to obtain new executable files;
and repackaging the new executable file to generate a new application installation file.
According to one or more embodiments of the present disclosure, example 2 provides a file processing method, determining call information of at least two class files in an executable file of an application installation file, including:
acquiring at least two corresponding class files from at least two executable files of the application installation file;
analyzing the calling relation among functions in the at least two class files through a class file calling relation analysis tool, and obtaining calling information of the at least two class files according to analysis results; the calling relation among the functions comprises calling and called relations among the functions in different class files.
According to one or more embodiments of the present disclosure, example 3 provides a file processing method, which obtains at least two class files from at least two executable files of an application installation file, including:
Mapping the application installation file to a shared memory, and decompiling the application installation file in the shared memory to obtain at least two executable files;
and for each executable file of the at least two executable files, confusion and compiling are carried out on the executable files to obtain corresponding class files so as to obtain at least two class files.
Example 4 provides a method for processing a file, where the executable file is a dex file in an android application installation file APK, and the class file is a class file, according to one or more embodiments of the present disclosure.
According to one or more embodiments of the present disclosure, example 5 provides a file processing method, according to call information of the at least two class files, reconfiguring storage information between a class file and the executable file in the at least two class files, to obtain a new executable file, including:
generating a corresponding class file configuration file according to the calling information of the at least two class files;
and storing the class files with calling relations in the at least two class files in the same executable file based on the class file configuration file to obtain a new executable file.
According to one or more embodiments of the present disclosure, example 6 provides a file processing method, where storing a class file having a calling relationship in the at least two class files in the same executable file includes:
and distributing the same executable file to the class files with calling relations in the at least two class files by calling a preset class file reconfiguration function so as to store the class files with calling relations in the same executable file.
According to one or more embodiments of the present disclosure, example 7 provides a document processing apparatus, comprising:
the calling information determining module is used for determining calling information of at least two class files in the executable files of the application installation file;
the storage information configuration module is used for reconfiguring storage information between class files in the at least two class files and the executable files according to calling information of the at least two class files to obtain new executable files;
and the file packaging generating module is used for repackaging the new executable file to generate a new application installation file.
According to one or more embodiments of the present disclosure, example 8 provides a file processing apparatus, the call information determining module including:
The class file acquisition unit is used for acquiring at least two corresponding class files from at least two executable files of the application installation file;
the calling information determining unit is used for analyzing the calling relation between functions in the at least two class files through a class file calling relation analysis tool and obtaining the calling information of the at least two class files according to analysis results; the calling relation among the functions comprises calling and called relations among the functions in different class files.
According to one or more embodiments of the present disclosure, example 9 provides a file processing apparatus, a class file obtaining unit including:
mapping the application installation file to a shared memory, and decompiling the application installation file in the shared memory to obtain at least two executable files;
and for each executable file of the at least two executable files, confusion and compiling are carried out on the executable files to obtain corresponding class files so as to obtain at least two class files.
Example 10 provides a file processing apparatus according to one or more embodiments of the present disclosure, the executable file is a dex file in an android application installation file APK, and the class file is a class file.
Example 11 provides a document processing apparatus according to one or more embodiments of the present disclosure, the deposit information configuring module including:
a class file configuration information generating unit, configured to generate a corresponding class file configuration file according to the calling information of the at least two class files;
and the storage information reconfiguration unit is used for storing the class files with calling relations in the same executable file based on the class file configuration file to obtain a new executable file.
According to one or more embodiments of the present disclosure, example 12 provides a document processing apparatus, the deposit information reconfiguration unit including:
and distributing the same executable file to the class files with calling relations in the at least two class files by calling a preset class file reconfiguration function so as to store the class files with calling relations in the same executable file.
Example 13 provides an electronic device, according to one or more embodiments of the present disclosure, comprising:
one or more processing devices;
a storage means for storing one or more programs;
when the one or more programs are executed by the one or more processing apparatuses, the one or more processing apparatuses are caused to implement the file processing method as described in any one of examples 1 to 6.
According to one or more embodiments of the present disclosure, example 14 provides a computer-readable medium having stored thereon a computer program, characterized in that the program, when executed by a processing device, implements a file processing method as described in any one of examples 1 to 6.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (12)

1. A document processing method, comprising:
determining calling information of at least two class files in different executable files of the application installation file;
according to the calling information of the at least two class files, reconfiguring storage information between the class files in the at least two class files and the executable files, and storing the class files with calling relations in the same executable file to obtain a new executable file;
and repackaging the new executable file to generate a new application installation file.
2. The method of claim 1, wherein determining call information for at least two class files in an executable file of an application installation file comprises:
acquiring at least two corresponding class files from at least two executable files of the application installation file;
Analyzing the calling relation among functions in the at least two class files through a class file calling relation analysis tool, and obtaining calling information of the at least two class files according to analysis results; the calling relation among the functions comprises calling and called relations among the functions in different class files.
3. The method of claim 2, wherein obtaining corresponding at least two class files from at least two executable files of the application installation file comprises:
mapping the application installation file to a shared memory, and decompiling the application installation file in the shared memory to obtain at least two executable files;
and for each executable file of the at least two executable files, confusion and compiling are carried out on the executable files to obtain corresponding class files so as to obtain at least two class files.
4. The method of claim 1, wherein the executable file is a dex file in an android application installation file APK, and the class file is a class file.
5. The method of claim 1, wherein reconfiguring the storage information between the class files in the at least two class files and the executable file according to the call information of the at least two class files to obtain a new executable file comprises:
Generating a corresponding class file configuration file according to the calling information of the at least two class files;
and storing the class files with calling relations in the at least two class files in the same executable file based on the class file configuration file to obtain a new executable file.
6. The method of claim 5, wherein storing the class file having the calling relationship in the same executable file comprises:
and distributing the same executable file to the class files with calling relations in the at least two class files by calling a preset class file reconfiguration function so as to store the class files with calling relations in the same executable file.
7. A document processing apparatus, comprising:
the calling information determining module is used for determining calling information of at least two class files in different executable files of the application installation file;
the storage information configuration module is used for reconfiguring storage information between class files in the at least two class files and the executable files according to calling information of the at least two class files, and storing the class files with calling relations in the same executable file to obtain a new executable file;
And the file packaging generating module is used for repackaging the new executable file to generate a new application installation file.
8. The apparatus of claim 7, wherein the call information determination module comprises:
the class file acquisition unit is used for acquiring at least two corresponding class files from at least two executable files of the application installation file;
the calling information determining unit is used for analyzing the calling relation between functions in the at least two class files through a class file calling relation analysis tool and obtaining the calling information of the at least two class files according to analysis results; the calling relation among the functions comprises calling and called relations among the functions in different class files.
9. The apparatus according to claim 8, wherein the class file acquisition unit includes:
mapping the application installation file to a shared memory, and decompiling the application installation file in the shared memory to obtain at least two executable files;
and for each executable file of the at least two executable files, confusion and compiling are carried out on the executable files to obtain corresponding class files so as to obtain at least two class files.
10. The apparatus of claim 7, wherein the executable file is a dex file in an android application installation file APK and the class file is a class file.
11. An electronic device, comprising:
one or more processing devices;
a storage means for storing one or more programs;
when the one or more programs are executed by the one or more processing devices, the one or more processing devices are caused to implement the file processing method of any of claims 1-6.
12. A computer readable medium on which a computer program is stored, characterized in that the program, when being executed by a processing device, implements the file processing method of any of claims 1-6.
CN202010065717.XA 2020-01-20 2020-01-20 File processing method, device, equipment and medium Active CN111240738B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010065717.XA CN111240738B (en) 2020-01-20 2020-01-20 File processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010065717.XA CN111240738B (en) 2020-01-20 2020-01-20 File processing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN111240738A CN111240738A (en) 2020-06-05
CN111240738B true CN111240738B (en) 2023-11-21

Family

ID=70866196

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010065717.XA Active CN111240738B (en) 2020-01-20 2020-01-20 File processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN111240738B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111723016B (en) * 2020-06-24 2024-06-04 湖南国科微电子股份有限公司 File closing method, device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108132790A (en) * 2017-12-22 2018-06-08 广州酷狗计算机科技有限公司 Detect the method, apparatus and computer storage media of dead code
CN108509215A (en) * 2018-03-22 2018-09-07 广州视源电子科技股份有限公司 A kind of replacing options of system software, device, terminal device and storage medium
CN110321134A (en) * 2018-03-30 2019-10-11 深圳Tcl新技术有限公司 A kind of method of application installation package, the storage medium of generating is with application server
CN110399161A (en) * 2019-06-14 2019-11-01 五八有限公司 A kind of generation method of mapping relations, call method and device
CN110489159A (en) * 2019-08-02 2019-11-22 北京字节跳动网络技术有限公司 Installation kit compressing method and data analysis method, device, medium and equipment
CN110609687A (en) * 2019-04-12 2019-12-24 北京字节跳动网络技术有限公司 Compiling method, device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101854975B1 (en) * 2016-02-18 2018-05-04 라인 가부시키가이샤 Method and system for extending function of package file

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108132790A (en) * 2017-12-22 2018-06-08 广州酷狗计算机科技有限公司 Detect the method, apparatus and computer storage media of dead code
CN108509215A (en) * 2018-03-22 2018-09-07 广州视源电子科技股份有限公司 A kind of replacing options of system software, device, terminal device and storage medium
CN110321134A (en) * 2018-03-30 2019-10-11 深圳Tcl新技术有限公司 A kind of method of application installation package, the storage medium of generating is with application server
CN110609687A (en) * 2019-04-12 2019-12-24 北京字节跳动网络技术有限公司 Compiling method, device, electronic equipment and storage medium
CN110399161A (en) * 2019-06-14 2019-11-01 五八有限公司 A kind of generation method of mapping relations, call method and device
CN110489159A (en) * 2019-08-02 2019-11-22 北京字节跳动网络技术有限公司 Installation kit compressing method and data analysis method, device, medium and equipment

Also Published As

Publication number Publication date
CN111240738A (en) 2020-06-05

Similar Documents

Publication Publication Date Title
CN111581563B (en) Page response method and device, storage medium and electronic equipment
CN111581555B (en) Document loading method, device, equipment and storage medium
CN113835992B (en) Memory leakage processing method and device, electronic equipment and computer storage medium
CN114625536B (en) Video memory allocation method, device, medium and electronic equipment
CN112965761B (en) Data processing method, system, electronic equipment and storage medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN111309391A (en) Application program starting method, device, equipment and medium
CN111400068B (en) Interface control method and device, readable medium and electronic equipment
CN113407165B (en) SDK generation and self-upgrade method, device, readable medium and equipment
CN112965713B (en) Development method, device, equipment and storage medium of visual editor
CN112416303B (en) Software development kit hot repair method and device and electronic equipment
CN111240738B (en) File processing method, device, equipment and medium
CN113391860B (en) Service request processing method and device, electronic equipment and computer storage medium
CN110704050B (en) Module initializing method and device, electronic equipment and computer readable storage medium
CN116679930A (en) Front-end project construction method and device, electronic equipment and storage medium
CN113391882B (en) Virtual machine memory management method and device, storage medium and electronic equipment
CN114860213A (en) Application package generation method, device, equipment and medium
CN111538717B (en) Data processing method, device, electronic equipment and computer readable medium
CN111008178B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN111324336B (en) Method, device, terminal and storage medium for implementing dependency injection
CN111338822B (en) Message processing method and device
CN111290812B (en) Display method, device, terminal and storage medium of application control
CN110502251B (en) Application installation method and device
CN109669720B (en) Chain type asynchronous request processing method and device based on Promise and electronic equipment
CN111240657A (en) Method and device for generating SDK and electronic equipment

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230428

Address after: Room 802, Information Building, 13 Linyin North Street, Pinggu District, Beijing, 101299

Applicant after: Beijing youzhuju Network Technology Co.,Ltd.

Address before: No. 715, 7th floor, building 3, 52 Zhongguancun South Street, Haidian District, Beijing 100081

Applicant before: Beijing infinite light field technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant