CN114721688A - SDK upgrading method and device and computer equipment - Google Patents

SDK upgrading method and device and computer equipment Download PDF

Info

Publication number
CN114721688A
CN114721688A CN202210415416.4A CN202210415416A CN114721688A CN 114721688 A CN114721688 A CN 114721688A CN 202210415416 A CN202210415416 A CN 202210415416A CN 114721688 A CN114721688 A CN 114721688A
Authority
CN
China
Prior art keywords
plug
target
upgraded
sdk
compiling
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
CN202210415416.4A
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 Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao 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 Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202210415416.4A priority Critical patent/CN114721688A/en
Publication of CN114721688A publication Critical patent/CN114721688A/en
Priority to PCT/CN2023/082408 priority patent/WO2023202299A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

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

Abstract

The present disclosure provides an SDK upgrading method, device and computer equipment, wherein the method comprises: determining a plug-in to be upgraded corresponding to the function to be upgraded in the target software tool development kit SDK; determining a specified dependency library on which the plug-in to be upgraded depends; compiling the host engineering to which the SDK belongs based on the specified dependency library, wherein the dependency library of the host application obtained after compiling comprises the specified dependency library; compiling plug-ins to be upgraded except the specified dependency library to obtain target plug-ins, wherein the target plug-ins are used for upgrading the SDK; the target plug-in is capable of invoking a specified dependency library in the host application at run-time. According to the technical scheme, the plug-in package can be reduced by compiling part of the resource library in the plug-in to the host in the host compiling process, so that the technical problems that the plug-in downloading success rate is low and the plug-in code modification amount is large due to the fact that the plug-in package is large are solved.

Description

SDK upgrading method and device and computer equipment
Technical Field
The present disclosure relates to the technical field of computers, and in particular, to an SDK upgrading method and apparatus, and a computer device.
Background
Software Development Kit (SDK) is generally a collection of Development tools used by Software engineers to build application Software for a specific Software package, Software framework, hardware platform, operating system, and the like. At present, self-upgrading schemes of game SDK on the market are all technical schemes adopting similar plug-in components such as replugin and the like. In the technical scheme of plug-in, the host to which the SDK belongs is basically a shell, all functions are put in the plug-in, but if the SDK has more complex functions and depends on more basic libraries, the plug-in to be issued during self-upgrading is large, inconvenience during plug-in updating is caused, and if a user downloads the plug-in, the success rate of plug-in downloading is reduced, so that inconvenience is caused when the client updates the SDK.
Disclosure of Invention
The embodiment of the disclosure at least provides an SDK upgrading method, an SDK upgrading device and computer equipment.
In a first aspect, an embodiment of the present disclosure provides an SDK upgrading method, applied to a server, where the method includes: determining a plug-in to be upgraded corresponding to the function to be upgraded in the target software tool development kit SDK; determining a specified dependency library on which the plug-in to be upgraded depends; compiling the host engineering to which the SDK belongs based on the specified dependency library, wherein the dependency library of the host application obtained after compiling comprises the specified dependency library; compiling plug-ins to be upgraded except the specified dependency library to obtain target plug-ins, wherein the target plug-ins are used for upgrading the SDK; the target plug-in is capable of invoking a specified dependency library in the host application at runtime.
With reference to the first aspect, embodiments of the present disclosure provide a first possible implementation manner of the first aspect, where: compiling the plug-ins to be upgraded except the specified dependency library to obtain target plug-ins, wherein the compiling comprises the following steps: deleting the target code which is the same as the host project in the plug-in to be upgraded after deleting the specified dependency library which the plug-in to be upgraded depends on; and executing an obfuscation compiling task on the plug-in to be upgraded after the object code is deleted, and obtaining the object plug-in after obfuscation compiling, wherein the obfuscation compiling task comprises an indication parameter used for indicating a code used by the plug-in to be upgraded in the host application.
With reference to the first possible implementation manner of the first aspect, an embodiment of the present disclosure provides a second possible implementation manner of the first aspect, where: deleting the target code in the plug-in to be upgraded, which is the same as the host project, comprises the following steps: determining a target SDK package in a plug-in to be upgraded except the specified dependency library, and deleting the target SDK package, wherein the target SDK package comprises the target code and a resource file on which the target code depends; the method further comprises the following steps: adding a target external dependency library for the plug-in to be upgraded; the target external dependency library comprises target resources used in the plug-in to be upgraded, and the target resources are resources which are not included in the plug-in to be upgraded.
With reference to the first possible implementation manner of the first aspect, an embodiment of the present disclosure provides a third possible implementation manner of the first aspect, where: executing an obfuscation compiling task on the plug-in to be upgraded after the target code is deleted, and obtaining the target plug-in after obfuscation compiling, wherein the obfuscation compiling task comprises the following steps: intercepting a confusion compiling task for performing confusion compiling processing on the plug-in to be upgraded; setting plug-in confusion parameters in the confusion compiling task as target data, wherein the target data is used for representing information of a code used by the plug-in to be upgraded in the host application and/or representing confusion rules of the host application for carrying out confusion processing on the code; and performing obfuscation compiling processing on the plug-in to be upgraded according to the plug-in obfuscation parameters set in the obfuscation compiling task to obtain the target plug-in.
With reference to the third possible implementation manner of the first aspect, an embodiment of the present disclosure provides a fourth possible implementation manner of the first aspect, where: the method further comprises the following steps: in the process of compiling the host engineering to which the SDK belongs based on the specified dependency library, performing obfuscation processing on the host engineering containing the specified dependency library to obtain a target table, wherein the target table contains obfuscation rules for obfuscating the specified dependency library; setting the plug-in obfuscation parameter in the obfuscation compiling task as target data, including: and determining the information of the specified dependent libraries moved to the host project and/or the data in the target table as the target data.
With reference to the fourth possible implementation manner of the first aspect, an embodiment of the present disclosure provides a fifth possible implementation manner of the first aspect, where: compiling the plug-ins to be upgraded except the specified dependency library to obtain target plug-ins, and further comprising: determining resource identification information of resource files in the plug-in to be upgraded; and modifying the resource identification information according to a preset rule so that the modified resource identification information of the resource file in the plug-in to be upgraded is different from the resource identification information of the resource file in the host project.
With reference to the first aspect, embodiments of the present disclosure provide a sixth possible implementation manner of the first aspect, where: the method further includes determining the specified dependency library by: determining an external third party dependency library as the designated dependency library; and/or determining the internal dependency library with the updating frequency smaller than the preset frequency and the volume larger than the preset volume as the specified dependency library.
In a second aspect, an embodiment of the present disclosure further provides an SDK upgrading method, applied to a client, where the method includes: detecting whether a plug-in to be updated exists when a target software tool development kit (SDK) is initialized, wherein the plug-in to be updated is the target plug-in determined by the method of any one of claims 1 to 7; and after the plug-in to be updated is detected, loading the plug-in to be updated, and installing the loaded plug-in to be updated so as to finish the upgrading treatment of the target software tool development kit SDK.
In combination with the second aspect, embodiments of the present disclosure provide a first possible implementation manner of the second aspect, where: installing the plug-in to be updated after loading, comprising the following steps: replacing a class loader of an access party accessing the SDK with a preset class loader, and replacing an application context of the access party accessing the SDK with a preset application context; wherein the preset class loader is configured to search classes to be loaded in the host application and a local loaded plugin according to a preset search order, the preset application context is configured such that the access party can search resources in the host application and the loaded plugin simultaneously, and the local loaded plugin comprises: and the plug-in to be updated and the local history loaded plug-ins after loading.
In a third aspect, an embodiment of the present disclosure further provides an SDK upgrading apparatus, where the apparatus is disposed in a server, and the apparatus includes: the system comprises a determining unit, a judging unit and a judging unit, wherein the determining unit is used for determining a plug-in to be upgraded corresponding to a function to be upgraded in a target software tool development kit (SDK); determining a specified dependency library which the plug-in to be upgraded depends on; the mobile unit is used for compiling the host engineering to which the SDK belongs based on the specified dependency library, wherein the dependency library of the host application obtained after compiling comprises the specified dependency library; the compiling unit is used for compiling the plug-ins to be upgraded except the specified dependency library to obtain target plug-ins, wherein the target plug-ins are used for upgrading the SDK; the target plug-in is capable of invoking a specified dependency library in the host application at runtime.
In a fourth aspect, an embodiment of the present disclosure further provides an SDK upgrading apparatus, which is disposed at a client, and the apparatus includes: a detecting unit, configured to detect whether a to-be-updated plug-in exists when a target software tool development kit SDK is initialized, where the to-be-updated plug-in is a target plug-in determined by the method of any one of the first aspect; and the loading and installing unit is used for loading the plug-in to be updated after the plug-in to be updated is detected, and installing the loaded plug-in to be updated so as to finish the upgrading processing of the target software tool development kit SDK.
In a fifth aspect, an embodiment of the present disclosure further provides a computer device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the computer device is running, the machine-readable instructions when executed by the processor performing the steps of the first aspect described above, or any possible implementation of the first aspect.
In a sixth aspect, this disclosed embodiment further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program, when executed by a processor, performs the steps in the first aspect described above or any one of the possible implementation manners of the first aspect.
Firstly, determining a plug-in to be upgraded corresponding to a function to be upgraded in an SDK of a target software tool development kit, and determining a specified dependency library on which the plug-in to be upgraded depends; then, removing the specified dependency library in the plug-in to be upgraded, compiling the host project based on the specified dependency library, and compiling the plug-in to be upgraded with the removed specified dependency library to obtain a target plug-in, wherein the target plug-in is used for upgrading the SDK; wherein the target plug-in is capable of invoking a specified dependency library in the host application at runtime. Compared with the plug-in technical scheme described in the background art, the technical scheme of the disclosure can reduce the volume of the plug-in package by compiling part of the dependency libraries in the plug-ins to the host engineering in the host compiling process, thereby solving the technical problems of low plug-in downloading success rate and large plug-in code modification amount caused by large plug-in package volume.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly described below, and the drawings herein incorporated in and forming a part of the specification illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It is appreciated that the following drawings depict only certain embodiments of the disclosure and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.
Fig. 1 shows a flowchart of an SDK upgrade method provided by an embodiment of the present disclosure;
fig. 2 is a flowchart illustrating a specific method of step S106 in the SDK upgrading method provided in the embodiment of the present disclosure;
fig. 3 is a flowchart illustrating a specific method of step S202 in the SDK upgrading method provided in the embodiment of the present disclosure;
FIG. 4 is a flow chart illustrating another SDK upgrading method provided by the disclosed embodiments;
fig. 5 is a schematic diagram illustrating an SDK upgrade apparatus provided by an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of another SDK upgrading apparatus provided by the disclosed embodiments;
fig. 7 shows a schematic diagram of a computer device provided by an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions in the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.
Research shows that when the SDK is upgraded, the selected technical scheme is a plug-in technical scheme, in the plug-in technical scheme, a host to which the SDK belongs is basically an empty shell, and all functions are placed in a plug-in. If all functions are put in the plug-in, the plug-in package is very large, and at this time, if the user downloads the plug-in, the success rate of plug-in downloading is reduced, so that the operation is inconvenient when the client updates the SDK.
With the rapid development of computer technology, the number of functional modules of the existing client is increasing. If the coupling degree between the functions of the client is high, the development cost of the client is increased. In order to improve the development efficiency of the client and reduce the development cost of the client, a plug-in technology can be adopted to realize the development process of the client. The technology of plug-in can be understood as that a client is developed according to the mode of hosts and plug-ins. That is, the plug-in solution includes one host project and a plurality of plug-in projects.
In the development environment of the client, the host engineering can be compiled to obtain a host application APK; then, the plug-in function can be compiled in the development environment to generate the plug-in APK. The host application can be understood as a main APP, the host application can load the plug-in APK, and the host application can also provide basic class libraries and functions for the plug-in APK; each plug-in APK may correspond to a function in the client, which may be loaded by the host application.
Based on the above research, the present disclosure provides an SDK upgrade method, and compared with the plug-in technical scheme described in the background art, the technical scheme of the present disclosure compiles a part of resource libraries in a plug-in into a host in a host compiling process, so that a plug-in package can be reduced, thereby solving the technical problems of low plug-in download success rate and large plug-in code modification amount caused by a large plug-in package.
The above-mentioned drawbacks are the results of the inventor after practical and careful study, and therefore, the discovery process of the above-mentioned problems and the solutions proposed by the present disclosure to the above-mentioned problems should be the contribution of the inventor in the process of the present disclosure.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
To facilitate understanding of this embodiment, first, a method for upgrading an SDK disclosed in an embodiment of the present disclosure is described in detail, where an execution subject of the method for upgrading an SDK provided in an embodiment of the present disclosure is generally a computer device with certain computing capability, and the computer device includes, for example: a terminal device, which may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle mounted device, a wearable device, or a server or other processing device. In some possible implementations, the SDK upgrade method may be implemented by way of a processor calling computer-readable instructions stored in a memory.
The following describes the SDK upgrade method provided by the embodiment of the present disclosure by taking an execution subject as a terminal device as an example.
Example one
Referring to fig. 1, a flowchart of an SDK upgrading method provided in the embodiment of the present disclosure is shown, where the method includes steps S102 to S106, where:
s102: determining a plug-in to be upgraded corresponding to the function to be upgraded in the SDK of the target software tool development kit; and determining a specified dependency library on which the plug-in to be upgraded depends.
In the embodiment of the present disclosure, the SDK is a set of corresponding access functions provided for a specific client APP, and in order to reduce the coupling degree between the functions in the client, in the technical solution of plug-in, each function included in the SDK may be compiled into a form of a corresponding plug-in APK (android package) file, and the plug-in APK files are issued.
In the embodiment of the present disclosure, functions to be upgraded in the SDK may be determined first, where the functions to be upgraded may be one or more. And then, determining the plug-in corresponding to the function to be upgraded as the plug-in to be upgraded.
After determining the plug-in to be upgraded, a specified dependent library in the plug-in to be upgraded may be determined. Here, the specified dependency library may be determined by:
the first method is as follows: determining an external third party dependency library as the designated dependency library;
the second method comprises the following steps: determining an internal dependency library with an updating frequency smaller than a preset frequency and a volume larger than a preset volume as the designated dependency library;
the third method comprises the following steps: and determining an external third-party dependent library as the specified dependent library, and determining an internal dependent library with an updating frequency smaller than a preset frequency and a volume larger than a preset volume in the internal dependent library as the specified dependent library.
Thus, in embodiments of the present disclosure, specifying a dependency library includes: an external third party dependency library and/or a designated internal dependency library. The specified dependent source library of the plug-in to be upgraded includes a code and a resource corresponding to the plug-in to be upgraded, wherein the resource may include but is not limited to the following resources: various types of resources such as text, pictures, colors, sizes, controls, animations, etc.; the code in the plug-in to be upgraded uses the resources described above during running.
Here, the external third party dependent library may be a common library Support, Gson, or the like; the specified internal dependency library may be an internal dependency library in the plug-in that is bulky (e.g., greater than a predetermined volume) and infrequently updated (e.g., less frequently updated than a predetermined frequency). Wherein, the user can set the specific values of the predetermined volume and the predetermined frequency according to the actual situation, which is not limited in this disclosure.
In the application, the user can specify the external third-party dependency library and the internal dependency library in advance. For example, a dependent library whose update frequency is less than a predetermined frequency among the internal dependent libraries of the plug-in may be determined as the designated dependent library; the update frequency in the internal dependency library of the plug-in is less than the predetermined frequency, and the dependency library with the volume greater than the predetermined volume is determined as the designated dependency library.
S104: and compiling the host engineering to which the SDK belongs based on the specified dependency library, wherein the dependency library of the host application obtained after compiling comprises the specified dependency library.
After the specified dependent library of the plug-in to be upgraded is determined, the specified dependent library can be moved to a host project of the client APP (namely, a host project to which the SDK belongs), and the specified dependent library in the plug-in to be upgraded is deleted. The host project can then be compiled based on the code and resources in the specified dependency library to generate the host application. The generated host application comprises a code file and a resource file.
S106: compiling the plug-in to be upgraded with the designated dependency library removed to obtain a target plug-in, wherein the target plug-in is used for upgrading the SDK; wherein the target plug-in is capable of invoking a specified dependent library in the host when a client runs.
In the embodiment of the present disclosure, after the specified dependent library is removed from the to-be-upgraded plugin, the plugin project corresponding to the to-be-upgraded plugin may be compiled to obtain a new plugin APK file (that is, the target plugin), where the described compiling process refers to a process of generating an external product (for example, an APK file) by combining a code and a resource.
In the embodiment of the disclosure, after compiling the new plug-in APK file, the user can download the plug-ins on the local mobile terminal, install the plug-ins, and perform the upgrade processing of the SDK through the plug-ins.
Firstly, determining a plug-in to be upgraded corresponding to a function to be upgraded in an SDK of a target software tool development kit, and determining a specified dependency library on which the plug-in to be upgraded depends; then, removing the specified dependency library in the plug-in to be upgraded, compiling the host project based on the specified dependency library, and compiling the plug-in to be upgraded with the removed specified dependency library to obtain a target plug-in, wherein the target plug-in is used for upgrading the SDK; wherein the target plug-in is capable of invoking a specified dependency library in the host application at runtime. Compared with the plug-in technical scheme described in the background art, the technical scheme of the disclosure can reduce the volume of the plug-in package by compiling part of the dependency libraries in the plug-ins to the host engineering in the host compiling process, thereby solving the technical problems of low plug-in downloading success rate and large plug-in code modification amount caused by large plug-in package volume.
As can be seen from the above description, in the embodiment of the present disclosure, first, a to-be-upgraded plug-in corresponding to a to-be-upgraded function in an SDK of a target software tool development kit is determined, then, a specified dependency library in the to-be-upgraded plug-in is moved to a host engineering to which the SDK belongs, and finally, a plug-in engineering corresponding to the to-be-upgraded plug-in from which the specified dependency library is removed is compiled to obtain the target plug-in.
In an optional implementation manner of the embodiment of the present disclosure, as shown in fig. 2, the compiling, in step S106, the plug-in to be upgraded except for the specified dependency library to obtain the target plug-in includes the following processes:
step S201, deleting the target code which is the same as the host project in the plug-in to be upgraded after deleting the specified dependency library which the plug-in to be upgraded depends on;
step S202, executing an obfuscating compiling task on the plug-in to be upgraded after the target code is deleted, and obtaining the target plug-in after the obfuscating compiling, wherein the obfuscating compiling task comprises an indication parameter used for indicating a code used by the plug-in to be upgraded in the host application.
As can be seen from the description in the background section, the existing SDK self-upgrading scheme is a similar plug-in scheme. In the technical scheme, if the plug-in and the host application contain the same three-party library code, a Class cast exception error (i.e., a Class conversion error) is easily caused, and the Class conversion error refers to a problem that a Class loader of the host application and a Class loader of the plug-in load the same Class and perform mutual conversion (i.e., a problem that different Class loaders load the same Class and perform mutual conversion). If no duplicate code exists in the host application and the plug-in, the ClassCastException class conversion error can be avoided.
Therefore, in the application, in order to avoid class transformation errors of the classscastexception class, the same code in the plug-in to be upgraded as the host engineering can be deleted in the compiling process of the plug-in to be upgraded. The code in the plug-in to be upgraded, which is the same as the host project, is the target code in step S201. Here, the object code in the plug-in to be upgraded may be deleted by the gradle plug-in. The method comprises the steps that a plug-in unit of the gradle is defined by a related technician in advance, and target codes in the plug-in unit to be upgraded are removed through the plug-in unit of the gradle.
After the target code is removed from the plug-in to be upgraded, the host engineering and the plug-in are ensured not to have repeated codes, and at the moment, ClassCastException class conversion errors can be avoided.
In specific implementation, the target code in the plug-in to be upgraded, which is the same as the host project, can be determined in a code similarity comparison mode. For example, a code whose similarity satisfies a preset similarity requirement (e.g., is greater than a preset similarity threshold) may be determined as the target code. Or, determining a code in the plug-in to be upgraded, which is the same as the host project, according to a code identifier, wherein the code identifier is used for indicating information such as a function, a type, a name and the like of the code. For example, the code with the same code identification in the plug-in to be upgraded and the host project can be determined as the target code.
After the target code in the plug-in to be upgraded is removed, a confusion compiling task can be executed on the plug-in to be upgraded with the target code deleted, and the target plug-in is obtained after confusion compiling.
In an optional implementation manner, the deleting, in the step S201, a target code in the plug-in to be upgraded, which is the same as the target code in the host project, specifically includes the following steps:
and determining a target SDK package in the plug-in to be upgraded except the specified dependency library, and deleting the target SDK package, wherein the target SDK package comprises the target code and the resource file on which the target code depends.
In the technical scheme of plug-in, the codes and the resources corresponding to the codes are integrated in the plug-in project corresponding to the plug-in to be upgraded. Therefore, when the target code is removed from the plug-in to be upgraded, the target SDK packet containing the target code can be determined in the plug-in to be upgraded from which the specified dependent library is deleted. And then deleting the target SDK packet in the plug-in project corresponding to the plug-in to be upgraded, thereby realizing the deletion of the target code in the plug-in to be upgraded. It should be understood that a plug-in project corresponding to a plug-in to be upgraded includes a plurality of SDK packages, each SDK package includes a code and a resource file on which the code depends, where different SDK packages may implement different functions.
In specific implementation, the code identifier of the target code can be obtained, and the SDK packet matched with the code identifier is determined in the plug-in project corresponding to the plug-in to be upgraded, so that the matched SDK packet is determined as the target SDK packet.
Here, each SDK package in the plug-in project corresponding to the plug-in to be upgraded may include a corresponding data package identifier, where the data package identifier may be an identifier determined based on a code included in the SDK package. Based on this, the SDK packet matching the code identification can be determined as the target SDK packet among the plurality of SDK packets based on the packet identification.
As can be seen from the above description, in the plug-in technical solution, the code and the resource corresponding to the code exist in the plug-in project corresponding to the plug-in to be upgraded as a whole, and therefore, when the target code is removed from the plug-in to be upgraded, the resource and the code may be removed at the same time. That is, when the target code is removed from the plug-in to be upgraded, the resource library on which the plug-in to be upgraded depends may be removed. For example, after the target SDK packet is determined, if the target SDK packet is deleted, the resources and codes may be deleted at the same time. If the resources on which the plug-in to be upgraded depends are removed, the plug-in to be upgraded fails to compile due to lack of related resources.
Based on this, the method can further comprise the following steps:
adding a target external dependency library for the plug-in to be upgraded; the target external dependency library comprises target resources used in the plug-in to be upgraded, and the target resources are resources which are not included in the plug-in to be upgraded.
Here, the target resources contained in the target external dependency library are not limited to the resources contained in the target SDK package, and may also be resources that are not contained in the target SDK package and the plug-in to be upgraded and are needed by the plug-in to be upgraded.
In specific implementation, a resource list can be obtained in advance, wherein the resource list comprises all resources required to be used by the plug-in to be upgraded; then, it can be determined that the plug-in project which is not included in the plug-in to be upgraded is the target resource based on the resource list, and the resource which is needed to be used by the plug-in to be upgraded is the target resource.
In specific implementation, after the target SDK package is deleted, whether the plug-in to be upgraded includes the target resource may be determined; the target resource is a resource which is not included in the plug-in to be upgraded, and the target resource is a resource used in the compiling process of the plug-in to be upgraded.
If the plug-in to be upgraded does not contain the target resource, the target resource can be added in the plug-in to be upgraded, and the dependency relationship between the plug-in to be upgraded and the target resource is established, so that the plug-in to be upgraded depends on the target resource in the compiling process.
In particular, an external dependency library including the target resource (i.e., the target external dependency library described in the above step) may be obtained. And adding a target external dependency library containing the target resource in the plug-in project corresponding to the plug-in to be upgraded.
In the embodiment of the present disclosure, after deleting the object code, the gradle plug-in described in the above process may determine whether the plug-in to be upgraded includes a resource (i.e., an object resource) used in the compiling process of the plug-in to be upgraded. If so, executing the subsequent steps; and if not, adding the target external dependency library in the plug-in project corresponding to the plug-in to be upgraded. By means of increasing the target external dependency library through the gradle plug-ins, the plug-ins to be upgraded can independently depend on resources in the target external dependency library and do not depend on codes in the target external dependency library; the method aims to eliminate the codes, which are identical to the host engineering, in the plug-in to be upgraded, so that the plug-in to be upgraded cannot be compiled failure due to lack of related resources.
In the embodiment of the present disclosure, after the target code in the plug-in to be upgraded is removed according to the method described above, obfuscating and compiling the plug-in project corresponding to the plug-in to be upgraded may be performed, and a new plug-in APK file, that is, a target plug-in, after obfuscating and compiling is obtained.
In an alternative embodiment, as shown in fig. 3, in step S202, after the plug-in to be upgraded after the object code is deleted is executed with an obfuscated compilation task, the obfuscating and compiling to obtain the object plug-in includes the following processes:
step S301, intercepting a confusion compiling task for performing confusion compiling processing on the plug-in to be upgraded;
step S302, setting a plug-in obfuscating parameter in the obfuscating compiling task as target data, wherein the target data is used for representing information of a code used by the plug-in to be upgraded in the host application and/or representing an obfuscating rule for obfuscating the code by the host application; wherein, the plug-in confusion parameter can be understood as described in the above steps: and the indication parameter is used for indicating the code used by the plug-in to be upgraded in the host application.
The plug-in obfuscating parameter comprises a third dependent parameter and/or an application obfuscating parameter, wherein the third dependent parameter is used for representing information of a code used by the plug-in to be upgraded in the host application, and the application obfuscating parameter is used for representing an obfuscating rule of the host application for obfuscating the code.
Step S303, performing obfuscation compiling processing on the plug-in to be upgraded according to the plug-in obfuscation parameter set in the obfuscation compiling task to obtain the target plug-in.
In the application, a gradle obfuscating compilation task (progrardtask) when the plug-in project is compiled can be intercepted by the gradle plug-in, so that the purpose of interfering in an obfuscating step in the plug-in package compiling process is achieved. In the embodiment of the disclosure, the purpose of intervening the obfuscation step is to enable the plug-in to be upgraded to be obfuscated into the code that can be recognized by the host during the obfuscation process.
In the embodiment of the disclosure, after intercepting the obfuscated compiling task, a plug-in obfuscating parameter in the obfuscated compiling task may be modified, where the plug-in obfuscating parameter includes: a third party dependent parameter (i.e., libraryJars parameter) and/or an application obfuscation parameter (i.e., applymaping parameter). The libraryJars parameter is used for indicating a three-party package imported into the host project (namely, the specified dependency library imported into the host) and information used for indicating the code used by the plug-in to be upgraded in the host project, and the applymaping parameter is used for indicating the host to apply an obfuscation rule for obfuscating the code.
The information of the specified dependency library moved to the host engineering and the information of the code used by the plug-in to be upgraded in the host engineering can be set as the third-party dependency parameters (namely, libraryJars parameters); and setting data in the target table as an application obfuscating parameter (i.e., an obfuscating parameter), wherein the target table contains an obfuscating rule for obfuscating the host, and the target table may be a mapping table.
In the embodiment of the present disclosure, the information of the specified dependency library stored in the host engineering and the code used by the plug-in to be upgraded in the host engineering may be added to the libraryJars parameter in the plug-in obfuscation compilation task to indicate the specified dependency library imported into the host engineering and indicate the information of the code used by the plug-in to be upgraded in the specified dependency library. The data in the host mapping table is then added to the applymaping parameter in the obfuscated compilation task to indicate the obfuscation rules when the plug-in invokes the code in the host application. At this time, the applymapping parameter is used in cooperation with the libraryJars parameter, so that all codes in the host application are taken as third-party dependencies to be added into the obfuscating dependencies, and obfuscating is carried out according to obfuscating rules recorded in a mapping table of the host during obfuscating so as to be obfuscated into the codes which can be identified by the host application.
It should be noted that, in the embodiment of the present disclosure, since the specified dependency library moved into the host engineering may also be used in the plug-in compiling process, it is also necessary to implement adding the dependency in the host engineering into the obfuscated dependency through the above-described process, so that the plug-in can continue to use these dependent resources.
It should be noted that, in the SDK upgrade method provided by the present disclosure, the method includes not only a compilation process of a plug-in project but also a compilation process of a host project, where the compilation process of the host project may be understood as:
and in the process of compiling the host project to which the SDK belongs based on the specified dependency library, performing obfuscation processing on the host project including the specified dependency library, and obfuscating to obtain a target table, wherein the target table includes obfuscating rules for obfuscating the specified dependency library.
Based on this, the step of setting the plug-in obfuscation parameter in the obfuscation compiling task as target data includes:
and determining the information of the specified dependent libraries moved to the host project and/or the data in the target table as the target data.
In embodiments of the present disclosure, the host project may be compiled after the specified dependency library is moved into the host project. In the compiling process of the host engineering, the specified dependency library brought into the host engineering and the mapping table after host engineering obfuscation processing can be stored, and the obfuscating rule of the host engineering after obfuscation is recorded in the mapping table for use in a subsequent plug-in generating process, wherein the mapping table is the target table.
According to the description, after the specified dependency library in the plug-in to be upgraded is moved to the host engineering, the host engineering can be subjected to obfuscation compiling processing to obtain the mapping table, and the mapping table is stored. Thereafter, step S104 and step S106 may be performed. In the process of executing step S106, when performing obfuscation compilation processing on the plug-in to be upgraded after the target code is removed, the data in the mapping table saved in advance may be set as an application obfuscation parameter (i.e., an applymappinging parameter), so as to execute an obfuscation compilation task of the plug-in according to the applymapping parameter and the libraryJars parameter.
In another optional implementation manner of the present disclosure, step S106, compiling plug-ins to be upgraded except for the specified dependency library to obtain target plug-ins, further includes the following processes:
firstly, determining resource identification information of resource files in the plug-in to be upgraded;
and then, modifying the resource identification information according to a preset rule so that the modified resource identification information of the resource file in the plug-in to be upgraded is different from the resource identification information of the resource file in the host project.
And pre-allocating a corresponding resource ID for the resource file, wherein the resource ID is an 8-bit hexadecimal integer. For example: 0x01010001, 0x7f010001, in the format ppteteee, PP denotes the package type.
In the embodiment of the present disclosure, the plug-in to be upgraded and the host project include corresponding resource IDs (i.e., resource identification information), and at this time, in order to distinguish the resource IDs (i.e., resource identification information) in the plug-in to be upgraded and the host project, the resource IDs (i.e., resource identification information) in the plug-in to be upgraded need to be modified. If the resource IDs of the plug-in to be upgraded and the host are not distinguished, the problem that the resource IDs are the same, but the same resource ID corresponds to different resources may occur.
Specifically, in the embodiment of the present disclosure, the package ID field in the resource ID in the plug-in to be upgraded may be replaced, and is changed from 7f beginning to non-7 f beginning, so as to facilitate distinguishing from the resource in the host project.
As can be seen from the above description, the present application provides an SDK upgrading method, by which a convenient self-upgrade scheme can be provided for an SDK (e.g., game SDK) with a complex function and structure, and the normal forwarding process is not affected substantially, and a classscastexception error can be avoided, while the size of a plug-in package is reduced as much as possible.
Example two
Referring to fig. 4, a flowchart of an SDK upgrading method provided in the embodiment of the present disclosure is shown, where the method includes steps S402 to S404, where:
step S402: when a target software tool development kit (SDK) is initialized, whether a plug-in to be updated exists is detected, wherein the plug-in to be updated is the target plug-in determined by the method in any one of the first embodiment.
Step S404: and after the plug-in to be updated is detected, loading the plug-in to be updated, and installing the loaded plug-in to be updated so as to finish the upgrading treatment of the target software tool development kit SDK.
Compared with the plug-in technical scheme described in the background technology, the SDK upgrading method provided by the embodiment of the disclosure compiles a partial resource library in the plug-in into the host application in the host compiling process, can reduce the volume of the plug-in package, and thus solves the technical problems of low plug-in download success rate and large plug-in code modification amount caused by large volume of the plug-in package.
Specifically, in the embodiment of the present disclosure, in the process of initializing the SDK, it is first determined whether a plug-in to be updated exists locally or whether a plug-in to be downloaded and updated exists. If the plug-in to be updated exists locally, the subsequent steps are continuously executed; if the local plug-in is to be downloaded and updated, downloading the plug-in to be updated, and continuing to execute the subsequent steps.
After the plug-in to be updated is downloaded, the plug-in to be updated can be loaded, and the loaded plug-in to be updated is installed, so that the upgrading processing of the SDK is completed.
In an optional implementation manner of the embodiment of the present disclosure, in step S404, installing the plug-in to be updated after being loaded includes the following processes:
replacing a class loader of an access party accessing the SDK with a preset class loader, and replacing an application context of the access party accessing the SDK with a preset application context;
wherein the preset class loader is configured to search classes to be loaded in the host application and a local loaded plugin according to a preset search order, the preset application context is configured such that the access party can search resources in the host application and the loaded plugin simultaneously, and the local loaded plugin comprises: the plug-in to be updated after loading and the local history loaded plug-in.
In the embodiment of the disclosure, in the SDK initialization process, after a plug-in to be updated is detected, the plug-in to be updated is loaded, a class loader of an access side of the SDK is replaced, and the class loader is replaced by a preset class loader, wherein when the preset class loader loads a class, a class in a host application is searched first; if not, the local loaded plug-in is searched; if not, then query whether there is an unloaded plug-in. If the plug-ins are not loaded, the plug-ins are triggered to be loaded, and then classes are searched in the plug-ins after the plug-ins are loaded.
In the embodiment of the present disclosure, the application context of the access side of the SDK may also be replaced with a preset application context, and the preset application context is configured to be able to search resources in the host application and the loaded plug-in at the same time.
It should be noted that, in the existing plug-in technical solution, the host application calls the plug-in, and the plug-in calls the host application and needs to be adapted to a certain degree, and for the SDK with a complicated engineering structure, the SDK needs to be adapted and modified with a large workload first, which is inconvenient.
In the method, the class loader of the access party of the target software tool development kit SDK is replaced by the preset class loader, and the application context of the access party of the target software tool development kit SDK is replaced by the preset application context, so that the new function of the plug-in can be normally developed when the plug-in is developed, and the plug-in can normally call the required host code without special processing.
In the embodiment of the disclosure, in the plug-in installation process, a corresponding class loader can be created for the plug-in, and resources in the plug-in are added. After the callback that the plug-in loading is successful is received, the corresponding function in the plug-in SDK can be used, and the function in the plug-in can be self-upgraded in a mode of a dynamically issued new version plug-in.
According to the technical scheme, the problems that the plug-in package is large, the host plug-ins are complex to call and the like in the self-upgrading process of the complex SDK are solved, and meanwhile, the plug-ins can be developed basically according to a normal development mode; and the usability of the SDK self-upgrading development is enlarged, the size of the plug-in package is reduced as much as possible, and the downloading flow of a user is saved.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Based on the same inventive concept, an SDK upgrading device corresponding to the SDK upgrading method is also provided in the embodiments of the present disclosure, and since the principle of the device in the embodiments of the present disclosure for solving the problem is similar to the SDK upgrading method described above in the embodiments of the present disclosure, the implementation of the device may refer to the implementation of the method, and repeated details are not described again.
EXAMPLE III
Referring to fig. 5, a schematic architecture diagram of an SDK upgrading apparatus provided in an embodiment of the present disclosure is shown, where the apparatus includes: a determination unit 51, a moving unit 52, a compiling unit 53; wherein the content of the first and second substances,
a determining unit 51, configured to determine a to-be-upgraded plug-in corresponding to a to-be-upgraded function in the target software tool development kit SDK; determining a specified dependency library which the plug-in to be upgraded depends on;
the mobile unit 52 is configured to compile a host project to which the SDK belongs based on the specified dependency library, where the dependency library of the host application obtained after compilation includes the specified dependency library;
the compiling unit 53 is configured to compile plug-ins to be upgraded, except for the specified dependency library, to obtain a target plug-in, where the target plug-in is configured to upgrade the SDK; the target plug-in is capable of invoking a specified dependency library in the host application at runtime.
In the embodiment of the disclosure, firstly, a plug-in to be upgraded corresponding to a function to be upgraded in a target software tool development kit (SDK) is determined, and a specified dependency library on which the plug-in to be upgraded depends is determined; then, removing the specified dependency library in the plug-in to be upgraded, compiling the host project based on the specified dependency library, and compiling the plug-in to be upgraded with the removed specified dependency library to obtain a target plug-in, wherein the target plug-in is used for upgrading the SDK; wherein the target plug-in is capable of invoking a specified dependency library in the host application at runtime. Compared with the plug-in technical scheme described in the background art, the technical scheme of the disclosure can reduce the volume of the plug-in package by compiling part of the dependency libraries in the plug-ins to the host engineering in the host compiling process, thereby solving the technical problems of low plug-in downloading success rate and large plug-in code modification amount caused by large plug-in package volume.
In a possible implementation manner, the compiling unit is further configured to: deleting the target code which is the same as the host project in the plug-in to be upgraded after deleting the specified dependency library which the plug-in to be upgraded depends on; and executing an obfuscation compiling task on the plug-in to be upgraded after the target code is deleted, and obtaining the target plug-in after obfuscation compiling, wherein the obfuscation compiling task comprises an indication parameter used for indicating a code used by the plug-in to be upgraded in the host application.
In a possible implementation, the compiling unit is further configured to: deleting the target code in the plug-in to be upgraded, which is the same as the host project, comprises the following steps: determining a target SDK package in a plug-in to be upgraded except the specified dependency library, and deleting the target SDK package, wherein the target SDK package comprises the target code and a resource file on which the target code depends; the apparatus is also configured to: adding a target external dependency library for the plug-in to be upgraded; the target external dependency library comprises target resources used in the plug-in to be upgraded, and the target resources are resources which are not included in the plug-in to be upgraded.
In a possible implementation manner, the compiling unit is further configured to: intercepting a confusion compiling task for performing confusion compiling processing on the plug-in to be upgraded; setting plug-in confusion parameters in the confusion compiling task as target data, wherein the target data is used for representing information of a code used by the plug-in to be upgraded in the host application and/or representing confusion rules of the host application for carrying out confusion processing on the code; and performing obfuscation compiling processing on the plug-in to be upgraded according to the plug-in obfuscation parameters set in the obfuscation compiling task to obtain the target plug-in.
In one possible embodiment, the apparatus is further configured to: in the process of compiling the host engineering to which the SDK belongs based on the specified dependency library, performing obfuscation processing on the host engineering containing the specified dependency library to obtain a target table, wherein the target table contains obfuscation rules for obfuscating the specified dependency library; a compiling unit further configured to: and determining the information of the specified dependent libraries moved to the host project and/or the data in the target table as the target data.
In a possible implementation, the compiling unit is further configured to: determining resource identification information of resource files in the plug-in to be upgraded; and modifying the resource identification information according to a preset rule so that the modified resource identification information of the resource file in the plug-in to be upgraded is different from the resource identification information of the resource file in the host project.
In one possible embodiment, the method further comprises determining the specified dependency base by: determining an external third party dependency library as the designated dependency library; and/or determining the internal dependency library with the updating frequency smaller than the preset frequency and the volume larger than the preset volume as the specified dependency library.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
Example four
Referring to fig. 6, a schematic architecture diagram of an SDK upgrading apparatus provided in an embodiment of the present disclosure is shown, where the apparatus includes: a detection unit 61, a loading and mounting unit 62; wherein the content of the first and second substances,
a detecting unit 61, configured to detect whether a plug-in to be updated exists when a target software tool development kit SDK is initialized, where the plug-in to be updated is a target plug-in determined by the method according to any one of claims 1 to 7;
and a loading and installing unit 62, configured to load the plug-in to be updated after the plug-in to be updated is detected, and install the loaded plug-in to be updated, so as to complete the upgrade processing on the target software tool development kit SDK.
In the embodiment of the disclosure, first, when a target software tool development kit SDK is initialized, whether a plug-in to be updated exists is detected, and then, after the plug-in to be updated is detected, the plug-in to be updated is loaded, and the loaded plug-in to be updated is installed, so as to complete the upgrade processing of the target software tool development kit SDK.
In a possible embodiment, the load mount unit is further configured to: replacing a class loader of an access party accessing the SDK with a preset class loader, and replacing an application context of the access party accessing the SDK with a preset application context; wherein the preset class loader is configured to search classes to be loaded in the host application and a local loaded plugin according to a preset search order, the preset application context is configured such that the access party can search resources in the host application and the loaded plugin simultaneously, and the local loaded plugin comprises: and the plug-in to be updated and the local history loaded plug-ins after loading.
EXAMPLE five
Based on the same technical concept, the embodiment of the disclosure also provides computer equipment. Referring to fig. 7, a schematic structural diagram of a computer device 700 provided in the embodiment of the present disclosure includes a processor 701, a memory 702, and a bus 703. The memory 702 is used for storing execution instructions and includes a memory 7021 and an external memory 7022; the memory 7021 is also referred to as an internal memory, and is used to temporarily store operation data in the processor 701 and data exchanged with an external memory 7022 such as a hard disk, the processor 701 exchanges data with the external memory 7022 through the memory 7021, and when the computer apparatus 700 is operated, the processor 701 and the memory 702 communicate with each other through the bus 703, so that the processor 701 executes the following instructions:
determining a plug-in to be upgraded corresponding to the function to be upgraded in the target software tool development kit SDK; determining a specified dependency library on which the plug-in to be upgraded depends;
compiling the host engineering to which the SDK belongs based on the specified dependency library, wherein the dependency library of the host application obtained after compiling comprises the specified dependency library;
compiling plug-ins to be upgraded except the specified dependency library to obtain target plug-ins, wherein the target plug-ins are used for upgrading the SDK; the target plug-in is capable of invoking a specified dependency library in the host application at runtime.
The processor 701 may also execute the following instructions:
when a target software tool development kit (SDK) is initialized, detecting whether a plug-in to be updated exists, wherein the plug-in to be updated is a target plug-in determined by any one of the methods of the first aspect; and after the plug-in to be updated is detected, loading the plug-in to be updated, and installing the loaded plug-in to be updated so as to finish the upgrading treatment of the target software tool development kit SDK.
The embodiments of the present disclosure also provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the SDK upgrading method described in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
The computer program product for updating the SDK provided in the embodiment of the present disclosure includes a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the steps of updating the SDK in the above method embodiment, which may be referred to specifically for the above method embodiment, and are not described herein again.
The embodiments of the present disclosure also provide a computer program, which when executed by a processor implements any one of the methods of the foregoing embodiments. The computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the units into only one type of logical function may be implemented in other ways, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in software functional units and sold or used as a stand-alone product, may be stored in a non-transitory computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used for illustrating the technical solutions of the present disclosure and not for limiting the same, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: those skilled in the art can still make modifications or changes to the embodiments described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the technical scope of the disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (13)

1. An SDK upgrade method, the method comprising:
determining a plug-in to be upgraded corresponding to the function to be upgraded in the target software tool development kit SDK; determining a specified dependency library on which the plug-in to be upgraded depends;
compiling the host engineering to which the SDK belongs based on the specified dependency library, wherein the dependency library of the host application obtained after compiling comprises the specified dependency library;
compiling plug-ins to be upgraded except the specified dependency library to obtain target plug-ins, wherein the target plug-ins are used for upgrading the SDK; the target plug-in is capable of invoking a specified dependency library in the host application at runtime.
2. The method of claim 1, wherein compiling plug-ins to be upgraded other than the specified dependency library to obtain target plug-ins comprises:
deleting the target code which is the same as the host project in the plug-in to be upgraded after deleting the specified dependency library which the plug-in to be upgraded depends on;
and executing an obfuscation compiling task on the plug-in to be upgraded after the target code is deleted, and obtaining the target plug-in after obfuscation compiling, wherein the obfuscation compiling task comprises an indication parameter used for indicating a code used by the plug-in to be upgraded in the host application.
3. The method of claim 2,
deleting the target code in the plug-in to be upgraded, which is the same as the host project, wherein the deleting comprises the following steps: determining a target SDK package in a plug-in to be upgraded except the specified dependency library, and deleting the target SDK package, wherein the target SDK package comprises the target code and a resource file on which the target code depends;
the method further comprises the following steps: adding a target external dependency library for the plug-in to be upgraded; the target external dependency library comprises target resources used in the plug-in to be upgraded, and the target resources are resources which are not included in the plug-in to be upgraded.
4. The method of claim 2, wherein performing obfuscating compilation on the plug-in to be upgraded after the object code is deleted, the obfuscating compilation to obtain the object plug-in comprises:
intercepting a confusion compiling task for performing confusion compiling processing on the plug-in to be upgraded;
setting plug-in confusion parameters in the confusion compiling task as target data, wherein the target data is used for representing information of a code used by the plug-in to be upgraded in the host application and/or representing confusion rules of the host application for carrying out confusion processing on the code;
and performing obfuscation compiling processing on the plug-in to be upgraded according to the plug-in obfuscation parameters set in the obfuscation compiling task to obtain the target plug-in.
5. The method of claim 4, further comprising:
in the process of compiling the host engineering to which the SDK belongs based on the specified dependency library, performing obfuscation processing on the host engineering containing the specified dependency library to obtain a target table, wherein the target table contains obfuscation rules for obfuscating the specified dependency library;
setting the plug-in obfuscation parameter in the obfuscation compiling task as target data, including:
and determining the information of the specified dependent libraries moved to the host project and/or the data in the target table as the target data.
6. The method of claim 1, wherein compiling plug-ins to be upgraded other than the specified dependency library to obtain target plug-ins further comprises:
determining resource identification information of resource files in the plug-in to be upgraded;
and modifying the resource identification information according to a preset rule so that the modified resource identification information of the resource file in the plug-in to be upgraded is different from the resource identification information of the resource file in the host project.
7. The method of claim 1, further comprising determining the specified dependency library by:
determining an external third party dependency library as the designated dependency library;
and/or
And determining the internal dependency library with the updating frequency smaller than the preset frequency and the volume larger than the preset volume as the specified dependency library.
8. An SDK upgrading method is applied to terminal equipment, and the method comprises the following steps:
detecting whether a plug-in to be updated exists when a target software tool development kit (SDK) is initialized, wherein the plug-in to be updated is the target plug-in determined by the method of any one of claims 1 to 7;
and after the plug-in to be updated is detected, loading the plug-in to be updated, and installing the loaded plug-in to be updated so as to finish the upgrading treatment of the target software tool development kit SDK.
9. The method of claim 8, wherein installing the plug-in to be updated after loading comprises:
replacing a class loader of an access party accessing the SDK with a preset class loader, and replacing an application context of the access party accessing the SDK with a preset application context;
wherein the preset class loader is configured to search classes to be loaded in the host application and a local loaded plugin according to a preset search order, the preset application context is configured such that the access party can search resources in the host application and the loaded plugin simultaneously, and the local loaded plugin comprises: and the plug-in to be updated and the local history loaded plug-ins after loading.
10. An SDK upgrading device, which is arranged on a server, the device comprises:
the system comprises a determining unit, a judging unit and a judging unit, wherein the determining unit is used for determining a plug-in to be upgraded corresponding to a function to be upgraded in a target software tool development kit (SDK); determining a specified dependency library on which the plug-in to be upgraded depends;
the mobile unit is used for compiling the host engineering to which the SDK belongs based on the specified dependency library, wherein the dependency library of the host application obtained after compiling comprises the specified dependency library;
the compiling unit is used for compiling the plug-ins to be upgraded except the specified dependency library to obtain target plug-ins, wherein the target plug-ins are used for upgrading the SDK; the target plug-in is capable of invoking a specified dependency library in the host application at runtime.
11. An SDK upgrading device, which is arranged at a client, the device comprises:
a detecting unit, configured to detect whether a plug-in to be updated exists when a target software tool development kit SDK is initialized, where the plug-in to be updated is a target plug-in determined by the method according to any one of claims 1 to 7;
and the loading and installing unit is used for loading the plug-in to be updated after the plug-in to be updated is detected, and installing the loaded plug-in to be updated so as to finish the upgrading processing of the target software tool development kit SDK.
12. A computer device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when a computer device is running, the machine-readable instructions when executed by the processor performing the steps of the SDK upgrade method of any one of claims 1 to 9.
13. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, performs the steps of the SDK upgrade method of any one of claims 1 to 9.
CN202210415416.4A 2022-04-20 2022-04-20 SDK upgrading method and device and computer equipment Pending CN114721688A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210415416.4A CN114721688A (en) 2022-04-20 2022-04-20 SDK upgrading method and device and computer equipment
PCT/CN2023/082408 WO2023202299A1 (en) 2022-04-20 2023-03-20 Sdk upgrade method and apparatus, and computer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210415416.4A CN114721688A (en) 2022-04-20 2022-04-20 SDK upgrading method and device and computer equipment

Publications (1)

Publication Number Publication Date
CN114721688A true CN114721688A (en) 2022-07-08

Family

ID=82246342

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210415416.4A Pending CN114721688A (en) 2022-04-20 2022-04-20 SDK upgrading method and device and computer equipment

Country Status (2)

Country Link
CN (1) CN114721688A (en)
WO (1) WO2023202299A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023202299A1 (en) * 2022-04-20 2023-10-26 北京字跳网络技术有限公司 Sdk upgrade method and apparatus, and computer device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117290257B (en) * 2023-11-27 2024-02-02 天津丈八网络安全科技有限公司 Software lifecycle standardization management method and system based on plug-in call
CN118037405A (en) * 2024-04-12 2024-05-14 张家港保税数据科技有限公司 Lightweight dynamic delivery service method and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7725881B2 (en) * 2006-06-09 2010-05-25 Microsoft Corporation Automatically extracting coupling metrics from compiled code
US8887154B2 (en) * 2012-09-06 2014-11-11 Imagine Communications Corp. Systems and methods for partitioning computing applications to optimize deployment resources
CN109542445A (en) * 2017-08-01 2019-03-29 北京京东尚科信息技术有限公司 A kind of method and apparatus that Android plug-in unit melts hair
CN111258587B (en) * 2020-01-17 2023-08-22 苏宁云计算有限公司 Android application plug-in implementation method, device, equipment and storage medium
CN113407165B (en) * 2021-06-29 2023-04-07 抖音视界有限公司 SDK generation and self-upgrade method, device, readable medium and equipment
CN114721688A (en) * 2022-04-20 2022-07-08 北京字跳网络技术有限公司 SDK upgrading method and device and computer equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023202299A1 (en) * 2022-04-20 2023-10-26 北京字跳网络技术有限公司 Sdk upgrade method and apparatus, and computer device

Also Published As

Publication number Publication date
WO2023202299A1 (en) 2023-10-26

Similar Documents

Publication Publication Date Title
EP3128421B1 (en) Method, device, and system for achieving java application installation by cloud compilation
CN108897562B (en) Installation package updating method, device, medium and equipment
CN114721688A (en) SDK upgrading method and device and computer equipment
CN107967139B (en) Hot updating method and device for game
US20040250245A1 (en) Network having customizable generators and electronic device having customizable updating software
EP2098955A1 (en) Dynamic resolution of dependent components
CN107797820B (en) Method and device for generating patch
CN104375849A (en) Core loading method and device
EP3296906A1 (en) Method for protecting dex file from being decompiled in android system
CN107861742A (en) The operation method and terminal device of a kind of program
CN112769706B (en) Componentized routing method and system
CN106796521B (en) API version control independent of product release
CN111290801A (en) Data processing method, data processing device, computer equipment and storage medium
CN104731622A (en) Application program loading method and device and mobile terminal
CN112612502A (en) Patch generation method, device, equipment and storage medium
US11036852B2 (en) System and method for software diversification
CN110045998A (en) Load the method and device of dynamic base
JP2007510211A (en) Mapping dynamic link libraries on computer equipment
US10552135B1 (en) Reducing a size of an application package
WO2023207418A1 (en) Sdk upgrade method and apparatus, and computer device
CN116775087A (en) Thermal repair method, device, electronic equipment and storage medium
CN111949303A (en) Upgrade package processing method and device, electronic equipment and storage medium
CN110046504B (en) SO file hiding method, storage medium and device based on Linker
CN113157348A (en) Game starting method and device, computer equipment and storage medium
CN113419735B (en) Plug-in optimization method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination