WO2023202299A1 - Procédé et appareil de mise à niveau de sdk, et dispositif informatique - Google Patents

Procédé et appareil de mise à niveau de sdk, et dispositif informatique Download PDF

Info

Publication number
WO2023202299A1
WO2023202299A1 PCT/CN2023/082408 CN2023082408W WO2023202299A1 WO 2023202299 A1 WO2023202299 A1 WO 2023202299A1 CN 2023082408 W CN2023082408 W CN 2023082408W WO 2023202299 A1 WO2023202299 A1 WO 2023202299A1
Authority
WO
WIPO (PCT)
Prior art keywords
plug
target
upgraded
sdk
library
Prior art date
Application number
PCT/CN2023/082408
Other languages
English (en)
Chinese (zh)
Inventor
魏君成
Original Assignee
北京字跳网络技术有限公司
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 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2023202299A1 publication Critical patent/WO2023202299A1/fr

Links

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

Definitions

  • the present disclosure belongs to the field of computer technology, and specifically relates to an SDK upgrade method, device and computer equipment.
  • SDK Software Development Kit
  • the host to which the SDK belongs is basically an empty shell, and all functions are placed in the plug-in. If the functions of the SDK are more complex and rely on many basic libraries, the plug-ins to be distributed during self-upgrade will be very large, causing inconvenience during plug-in updates. Moreover, if users download plug-ins, the success rate of plug-in download will be reduced, thus This causes inconvenience when updating the SDK on the client side.
  • the embodiments of the present disclosure provide at least an SDK upgrade method, device and computer equipment.
  • embodiments of the present disclosure provide an SDK upgrade method, applied to a server.
  • the method includes: determining the plug-in to be upgraded corresponding to the function to be upgraded in the target software tool development kit SDK; and determining the plug-in to be upgraded.
  • the specified dependent library it depends on; compile the host project to which the SDK belongs based on the specified dependent library, wherein the dependency library of the host application obtained after compilation contains the specified dependent library; except the specified dependent library Compile other plug-ins to be upgraded to obtain a target plug-in, wherein the target plug-in is used to upgrade the SDK; the target plug-in can call the specified dependent library in the host application during runtime.
  • compiling the plug-in to be upgraded except the specified dependent library to obtain the target plug-in includes: after deleting the specified dependent library on which the plug-in to be upgraded depends, deleting the plug-in to be upgraded and The same target code as the host project; perform an obfuscation compilation task on the plug-in to be upgraded after deleting the target code, and obtain the target plug-in after obfuscation and compilation, wherein the obfuscation compilation task includes instructions for the plug-in to be upgraded Indicative parameters for code used in the host application.
  • an embodiment of the present disclosure provides a second possible implementation manner of the first aspect, wherein: deleting the target code in the plug-in to be upgraded that is the same as the host project includes: : Determine the target SDK package in the plug-in to be upgraded except the specified dependent library, and delete the target SDK package, wherein the target SDK package contains the target code and the resource files on which the target code depends;
  • the method also includes: adding a target external dependency library for the plug-in to be upgraded; wherein the target external dependency library contains target resources used in the plug-in to be upgraded, and the target resources are not included in the plug-in to be upgraded. Resources in the plugin.
  • the embodiment of the present disclosure provides a third possible implementation manner of the first aspect, wherein: performing obfuscated compilation on the plug-in to be upgraded after deleting the target code
  • the task is to obtain the target plug-in after obfuscation and compilation, including: intercepting the obfuscation and compilation task of performing obfuscation and compilation processing on the plug-in to be upgraded; setting the plug-in obfuscation parameters in the obfuscation and compilation task as target data, where the target data is Information used to characterize the code used by the plug-in to be upgraded in the host application, and/or, obfuscation rules used to characterize the obfuscation of the code by the host application; according to the plug-in obfuscation set in the obfuscation compilation task
  • the parameters are used to obfuscate and compile the plug-in to be upgraded to obtain the target plug-in.
  • embodiments of the present disclosure provide a fourth possible implementation manner of the first aspect, wherein: the method further includes: During the compilation process of the host project, the host project containing the specified dependent library is obfuscated to obtain a target table, wherein the target table contains obfuscation rules for obfuscating the specified dependent library; Setting the plug-in obfuscation parameters in the obfuscation compilation task as the target data includes: moving the information to the specified dependent library in the host project, and/or determining the data in the target table as the target data. .
  • embodiments of the present disclosure provide a fifth possible implementation manner of the first aspect, wherein: the plug-in to be upgraded other than the specified dependent library is compiled to obtain the target plug-in , further comprising: determining the resource identification information of the resource file in the plug-in to be upgraded; modifying the resource identification information according to preset rules, so that the modified resource identification information of the resource file in the plug-in to be upgraded is consistent with the resource identification information of the resource file in the plug-in to be upgraded.
  • the resource identification information of the resource files in the host project is different.
  • embodiments of the present disclosure provide a sixth possible implementation manner of the first aspect, wherein: the method further includes determining the specified dependent library in the following manner: determining the external third-party dependent library as the Specify a dependent library; and/or determine an internal dependent library whose update frequency is less than a predetermined frequency and whose volume is greater than a predetermined volume as the designated dependent library.
  • embodiments of the present disclosure also provide an SDK upgrade method, which is applied to the client.
  • the method includes: when the target software tool development kit SDK is initialized, detecting whether there is a plug-in to be updated, wherein the plug-in to be updated is The plug-in is a target plug-in determined by the method described in any one of the above first aspects; after detecting the plug-in to be updated, the plug-in to be updated is loaded, and the loaded plug-in to be updated is installed to complete the update. Upgrade processing of the target software tool development kit SDK.
  • installing the plug-in to be updated after loading includes: installing the plug-in of the access party that accesses the SDK.
  • the class loader is replaced with a preset class loader, and the application context of the access party of the SDK is replaced with a preset application context; wherein the preset class loader is configured to search in the host application in a preset search order. and the local loaded plug-in to search for the class to be loaded.
  • the preset application context is configured so that the access party can simultaneously search for resources in the host application and the loaded plug-in.
  • the locally loaded plug-in includes: after loading Plug-ins to be updated and local history of loaded plug-ins.
  • embodiments of the present disclosure also provide an SDK upgrade device, which is provided on a server.
  • the device includes: a determining unit for determining the plug-in to be upgraded corresponding to the function to be upgraded in the target software tool development kit SDK; and determining The specified dependency library on which the plug-in to be upgraded depends; the mobile unit is used to compile the host project to which the SDK belongs based on the specified dependency library, wherein the dependency library of the host application obtained after compilation contains the specified dependency library.
  • Dependent libraries compilation units, Used to compile plug-ins to be upgraded other than the specified dependent library to obtain a target plug-in, wherein the target plug-in is used to upgrade the SDK; the target plug-in can call the host application during runtime Specified dependent libraries in .
  • embodiments of the present disclosure also provide an SDK upgrade device, which is provided on a client.
  • the device includes: a detection unit configured to detect whether there is a plug-in to be updated when the target software tool development kit SDK is initialized, wherein , the plug-in to be updated is the target plug-in determined by the method in any one of the above first aspects; the loading and installation unit is used to load the plug-in to be updated after detecting the plug-in to be updated, and to load the plug-in.
  • the subsequent plug-ins to be updated are installed to complete the upgrade process of the target software tool development kit SDK.
  • embodiments of the present disclosure further provide a computer device, including: a processor, a memory, and a bus.
  • the memory stores machine-readable instructions executable by the processor.
  • the processing The processor communicates with the memory through a bus, and when the machine-readable instructions are executed by the processor, the steps in the above-mentioned first aspect, or any possible implementation manner of the first aspect, are performed.
  • embodiments of the present disclosure also provide a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the computer program When the computer program is run by a processor, it executes the above-mentioned first aspect, or any of the first aspects. steps in a possible implementation.
  • the SDK upgrade method, device and computer equipment provided by the embodiments of the present disclosure first determine the plug-in to be upgraded corresponding to the function to be upgraded in the target software tool development kit SDK, and determine the designated dependency library on which the plug-in to be upgraded depends; then, You can remove the specified dependent library in the plug-in to be upgraded, compile the host project based on the specified dependent library, and compile the plug-in to be upgraded with the specified dependent library removed to obtain the target plug-in, which is used to upgrade the SDK. ; Among them, the target plug-in can call the specified dependent library in the host application at runtime.
  • the technical solution of the present disclosure can reduce the size of the plug-in package by compiling some dependent libraries in the plug-in into the host project during the host compilation process, thereby solving the problem of plug-in package
  • the large size causes technical problems such as low plug-in download success rate and large amount of plug-in code modification.
  • Figure 1 shows a flow chart of an SDK upgrade method provided by an embodiment of the present disclosure
  • Figure 2 shows a flow chart of the specific method of step S106 in the SDK upgrade method provided by the embodiment of the present disclosure
  • Figure 3 shows a flow chart of the specific method of step S202 in the SDK upgrade method provided by the embodiment of the present disclosure
  • Figure 4 shows a flow chart of another SDK upgrade method provided by an embodiment of the present disclosure
  • Figure 5 shows a schematic diagram of an SDK upgrade device provided by an embodiment of the present disclosure
  • Figure 6 shows a schematic diagram of another SDK upgrade device provided by an embodiment of the present disclosure
  • FIG. 7 shows a schematic diagram of a computer device provided by an embodiment of the present disclosure.
  • the technical solution selected was a plug-in technical solution.
  • the host to which the SDK belongs is basically an empty shell, and all functions are placed in the plug-in. If all functions are placed in plug-ins, the plug-in package will be very large. At this time, if the user downloads the plug-in, the success rate of plug-in download will be reduced, which will lead to inconvenience when updating the SDK on the client.
  • plug-in technology can be used to implement the client development process.
  • plug-in technology can be understood as developing a client in the form of a host and a plug-in. That is to say, the plug-in technical solution includes a host project and multiple plug-in projects.
  • the host application can be understood as the 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 can correspond to a function in the client, and the plug-in APK can be loaded by the host application.
  • the present disclosure provides an SDK upgrade method.
  • the technical solution of the present disclosure compiles part of the resource library in the plug-in into the host during the host compilation process.
  • the plug-in package can be reduced, thereby solving the technical problems of low plug-in download success rate and large amount of plug-in code modification due to the large plug-in package.
  • the execution subject of the SDK upgrade method provided by the embodiments of the present disclosure is generally a computer device with certain computing capabilities.
  • the computer device includes, for example, a terminal device or a server or other processing device.
  • the terminal device can be a user equipment (User Equipment, UE). , mobile devices, user terminals, terminals, cellular phones, cordless phones, personal digital assistant (PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc.
  • the SDK upgrade method can be implemented by the processor calling computer-readable instructions stored in the memory.
  • the following takes the execution subject as a terminal device as an example to describe the SDK upgrade method provided by the embodiment of the present disclosure. Explain.
  • FIG. 1 there is a flow chart of an SDK upgrade method provided by an embodiment of the present disclosure.
  • the method includes steps S102 to S106, wherein:
  • S102 Determine the plug-in to be upgraded corresponding to the function to be upgraded in the target software tool development kit SDK; and determine the designated dependency library on which the plug-in to be upgraded depends.
  • the SDK is a collection of corresponding access functions provided to a designated client APP.
  • each function included in the SDK can be compiled into the form of a corresponding plug-in APK (Android Package) file, and these plug-in APK files Deliver.
  • APK Android Package
  • the functions to be upgraded in the SDK may be determined first, where the number of functions to be upgraded may be one or more. Then, determine that the plug-in corresponding to the function to be upgraded is the plug-in to be upgraded.
  • the specified dependent library in the plug-in to be upgraded can be determined.
  • the specified dependent library can be determined in the following way:
  • Method 1 Determine the external third-party dependent library as the specified dependent library
  • Method 2 Determine the internal dependent libraries whose update frequency is less than the predetermined frequency and whose volume is greater than the predetermined volume as the designated dependent libraries;
  • Method 3 Determine the external third-party dependent library as the designated dependent library, and determine the internal dependent library whose update frequency is less than a predetermined frequency and whose volume is greater than a predetermined volume as the designated dependent library.
  • the specified dependent library includes: an external third-party dependent library and/or a specified internal dependent library.
  • the specified dependency source library of the plug-in to be upgraded contains the code and resources corresponding to the plug-in to be upgraded.
  • the resources can include but are not limited to the following resources: text, pictures, colors, sizes, controls, animations and other types of resources; the code in the plug-in to be upgraded will use the resources described above when running.
  • external third-party dependent libraries can be commonly used libraries such as Support, Gson, etc.
  • the specified internal dependency library may be an internal dependency library in the plug-in that is large (for example, larger than a predetermined volume) and updated infrequently (for example, the update frequency is less than a predetermined frequency).
  • the user can set the preset according to actual
  • the specific numerical values of the predetermined volume and the predetermined frequency are not specifically limited in this disclosure.
  • users can specify external third-party dependent libraries and specify internal dependent libraries in advance.
  • a dependent library in the plug-in's internal dependent library whose update frequency is less than a predetermined frequency can be determined as a designated dependent library.
  • a dependent library in the plug-in's internal dependency library whose update frequency is less than a predetermined frequency and whose volume is greater than a predetermined volume can also be determined as a designated dependency library. This disclosure does not specifically limit the designated dependency library.
  • S104 Compile the host project to which the SDK belongs based on the specified dependency library, where the dependency library of the host application obtained after compilation contains the specified dependency library.
  • the specified dependent library can be moved to the host project of the client APP (that is, the host project to which the SDK belongs), and the specified dependent library in the plug-in to be upgraded can be deleted.
  • the host project can be compiled based on the code and resources in the specified dependent library to generate the host application.
  • the generated host application contains code files and resource files.
  • S106 Compile the plug-in to be upgraded that removes the specified dependent library to obtain a target plug-in.
  • the target plug-in is used to upgrade the SDK; wherein the target plug-in can call the target plug-in when the client is running.
  • Specified dependent libraries in the host are used to upgrade the plug-in to be upgraded.
  • the plug-in project corresponding to the plug-in to be upgraded can be compiled to obtain a new plug-in APK file (that is, the above-mentioned target plug-in).
  • the compilation process described above refers to the process of combining codes and resources to generate external products (for example, APK files).
  • the user after compiling and obtaining the new plug-in APK file, the user can download these plug-ins on the local mobile terminal, install these plug-ins, and perform SDK upgrade processing through these plug-ins.
  • the SDK upgrade method provided by the embodiment of the present disclosure first determines the plug-in to be upgraded corresponding to the function to be upgraded in the target software tool development kit SDK, and determines the designated dependency library on which the plug-in to be upgraded depends. Then, you can remove the specified dependent library in the plug-in to be upgraded, compile the host project based on the specified dependent library, and compile the plug-in to be upgraded with the specified dependent library removed to obtain the target plug-in, which is used to compile the SDK Perform upgrade processing.
  • the target plug-in can call the specified dependent library in the host application at runtime.
  • the technical solution of the present disclosure can reduce the size of the plug-in package by compiling some dependent libraries in the plug-in into the host project during the host compilation process, thereby solving the problem of plug-in download success rate caused by the large plug-in package size.
  • the technical problems are low and the amount of plug-in code modification is large.
  • the plug-in to be upgraded corresponding to the function to be upgraded in the target software tool development kit SDK is determined, and then the specified dependency library in the plug-in to be upgraded is moved to the host project to which the SDK belongs. , and finally, compile the plug-in project corresponding to the plug-in to be upgraded that removes the specified dependent library to obtain the target plug-in.
  • step S106 compiles the plug-in to be upgraded except the specified dependent library to obtain the target plug-in, including the following process:
  • Step S201 After deleting the specified dependency library on which the plug-in to be upgraded depends, delete the target code in the plug-in to be upgraded that is the same as the host project.
  • Step S202 perform an obfuscation compilation task on the plug-in to be upgraded after deleting the target code, and obtain the target plug-in after obfuscation and compilation, wherein the obfuscation compilation task includes instructions for indicating that the plug-in to be upgraded is in the host application. Indicative parameters for the code used.
  • ClassCastException errors ie, class conversion errors
  • Class conversion errors refer to problems that occur when the class loader of the host application and the class loader of the plug-in load the same class and perform mutual conversion (that is, different class loaders load the same class and perform mutual conversion) problems that arise). If there is no duplicate code in the host application and plug-in, ClassCastException class conversion errors can be avoided at this time.
  • the same code as the host project in the plug-in to be upgraded can be deleted.
  • the code in the plug-in to be upgraded that is the same as the host project is the target code in the above step S201.
  • the gradle plug-in is a gradle plug-in pre-defined by relevant technical personnel, so that the target code in the plug-in to be upgraded can be eliminated through the gradle plug-in.
  • the same target code in the plug-in to be upgraded as that of the host project can be determined through code similarity comparison. For example, a code whose similarity meets a preset similarity requirement (for example, is greater than a preset similarity threshold) may be determined as the target code.
  • the code in the plug-in to be upgraded that is the same as the host project can be determined based on the code identification, where the code identification is used to indicate the function, type, name and other information of the code. For example, the code with the same code identifier in the plug-in to be upgraded and the host project can be determined as the target code.
  • an obfuscation compilation task can be performed on the plug-in to be upgraded with the target code deleted, and the above-mentioned target plug-in is obtained after obfuscation and compilation.
  • step S201 deletes the same target code as the host project in the plug-in to be upgraded, specifically including the following steps:
  • the code and its corresponding resources exist as a whole in the plug-in project corresponding to the plug-in to be upgraded. Therefore, when the target code is eliminated from the plug-in to be upgraded, the target SDK package containing the target code can be determined in the plug-in to be upgraded with the specified dependent library deleted. Then, delete the target SDK package in the plug-in project corresponding to the plug-in to be upgraded, thereby achieving deletion of the target code in the plug-in to be upgraded.
  • the plug-in project corresponding to the plug-in to be upgraded contains many SDK packages, and each SDK package contains code and resource files on which the code depends. Among them, different SDK packages can implement different functions.
  • the code identifier of the target code can be obtained, and the SDK package matching the code identifier can be determined in the plug-in project corresponding to the plug-in to be upgraded, thereby determining the matching SDK package as the target SDK package.
  • each SDK package in the plug-in project corresponding to the plug-in to be upgraded may include a corresponding data package identifier.
  • the data package identifier may be an identifier determined based on the code included in the SDK package. Based on this, the SDK package matching the code identifier can be determined as the target SDK package among multiple SDK packages based on the data package identifier.
  • the code and its corresponding resources work It exists as a whole 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, resources and code may be removed at the same time. In other words, when the target code is eliminated from the plug-in to be upgraded, the resource library on which the plug-in to be upgraded may also be eliminated. For example, after determining the target SDK package, if the target SDK package is deleted, the resources and code may be deleted at the same time. If the resources that the plug-in to be upgraded depend on are removed, the plug-in to be upgraded will fail to compile due to lack of relevant resources.
  • the present disclosure may also include the following steps:
  • the target resources included in the target external dependency library are not limited to the resources in the target SDK package mentioned above. They can also be resources that are not included in the target SDK package and the plug-in to be upgraded and that are needed by the plug-in to be upgraded.
  • the resource list can be obtained in advance.
  • the resource list includes all resources required by the plug-in to be upgraded. After that, it can be determined based on the resource list that the corresponding plug-in project is not included in the plug-in to be upgraded, and the resources required by the plug-in to be upgraded are the target resources.
  • the plug-in to be upgraded contains the target resource.
  • the target resource is a resource not included in the plug-in to be upgraded, and the target resource is a resource used in the compilation process of the plug-in to be upgraded.
  • the target resource can be added to the plug-in to be upgraded, and a dependency relationship between the plug-in to be upgraded and the target resource can be established, so that the plug-in to be upgraded depends on all the resources during the compilation process. Describe the target resource.
  • the external dependency library containing the target resource can be obtained (that is, the target external dependency library described in the above steps). Add the target external dependency library containing the target resource to the plug-in project corresponding to the plug-in to be upgraded.
  • the plug-in to be upgraded contains the resources (ie, target resources) used in the compilation process of the plug-in to be upgraded. If included, perform subsequent steps; if not included If included, add the above target external dependency library to the plug-in project corresponding to the plug-in to be upgraded.
  • the plug-in to be upgraded can rely solely on the resources in the target external dependency library instead of relying on the code in the target external dependency library.
  • the purpose of using this method is to eliminate the code in the plug-in to be upgraded that is the same as the host project, so that the plug-in to be upgraded will not fail to compile due to lack of relevant resources.
  • the plug-in project corresponding to the plug-in to be upgraded can be obfuscated and compiled. After the obfuscation and compilation process, the compiled new plug-in APK is obtained. file, that is, the target plug-in.
  • step S202 is to perform an obfuscation and compilation task on the plug-in to be upgraded after deleting the target code.
  • the target plug-in is obtained, including the following process:
  • Step S301 Intercept the obfuscation and compilation task of performing obfuscation and compilation processing on the plug-in to be upgraded.
  • Step S302 Set the plug-in obfuscation parameters in the obfuscation compilation task as target data, where the target data is used to characterize the code used by the plug-in to be upgraded in the host application, and/or for Obfuscation rules representing the obfuscation of the code by the host application; wherein, the plug-in obfuscation parameter can be understood as the instruction parameter used to indicate the code used by the plug-in to be upgraded in the host application as described in the above steps.
  • the plug-in obfuscation parameters include third dependency parameters and/or application obfuscation parameters.
  • the third dependency parameter is used to represent information about the code used by the plug-in to be upgraded in the host application
  • the application obfuscation parameter is used to represent the obfuscation rules used by the host application to obfuscate the code.
  • Step S303 Perform obfuscation and compilation processing on the plug-in to be upgraded according to the plug-in obfuscation parameters set in the obfuscation compilation task to obtain the target plug-in.
  • the gradle obfuscation compilation task when compiling the plug-in project can be intercepted through the gradle plug-in to achieve the purpose of intervening in the obfuscation step in the plug-in package compilation process.
  • the purpose of intervening in the obfuscation step is to enable the plug-in to be upgraded to be obfuscated into code that the host can recognize during the obfuscation process.
  • the plug-in obfuscation parameters in the obfuscated compilation task can be modified.
  • the plug-in obfuscation parameters include: third-party dependency parameters (i.e., libraryJars parameters) and/or application obfuscation parameters (i.e., applymapping parameters).
  • libraryJars The parameters are used to indicate the third-party package imported into the host project (that is, the specified dependent library imported into the host), and the information used to indicate the code used by the plug-in to be upgraded in the host project.
  • the applymapping parameter is used to indicate The host applies obfuscation rules to obfuscate the code.
  • Embodiments of the present disclosure can set the information of the specified dependent library moved to the host project and the information of the code used by the plug-in to be upgraded in the host project as third-party dependency parameters (ie, libraryJars parameters). And, set the data in the target table as the application obfuscation parameter (ie, applymapping parameter).
  • the target table contains confusion rules for confusing the host, and the target table can be a mapping table.
  • information about the specified dependent library saved in the host project and the code used by the plug-in to be upgraded in the host project can be added to the libraryJars parameter in the plug-in obfuscation compilation task to indicate import into the host project.
  • the specified dependent library in the specified dependent library, and information indicating the code used by the plug-in to be upgraded in the specified dependent library are added to the libraryJars parameter in the plug-in obfuscation compilation task to indicate import into the host project.
  • the specified dependent library in the specified dependent library, and information indicating the code used by the plug-in to be upgraded in the specified dependent library add the data in the host mapping table to the applymapping parameter in the obfuscation compilation task to indicate the obfuscation rules when the plug-in calls the code in the host application.
  • the applymapping parameter is used in conjunction with the libraryJars parameter, so that all the code in the host application is added to the obfuscated dependency as a third-party dependency, and the obfuscation must be performed according to the obfuscation rules recorded in the host's mapping table to obfuscate it into the host application. Can recognize codes.
  • SDK upgrade method not only includes the compilation process of the plug-in project, but also includes the compilation process of the host project.
  • the compilation process of the host project can be understood as:
  • the host project including the specified dependent library is obfuscated to obtain a target table.
  • the target table contains obfuscation rules for obfuscating the specified dependent library.
  • the above steps set the plug-in obfuscation parameters in the obfuscation compilation task as target data, including:
  • Information moved to the specified dependent library in the host project and/or data in the target table is determined as the target data.
  • the host project after moving the specified dependent library to the host project, the host project can be compiled.
  • the specified dependent libraries brought into the host project and the mapping table after obfuscation of the host project can be saved.
  • the mapping table records the obfuscation rules after the host project is obfuscated for use in the subsequent plug-in generation process.
  • the mapping table is the above target table.
  • step S104 and step S106 can be executed.
  • the data in the pre-saved mapping table can be set as application obfuscation parameters (i.e., applymapping parameters), so as to perform the obfuscation process according to the applymapping parameters and libraryJars parameters to perform obfuscated compilation tasks of the plug-in.
  • step S106 compiling the plug-in to be upgraded except the specified dependent library to obtain the target plug-in, also includes the following process:
  • the resource identification information is modified according to preset rules, 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.
  • the resource file is pre-allocated with a corresponding resource ID, where the resource ID is an 8-digit hexadecimal integer. For example: 0x01010001, 0x7f010001, the format is PPTTEEEE, PP represents the package type.
  • the plug-in to be upgraded and the host project contain corresponding resource IDs (ie, resource identification information).
  • resource IDs ie, resource identification information
  • the resource ID may be the same, but the same resource ID corresponds to different resources.
  • the resource ID in the plug-in to be upgraded can be replaced.
  • the present disclosure provides an SDK upgrade method, which can provide a convenient self-upgrade solution for SDKs with relatively complex functions and structures (for example, game SDKs), and has basically no impact on the normal development process. It can also avoid ClassCastException errors and reduce the size of the plug-in package as much as possible.
  • FIG. 4 a flow chart of an SDK upgrade method provided by an embodiment of the present disclosure is shown.
  • the method includes steps S402 to S404, wherein:
  • Step S402 When the target software tool development kit SDK is initializing, detect whether there is a plug-in to be updated, where the plug-in to be updated is the target plug-in determined by any of the methods in the first embodiment.
  • Step S404 After detecting the plug-in to be updated, load the plug-in to be updated, and install the loaded plug-in to be updated to complete the upgrade process of the target software tool development kit SDK.
  • the SDK upgrade method provided by the embodiment of the present disclosure first detects whether there is a plug-in to be updated when the target software tool development kit SDK is initialized. Then, after detecting the plug-in to be updated, the plug-in to be updated is loaded, and the loaded plug-in to be updated is installed to complete the upgrade process of the target software tool development kit SDK.
  • the SDK upgrade method of the present disclosure compiles part of the resource library in the plug-in into the host application during the host compilation process, which can reduce the size of the plug-in package, thereby solving the problem of plug-in package
  • the large size causes technical problems such as low plug-in download success rate and large amount of plug-in code modification.
  • the SDK initialization process it is first determined whether there is a plug-in to be updated locally or whether there is a plug-in to be downloaded and updated. If there is a plug-in to be updated locally, continue to perform subsequent steps; if there is a plug-in to be updated locally, download the plug-in to be updated, and continue to perform subsequent steps.
  • step S404, installing the loaded plug-in to be updated includes the following process:
  • the preset class loader is configured to search for classes to be loaded in the host application and locally loaded plug-ins according to a preset search order.
  • the preset application context is configured so that the access party can simultaneously search for resources in the host application and loaded plug-ins.
  • the locally loaded plug-ins include: plug-ins to be updated after loading and local history loaded plug-ins.
  • the plug-in to be updated is loaded, and the class loader of the access party of the SDK is replaced, and the class loader is replaced with the default class loader. device.
  • the default class loader when loading a class, the default class loader will first search for the class in the host application; if it is not found, it will search for the locally loaded plug-in; if it has not been found, it will check whether there is an unloaded plug-in. If there are unloaded plug-ins, trigger plug-in loading, and then search for classes in the plug-ins after loading.
  • the application application context of the access party of the SDK can also be replaced with a default application context, and the default application context is configured to be able to simultaneously search for resources in the host application and loaded plug-ins.
  • a corresponding class loader can also be created for the plug-in and resources in the plug-in can be added.
  • the technical solution of the present disclosure solves the problem of complex SDK self-upgrade process.
  • the plug-in package is large, and host plug-ins are complicated to call each other.
  • this technical solution can make the development of plug-ins basically follow the normal development method, and expand the ease of use of SDK self-upgrade development, while minimizing the size of the plug-in package and saving user download traffic.
  • the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possible The internal logic is determined.
  • embodiments of the present disclosure also provide an SDK upgrade device corresponding to the SDK upgrade method. Since the problem-solving principle of the device in the embodiment of the present disclosure is similar to the above-mentioned SDK upgrade method in the embodiment of the present disclosure, the implementation of the device can be referred to the implementation of the method, and repeated details will not be repeated.
  • FIG. 5 it is a schematic architectural diagram of an SDK upgrade device provided by an embodiment of the present disclosure.
  • the device includes: a determination unit 51, a moving unit 52, and a compilation unit 53; wherein,
  • the determination unit 51 is used to determine the plug-in to be upgraded corresponding to the function to be upgraded in the target software tool development kit SDK; and to determine the designated dependency library on which the plug-in to be upgraded depends;
  • the mobile unit 52 is configured to compile the host project to which the SDK belongs based on the specified dependency library, wherein the dependency library of the host application obtained after compilation contains the specified dependency library;
  • the compilation unit 53 is used to compile plug-ins to be upgraded other than the specified dependent library to obtain a target plug-in, wherein the target plug-in is used to upgrade the SDK; the target plug-in can be called during runtime Specified dependent libraries in the host application.
  • the plug-in to be upgraded corresponding to the function to be upgraded in the target software tool development kit SDK is determined, and the designated dependency library on which the plug-in to be upgraded is determined is determined. Then, you can remove the specified dependent library in the plug-in to be upgraded, compile the host project based on the specified dependent library, and compile the plug-in to be upgraded with the specified dependent library removed to obtain the target plug-in.
  • the target plug-in is used to upgrade the SDK; the target plug-in can call the specified dependent library in the host application at runtime.
  • the technical solution of the present disclosure can reduce the size of the plug-in package by compiling some dependent libraries in the plug-in into the host project during the host compilation process, thereby solving the problem of plug-in package
  • the large size causes technical problems such as low plug-in download success rate and large amount of plug-in code modification.
  • the compilation unit is further configured to: after deleting the specified dependency library on which the plug-in to be upgraded depends, delete the target code in the plug-in to be upgraded that is the same as the host project; before deleting the The plug-in to be upgraded after the target code executes an obfuscation compilation task, and the target plug-in is obtained after obfuscation and compilation.
  • the obfuscation compilation task includes an indication parameter for indicating the code used by the plug-in to be upgraded in the host application.
  • the compilation unit is also configured to: delete the target code in the plug-in to be upgraded that is the same as the host project, including: determining the target SDK package in the plug-in to be upgraded except the specified dependent library, and Delete the target SDK package, wherein the target SDK package contains the target code and the resource files on which the target code depends; the device is also used to: add a target external dependency library for the plug-in to be upgraded; wherein, the The target external dependency library contains target resources used in the plug-in to be upgraded, and the target resources are resources not included in the plug-in to be upgraded.
  • the compilation unit is also configured to: intercept an obfuscation compilation task that performs obfuscation compilation processing on the plug-in to be upgraded; and set the plug-in obfuscation parameters in the obfuscation compilation task as target data, where:
  • the target data is used to represent information about the code used by the plug-in to be upgraded in the host application, and/or is used to represent the obfuscation rules used by the host application to obfuscate the code; according to the obfuscation compilation task
  • the set plug-in obfuscation parameters are used to obfuscate and compile the plug-in to be upgraded to obtain the target plug-in.
  • the device is further configured to: in the process of compiling the host project to which the SDK belongs based on the specified dependent library, obfuscate the host project containing the specified dependent library. , obfuscate to obtain a target table, wherein the target table contains obfuscation rules for obfuscating the specified dependent library; the compilation unit is also used to: move the information of the specified dependent library to the host project, and/ Or, the data in the target table is determined as target data.
  • the compilation unit is further configured to: determine the resource identification information of the resource file in the plug-in to be upgraded; and modify the resource identification information according to preset rules, so that the modified resource identification information can be
  • the resource identification information of the resource file in the upgrade plug-in is different from the resource identification information of the resource file in the host project.
  • the method further includes determining the designation in the following manner Dependent library: determine the external third-party dependent library as the designated dependent library; and/or determine the internal dependent library whose update frequency is less than a predetermined frequency and whose volume is greater than a predetermined volume as the designated dependent library.
  • FIG. 6 it is a schematic architectural diagram of an SDK upgrade device provided by an embodiment of the present disclosure.
  • the device includes: a detection unit 61 and a loading and installation unit 62; wherein,
  • the detection unit 61 is used to detect whether there is a plug-in to be updated when the target software tool development kit SDK is initialized, wherein the plug-in to be updated is the target plug-in determined by the method described in any one of claims 1 to 7. ;
  • the loading and installation unit 62 is configured to load the plug-in to be updated after detecting the plug-in to be updated, and install the loaded plug-in to be updated, so as to complete the upgrade process of the target software tool development kit SDK.
  • the target software tool development kit SDK is initialized, it is detected whether there is a plug-in to be updated, and then, after the plug-in to be updated is detected, the plug-in to be updated is loaded, and the plug-in to be updated is loaded.
  • the plug-in to be updated is installed to complete the upgrade process of the target software tool development kit SDK.
  • the SDK upgrade method of the present disclosure uses the plug-in during the host compilation process. Part of the resource library is compiled into the host, which can shrink the plug-in package, thereby solving the technical problems of low plug-in download success rate and large amount of plug-in code modification caused by the large plug-in package.
  • loading the installation unit is also used to: replace the class loader of the access party to the SDK with a default class loader, and replace the application context of the access party of the SDK.
  • the preset class loader is configured to search for classes to be loaded in the host application and locally loaded plug-ins according to a preset search order, and the preset application context is configured to the interface
  • the incoming party can simultaneously search for resources in the host application and loaded plug-ins.
  • the local loaded plug-ins include: plug-ins to be updated after loading and local historical loaded plug-ins.
  • a schematic structural diagram of a computer device 700 provided for an embodiment of the present disclosure includes a processor 701 , a memory 702 , and a bus 703 .
  • the memory 702 is used to store execution instructions, including the memory 7021 and the external memory 7022; the memory 7021 here is also called the internal memory, and is used to temporarily store the operation data in the processor 701, as well as the data exchanged with the external memory 7022 such as the hard disk,
  • the processor 701 exchanges data with the external memory 7022 through the memory 7021.
  • the processor 701 and the memory 702 communicate through the bus 703, so that the processor 701 executes the following instructions:
  • Processor 701 can also execute the following instructions:
  • the target software tool development kit SDK When the target software tool development kit SDK is initialized, detect whether there is a plug-in to be updated, wherein the plug-in to be updated is the target plug-in determined by any one of the methods described in the first aspect; when the plug-in to be updated is detected After the plug-in is loaded, the plug-in to be updated is loaded, and the loaded plug-in to be updated is installed to complete the upgrade process of the target software tool development kit SDK.
  • Embodiments of the present disclosure also provide a computer-readable storage medium.
  • a computer program is stored on the computer-readable storage medium.
  • the storage medium may be a volatile or non-volatile computer-readable storage medium.
  • the computer program product for SDK upgrade provided by the embodiments of the present disclosure includes a computer-readable storage medium storing program code.
  • the instructions included in the program code can be used to perform the SDK upgrade steps described in the above method embodiments. Specifically, Please refer to the above method embodiments, which will not be described again here.
  • Embodiments of the present disclosure also provide a computer program, which implements any of the methods in the foregoing embodiments when executed by a processor.
  • the computer program product can be implemented specifically through hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium.
  • the computer program product is embodied as a software product, such as a Software Development Kit (SDK), etc. wait.
  • SDK Software Development Kit
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in various embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor.
  • the technical solution of the present disclosure is essentially or contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the various embodiments of the present disclosure. All or part of the steps of a method.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code. .

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

L'invention concerne un procédé et un appareil de mise à niveau de SDK, et un dispositif informatique. Le procédé consiste à : déterminer un module d'extension à mettre à niveau correspondant à une fonction à mettre à niveau dans un kit de développement logiciel (SDK) cible, et déterminer une bibliothèque de dépendances spécifiée de laquelle dépend le module d'extension à mettre à niveau ; sur la base de la bibliothèque de dépendances spécifiée, compiler un projet hôte auquel appartient le SDK, une bibliothèque de dépendances d'une application hôte qui est obtenue après la compilation comprenant la bibliothèque de dépendances spécifiée ; et compiler le module d'extension à mettre à niveau autre que la bibliothèque de dépendances spécifiée, de façon à obtenir un module d'extension cible, le module d'extension cible étant utilisé pour mettre à niveau le SDK, et le module d'extension cible pouvant appeler la bibliothèque de dépendances spécifiée dans l'application hôte pendant qu'il est exécuté. Au moyen de la compilation d'une partie des bibliothèques de ressources dans un module d'extension dans un hôte pendant un processus de compilation d'hôte, un paquetage d'extension peut être réduit, ce qui permet de résoudre les problèmes techniques d'un faible taux de réussite de téléchargement de module d'extension et d'une relativement grande quantité de transformation de code d'extension résultant d'un relativement grand paquetage d'extension.
PCT/CN2023/082408 2022-04-20 2023-03-20 Procédé et appareil de mise à niveau de sdk, et dispositif informatique WO2023202299A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210415416.4 2022-04-20
CN202210415416.4A CN114721688A (zh) 2022-04-20 2022-04-20 一种sdk升级方法、装置以及计算机设备

Publications (1)

Publication Number Publication Date
WO2023202299A1 true WO2023202299A1 (fr) 2023-10-26

Family

ID=82246342

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/082408 WO2023202299A1 (fr) 2022-04-20 2023-03-20 Procédé et appareil de mise à niveau de sdk, et dispositif informatique

Country Status (2)

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

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117290257A (zh) * 2023-11-27 2023-12-26 天津丈八网络安全科技有限公司 一种基于插件调用的软件生命周期规范化管理方法及系统
CN118037405A (zh) * 2024-04-12 2024-05-14 张家港保税数据科技有限公司 一种轻量级动态交割服务方法和系统

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114721688A (zh) * 2022-04-20 2022-07-08 北京字跳网络技术有限公司 一种sdk升级方法、装置以及计算机设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070288910A1 (en) * 2006-06-09 2007-12-13 Microsoft Corporation Automatically extracting coupling metrics from compiled code
US20140068560A1 (en) * 2012-09-06 2014-03-06 Digital Rapids Corporation Systems and methods for partitioning computing applications to optimize deployment resources
CN109542445A (zh) * 2017-08-01 2019-03-29 北京京东尚科信息技术有限公司 一种Android插件化开发的方法和装置
CN111258587A (zh) * 2020-01-17 2020-06-09 苏宁云计算有限公司 一种安卓应用插件化的实现方法、装置、设备及存储介质
CN113407165A (zh) * 2021-06-29 2021-09-17 北京字节跳动网络技术有限公司 Sdk的生成和自升级方法、装置、可读介质和设备
CN114721688A (zh) * 2022-04-20 2022-07-08 北京字跳网络技术有限公司 一种sdk升级方法、装置以及计算机设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070288910A1 (en) * 2006-06-09 2007-12-13 Microsoft Corporation Automatically extracting coupling metrics from compiled code
US20140068560A1 (en) * 2012-09-06 2014-03-06 Digital Rapids Corporation Systems and methods for partitioning computing applications to optimize deployment resources
CN109542445A (zh) * 2017-08-01 2019-03-29 北京京东尚科信息技术有限公司 一种Android插件化开发的方法和装置
CN111258587A (zh) * 2020-01-17 2020-06-09 苏宁云计算有限公司 一种安卓应用插件化的实现方法、装置、设备及存储介质
CN113407165A (zh) * 2021-06-29 2021-09-17 北京字节跳动网络技术有限公司 Sdk的生成和自升级方法、装置、可读介质和设备
CN114721688A (zh) * 2022-04-20 2022-07-08 北京字跳网络技术有限公司 一种sdk升级方法、装置以及计算机设备

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117290257A (zh) * 2023-11-27 2023-12-26 天津丈八网络安全科技有限公司 一种基于插件调用的软件生命周期规范化管理方法及系统
CN117290257B (zh) * 2023-11-27 2024-02-02 天津丈八网络安全科技有限公司 一种基于插件调用的软件生命周期规范化管理方法及系统
CN118037405A (zh) * 2024-04-12 2024-05-14 张家港保税数据科技有限公司 一种轻量级动态交割服务方法和系统

Also Published As

Publication number Publication date
CN114721688A (zh) 2022-07-08

Similar Documents

Publication Publication Date Title
WO2023202299A1 (fr) Procédé et appareil de mise à niveau de sdk, et dispositif informatique
EP3128421B1 (fr) Procédé, dispositif et système permettant de réaliser une installation d'application java par compilation en nuage
CN108897562B (zh) 安装包更新方法、装置、介质以及设备
US20100306759A1 (en) System for packaging native program extensions together with virtual machine applications
KR100883699B1 (ko) 무선 장치 동작 환경에서 비검증된 프로그램들의 실행
EP1023685A1 (fr) Systeme et procede de gestion de l'installation d'applications au profit d'un dispositif mobile
JP2004005419A (ja) インストール処理装置、処理方法及び記憶媒体ならびにプログラム
US20040015960A1 (en) Method for loading and executing an application in an embedded environment
CN104375849A (zh) 加载内核的方法及装置
US20190095181A1 (en) Easy-To-Use Type Of Compile-Time Dependency Injection Method And Device In The Java Platform
US20150012732A1 (en) Method and device for recombining runtime instruction
CN107861742A (zh) 一种程序的运行方法和终端设备
CN108228077B (zh) 存储区的管理方法、运行方法、装置、设备、可读介质
CN110609687A (zh) 一种编译方法、装置、电子设备和存储介质
CN106796521B (zh) 独立于产品发布的api版本控制
CN102968321A (zh) 应用程序安装装置和应用程序安装方法
CN110765394A (zh) so文件加载方法、装置、存储介质及终端设备
CN109271792B (zh) 一种基于Android本地层挂钩的终端外设控制方法及装置
WO2023207418A1 (fr) Procédé et appareil de mise à niveau de sdk, et dispositif informatique
CN110334031B (zh) 内存分配代码检测方法、装置、计算机设备及存储介质
KR100775431B1 (ko) 임베디드 시스템 및 임베디드 시스템의 펌웨어 업데이트방법
KR100744502B1 (ko) 무선 단말기의 베이스 구조 및 그 방법
CN115220873A (zh) 一种在Android系统中运行Open Harmony应用的方法
CN114327548A (zh) 软件升级方法及相关装置
CN112579129A (zh) 基于服务器的软件更新方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23790960

Country of ref document: EP

Kind code of ref document: A1