CN109683954A - The library lib integrated approach, device and storage medium - Google Patents

The library lib integrated approach, device and storage medium Download PDF

Info

Publication number
CN109683954A
CN109683954A CN201811635805.8A CN201811635805A CN109683954A CN 109683954 A CN109683954 A CN 109683954A CN 201811635805 A CN201811635805 A CN 201811635805A CN 109683954 A CN109683954 A CN 109683954A
Authority
CN
China
Prior art keywords
library
lib
target
name
library lib
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.)
Pending
Application number
CN201811635805.8A
Other languages
Chinese (zh)
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 Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201811635805.8A priority Critical patent/CN109683954A/en
Publication of CN109683954A publication Critical patent/CN109683954A/en
Pending legal-status Critical Current

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

Landscapes

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

Abstract

The disclosure is directed to a kind of library lib integrated approach, device and storage mediums, belong to software technology field.The described method includes: obtaining the library target lib for the first version that the specified library lib relies on, first library lib and the 2nd library lib are with target lib inventory in dependence, and the version in the library target lib relied on is different, there are dependences between first library lib and the 2nd library lib, and specifying the library lib is any one in the first library lib and the 2nd library lib;Newly establish a library lib for specifying the library lib to rely on, the alternative document of packet name, class file name and dependence class file name between the library target lib and the newly-established library lib of the second edition that 3rd library lib relies on is all different, 3rd library lib is any one in the first library lib and the 2nd library lib, and the 3rd library lib is different from the specified library lib;Determine the dependence between the specified library lib and the newly-established library lib.Disclosure both sides, which rely on, can exist simultaneously without conflicting, i.e., the library lib edition compatibility is realized under the premise of not changing both sides' dependency logic.

Description

The library lib integrated approach, device and storage medium
Technical field
This disclosure relates to software technology field, the in particular to a kind of library lib integrated approach, device and storage medium.
Background technique
Android application program usually can also integrate some third party's functions other than being integrated with internal development function. Wherein, in integrated third party's function, the case where usually will appear two libraries lib while relying on another library lib, such as one The library A of application program relies on library B and library C, and library B is also relied on library C, i.e. library A and library B while being integrated with library C.Often both sides at this time Need to rely on the library lib of same version.In addition, both sides may be used also between each version in the library lib in the case where compatible use It can rely on respectively the library lib of one of version.
However, often version difference just cannot be compatible with, and will occur library in the case where incompatible and rely on conflict, it can not Integrated third party's function.For this purpose, how to integrate the library lib, collision problem is relied on to solve library, becomes those skilled in the art urgently A problem to be solved.
Summary of the invention
The disclosure provides a kind of library lib integrated approach, device and storage medium, is able to solve the problem of library relies on conflict.
According to the first aspect of the embodiments of the present disclosure, a kind of library lib integrated approach is provided, which comprises
Obtain the library target lib for the first version that the specified library lib relies on, the first library lib and the 2nd library lib with the mesh Lib inventory is marked in dependence, and the version in the library the target lib relied on is different, the first library lib and described second There are dependence between the library lib, the specified library lib is any one in the first library lib and the 2nd library lib It is a;
One is newly established for the library lib that the specified library lib relies on, the target for the second edition that the 3rd library lib relies on Packet name, class file name between the library lib and the newly-established library lib and rely on the alternative document of the class file name not phase Together, the 3rd library lib be the first library lib and the 2nd library lib in any one, and the 3rd library lib with The specified library lib is different;
Determine the dependence between the specified library lib and the newly-established library lib.
In one possible implementation, described new to establish one for the library lib that the specified library lib relies on, packet It includes:
Packet name, the library target lib of the second edition described in new Bao Mingyu are reset for the library target lib of the first version Packet name it is different;
Establish the first mapping relations between the original packet name in the library target lib of first version described in the new Bao Mingyu;
Based on first mapping relations, the class file of class file in the library target lib of the first version is reset Name, and the second mapping relations between the primitive class filename of the class file and new class file name are established, the new class file Name is different from the class file name in the library target lib of the second edition;
Based on second mapping relations, the alternative document in the library target lib of the first version is repaired Change, obtains the newly-established library lib.
In one possible implementation, described to be based on second mapping relations, to the target of the first version The alternative document in the library lib is modified, comprising:
When the alternative document is resource (resource) file, in the resource file, determines and use institute State the first object position of primitive class filename;
Based on second mapping relations, the primitive class filename used at the first object position is updated to The new class file name.
In one possible implementation, described to be based on second mapping relations, to the target of the first version The alternative document in the library lib is modified, comprising:
When the alternative document is so (shared object, shared library) file, in so file, really Surely the second target position of the primitive class filename is used;
Based on second mapping relations, the primitive class filename that second target location is used is updated to The new class file name.
In one possible implementation, described to be based on first mapping relations, reset the first version The library target lib in class file class file name, comprising:
Based on first mapping relations, the original packet name for including in the primitive class filename is updated to described Simultaneously class name is arranged for the class file again in new packet name, obtains the new class file name.
According to the second aspect of an embodiment of the present disclosure, a kind of library lib integrating device is provided, described device includes:
Module is obtained, is configured as obtaining the library target lib for the first version that the specified library lib relies on, the first library lib and the Two libraries lib are with the target lib inventory in dependence, and the version in the library the target lib relied on is different, and described first There are dependence between the library lib and the 2nd library lib, the specified library lib is the first library lib and described second Any one in the library lib;
Module is established, is configured as newly establishing one for the library lib that the specified library lib relies on, the 3rd library lib relies on The second edition the library target lib and the newly-established library lib between packet name, class file name and rely on the class file name Alternative document be all different, the 3rd library lib be the first library lib and the 2nd library lib in any one, and 3rd library lib is different from the specified library lib;
Determining module, the dependence being configured to determine that between the specified library lib and the newly-established library lib.
In one possible implementation, described to establish module, it is additionally configured to the target lib for the first version Library resets packet name, and the packet name in the library target lib of the second edition described in new Bao Mingyu is different;It establishes described in the new Bao Mingyu The first mapping relations between the original packet name in the library target lib of first version;Based on first mapping relations, reset The class file name of class file in the library target lib of the first version, and establish the primitive class filename of the class file and new The class file name in the library target lib of the second mapping relations between class file name, the new class file name and the second edition It is different;Based on second mapping relations, modify to the alternative document in the library target lib of the first version, Obtain the newly-established library lib.
In one possible implementation, described to establish module, be additionally configured to be when the alternative document When resource file, in the resource file, the first object position using the primitive class filename is determined;Base In second mapping relations, the primitive class filename used at the first object position is updated to the new class text Part name.
In one possible implementation, described to establish module, it is additionally configured to when the alternative document be so file When, in so file, determine the second target position using the primitive class filename;It is closed based on second mapping System, the primitive class filename that second target location is used are updated to the new class file name.
In one possible implementation, described to establish module, it is additionally configured to based on first mapping relations, it will The original packet name for including in the primitive class filename is updated to the new packet name and class is arranged for the class file again Name, obtains the new class file name.
According to the third aspect of an embodiment of the present disclosure, a kind of library lib integrating device is provided, described device includes:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to: obtain the library target lib for the first version that the specified library lib relies on, first The library lib and the 2nd library lib are with the target lib inventory in dependence, and the version in the library the target lib relied on is not Together, there are dependence between the first library lib and the 2nd library lib, the specified library lib is the first library lib With any one in the 2nd library lib;One is newly established for the library lib that the specified library lib relies on, the 3rd library lib Packet name, class file name and dependence the class text between the library target lib of the second edition of dependence and the newly-established library lib The alternative document of part name is all different, and the 3rd library lib is any one in the first library lib and the 2nd library lib It is a, and the 3rd library lib is different from the specified library lib;Determine the specified library lib and the newly-established library lib it Between dependence.
According to a fourth aspect of embodiments of the present disclosure, a kind of storage medium is provided, computer program instructions are stored thereon with, The computer program instructions realize the library lib integrated approach described in above-mentioned first aspect when being executed by processor.
The technical scheme provided by this disclosed embodiment can include the following benefits:
Pass is being relied on target lib inventory when generating library dependence conflict, such as in the first library lib and the 2nd library lib System, and the version difference in the library target lib that relies on the 2nd library lib of the first library lib, deposit between the first library lib and the 2nd library lib In the case where dependence, the embodiment of the present disclosure can obtain the library target lib for the first version that the specified library lib relies on and create Vertical one library lib relied on for the specified library lib, wherein the specified library lib is any one in the first library lib and the 2nd library lib It is a, in addition to the packet between the library target lib and the newly-established library lib of the second edition for specifying the 3rd library lib in the library lib to rely on The alternative document of name, class file name and dependence class file name is all different, and determines the specified library lib and the newly-established library lib Between dependence, the embodiment of the present disclosure is modified by the library target lib relied on one of library lib, so that double Side relies on to exist simultaneously and realize under the premise of not changing both sides' dependency logic without conflict namely the embodiment of the present disclosure The library lib edition compatibility, will not be because the library lib version be by mandatory constraint, and effect is preferable.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention Example, and be used to explain the principle of the present invention together with specification.
Fig. 1 is a kind of flow chart of library lib integrated approach shown according to an exemplary embodiment.
Fig. 2 is the flow chart of the another kind library lib shown according to an exemplary embodiment integrated approach.
Fig. 3 is a kind of block diagram of library lib integrating device shown according to an exemplary embodiment.
Fig. 4 is the block diagram of the another kind library lib shown according to an exemplary embodiment integrating device.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended The example of device and method being described in detail in claims, some aspects of the invention are consistent.
Fig. 1 is a kind of flow chart of library lib integrated approach shown according to an exemplary embodiment, as shown in Figure 1, the party Method includes the following steps.
In a step 101, the library target lib for the first version that the specified library lib relies on, the first library lib and the 2nd lib are obtained Library is with target lib inventory in dependence, and the version in the library target lib that the first library lib is relied on the 2nd library lib is different, There are dependences between first library lib and the 2nd library lib, and it is any in the first library lib and the 2nd library lib for specifying the library lib One.
In a step 102, a library lib for specifying the library lib to rely on, the second edition that the 3rd library lib relies on newly are established The alternative document of packet name, class file name and dependence class file name between this library target lib and the newly-established library lib is equal Not identical, the 3rd library lib is any one in the first library lib and the 2nd library lib, and the 3rd library lib and the specified library lib are not Together.
In step 103, the dependence between the specified library lib and the newly-established library lib is determined.
The method that the embodiment of the present disclosure provides, when generating library dependence conflict, such as in the first library lib and the 2nd library lib With target lib inventory in dependence, and the version in the library target lib that the first library lib is relied on the 2nd library lib is different, the There are in the case where dependence between one library lib and the 2nd library lib, the embodiment of the present disclosure can obtain the specified library lib and rely on The library lib relied on for the specified library lib is simultaneously newly established in the library target lib of first version, wherein the specified library lib is the first lib Any one in library and the 2nd library lib, in addition to the second edition of specifying the 3rd library lib in the library lib to rely on the library target lib with The alternative document of packet name, class file name and dependence class file name between the newly-established library lib is all different, and determination refers to Determine the dependence between the library lib and the newly-established library lib, the embodiment of the present disclosure passes through the mesh that relies on one of library lib The mark library lib is modified, so that both sides, which rely on to exist simultaneously, is not changing both sides without conflict namely the embodiment of the present disclosure The library lib edition compatibility is realized under the premise of dependency logic, will not be because the library lib version to be by mandatory constraint, effect is preferable.
In one possible implementation, described new to establish one for the library lib that the specified library lib relies on, packet It includes:
Packet name, the library target lib of the second edition described in new Bao Mingyu are reset for the library target lib of the first version Packet name it is different;
Establish the first mapping relations between the original packet name in the library target lib of first version described in the new Bao Mingyu;
Based on first mapping relations, the class file of class file in the library target lib of the first version is reset Name, and the second mapping relations between the primitive class filename of the class file and new class file name are established, the new class file Name is different from the class file name in the library target lib of the second edition;
Based on second mapping relations, the alternative document in the library target lib of the first version is repaired Change, obtains the newly-established library lib.
In one possible implementation, described to be based on second mapping relations, to the target of the first version The alternative document in the library lib is modified, comprising:
When the alternative document is resource file, in the resource file, determine using described original The first object position of class file name;
Based on second mapping relations, the primitive class filename used at the first object position is updated to The new class file name.
In one possible implementation, described to be based on second mapping relations, to the target of the first version The alternative document in the library lib is modified, comprising:
When the alternative document is so file, in so file, the using the primitive class filename is determined Two target positions;
Based on second mapping relations, the primitive class filename that second target location is used is updated to The new class file name.
In one possible implementation, described to be based on first mapping relations, reset the first version The library target lib in class file class file name, comprising:
Based on first mapping relations, the original packet name for including in the primitive class filename is updated to described Simultaneously class name is arranged for the class file again in new packet name, obtains the new class file name.
All the above alternatives can form the alternative embodiment of the disclosure, herein no longer using any combination It repeats one by one.
Fig. 2 is a kind of flow chart of library lib integrated approach shown according to an exemplary embodiment, the execution of this method Main body is mobile terminal, and illustratively, which is the terminal for being equipped with Android operation system, a kind of possible In implementation, the executing subject of this method is Android application program.Referring to fig. 2, this approach includes the following steps.
In step 201, the library target lib for the first version that the specified library lib relies on, the first library lib and the 2nd lib are obtained Library is with target lib inventory in dependence, and the version in the library target lib relied on is different, the first library lib and the 2nd library lib Between there are dependence, specifying the library lib is any one in the first library lib and the 2nd library lib.
The situation that the embodiment of the present disclosure generates library dependence conflict is usual are as follows: the library A of an application program on mobile terminal Dependent on library B and library C, and library B is also integrated with library C simultaneously dependent on library C, i.e. library A and library B simultaneously, and library A and library B is relied on not With the library C of version.
Wherein, library C corresponds to the library above-mentioned target lib, and library A and library B correspond to two libraries lib that above-mentioned generation library relies on conflict, That is the first library lib and the 2nd library lib.And the first specified library lib in the library lib and the 2nd library lib relies on the mesh of first version The library lib is marked, the 3rd library lib in the first library lib and the 2nd library lib relies on the library target lib of the second edition.Wherein, the 3rd lib Library is any one in the first library lib and the 2nd library lib, and the 3rd library lib is different from the specified library lib, i.e., the 3rd library lib is Another library lib other than specifying lib.
In above-mentioned scene, library A has been internally integrated library C, the library C of another version is integrated with further through library B, due to version Difference cannot be compatible with, so the library C that library A relies on two different editions can generate library and rely on conflict.And if library A and library B relies on version This identical library C will not then occur library and rely on conflict.
The embodiment of the present disclosure relies on conflict to solve library, can modify in the first library lib and the 2nd library lib a wherein side institute The library target lib of dependence, i.e., the specified library lib are any one in the first library lib and the 2nd library lib, can also be modified any The library target lib that one side is relied on.In one possible implementation, that version that library B in above-mentioned example can be relied on This library C modifies.
Wherein, the library lib is a kind of static link library.In the example above, for the A of library, library B is a third party Library, and for the B of library, library C is a third party library.For any one library, a unique packet name is all had (Package Name)。
In step 202, packet name, the target of the new Bao Mingyu second edition are reset for the library target lib of first version The packet name in the library lib is different;Establish the first mapping relations between the original packet name in the library target lib of new Bao Mingyu first version.
Since the embodiment of the present disclosure is related to modifying to the packet name in the library target lib of first version, in order to right The packet name of modification front and back distinguishes, and the packet name before modification is referred to as original packet name by the embodiment of the present disclosure, and will modify it Packet name afterwards is referred to as new packet name.
In the embodiments of the present disclosure, the packet name in the library target lib of the Bao Mingyu second edition reset is different, i.e., again One packet name not conflicted is set.Illustratively, the Bao Mingke reset is made of the English alphabet of small letter, and the disclosure is implemented Example is to this without specifically limiting.
In addition, the embodiment of the present disclosure can also be established between the original packet name in the library target lib of new Bao Mingyu first version Mapping relations.It should be noted that can also establish other mapping relations due to subsequent, and in order to different mapping relations into Row is distinguished, and the mapping relations being arranged herein are referred to as the first mapping relations.
In step 203, the first mapping relations are based on, the class of class file in the library target lib of first version is reset Filename, and the second mapping relations between the primitive class filename of the class file and new class file name are established, new class file name It is different from the class file name in the library target lib of the second edition.
Due to including class (Class) file in the library target lib, also need first to be closed according to the first of above-mentioned setting the mapping It is the class file to traverse the library target lib of modification first version, and establishes between primitive class filename and new class file name Second mapping relations.It should be noted why establish the second mapping relations be because are as follows: in addition to including class in the library target lib It further include relying on the alternative document of class file name, therefore also need to modify it according to the second mapping relations of setting except file His file.
A kind of expression way is changed, not only includes Class code in the library target lib, also comprising relying on class file name Resource file and so file etc., therefore when library dependence conflict occurs, it also needs to modify this other than modifying class file A little files are to realize compatibility.
Wherein, class file name consists of two parts, and including the packet name in the library lib and the class name of class file, therefore the disclosure is real Example is applied when resetting class file name, includes but is not limited to take following manner: based on the first mapping relations, by primitive class text The original packet name for including in part name is updated to new packet name and class name is arranged for class file again, obtains new class file name.
Illustratively, can be according to following rule when class name is arranged: class name can be started and its in word by capitalization His letter is small letter;If class name is made of multiple words, the initial of each word should be capitalization for example TestPage;If abridged in class name comprising word, each letter of this abbreviation should all be capitalized, such as: XMLExample, The embodiment of the present disclosure is to this without specifically limiting.
In step 204, the second mapping relations are based on, the alternative document in the library target lib of first version is repaired Change, obtains the newly-established library lib.
In the embodiments of the present disclosure, the alternative document of dependence primitive class filename includes in the library target lib of first version But it is not limited to so file and resource file.Referring to fig. 2, this step is for using original in resource file and so file At the position of beginning class file name, the modification to primitive class filename is completed according to the second mapping relations.
For so file, so file is dynamic link library, so file, that is, ELF in Android operation system (Executable and Linkable Format can be performed and can link format) file, is a binary file.Its In, so file is sometimes directly called, participates in compiling sometimes, i.e., a .so file may be by multiple applications Program uses, therefore is named as share object.
It mainly include text-string (string), color (colors), array for resource file (arrays), animation (anim), layout (layout), image and icon (drawable), audio frequency and video (media) and other answer The component used with program.Wherein, in Android operation system development process, the frequency of use highest of resource file, Either string, drawable or layout, these resources are commonly used and arrive.
Step 204a, it when alternative document is resource resource file, in resource file, determines using original The first object position of class file name;Based on the second mapping relations, more by the primitive class filename used at first object position It is newly new class file name.
Step 204b, it when alternative document is shared library so file, in so file, determines and uses original class file Second target position of name;Based on the second mapping relations, the primitive class filename that the second target location uses is updated to newly Class file name.
It should be noted that 202 foundation for completing the specified library lib to step 204, and the 3rd lib through the above steps Packet name, class file name and the dependence class between the library target lib and the newly-established library lib of the second edition that library relies on The alternative document of filename is all different.
In step 205, the dependence between the specified library lib and the newly-established library lib is determined.
The method that the embodiment of the present disclosure provides, when generating library dependence conflict, such as in the first library lib and the 2nd library lib With target lib inventory in dependence, and the version in the library target lib that the first library lib is relied on the 2nd library lib is different, the There are in the case where dependence between one library lib and the 2nd library lib, the embodiment of the present disclosure can obtain the specified library lib and rely on A library lib for specifying the library lib to rely on simultaneously newly is established in the library target lib of first version, wherein the specified library lib is first Any one in the library lib and the 2nd library lib, in addition to the target lib for the second edition for specifying the 3rd library lib in the library lib to rely on The alternative document of packet name, class file name and dependence class file name between library and the newly-established library lib is all different, and really Surely the dependence between the specified library lib and the newly-established library lib, the embodiment of the present disclosure is by relying on one of library lib The library target lib modify so that both sides rely on can exist simultaneously without conflict namely the embodiment of the present disclosure do not changing The library lib edition compatibility is realized under the premise of both sides' dependency logic, will not be because the library lib version to be by mandatory constraint, effect is preferable.
Fig. 3 is a kind of block diagram of library lib integrating device shown according to an exemplary embodiment.Referring to Fig. 3, the device packet It includes and obtains module 301, establish module 302, determining module 303.
Module 301 is obtained, is configured as obtaining the library target lib for the first version that the specified library lib relies on, the first library lib With the 2nd library lib with the target lib inventory in dependence, and the version in the library the target lib relied on is different, described There are dependence between first library lib and the 2nd library lib, the specified library lib is the first library lib and described the Any one in two libraries lib;
Module 302 is established, is configured as newly establishing one for the library lib that the specified library lib relies on, the 3rd library lib Packet name, class file name and dependence the class text between the library target lib of the second edition of dependence and the newly-established library lib The alternative document of part name is all different, and the 3rd library lib is any one in the first library lib and the 2nd library lib It is a, and the 3rd library lib is different from the specified library lib;
Determining module 303 is configured to determine that the dependence between the specified library lib and the newly-established library lib is closed System.
The device that the embodiment of the present disclosure provides, when generating library dependence conflict, such as in the first library lib and the 2nd library lib With target lib inventory in dependence, and the version in the library target lib that the first library lib is relied on the 2nd library lib is different, the There are in the case where dependence between one library lib and the 2nd library lib, the embodiment of the present disclosure can obtain the specified library lib and rely on A library lib for specifying the library lib to rely on simultaneously newly is established in the library target lib of first version, wherein the specified library lib is first Any one in the library lib and the 2nd library lib, in addition to the mesh for the second edition that another library lib in the specified library lib relies on The alternative document of packet name, class file name and dependence class file name between the mark library lib and the newly-established library lib is all different, And determining the dependence between the specified library lib and the newly-established library lib, the embodiment of the present disclosure passes through to one of library lib The library target lib of dependence is modified, so that both sides, which rely on, can exist simultaneously without conflict namely the embodiment of the present disclosure not The library lib edition compatibility is realized under the premise of change both sides' dependency logic, it will not be because the library lib version be by mandatory constraint, effect Preferably.
In one possible implementation, module 302 is established, the target lib for the first version is additionally configured to Library resets packet name, and the packet name in the library target lib of the second edition described in new Bao Mingyu is different;It establishes described in the new Bao Mingyu The first mapping relations between the original packet name in the library target lib of first version;Based on first mapping relations, reset The class file name of class file in the library target lib of the first version, and establish the primitive class filename of the class file and new The class file name in the library target lib of the second mapping relations between class file name, the new class file name and the second edition It is different;Based on second mapping relations, modify to the alternative document in the library target lib of the first version, Obtain the newly-established library lib.
In one possible implementation, module 302 is established, is additionally configured to when the alternative document be resource When file, in the resource file, the first object position using the primitive class filename is determined;Based on described The primitive class filename used at the first object position is updated to the new class file name by two mapping relations.
In one possible implementation, 302 pieces of mould are established, is additionally configured to when the alternative document be so file When, in so file, determine the second target position using the primitive class filename;It is closed based on second mapping System, the primitive class filename that second target location is used are updated to the new class file name.
In one possible implementation, module 302 is established, is additionally configured to based on first mapping relations, it will The original packet name for including in the primitive class filename is updated to the new packet name and class is arranged for the class file again Name, obtains the new class file name.
All the above alternatives can form the alternative embodiment of the disclosure, herein no longer using any combination It repeats one by one.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method Embodiment in be described in detail, no detailed explanation will be given here.
Fig. 4 is a kind of block diagram of library lib integrating device 400 shown according to an exemplary embodiment.For example, device 400 It can be mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, Medical Devices, Body-building equipment, personal digital assistant etc..
Referring to Fig. 4, device 400 may include following one or more components: processing component 402, memory 404, power supply Component 406, multimedia component 408, audio component 410, the interface 412 of I/O (Input/Output, input/output), sensor Component 414 and communication component 416.
The integrated operation of the usual control device 400 of processing component 402, such as with display, telephone call, data communication, phase Machine operation and record operate associated operation.Processing component 402 may include that one or more processors 420 refer to execute It enables, to perform all or part of the steps of the methods described above.In addition, processing component 402 may include one or more modules, just Interaction between processing component 402 and other assemblies.For example, processing component 402 may include multi-media module, it is more to facilitate Interaction between media component 408 and processing component 402.
Memory 404 is configured as storing various types of data to support the operation in device 400.These data are shown Example includes the instruction of any application or method for operating on device 400, contact data, and telephone book data disappears Breath, picture, video etc..Memory 404 can be by any kind of volatibility or non-volatile memory device or their group It closes and realizes, such as SRAM (Static Random Access Memory, static random access memory), EEPROM (Electrically-Erasable Programmable Read-Only Memory, the read-only storage of electrically erasable Device), EPROM (Erasable Programmable Read Only Memory, Erasable Programmable Read Only Memory EPROM), PROM (Programmable Read-Only Memory, programmable read only memory), and ROM (Read-Only Memory, it is read-only to deposit Reservoir), magnetic memory, flash memory, disk or CD.
Power supply module 406 provides electric power for the various assemblies of device 400.Power supply module 406 may include power management system System, one or more power supplys and other with for device 400 generate, manage, and distribute the associated component of electric power.
Multimedia component 408 includes the screen of one output interface of offer between described device 400 and user.One In a little embodiments, screen may include LCD (Liquid Crystal Display, liquid crystal display) and TP (Touch Panel, touch panel).If screen includes touch panel, screen may be implemented as touch screen, from the user to receive Input signal.Touch panel includes one or more touch sensors to sense the gesture on touch, slide, and touch panel.Institute The boundary of a touch or slide action can not only be sensed by stating touch sensor, but also be detected and the touch or slide phase The duration and pressure of pass.In some embodiments, multimedia component 408 includes that a front camera and/or postposition are taken the photograph As head.When device 400 is in operation mode, such as in a shooting mode or a video mode, front camera and/or rear camera can With the multi-medium data outside reception.Each front camera and rear camera can be a fixed optical lens system Or there are focusing and optical zoom capabilities.
Audio component 410 is configured as output and/or input audio signal.For example, audio component 410 includes a MIC (Microphone, microphone), when device 400 is in operation mode, such as call mode, recording mode, and voice recognition mode When, microphone is configured as receiving external audio signal.The received audio signal can be further stored in memory 404 Or it is sent via communication component 416.In some embodiments, audio component 410 further includes a loudspeaker, for exporting audio Signal.
I/O interface 412 provides interface between processing component 402 and peripheral interface module, and above-mentioned peripheral interface module can To be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and lock Determine button.
Sensor module 414 includes one or more sensors, and the state for providing various aspects for device 400 is commented Estimate.For example, sensor module 414 can detecte the state that opens/closes of equipment 400, the relative positioning of component, such as component For the display and keypad of device 400, sensor module 414 can be with the position of 400 1 components of detection device 400 or device Set change, the existence or non-existence that user contacts with device 400, the temperature in 400 orientation of device or acceleration/deceleration and device 400 Variation.Sensor module 414 may include proximity sensor, be configured to detect without any physical contact near The presence of object.Sensor module 414 can also include optical sensor, such as CMOS (Complementary Metal Oxide Semiconductor, complementary metal oxide) or CCD (Charge-coupled Device, charge coupled cell) image biography Sensor, for being used in imaging applications.In some embodiments, which can also include acceleration sensing Device, gyro sensor, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 416 is configured to facilitate the communication of wired or wireless way between device 400 and other equipment.Device 400 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or their combination.In an exemplary implementation In example, communication component 416 receives broadcast singal or broadcast related information from external broadcasting management system via broadcast channel. In one exemplary embodiment, the communication component 416 further includes that (Near Field Communication, near field are logical by NFC Letter) module, to promote short range communication.
In the exemplary embodiment, device 400 can be by one or more ASIC (Application Specific Integrated Circuit, application specific integrated circuit), DSP (Digital signalProcessor, Digital Signal Processing Device), DSPD (Digital signal Processor Device, digital signal processing appts), PLD (Programmable Logic Device, programmable logic device), FPGA) (Field Programmable Gate Array, field programmable gate Array), controller, microcontroller, microprocessor or other electronic components realize, for executing the above-mentioned library lib integrated approach.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided It such as include the memory 404 of instruction, above-metioned instruction can be executed by the processor 420 of device 400 to complete the above method.For example, The non-transitorycomputer readable storage medium can be ROM, RAM (Random Access Memory, random access memory Device), CD-ROM (Compact Disc Read-Only Memory, compact disc read-only memory), tape, floppy disk and light data deposit Store up equipment etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the processing of device 400 When device executes, so that device 400 is able to carry out the above-mentioned library lib integrated approach.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.

Claims (12)

1. a kind of library lib integrated approach, which is characterized in that the described method includes:
Obtain the library target lib for the first version that the specified library lib relies on, the first library lib and the 2nd library lib with the target Lib inventory is in dependence, and the version in the library the target lib relied on is different, the first library lib and the 2nd lib There are dependence between library, the specified library lib is any one in the first library lib and the 2nd library lib;
According to the specified library lib, the library lib, the library target lib for the second edition that the 3rd library lib relies on and new foundation are newly established The library lib between packet name, class file name and rely on the alternative document of the class file name and be all different, the 3rd lib Library is any one in the first library lib and the 2nd library lib, and the 3rd library lib and the specified library lib are not Together;
Determine the dependence between the specified library lib and the newly-established library lib.
2. being wrapped the method according to claim 1, wherein described newly establish the library lib according to the specified library lib It includes:
Packet name, the packet in the library target lib of the second edition described in new Bao Mingyu are reset for the library target lib of the first version Name is different;
Establish the first mapping relations between the original packet name in the library target lib of first version described in the new Bao Mingyu;
Based on first mapping relations, the class file name of class file in the library target lib of the first version is reset, and Establish the second mapping relations between the primitive class filename of the class file and new class file name, the new class file name and institute The class file name for stating the library target lib of the second edition is different;
Based on second mapping relations, modifies, obtain to the alternative document in the library target lib of the first version To the newly-established library lib.
3. the method according to claim 1, wherein described be based on second mapping relations, to described first The alternative document in the library target lib of version is modified, comprising:
When the alternative document is resource resource file, in the resource file, determine using described original The first object position of class file name;
Based on second mapping relations, the primitive class filename used at the first object position is updated to described New class file name.
4. the method according to claim 1, wherein described be based on second mapping relations, to described first The alternative document in the library target lib of version is modified, comprising:
When the alternative document is shared library so file, in so file, determines and use the original class file Second target position of name;
Based on second mapping relations, the primitive class filename that second target location is used is updated to described New class file name.
5. according to the method described in claim 2, it is characterized in that, it is described be based on first mapping relations, reset institute State the class file name of class file in the library target lib of first version, comprising:
Based on first mapping relations, the original packet name for including in the primitive class filename is updated to the new packet Simultaneously class name is arranged for the class file again in name, obtains the new class file name.
6. a kind of library lib integrating device, which is characterized in that described device includes:
Module is obtained, is configured as obtaining the library target lib for the first version that the specified library lib relies on, the first library lib and second The library lib is with the target lib inventory in dependence, and the version in the library the target lib relied on is different, and described first There are dependence between the library lib and the 2nd library lib, the specified library lib is the first library lib and described second Any one in the library lib;
Module is established, is configured as newly establishing the library lib according to the specified library lib, the second edition that the 3rd library lib relies on The alternative document of packet name, class file name and the dependence class file name between the library target lib and the newly-established library lib is equal Not identical, the 3rd library lib is any one in the first library lib and the 2nd library lib, and the 3rd lib Library is different from the specified library lib;
Determining module, the dependence being configured to determine that between the specified library lib and the newly-established library lib.
7. device according to claim 6, which is characterized in that it is described to establish module, it is additionally configured to as the first edition This library target lib resets packet name, and the packet name in the library target lib of the second edition described in new Bao Mingyu is different;Described in foundation The first mapping relations between the original packet name in the library target lib of first version described in new Bao Mingyu;Based on first mapping Relationship, resets the class file name of class file in the library target lib of the first version, and establishes the original of the class file The second mapping relations between class file name and new class file name, the target lib of the new class file name and the second edition The class file name in library is different;Based on second mapping relations, to other texts described in the library target lib of the first version Part is modified, and the newly-established library lib is obtained.
8. device according to claim 6, which is characterized in that it is described to establish module, it is additionally configured to when other described texts When part is resource resource file, in the resource file, the first mesh using the primitive class filename is determined Cursor position;Based on second mapping relations, the primitive class filename used at the first object position is updated to The new class file name.
9. device according to claim 6, which is characterized in that it is described to establish module, it is additionally configured to when other described texts When part is shared library so file, in so file, the second target position using the primitive class filename is determined; Based on second mapping relations, the primitive class filename that second target location is used is updated to the new class Filename.
10. device according to claim 7, which is characterized in that it is described to establish module, it is additionally configured to based on described first The original packet name for including in the primitive class filename is updated to the new packet name and is again the class by mapping relations Class name is arranged in file, obtains the new class file name.
11. a kind of library lib integrating device, which is characterized in that described device includes:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to: obtain the library target lib for the first version that the specified library lib relies on, the first library lib With the 2nd library lib with the target lib inventory in dependence, and the version in the library the target lib relied on is different, described There are dependence between first library lib and the 2nd library lib, the specified library lib is the first library lib and described the Any one in two libraries lib;According to the specified library lib, the library lib, the mesh for the second edition that the 3rd library lib relies on newly are established It marks the packet name between the library lib and the newly-established library lib, class file name and relies on the alternative document of the class file name not Identical, the 3rd library lib is any one in the first library lib and the 2nd library lib, and the 3rd library lib It is different from the specified library lib;Determine the dependence between the specified library lib and the newly-established library lib.
12. a kind of storage medium, is stored thereon with computer program instructions, which is characterized in that the computer program instructions quilt The library lib integrated approach described in any claim in the claims 1 to 5 is realized when processor executes.
CN201811635805.8A 2018-12-29 2018-12-29 The library lib integrated approach, device and storage medium Pending CN109683954A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811635805.8A CN109683954A (en) 2018-12-29 2018-12-29 The library lib integrated approach, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811635805.8A CN109683954A (en) 2018-12-29 2018-12-29 The library lib integrated approach, device and storage medium

Publications (1)

Publication Number Publication Date
CN109683954A true CN109683954A (en) 2019-04-26

Family

ID=66191206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811635805.8A Pending CN109683954A (en) 2018-12-29 2018-12-29 The library lib integrated approach, device and storage medium

Country Status (1)

Country Link
CN (1) CN109683954A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941443A (en) * 2019-12-12 2020-03-31 支付宝(杭州)信息技术有限公司 Method and device for modifying file name in SDK and electronic equipment
CN111045701A (en) * 2019-07-11 2020-04-21 华控清交信息科技(北京)有限公司 Version switching method and device and version switching device
CN111506567A (en) * 2020-04-24 2020-08-07 苏州达家迎信息技术有限公司 Cross-database cleaning method and device for data, computer equipment and medium
CN111679852A (en) * 2020-05-29 2020-09-18 北京五八信息技术有限公司 Detection method and device for conflict dependency library
CN112764797A (en) * 2021-01-06 2021-05-07 浙江大华技术股份有限公司 Software compatibility detection method and device, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105468650A (en) * 2014-09-12 2016-04-06 阿里巴巴集团控股有限公司 Merge conflict processing method and device and conflicting file processing method and device
CN106293679A (en) * 2015-06-11 2017-01-04 阿里巴巴集团控股有限公司 A kind of element term conflict processing method and device
US9971594B2 (en) * 2016-08-16 2018-05-15 Sonatype, Inc. Method and system for authoritative name analysis of true origin of a file
CN108334334A (en) * 2018-03-07 2018-07-27 政采云有限公司 A kind of management relies on the method and system of packet version
CN108762761A (en) * 2018-05-17 2018-11-06 深圳市分期乐网络科技有限公司 Generation method, device, server and the storage medium of target channel packet

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105468650A (en) * 2014-09-12 2016-04-06 阿里巴巴集团控股有限公司 Merge conflict processing method and device and conflicting file processing method and device
CN106293679A (en) * 2015-06-11 2017-01-04 阿里巴巴集团控股有限公司 A kind of element term conflict processing method and device
US9971594B2 (en) * 2016-08-16 2018-05-15 Sonatype, Inc. Method and system for authoritative name analysis of true origin of a file
CN108334334A (en) * 2018-03-07 2018-07-27 政采云有限公司 A kind of management relies on the method and system of packet version
CN108762761A (en) * 2018-05-17 2018-11-06 深圳市分期乐网络科技有限公司 Generation method, device, server and the storage medium of target channel packet

Non-Patent Citations (7)

* Cited by examiner, † Cited by third party
Title
BENEDICTJIN: "Maven 高级玩法", 《HTTPS://BLOG.CSDN.NET/OASIDUOFU/ARTICLE/DETAILS/80528615》 *
CPTBTPTPSS: "APK文件结构和安装过程", 《HTTPS://BLOG.CSDN.NET/BUPT073114/ARTICLE/DETAILS/42298337》 *
IT小奋: "Java Jar冲突解决", 《HTTPS://BLOG.CSDN.NET/U010820702/ARTICLE/DETAILS/61418922》 *
QILED: "APK基本文件结构", 《HTTPS://BLOG.CSDN.NET/QILED/ARTICLE/DETAILS/80984385》 *
不言不语技术: "Android中集成第三方软件包(.jar, .so)", 《HTTPS://WWW.CNBLOGS.COM/HZCYA1995/P/13318621.HTML》 *
大东: "jar包冲突解决--jarjar工具修改jar包名", 《HTTPS://BLOG.CSDN.NET/WEIXIN_42310890/ARTICLE/DETAILS/81261831》 *
是GUAVA不是瓜娃: "Maven中 jar包冲突原理与解决办法", 《HTTPS://BLOG.CSDN.NET/NOAMAN_WGS/ARTICLE/DETAILS/81137893》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045701A (en) * 2019-07-11 2020-04-21 华控清交信息科技(北京)有限公司 Version switching method and device and version switching device
CN111045701B (en) * 2019-07-11 2024-06-11 华控清交信息科技(北京)有限公司 Version switching method and device for version switching
CN110941443A (en) * 2019-12-12 2020-03-31 支付宝(杭州)信息技术有限公司 Method and device for modifying file name in SDK and electronic equipment
CN111506567A (en) * 2020-04-24 2020-08-07 苏州达家迎信息技术有限公司 Cross-database cleaning method and device for data, computer equipment and medium
CN111506567B (en) * 2020-04-24 2022-10-28 苏州达家迎信息技术有限公司 Cross-database cleaning method and device for data, computer equipment and medium
CN111679852A (en) * 2020-05-29 2020-09-18 北京五八信息技术有限公司 Detection method and device for conflict dependency library
CN112764797A (en) * 2021-01-06 2021-05-07 浙江大华技术股份有限公司 Software compatibility detection method and device, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN109683954A (en) The library lib integrated approach, device and storage medium
US8704914B2 (en) Apparatus to automatically tag image and method thereof
EP3032412A1 (en) Method and device for upgrading firmware
JP7315796B2 (en) Circuit principle diagram check method, device and system
EP3176709A1 (en) Video categorization method and apparatus, computer program and recording medium
WO2017035994A1 (en) Method and apparatus for connecting external device
CN104103085A (en) Objects in screen images
WO2017177595A1 (en) Data migration method and device
CN106528255B (en) Kind loading method and device
KR20150144264A (en) Tag creation method, device and terminal
WO2017088256A1 (en) Unlocking method and device
KR102440341B1 (en) Video processing method, apparatus, terminal and storage medium
CN109670025B (en) Dialogue management method and device
CN109582297A (en) A kind of generation method of Code Template, device, electronic equipment and storage medium
CN105468606B (en) Webpage saving method and device
CN106997356A (en) The sorting technique and device of picture
EP3173949A1 (en) Method and device for pushing user information
CN106528197B (en) Shooting method and device
RU2645590C2 (en) Data processing means and method
CN107506250A (en) Information processing method and equipment
CN111163220B (en) Display method, communication terminal and computer storage medium
JP6082842B2 (en) Application list execution method, application list execution device, program, and recording medium
CN107038034A (en) The method and apparatus that personal account page layout background is provided
CN109194639A (en) Message sink processing method, device, terminal and readable storage medium storing program for executing
JP2007080021A (en) Electronic device with fingerprint matching function

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