CN110489162B - Method, device, medium and equipment for simplifying installation package SO (storage and retrieval) file - Google Patents

Method, device, medium and equipment for simplifying installation package SO (storage and retrieval) file Download PDF

Info

Publication number
CN110489162B
CN110489162B CN201910710290.1A CN201910710290A CN110489162B CN 110489162 B CN110489162 B CN 110489162B CN 201910710290 A CN201910710290 A CN 201910710290A CN 110489162 B CN110489162 B CN 110489162B
Authority
CN
China
Prior art keywords
file
function
export
configuration mode
configuring
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
CN201910710290.1A
Other languages
Chinese (zh)
Other versions
CN110489162A (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 CN201910710290.1A priority Critical patent/CN110489162B/en
Publication of CN110489162A publication Critical patent/CN110489162A/en
Application granted granted Critical
Publication of CN110489162B publication Critical patent/CN110489162B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure provides a method, an apparatus, a medium and a device for simplifying an installation package SO file, where the method includes: establishing a link relation between a first function and a second function, wherein the first function operates in a first development language, and the second function operates in a second development language; creating a source code file, wherein the file only comprises the second function; and configuring the SO file export path to lead the SO file export path to point to the source code file. According to the method, through the configuration of the SO file, the depth reduction of the android sol volume can be realized under the condition of little change of the source code, and the execution effect of the android sol volume cannot be influenced. The simplifying effect is generally about 20% -40%, so that the volume of the android application installation package can be effectively simplified, the downloading success rate of the application is further improved, more users are brought to the product, and the popularization efficiency of the product is improved.

Description

Method, device, medium and equipment for simplifying installation package SO (storage and retrieval) file
Technical Field
The disclosure relates to the technical field of computers, in particular to a method, a device, a medium and equipment for simplifying an installation package SO file.
Background
The volume of an android application is one of the important indexes for measuring the application quality: the smaller the packet volume, the higher the download success rate of the user, and thus the more users of the application. The optimized simplifying scheme of the application resource and the dex is applied to actual projects (ResGuard, proguard, debug information in the dex is removed, vector pictures and the like) in large quantity, but a large simplifying space is still reserved for a solibrary which is applied in large quantity.
Therefore, how to deeply simplify the android device without affecting the execution effect of the android device and effectively reduce the volume of the android device is a technical problem to be solved.
BRIEF SUMMARY OF THE PRESENT DISCLOSURE
The disclosure aims to provide a method, a device, a medium and equipment for simplifying an installation package (SO) file, which can solve at least one technical problem. The specific scheme is as follows:
according to a specific embodiment of the present disclosure, in a first aspect, the present disclosure provides a method for simplifying an installation package SO file, including:
establishing a link relation between a first function and a second function, wherein the first function operates in a first development language, and the second function operates in a second development language;
creating a source code file, wherein the file only comprises the second function;
and configuring the SO file export path to lead the SO file export path to point to the source code file.
Optionally, the configuring the SO file export path to point to the source code file includes:
the SO file export path points to the source code file in a first configuration mode; or alternatively, the first and second heat exchangers may be,
and directing the SO file export path to the source code file in a second configuration mode.
Optionally, the method further comprises:
and configuring the static library of the SO file, SO that the static library of the SO file only retains the dependent export function and export variable.
Optionally, the configuring the static library of the SO file, SO that the static library of the SO file only retains the dependent export function and export variable includes:
the static library of the SO file is configured in a first configuration mode, SO that the static library of the SO file only keeps dependent export functions and export variables;
and configuring the static library of the SO file in a second configuration mode, SO that the static library of the SO file only keeps dependent export functions and export variables.
Optionally, the method further comprises:
and configuring the link sections of the SO file in a first configuration mode or in a second configuration mode, and removing unused sections in the link sections.
Optionally, the first development language is java language, and the second development language is c language.
Optionally, the method further comprises:
and configuring the functions and the variables of the SO file through a first configuration mode or a second configuration mode, SO that the functions and the variables are distributed into independent sections.
According to a second aspect of the specific embodiment of the present disclosure, the present disclosure provides an installation package SO file compacting apparatus, including:
the building unit is used for building a link relation between a first function and a second function, wherein the first function operates in a first development language, and the second function operates in a second development language;
the creating unit is used for creating a source code file, and the file only comprises the second function;
the configuration unit is used for configuring the SO file export path to lead the SO file export path to point to the source code file.
According to a third aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a method as claimed in any one of the above.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: one or more processors; storage means for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the method of any of the preceding claims.
Compared with the prior art, the scheme of the embodiment of the disclosure has at least the following beneficial effects: according to the method, through the configuration of the SO file, the depth reduction of the android sol volume can be realized under the condition of little change of the source code, and the execution effect of the android sol volume cannot be influenced. The simplifying effect is generally about 20% -40%, so that the volume of the android application installation package can be effectively simplified, the downloading success rate of the application is further improved, more users are brought to the product, and the popularization efficiency of the product is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort. In the drawings:
FIG. 1 illustrates a simplified method flow diagram according to an embodiment of the present disclosure;
FIG. 2 illustrates a simplified device architecture diagram according to an embodiment of the present disclosure;
fig. 3 illustrates a schematic diagram of an electronic device connection structure according to an embodiment of the present disclosure.
Detailed Description
For the purpose of promoting an understanding of the principles and advantages of the disclosure, reference will now be made in detail to the drawings, in which it is apparent that the embodiments described are only some, but not all embodiments of the disclosure. Based on the embodiments in this disclosure, all other embodiments that a person of ordinary skill in the art would obtain without making any inventive effort are within the scope of protection of this disclosure.
The terminology used in the embodiments of the disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure of embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, the "plurality" generally includes at least two.
It should be understood that the term "and/or" as used herein is merely one relationship describing the association of the associated objects, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
It should be understood that although the terms first, second, third, etc. may be used to describe … … in the presently disclosed embodiments, these … … should not be limited to these terms. These terms are only used to distinguish … …. For example, the first … … may also be referred to as the second … …, and similarly the second … … may also be referred to as the first … …, without departing from the scope of the disclosed embodiments.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrase "if determined" or "if detected (stated condition or event)" may be interpreted as "when determined" or "in response to determination" or "when detected (stated condition or event)" or "in response to detection (stated condition or event), depending on the context.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such product or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a commodity or device comprising such element.
Alternative embodiments of the present disclosure are described in detail below with reference to the drawings.
As shown in fig. 1, according to a specific embodiment of the present disclosure, the present disclosure provides a method for simplifying an installation package so file.
The so file is in the form of an elf, which is relatively complex and only a brief description of the knowledge that needs to be used is provided here. From the standpoint of compilation, the so file is mainly composed of a plurality of sections (sections): some sections are internally represented by symbol tables (e.g.,. Dynsym), some sections are internally represented by codes (e.g.,. Text), some sections are internally represented by variables with initial values (e.g.,. Data), and some sections are internally represented by variables with no initial values or initial values of 0 (e.g.,. Bss). The function or variable defined in c/c++ source code will be present in the corresponding section of so (a function is typically. Text, a variable is typically. Data or. Bss), and if this function or variable is derived, it will also be present in the symbol table (typically. Dynsym).
Briefly introduced here is a symbol table, where a symbol table has a plurality of symbols, a symbol generally representing a function or a variable, and some symbols are implemented by the present so, called derived symbols; some symbols are native dependent, called import symbols. The simplification of the scheme mainly relates to the simplification of the section in the so file, in particular to a symbol table.
The generation process of the so file is briefly described as follows: the generation of one so file needs four stages of preprocessing, compiling, assembling and linking, wherein the preprocessing stage performs operations such as macro definition expansion, include content replacement and the like; compiling the c/c++ code into assembly code in a compiling stage; the assembly stage compiles the assembly code generated in the previous stage into a target file (.o); and in the linking stage, all input target files (.o), a static library (.a) and a dynamic library (.so) are subjected to static linking to obtain a final so file.
The method includes that firstly, a java native method is registered in a function JNI_OnLoad, and therefore only one derived function of the JNI_OnLoad is needed in so. Redundant information in the so file, i.e. information that has no effect on the operation of the so file, is then removed during the compiling and linking phase. Such information includes the following:
not all functions and all variables that are directly or indirectly referenced by jni_onload. Since the so file is dynamically linked, its derived variables and derived functions are used by the outside world, where the derived variables do not reference other functions or variables, the derived functions can be considered their entry points. For a variable (or function), if it is not derived and is not directly or indirectly referenced by any derived function, then the variable (or function) is redundant information and does not affect the execution of the so file after deletion. Since the present disclosure has ensured in the previous step that the target so only derives the jni_onload function, it only needs to consider if the variable or function is referenced by jni_onload.
The function or variable in the static library on which the target so depends is redundant information if the function or variable is not directly or indirectly led to by the lead-out function, and the operation of the so is not affected after the function or variable is deleted.
The method specifically comprises the following steps:
step S102: and establishing a link relation between the first function and the second function, wherein the first function operates in a first development language, and the second function operates in a second development language.
And registering the native method of the java class in the function JNI_OnLoad through the C code. The native method of Java is implemented by using a Java style export function for many applications, and a better way is to export jni_onload function, which is automatically called when the system loads the target so, and we register native s in this function. This has several benefits:
first, the function of Java style is not needed to be derived, so that the safety of application can be improved to a certain extent.
Secondly, if the signature of the corresponding java native method changes, the so generated by adopting a register native mode collapses during loading, and problems are found in advance; the derived function of Java style is adopted, and only the native method is first called to collapse.
Third, the size of so can be reduced in general.
Step S104: creating a source code file, wherein the file only comprises the second function.
Configuration is added indicating that there are only jni_onload functions that need to be exported.
First a file (assumed to be version. Script) is created in the engineering catalog, the contents of which are as follows:
step S106: and configuring the SO file export path to lead the SO file export path to point to the source code file.
If ndkBuild is used, then the following is added in application. Mk:
APP_LDFLAGS+=-Wl,--version-script=src/main/cpp/version.script
the src/main/cpp/version file should be replaced by the actual path of the version file above (path relative to application. Mk).
If a cmake is used, the following is added to the cmakelist.
set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS}-Wl,--version-script=
${CMAKE_CURRENT_SOURCE_DIR}/version.script")
Here, the path of version, script is also replaced by the path of the real version, script file (cmake_shared_link_flags represents the directory where the current CMAKE lists, txt file is located).
After the configuration, the generated derivative function of so is only jni_onload.
Optionally, the linking stage further comprises the following steps: : and configuring the static library of the SO file, SO that the static library of the SO file only retains the dependent export function and export variable.
A configuration is added such that all derived symbols (including derived functions and derived variables) in the static library that are relied upon are no longer derived in the generated so.
If ndkBuild is used, then the following is added in application. Mk:
APP_LDFLAGS+=-Wl,--exclude-libs,ALL
if a cmake is used, the following is added to the cmakelist.
set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS}-Wl,--exclude-libs,ALL")。
Optionally, the linking stage further comprises the following steps:
and configuring the link sections of the SO file in a first configuration mode or in a second configuration mode, and removing unused sections in the link sections.
If ndkBuild is used, then the following is added in application. Mk:
APP_LDFLAGS+=-Wl,--gc-sections
if a cmake is used, the following is added to the cmakelist.
set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS}-Wl,--gc-sections")
The effect is as follows: if all members of a section are not used by functions or variables in the export table, then the section will not be present in the final so and can act on the static library of dependencies. With the above-mentioned flag, the final so volume is greatly reduced, but there may still be useless content: if only a portion of the members in a section are used, then the section is also retained.
Optionally, the method further comprises:
and configuring the functions and the variables of the SO file through a first configuration mode or a second configuration mode, SO that the functions and the variables are distributed into independent sections.
And adding configuration to ensure that functions and variables are distributed to independent sections.
If ndkBuild is used, then the following is added in application. Mk:
APP_CFLAGS+=-ffunction-sections-fdata-sections
if a cmake is used, the following is added to the cmakelist.
set(CMAKE_C_FLAGS"${CMAKE_C_FLAGS}-ffunction-sections-fdata-sections")
set(CMAKE_CXX_FLAGS"${CMAKE_CXX_FLAGS}-ffunction-sections-fdata-sections")
The above flags require that the compilation stage assign each function and variable to a separate section, thus solving the above-mentioned problem of "if only a portion of the members in a section are used, then that section is also preserved".
According to the method, through the configuration of the SO file, the depth reduction of the android sol volume can be realized under the condition of little change of the source code, and the execution effect of the android sol volume cannot be influenced. The simplifying effect is generally about 20% -40%, so that the volume of the android application installation package can be effectively simplified, the downloading success rate of the application is further improved, more users are brought to the product, and the popularization efficiency of the product is improved.
As shown in fig. 2, the present embodiment is a device for implementing the foregoing embodiment, and the steps of the method in the present embodiment have the same technical effects and are not described herein. According to a specific embodiment of the present disclosure, the present disclosure provides an installation package SO file compaction apparatus, including an establishing unit 202, a creating unit 204, and a configuring unit 206:
a building unit 202, configured to build a link relation between a first function and a second function, where the first function runs in a first development language, and the second function runs in a second development language;
a creating unit 204, configured to create a source code file, where the file includes only the second function;
and the configuration unit 206 is configured to configure the SO file export path, SO that the SO file export path points to the source code file.
The configuration unit 206 includes: the SO file export path points to the source code file in a first configuration mode; or, by a second configuration mode, the SO file export path points to the source code file.
The configuration unit 206 further includes: and configuring the static library of the SO file, SO that the static library of the SO file only retains the dependent export function and export variable.
The configuration unit 206 further includes: the static library of the SO file is configured in a first configuration mode, SO that the static library of the SO file only keeps dependent export functions and export variables; and configuring the static library of the SO file in a second configuration mode, SO that the static library of the SO file only keeps dependent export functions and export variables.
The configuration unit 206 further includes: and configuring the link sections of the SO file in a first configuration mode or in a second configuration mode, and removing unused sections in the link sections.
The first development language is java language, and the second development language is c language.
The configuration unit 206 further includes: and configuring the functions and the variables of the SO file through a first configuration mode or a second configuration mode, SO that the functions and the variables are distributed into independent sections.
The device realizes the depth simplification of the volume of the android SOs under the condition of little change of the source code by configuring the SO file, and the execution effect of the android SOs is not influenced. The simplifying effect is generally about 20% -40%, so that the volume of the android application installation package can be effectively simplified, the downloading success rate of the application is further improved, more users are brought to the product, and the popularization efficiency of the product is improved.
As shown in fig. 3, the present embodiment provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the one processor to enable the at least one processor to perform the method steps described in the embodiments above.
The disclosed embodiments provide a non-transitory computer storage medium storing computer executable instructions that perform the method steps described in the embodiments above.
Referring now to fig. 3, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are 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. 3 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. 3, the electronic device may include a processing means (e.g., a central processor, a graphics processor, etc.) 301 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 302 or a program loaded from a storage means 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 305. An input/output (I/O) interface 305 is also connected to the bus 305.
In general, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 305 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 305. The communication means 305 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 3 shows an electronic device 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 computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communications device 305, or from the storage device 308, or from the ROM 302. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing means 301.
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.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including 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. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.

Claims (8)

1. A method for simplifying an installation package SO file, comprising:
establishing a link relation between a first function and a second function, wherein the first function operates in a first development language, the second function operates in a second development language, the first function is a derived function, and the second function is a function referenced by the first function;
creating a source code file, wherein the file only comprises the second function;
the SO file export path points to the source code file in a first configuration mode; or alternatively, the first and second heat exchangers may be,
directing the SO file export path to the source code file in a second configuration mode; the first configuration mode comprises adding codes in application. Mk through configuration ndkBuild, and the second configuration mode comprises configuring cmake and adding codes in cmakelists. Txt;
and configuring the static library of the SO file, SO that the static library of the SO file only holds the export functions and the export variables which are depended on.
2. The method of claim 1, wherein said configuring the static library of SO files such that the static library of SO files retains only dependent export functions and export variables comprises:
the static library of the SO file is configured in a first configuration mode, SO that the static library of the SO file only keeps dependent export functions and export variables;
and configuring the static library of the SO file in a second configuration mode, SO that the static library of the SO file only keeps dependent export functions and export variables.
3. The method as recited in claim 1, further comprising:
and configuring the link sections of the SO file in a first configuration mode or in a second configuration mode, and removing unused sections in the link sections.
4. The method of claim 1, wherein the first development language is java language and the second development language is c language.
5. The method as recited in claim 1, further comprising:
and configuring the functions and the variables of the SO file through a first configuration mode or a second configuration mode, SO that the functions and the variables are distributed into independent sections.
6. An installation package SO file compaction device, comprising:
the system comprises a building unit, a first function generation unit, a second function generation unit and a storage unit, wherein the building unit is used for building a link relation between a first function and a second function, the first function runs in a first development language, the second function runs in a second development language, the first function is a derived function, and the second function is a function referenced by the first function;
the creating unit is used for creating a source code file, and the file only comprises the second function;
the first configuration unit is used for enabling the SO file export path to point to the source code file through a first configuration mode; or, by a second configuration mode, enabling the SO file export path to point to the source code file; the first configuration mode comprises adding codes in application. Mk through configuration ndkBuild, and the second configuration mode comprises configuring cmake and adding codes in cmakelists. Txt;
and the second configuration unit is used for configuring the static library of the SO file, SO that the static library of the SO file only retains the dependent export function and export variable.
7. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any one of claims 1 to 5.
8. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the method of any of claims 1 to 5.
CN201910710290.1A 2019-08-02 2019-08-02 Method, device, medium and equipment for simplifying installation package SO (storage and retrieval) file Active CN110489162B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910710290.1A CN110489162B (en) 2019-08-02 2019-08-02 Method, device, medium and equipment for simplifying installation package SO (storage and retrieval) file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910710290.1A CN110489162B (en) 2019-08-02 2019-08-02 Method, device, medium and equipment for simplifying installation package SO (storage and retrieval) file

Publications (2)

Publication Number Publication Date
CN110489162A CN110489162A (en) 2019-11-22
CN110489162B true CN110489162B (en) 2023-09-22

Family

ID=68549303

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910710290.1A Active CN110489162B (en) 2019-08-02 2019-08-02 Method, device, medium and equipment for simplifying installation package SO (storage and retrieval) file

Country Status (1)

Country Link
CN (1) CN110489162B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111562928B (en) * 2020-04-28 2023-05-05 北京字节跳动网络技术有限公司 Resource providing method and device, and resource downloading method and device
CN113050948B (en) * 2021-03-22 2022-07-19 厦门亿联网络技术股份有限公司 Dynamic library optimization method, device, equipment and storage medium
CN113064692B (en) * 2021-04-06 2022-11-29 深圳市研强物联技术有限公司 Method and system for generating firmware picture resource data

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105447349A (en) * 2015-11-20 2016-03-30 珠海多玩信息技术有限公司 Method and device for protecting derived symbol in so file
CN106650431A (en) * 2016-12-09 2017-05-10 北京奇虎科技有限公司 Method and device for reinforcing dynamic link library SO file of Android installation package
CN106775781A (en) * 2017-02-17 2017-05-31 北京金山安全软件有限公司 Method and device for reducing application installation packages and electronic equipment
WO2017107706A1 (en) * 2015-12-25 2017-06-29 北京奇虎科技有限公司 Elf file protection method and system based on arm instruction virtualization
CN107103215A (en) * 2017-04-27 2017-08-29 北京洋浦伟业科技发展有限公司 A kind of APK installation methods and device
CN108304158A (en) * 2016-08-24 2018-07-20 北京花甲科技有限公司 A kind of Proxy Method and equipment of dynamic base
CN109522020A (en) * 2018-09-29 2019-03-26 中国平安人寿保险股份有限公司 Android system installation kit method for reducing body weight, device, terminal and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105447349A (en) * 2015-11-20 2016-03-30 珠海多玩信息技术有限公司 Method and device for protecting derived symbol in so file
WO2017107706A1 (en) * 2015-12-25 2017-06-29 北京奇虎科技有限公司 Elf file protection method and system based on arm instruction virtualization
CN108304158A (en) * 2016-08-24 2018-07-20 北京花甲科技有限公司 A kind of Proxy Method and equipment of dynamic base
CN106650431A (en) * 2016-12-09 2017-05-10 北京奇虎科技有限公司 Method and device for reinforcing dynamic link library SO file of Android installation package
CN106775781A (en) * 2017-02-17 2017-05-31 北京金山安全软件有限公司 Method and device for reducing application installation packages and electronic equipment
CN107103215A (en) * 2017-04-27 2017-08-29 北京洋浦伟业科技发展有限公司 A kind of APK installation methods and device
CN109522020A (en) * 2018-09-29 2019-03-26 中国平安人寿保险股份有限公司 Android system installation kit method for reducing body weight, device, terminal and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于自修改字节码的Android软件保护技术研究;高琦等;《计算机应用与软件》;20160415(第04期);全文 *

Also Published As

Publication number Publication date
CN110489162A (en) 2019-11-22

Similar Documents

Publication Publication Date Title
CN109634598B (en) Page display method, device, equipment and storage medium
CN110489162B (en) Method, device, medium and equipment for simplifying installation package SO (storage and retrieval) file
CN110554876A (en) Method and device for compiling android project
CN110750545B (en) Dynamic library heat updating method, device, medium and equipment
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN111367516B (en) Application interface generation method and device and electronic equipment
CN110554874A (en) Method and device for reusing webpage components of SaaS platform
CN112395253B (en) Index file generation method, terminal device, electronic device and medium
CN110960855B (en) Communication protocol code updating method and device, electronic equipment and storage medium
CN112965761B (en) Data processing method, system, electronic equipment and storage medium
CN110895471A (en) Installation package generation method, device, medium and electronic equipment
CN112631590B (en) Component library generation method, device, electronic equipment and computer readable medium
CN111290737A (en) Method and device for application program development and electronic equipment
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN110928571A (en) Business program development method and device
CN113407165B (en) SDK generation and self-upgrade method, device, readable medium and equipment
CN112416303B (en) Software development kit hot repair method and device and electronic equipment
CN112835568A (en) Project construction method and device
CN112905220A (en) Thermal restoration method, device, equipment and storage medium
CN109815455B (en) Project file processing method and device
CN112965713B (en) Development method, device, equipment and storage medium of visual editor
CN113448585B (en) Compiling method and device of thread pool, electronic equipment and storage medium
CN112732365A (en) Method and device for starting pre-installed application program, electronic equipment and storage medium
CN110908711A (en) Control development method and device of application program and electronic equipment
CN113127430A (en) Mirror image information processing method and device, computer readable medium 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
GR01 Patent grant
GR01 Patent grant