WO2023207418A1 - 一种sdk升级方法、装置以及计算机设备 - Google Patents

一种sdk升级方法、装置以及计算机设备 Download PDF

Info

Publication number
WO2023207418A1
WO2023207418A1 PCT/CN2023/082413 CN2023082413W WO2023207418A1 WO 2023207418 A1 WO2023207418 A1 WO 2023207418A1 CN 2023082413 W CN2023082413 W CN 2023082413W WO 2023207418 A1 WO2023207418 A1 WO 2023207418A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
file
renamed
plug
sdk
Prior art date
Application number
PCT/CN2023/082413
Other languages
English (en)
French (fr)
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 WO2023207418A1 publication Critical patent/WO2023207418A1/zh

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/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • 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 is basically an empty shell, and all functions are in plug-ins.
  • the plug-in logic is simple, the page functions of the plug-in are relatively simple.
  • the plug-in only uses the Application Program Interface (API) provided natively by Android. If the page function of the plug-in is more complex, more resource libraries need to be added, making the plug-in dependent on more resource libraries.
  • API Application Program Interface
  • the embodiments of the present disclosure provide at least an SDK upgrade method, device and computer equipment.
  • an SDK upgrade method which includes: determining third-party resource files that a plug-in to be upgraded in the software tool development kit SDK depends on, and renaming the resource files to obtain the renamed The resource file after; replace the resource file in the resource merge result of the resource merge compilation task of the SDK's host project with the renamed resource file; call the renamed resource file in the resource merge result resource files, and rename the code package in the plug-in to be upgraded that relies on the renamed resource file; compile and obtain the plug-in APK based on the renamed resource file and the renamed code package. ;
  • the plug-in APK is used to upgrade the SDK.
  • the embodiment of the present disclosure provides a first possible implementation manner of the first aspect, wherein: before replacing the resource file in the resource merging result with the renamed resource file, The method further includes: traversing the resource layout files under the first specified directory in the resource merging result; and determining in the resource merging result the dependencies of the plug-in to be upgraded based on the resource identification information contained in the resource layout file.
  • the resource file before replacing the resource file in the resource merging result with the renamed resource file, The method further includes: traversing the resource layout files under the first specified directory in the resource merging result; and determining in the resource merging result the dependencies of the plug-in to be upgraded based on the resource identification information contained in the resource layout file.
  • the method further includes: connecting the host of the SDK After the resource file in the resource merging result of the resource merging compilation task of the project is replaced with the renamed resource file, the renamed resource file is saved to the first XML file, wherein the An XML file and a second XML file are located in different storage directories, and the second XML file is the XML file that stores the resource file in the resource merging result; the first XML file is compiled to obtain the A temporary file, wherein the file name of the temporary file is the file name of the renamed resource file; the temporary file is stored in the second designated directory of the resource merging and compilation task.
  • embodiments of the present disclosure provide a third possible implementation manner of the first aspect, wherein: the resource file is renamed to obtain the renamed resource file, including: determining a second XML file that stores the resource file in the resource merging result; replacing the parameter value of the file parameter of the second XML file with the file name of the renamed resource file to obtain the renamed Resource file; the file parameters include: tag value value and/or object attribute name name.
  • embodiments of the present disclosure provide a fourth possible implementation manner of the first aspect, wherein: the parameter values of the file parameters of the XML file are determined through the following steps, including: The second XML file is converted into a document object; the parameter values of the file parameters are obtained in the document object.
  • embodiments of the present disclosure provide a fifth possible implementation of the first aspect, wherein: the method further includes: adding in the host project the resource file on which the plug-in to be upgraded depends; Establish a dependency relationship between the plug-in to be upgraded and the resource file in the host project.
  • embodiments of the present disclosure provide a sixth possible implementation manner of the first aspect, wherein: the calling of the renamed resource file in the resource merging result includes: through the SDK The resource linking task of the host project calls the renamed resource file in the resource merging result.
  • embodiments of the present disclosure also provide an SDK upgrade device, including: a determination unit for determining third-party resource files that the plug-in to be upgraded of the software tool development package SDK depends on; a first renaming unit for The resource file is renamed to obtain the renamed resource file; a replacement unit is used to replace the resource file in the resource merging result of the resource merging compilation task of the host project of the SDK with the renamed resource file. the renamed resource file; the second renaming unit is used to call the renamed resource file in the resource merging result, and rename the code package in the plug-in to be upgraded that relies on the renamed resource file.
  • Rename a compilation unit, used to compile and obtain a plug-in APK based on the renamed resource file and the renamed code package; the plug-in APK is used to upgrade the SDK.
  • embodiments of the present disclosure also 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.
  • a computer program is stored on the computer-readable storage medium.
  • the computer program executes the above-mentioned first aspect, or any of the first aspects. steps in a possible implementation.
  • the third-party resource files on which the plug-in to be upgraded can be replaced with the renamed resource files, and the code packages in the plug-in to be upgraded that rely on the renamed resource files can be renamed based on The renamed resource files and code packages are compiled to obtain the plug-in APK.
  • the resource files used by the plug-in to be upgraded can be renamed, and the resource files on which the code of the plug-in to be upgraded can be replaced with the renamed resource files without changing the existing compilation method. .
  • 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 a specific method for renaming the original user interface UI library on which the plug-in to be upgraded depends in the SDK upgrade method provided by the embodiment of the present disclosure
  • Figure 3 shows a flow chart of another specific method of renaming the original user interface UI library on which the plug-in to be upgraded depends in the SDK upgrade method provided by the embodiment of the present disclosure
  • Figure 4 shows a flow chart of a specific method for replacing the original user interface UI library on which the plug-in to be upgraded depends on with the renamed UI library in the SDK upgrade method provided by the embodiment of the present disclosure
  • Figure 5 shows a flow chart of another SDK upgrade method provided by an embodiment of the present disclosure
  • Figure 6 shows a schematic diagram of an 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.
  • SDK Software Development Kit
  • 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, device and computer equipment.
  • the third-party resource files on which the plug-in to be upgraded can be replaced with the renamed resource files, and the code packages in the plug-in to be upgraded that rely on the renamed resource files can be renamed based on The renamed resource files and code packages are compiled to obtain the plug-in APK.
  • the resource files used by the plug-in to be upgraded can be reloaded. name, and replace the resource files that the code of the plug-in to be upgraded depends on with the renamed resource files without changing the existing compilation method.
  • 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 SDK upgrade method provided by the embodiment of the present disclosure will be described below by taking the execution subject as a mobile terminal as an example.
  • FIG. 1 is a flow chart of an SDK upgrade method provided by an embodiment of the present disclosure.
  • the method includes steps S102 to S108, wherein:
  • S102 Determine the third-party resource files that the plug-in to be upgraded of the software tool development kit SDK depends on, and rename the resource files to obtain the renamed resource files.
  • the SDK is a collection of corresponding access functions provided to a designated client APP.
  • the functions in the SDK will be packaged in the form of plug-ins, and these plug-ins will be distributed.
  • the resources contained in the resource files that the plug-in depends on can be characters Strings, pictures, colors, controls and other resources.
  • the code in the plug-in will use the resources described above when running.
  • 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 the plug-in corresponding to the function to be upgraded, and determine the plug-in as the plug-in to be upgraded. After that, you can determine the third-party resource files that the plug-in to be upgraded depends on in the resource support library.
  • the third-party resource file may be the original user interface (User Interface) library on which the plug-in to be upgraded depends, or may be other resource libraries on which the plug-in to be upgraded depends. This disclosure does not specifically limit this.
  • the resource file can be renamed.
  • the resource file can be renamed by modifying the parameter value of the file parameter corresponding to the resource file.
  • the resource merge and compilation task refers to merging the resources that each plug-in depends on into the corresponding file (i.e., the above resource merging result), and then storing the file in the specified resource directory (for example, build/intermediates/mergednot-compiled- resources directory).
  • the resource file that the plug-in to be upgraded depends on in the resource merging result, and replace the resource file with the renamed resource file.
  • the original user interface UI library on which the plug-in to be upgraded in the resource file depends can be replaced with the renamed UI library. After replacing the original user interface UI library, you can get a new resource file using the renamed UI library.
  • the corresponding product can be published externally (for example, to the server). For example, aar format data package or jar format data package. After releasing the corresponding product, you can execute the compilation process of the plug-in project to obtain the corresponding plug-in APK file.
  • S108 Compile and obtain a plug-in APK based on the renamed resource file and the renamed code package; the plug-in APK is used to upgrade the SDK.
  • the third-party resource files on which the plug-in to be upgraded can be replaced with the renamed resource files, and the code packages in the plug-in to be upgraded that rely on the renamed resource files can be renamed based on The renamed resource files and code packages are compiled to obtain the plug-in APK.
  • the resource files used by the plug-in to be upgraded can be renamed, and the resource files on which the code of the plug-in to be upgraded can be replaced with the renamed resource files without changing the existing compilation method. .
  • the plug-in to be upgraded corresponding to the function to be upgraded in the target software tool development kit SDK is used. Then, after determining the third-party resource file on which the plug-in to be upgraded depends in the resource merging result, and determining the original user interface UI (User Interface) library on which the plug-in to be upgraded depends in the resource file, the original user interface UI The library is replaced with the renamed UI library, thereby obtaining new resource files that use the renamed UI library. After renaming, publish the corresponding product to the server.
  • UI User Interface
  • Step S11 Add the resource file on which the plug-in to be upgraded depends in the host project.
  • Step S12 Establish a dependency relationship between the plug-in to be upgraded and the resource file in the host project.
  • the resource files that the plug-in to be upgraded depend on can also be added to the host project to which the target software tool development package SDK belongs. For example, you can add the original user interface UI library in the resource file to the host project. Afterwards, the dependency relationship between the plug-in to be upgraded and the resource files added in the host project can be established.
  • an indicator mark can be added to the host project, so that the plug-in that depends on the original user interface UI library is determined to be a plug-in to be upgraded through the indicator mark.
  • the plug-in to be upgraded can rely on the renamed resource files.
  • the resource file after renaming may still depend on the resource file before renaming. Therefore, the resource file before renaming also needs to be added to the host project so that the plug-in to be upgraded can rely on the resource file before renaming.
  • the plug-in to be upgraded in addition to relying on the resource file to be used (for example, the original user interface UI library), the plug-in to be upgraded also needs to rely on a resource file that has just been renamed. At this time, you need to add the resource file before renaming to the host project.
  • the target plug-in attribute parameters indicates that the original resource file is saved in the specified resource directory before the plug-in project corresponding to the plug-in to be upgraded is compiled.
  • the target plug-in attribute parameter may be the isShinkResources attribute. That is to say, the parameter value of the isShinkResources attribute parameter of the plug-in to be upgraded can be set to true (ie, the above-mentioned preset value).
  • the designated resource directory can be the following resource directory: (build/intermediates/mergednot-compiled-resources) directory.
  • the resource directory is a directory used to store compilation products of the resource merging and compilation task.
  • Figure 2 shows a flow chart of a specific method for renaming the original user interface UI library on which the plug-in to be upgraded depends in the SDK upgrade method provided by the embodiment of the present disclosure.
  • the present disclosure also includes the following steps:
  • Step S201 Traverse the resource layout files in the first specified directory in the resource merging result.
  • Step S202 Determine the resource file on which the plug-in to be upgraded depends in the resource merging result according to the resource identification information contained in the resource layout file.
  • the resource merging result of the resource merging and compilation task can be obtained. And find the resource files that the plug-in to be upgraded depends on in the resource merger result.
  • the resource files on which the plug-in to be upgraded can be searched in the resource merging result in the manner described in steps S201 and S202. After finding the resource file, you can replace the resource file with the renamed resource file.
  • the resource file on which the plug-in to be upgraded contains multiple resource libraries
  • the part of the resource library is the original user interface UI library (hereinafter referred to as the UI library) on which the plug-in to be upgraded depends.
  • the resource file that the plug-in to be upgraded depends on can be searched in the resource merging result by the method described in step S201 and step S202, and the above-mentioned UI library can be searched in the resource file, and the UI library in the resource file can be searched. Replace it with the renamed UI library to obtain the resource file using the renamed UI library.
  • the compilation process of the host project and plug-in project includes resource merge and compilation tasks (mergeResources) and resource linking tasks (processResources).
  • the resource merging and compilation task refers to merging the resources that the plug-in to be upgraded depends on into one file during the compilation phase of the host project (that is, the above resource merging result).
  • the resource merging result is stored in the first specified directory (build/intermediates/mergednot-compiled-resources directory).
  • the resource linking task indicates a task that links the resource merging results of the resource merging compilation task during the compilation process of the plug-in project.
  • the resource link task (processResources) will be introduced in the following implementation manner.
  • the parameter value of the isShinkResources attribute parameter of the plug-in to be upgraded is set to true. Therefore, after executing the resource merge compilation task, the resource files before compilation will be saved in the first specified directory. At this time, when the resource files that the plug-in to be upgraded depend on are renamed, the resource merging result of the resource merging and compilation task can be obtained, and the resource files in the resource merging processing result can be traversed in the first designated directory.
  • a replacement operation can be performed on the resource file to be replaced, so that the resource file after replacement is the renamed resource file, and the renamed resource file is obtained.
  • a replacement operation can be performed on the UI library to be replaced in the resource file to obtain a resource file using the renamed UI library.
  • Figure 3 shows a flow chart of another specific method of renaming the original user interface UI library on which the plug-in to be upgraded depends in the SDK upgrade method provided by the embodiment of the present disclosure.
  • the resource file is renamed to obtain the renamed
  • the resource file also includes the following processes:
  • Step S301 Determine the second XML file that stores the resource file in the resource merging result.
  • Step S302 Replace the parameter value of the file parameter of the second XML file with the file name of the renamed resource file to obtain the renamed resource file; the file parameters include: tag value value and/or Object attribute name name.
  • an extensible markup language XML file including the resource file to be replaced that is, a second XML file
  • the file parameters of the second XML file are determined, where the file parameters include: tag value value and/or object attribute name name.
  • the name of the target file parameter in the file parameter can be modified to the name of the renamed UI library, thereby obtaining a resource file using the renamed UI library.
  • the target file parameter is the parameter whose name among the file parameters is the same as the name of the resource file before modification.
  • the parameter values of the file parameters of the XML file can be determined through the following steps, specifically including:
  • the second XML file is converted into a document object.
  • the second XML file corresponding to the resource file that needs to be replaced can be converted into a document object (ie, document object). Then, obtain the file parameters of the second XML file in the document object, that is, the tag value value and/or the object attribute name name. And according to the replacement rules, the tag value value and/or the object attribute name name are replaced through the DOM library.
  • the replacement rule can be expressed as modifying the target file parameters whose names are the names of the resource files before modification in the file parameters to the names of the resource files after the renaming.
  • the resource merging result of the resource merging compilation task can be obtained, and the resource file in the resource merging result can be replaced with the renamed resource file.
  • the layout resource files can be traversed in the first designated directory to find the resource file to be replaced, and the resource file to be replaced can be replaced with the renamed resource file.
  • the first designated directory can be (build/ intermediates/merged-not-compiled-resources) directory.
  • renaming the resource file on which the plug-in to be upgraded depends can be understood as modifying the parameters related to the name of the resource file in the XML file where the resource file is located, thereby modifying the name of the resource file to a preset name.
  • the host and the plug-in do not have the same dependent libraries, and there will be no problem of class conversion errors.
  • the plug-in APK can be compiled based on the renamed resource file and the renamed code package.
  • Figure 4 shows a flowchart of a specific method for replacing the original user interface UI library on which the plug-in to be upgraded depends on with the renamed UI library in the SDK upgrade method provided by the embodiment of the present disclosure.
  • the method further includes the following process:
  • Step S401 After replacing the resource file in the resource merging result of the resource merging compilation task of the SDK's host project with the renamed resource file, save the renamed resource file to the third
  • the first XML file and the second XML file are located in different storage directories
  • the second XML file is the XML file that stores the resource file in the resource merging result.
  • Step S402 Compile the first XML file to obtain the temporary file, wherein the file name of the temporary file is the file name of the renamed resource file.
  • Step S403 Store the temporary file in the second designated directory of the resource merging and compilation task.
  • the renamed resource file can be Save it as an XML file with the same name in another directory (ie, the first XML file mentioned above).
  • a new XML resource file (ie, the above-mentioned first XML file) is obtained.
  • the use of the original user interface UI library can be replaced by the use of the renamed UI library through the new XML resource file.
  • the new XML resource file can be compiled through aapt2 to generate a compiled .flat file (a temporary file generated after resource compilation).
  • the renamed resource file in the resource merging result can be called.
  • the renamed resource file can be called in the resource merging result through the resource link task of the host project of the SDK, and the renamed resource file can be used to depend on the renamed resource file in the plug-in to be upgraded.
  • the code package is renamed.
  • the compilation process of the host project and the plug-in project includes a resource merging compilation task (mergeResources) and a resource linking task (processResources).
  • the resource link task represents the task of linking the resource compilation task results during the plug-in compilation process. That is, the resource merging and compilation task represents the task of merging the resource libraries that the plug-in to be upgraded depends on during the plug-in compilation process, and the resource linking task represents the link resource compilation task result when linking link resources.
  • a task task can be inserted between the resource merging and compiling task (mergeResources) and the resource linking task (processResources) through the gradle plug-in. Therefore, after the execution of the resource merging and compilation task is completed through this task task, the resource merging result of the resource merging and compilation task is determined, and the resource files in the resource merging result are traversed in the first designated directory. Next, replace the resource file in the first specified directory with the renamed resource file.
  • the code package in the plug-in to be upgraded that relies on the renamed resource file can be renamed. Specifically, Including the following processes:
  • the code included in the target code package is code used to call resource files.
  • the file parameters in the resource file need to be modified, but also the name of the code used to call the resource file (i.e., the target code package) in the plug-in to be upgraded needs to be modified, thereby realizing the name and renaming of the target code package.
  • the package names of the subsequent resource files are the same.
  • the resources in the renamed resource file can be called through the renamed code.
  • the classes in the plug-in to be upgraded can be modified through the Java bytecode manipulation framework ASM, thereby renaming all codes in the resource files.
  • the above-mentioned renaming process of the target code package includes self-developed code and lower-level dependent code.
  • the APK finally generated according to the above operation actually uses the renamed resource file, but the development process is still carried out in a manner that relies on the original resource file, and will not cause any intrusion into the development process.
  • the technical solution described in this disclosure solves the problem that third-party UI dependency libraries can be used normally to simplify the development workload during the development process of self-upgrading plug-ins for complex page SDKs.
  • the gradle plugin The reference to the original resource file is replaced by a reference to the renamed resource file, thereby avoiding possible class conversion errors and page layout confusion.
  • FIG. 5 there is a flow chart of another SDK upgrade method provided by an embodiment of the present disclosure.
  • the method includes the following process, which is specifically described as:
  • Step S501 Determine the third-party resource files on which the plug-in to be upgraded of the software tool development kit SDK depends, which is the same as step S102 and will not be described in detail here.
  • Step S502 Rename the resource file to obtain the renamed resource file.
  • the corresponding product can be released to the outside world (for example, to the server), for example, a data package or jar in aar format. format packet.
  • Step S503 Add the original resource file to the host project to which the target software tool development package SDK belongs.
  • the original resource files that the plug-in to be upgraded depend on will be deleted, for example, the original user interface UI library will be deleted.
  • Step S504 Set the parameter value of the isShinkResources attribute parameter of the plug-in to be upgraded to true.
  • Step S505 Execute the resource merging and compilation task, and obtain the resource merging processing result.
  • Step S506 Execute the ModifyResForRulesTask task and traverse the layout resource files from the first specified directory (build/intermediates/merged-not-compiled-resources) of the product of the resource merging and compilation task to find the resource file to be replaced.
  • the ModifyResForRulesTask task is the above-mentioned task task.
  • Step S507 Convert the resource file that needs to be replaced into a renamed resource file.
  • the resource file can be renamed in the following ways to obtain the renamed resource file, including:
  • the replacement rule can be expressed as modifying the target file parameters whose names are the names of the resource files before modification in the file parameters to the names of the resource files after the renaming.
  • Step S508 After the replacement, save the renamed resource file library as an xml file with the same name in another directory to use the renamed resource file.
  • Step S509 Compile the new renamed resource file through aapt2 to generate a compiled .flat file (ie, the above-mentioned temporary file).
  • Step S510 Copy and replace the temporary file into the product directory build/intermediates/res/merged of the original mergeResources task (ie, the above-mentioned second specified directory).
  • Step S511 when the resource link task (processResources) links resources (link), the renamed resource file will be used to link resources.
  • Step S512 Replace the name of the target code package in the plug-in to be upgraded with the name of the renamed resource file, thereby obtaining the complete renamed APK of the plug-in to be upgraded.
  • 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. 6 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 61 , a first renaming unit 62 , a replacement unit 63 , a second renaming unit 64 and a compilation unit. Unit 65; where,
  • the determination unit 61 is used to determine the third-party resource files on which the plug-in to be upgraded of the software tool development kit SDK depends;
  • the first renaming unit 62 is used to rename the resource file to obtain the renamed resource file
  • Replacement unit 63 configured to replace the resource file in the resource merging result of the resource merging compilation task of the SDK's host project with the renamed resource file
  • the second renaming unit 64 is configured to call the renamed resource file in the resource merging result, and rename the code package in the plug-in to be upgraded that relies on the renamed resource file;
  • the compilation unit 65 is configured to compile and obtain a plug-in APK based on the renamed resource file and the renamed code package; the plug-in APK is used to upgrade the SDK.
  • the third-party resource files on which the plug-in to be upgraded can be replaced with the renamed resource files, and the code packages in the plug-in to be upgraded that rely on the renamed resource files can be renamed based on The renamed resource files and code packages are compiled to obtain the plug-in APK.
  • the resource files used by the plug-in to be upgraded can be renamed, and the resource files on which the code of the plug-in to be upgraded can be replaced with the renamed resource files without changing the existing compilation method. .
  • the device is further configured to: before replacing the resource file in the resource merging result with the renamed resource file, traverse the files in the first specified directory in the resource merging result.
  • Resource layout file determine the resource file on which the plug-in to be upgraded depends in the resource merging result according to the resource identification information contained in the resource layout file.
  • the device is further configured to: after replacing the resource file in the resource merging result of the resource merging compilation task of the SDK's host project with the renamed resource file,
  • the renamed resource file is saved in a first XML file, wherein the first XML file and the second XML file are located in different storage directories, and the second XML file is stored in the resource merging result.
  • XML file of the resource file compile the first XML file to obtain the temporary file, wherein the file name of the temporary file is the file name of the renamed resource file; convert the temporary file
  • the file is stored in the second designated directory of the resource merging and compilation task.
  • the first renaming unit is used to determine the second XML file in which the resource file is stored in the resource merging result; and change the file parameters of the second XML file to The parameter value is replaced with the file name of the renamed resource file to obtain the renamed resource file; the file parameters include: tag value value and/or object attribute name name.
  • the first renaming unit is configured to: convert the second XML file into a document object; and obtain parameter values of the file parameters in the document object.
  • the device is further configured to: add the resource files on which the plug-in to be upgraded depends in the host project; establish a connection between the plug-in to be upgraded and the resource files in the host project. dependencies.
  • the second renaming unit is configured to call the renamed resource file in the resource merging result through a resource link task of the host project of the SDK.
  • 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:
  • Embodiments of the present disclosure also provide a computer-readable storage medium.
  • a computer program is stored on the computer-readable storage medium.
  • the computer program is implemented when the processor executes the above method.
  • the storage medium may be a volatile or non-volatile computer-readable storage medium.
  • the computer program product of the SDK upgrade method provided by the embodiment of the present disclosure includes a computer-readable storage medium storing program code.
  • the instructions included in the program code can be used to execute the steps of the SDK upgrade method described in the above method embodiment. , please refer to the above method embodiments for details, and 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 the part that 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 all or part of the steps of the methods described in various embodiments of the present disclosure.
  • 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)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

本公开提供了一种SDK升级方法、装置以及计算机设备,其中,该方法包括:确定软件工具开发包SDK的待升级插件依赖的第三方的资源文件,并将所述资源文件进行重命名处理,得到重命名后的资源文件。将所述SDK的宿主工程的资源合并编译任务的资源合并结果中的所述资源文件替换为所述重命名后的资源文件。调用所述资源合并结果中所述重命名后的资源文件,并对所述待升级插件中依赖所述重命名后的资源文件的代码包进行重命名。基于所述重命名后的资源文件和所述重命名后的代码包编译得到插件APK;所述插件APK用于对所述SDK进行升级处理。

Description

一种SDK升级方法、装置以及计算机设备
本公开要求于2022年4月26日提交中国国家知识产权局、申请号为202210446034.8、发明名称为“一种SDK升级方法、装置以及计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开属于计算机技术领域,具体涉及一种SDK升级方法、装置以及计算机设备。
背景技术
软件开发工具包(Software Development Kit,简称SDK)一般都是一些软件工程师为特定的软件包、软件框架、硬件平台、操作系统等建立应用软件时的开发工具的集合。目前,常见的SDK(例如,游戏SDK)自升级方案中,宿主基本是一个空壳,所有的功能均在插件中。同时由于插件逻辑简单,因此,插件的页面功能较为简单。此时,为了实现较为简单的页面功能,基本无需使用很复杂的库。例如,插件中只使用了安卓Android原生提供的应用程序接口(Application Program Interface,简称API)。如果插件的页面功能较为复杂,则需要增加更多的资源库,从而使得插件依赖更多的资源库。针对相关技术中为了实现更加复杂的页面功能从而增加更多资源库的技术方案存在以下缺陷:
(1)、如果插件的页面功能较为复杂,例如使用Support库添加多种页面效果、ConstraintLayout库进行布局管理、Navigation库进行跳转逻辑管理等等,此时只用原生的API而不使用上述依赖库会大大增加开发成本。
(2)、如果插件中依赖这些库,宿主中不引入这些库,此时,如果接入方接入SDK时使用了这些库,同样会造成宿主和插件中存在相同的依赖库,从而导致出现类转换错误的问题。
发明内容
本公开实施例至少提供一种SDK升级方法、装置以及计算机设备。
第一方面,本公开实施例提供了一种SDK升级方法,包括:确定软件工具开发包SDK的待升级插件依赖的第三方的资源文件,并将所述资源文件进行重命名处理,得到重命名后的资源文件;将所述SDK的宿主工程的资源合并编译任务的资源合并结果中的所述资源文件替换为所述重命名后的资源文件;调用所述资源合并结果中所述重命名后的资源文件,并对所述待升级插件中依赖所述重命名后的资源文件的代码包进行重命名;基于所述重命名后的资源文件和重命名后的所述代码包编译得到插件APK;所述插件APK用于对所述SDK进行升级处理。
结合第一方面,本公开实施例提供了第一方面的第一种可能的实施方式,其中:在将所述资源合并结果中的所述资源文件替换为所述重命名后的资源文件之前,所述方法还包括:遍历所述资源合并结果中第一指定目录下的资源布局文件;根据所述资源布局文件中包含的资源标识信息在所述资源合并结果中确定所述待升级插件依赖的所述资源文件。
结合第一方面和第一方面的第一种可能的实施方式,本公开实施例提供了第一方面的第二种可能的实施方式,其中:所述方法还包括:在将所述SDK的宿主工程的资源合并编译任务的资源合并结果中的所述资源文件替换为所述重命名后的资源文件之后,将所述重命名后的资源文件保存至第一XML文件中,其中,所述第一XML文件与第二XML文件位于不同的存储目录中,所述第二XML文件为所述资源合并结果中存储所述资源文件的XML文件;对所述第一XML文件进行编译,得到所述临时文件,其中,所述临时文件的文件名为所述重命名后的资源文件的文件名;将所述临时文件存放在所述资源合并编译任务的第二指定目录下。
结合第一方面第一种可能的实施方式,本公开实施例提供了第一方面的第三种可能的实施方式,其中:所述将所述资源文件进行重命名处理,得到重命名后的资源文件,包括:确定资源合并结果中存储所述资源文件的第二XML文件;将所述第二XML文件的文件参数的参数值替换为重命名后的资源文件的文件名,得到重命名后的资源文件;所述文件参数包括:标签值value和/或对象属性名name。
结合第一方面第一种可能的实施方式,本公开实施例提供了第一方面的第四种可能的实施方式,其中:通过以下步骤确定所述XML文件的文件参数的参数值,包括:将所述第二XML文件转换为文档对象;在所述文档对象中获取所述文件参数的参数值。
结合第一方面,本公开实施例提供了第一方面的第五种可能的实施方式,其中:所述方法还包括:在所述宿主工程中添加所述待升级插件依赖的所述资源文件;建立所述待升级插件和所述宿主工程中的资源文件之间的依赖关系。
结合第一方面,本公开实施例提供了第一方面的第六种可能的实施方式,其中:所述调用所述资源合并结果中所述重命名后的资源文件,包括:通过所述SDK的宿主工程的资源链接任务在所述资源合并结果中调用所述重命名后的资源文件。
第二方面,本公开实施例还提供一种SDK升级装置,包括:确定单元,用于确定软件工具开发包SDK的待升级插件依赖的第三方的资源文件;第一重命名单元,用于将所述资源文件进行重命名处理,得到重命名后的资源文件;替换单元,用于将所述SDK的宿主工程的资源合并编译任务的资源合并结果中的所述资源文件替换为所述重命名后的资源文件;第二重命名单元,用于调用所述资源合并结果中所述重命名后的资源文件,并对所述待升级插件中依赖所述重命名后的资源文件的代码包进行重命名;编译单元,用于基于所述重命名后的资源文件和重命名后的所述代码包编译得到插件APK;所述插件APK用于对所述SDK进行升级处理。
第三方面,本公开实施例还提供一种计算机设备,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当计算机设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤。
第四方面,本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤。
本公开实施例提供的SDK升级方法、装置以及计算机设备。在本公开技术方案中,可以将待升级插件所依赖的第三方的资源文件替换为重命名之后的资源文件,并对待升级插件中依赖重命名后的资源文件的代码包进行重命名,以基于重命名后的资源文件和代码包编译得到插件APK。通过该处理方式,可以将待升级插件所使用的资源文件进行重命名,并在不改变现有编译方式的前提下,将待升级插件的代码所依赖的资源文件替换为重命名后的资源文件。在接入方接入SDK并使用该资源文件时,由于插件和宿主中所依赖的资源文件不相同,因此,就不会出现类转换错误的问题,进一步地通过上述处理方式能够保证在不增加开发成本的情况下,不会出现类转换错误,以及页面布局错乱的问题。
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。
附图说明
附图用来提供对本发明的进一步理解,并且构成说明书的一部分,与本发明实施例一起用于解释本发明,并不构成对本发明的限制。在附图中:
图1示出了本公开实施例所提供的一种SDK升级方法的流程图;
图2示出了本公开实施例所提供的SDK升级方法中,对待升级插件依赖的原始用户界面UI库进行重命名处理的具体方法的流程图;
图3示出了本公开实施例所提供的SDK升级方法中,另一种对待升级插件依赖的原始用户界面UI库进行重命名的具体方法的流程图;
图4示出了本公开实施例所提供的SDK升级方法中,将待升级插件所依赖的原始用户界面UI库替换为重命名之后的UI库的具体方法的流程图;
图5示出了本公开实施例所提供的另一种SDK升级方法的流程图;
图6示出了本公开实施例所提供的一种SDK升级装置的示意图;
图7示出了本公开实施例所提供的一种计算机设备的示意图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。
软件开发工具包(Software Development Kit,简称SDK)一般都是一些软件工程师为特定的软件包、软件框架、硬件平台、操作系统等建立应用软件时的开发工具的集合。现有开发技术中,可以采用插件化的技术来实现客户端的开发过程。其中,插件化的技术可以理解为将一个客户端按照宿主和插件的方式进行开发。也即,在插件化技术方案中,包含一个宿主工程和多个插件工程。
在现有的开发环境下,可以对宿主工程进行编译,编译得到宿主应用APK。之后,可以在该开发环境下对插件功能进行编译,生成插件APK。其中,宿主应用又可以理解为主APP,宿主应用可以加载插件APK,宿主应用还可以为插件APK提供基本的类库和功能。每个插件APK可以对应客户端中的一个功能,该插件APK可以由宿主应用进行加载。
经研究发现,在现有的SDK自升级方法中,所有的功能都放在插件中。如果插件的页面功能较为复杂,则需要使用很复杂的库,此时会增加开发成本。如果在插件开发的过程中,在插件中依赖这些复杂的库,但是在宿主中不引入这些库,那么在接入方接入SDK时使用了这些库,同样会造成宿主和插件中存在相同的依赖库,从而导致出现类转换错误的问题。
基于上述研究,本公开提供了一种SDK升级方法、装置以及计算机设备。在本公开技术方案中,可以将待升级插件所依赖的第三方的资源文件替换为重命名之后的资源文件,并对待升级插件中依赖重命名后的资源文件的代码包进行重命名,以基于重命名后的资源文件和代码包编译得到插件APK。通过该处理方式,可以将待升级插件所使用的资源文件进行重命 名,并在不改变现有编译方式的前提下,将待升级插件的代码所依赖的资源文件替换为重命名后的资源文件。在接入方接入SDK并使用该资源文件时,由于插件和宿主中所依赖的资源文件不相同,因此,就不会出现类转换错误的问题,进一步地通过上述处理方式能够保证在不增加开发成本的情况下,不会出现类转换错误,以及页面布局错乱的问题。
针对以上方案所存在的缺陷,均是发明人在经过实践并仔细研究后得出的结果。因此,上述问题的发现过程以及下文中本公开针对上述问题所提出的解决方案,都应该是发明人在本公开过程中对本公开做出的贡献。
应注意到:相似的标号和字母在下面的附图中表示类似项。因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。
为便于对本实施例进行理解,首先对本公开实施例所公开的一种SDK升级方法进行详细介绍。本公开实施例所提供的SDK升级方法的执行主体一般为具有一定计算能力的计算机设备,该计算机设备例如包括:终端设备或服务器或其它处理设备,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字处理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等。在一些可能的实现方式中,该SDK升级方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。
下面以执行主体为移动终端为例对本公开实施例提供的SDK升级方法加以说明。
实施例一
参见图1所示,为本公开实施例提供的SDK升级方法的流程图,所述方法包括步骤S102~S108,其中:
S102:确定软件工具开发包SDK的待升级插件依赖的第三方的资源文件,并将所述资源文件进行重命名处理,得到重命名后的资源文件。
在本公开实施例中,SDK是向指定客户端APP提供的相应接入功能的集合。在插件化的技术方案中,会将SDK中的功能打包成插件的形式,并对这些插件进行下发。插件所依赖的资源文件中所包含的资源可以是字符 串、图片、颜色、控件等资源,插件中的代码在运行时会用到上述描述的资源。
在本公开实施例中,可以先确定SDK中的待升级功能,其中,待升级功能可以为一个或多个。然后,确定待升级功能所对应的插件,并将该插件确定为待升级插件。之后,可以在资源支持库中确定待升级插件依赖的第三方的资源文件。其中,该第三方的资源文件可以为待升级插件所依赖的原始用户界面UI(User Interface)库,或者,可以为待升级插件所依赖的其他资源库,本公开对此不作具体限定。
在确定出第三方的资源文件之后,可以对该资源文件进行重命名处理。具体实施时,可以通过修改该资源文件所对应的文件参数的参数值方式对该资源文件进行重命名处理。
S104:将所述SDK的宿主工程的资源合并编译任务的资源合并结果中的所述资源文件替换为所述重命名后的资源文件。
在对SDK的宿主工程进行编译的过程中,包含资源合并编译任务(mergeResources)。其中,资源合并编译任务是指将各插件所依赖的资源合并为对应的文件(即,上述资源合并结果),然后,将该文件存放在指定资源目录(例如,build/intermediates/mergednot-compiled-resources目录)中。
在获取到资源合并结果之后,可以在资源合并结果中查找待升级插件所依赖的资源文件,并将该资源文件替换为重命名后的资源文件。具体实施时,可以将该资源文件中待升级插件依赖的原始用户界面UI库替换为重命名后的UI库。在将原始用户界面UI库进行替换之后,可以得到使用重命名后UI库的新资源文件。
S106:调用所述资源合并结果中所述重命名后的资源文件,并对所述待升级插件中依赖所述重命名后的资源文件的代码包进行重命名。
为了将待升级插件的代码所依赖的资源文件替换为重命名rename后的资源文件,这里,还需要在对资源合并结果中的资源文件进行重命名后,对待升级插件中依赖该重命名后的资源文件的代码也进行重命名处理,从而实现待升级插件的代码能够依赖该重命名rename后的资源文件。也即, 能够实现待升级插件的代码在运行的过程中能够成功调用重命名rename后的资源文件中的资源。
具体实施时,可以先获取资源合并结果中待升级插件所依赖的资源文件,并确定资源文件中待升级插件所依赖的原始用户界面UI(User Interface)库。然后,将资源合并结果中原始用户界面UI库替换为重命名后的原始用户界面UI库,从而得到使用重命名之后的UI库的新资源文件。在资源合并结果中对原始用户界面UI库进行替换的过程中,还可以将待升级插件中依赖该原始用户界面UI库的相关代码的包名改成重命名后的包名。在修改完成之后,就可以对外发布(例如,向服务器发布)对应的产物。例如,aar格式的数据包或者jar格式的数据包。在发布对应的产物之后,就可以执行对插件工程的编译过程,从而得到对应的插件APK文件。
S108:基于所述重命名后的资源文件和所述重命名后的代码包编译得到插件APK;所述插件APK用于对所述SDK进行升级处理。
本公开实施例提供的SDK升级方法、装置以及计算机设备。在本公开技术方案中,可以将待升级插件所依赖的第三方的资源文件替换为重命名之后的资源文件,并对待升级插件中依赖重命名后的资源文件的代码包进行重命名,以基于重命名后的资源文件和代码包编译得到插件APK。通过该处理方式,可以将待升级插件所使用的资源文件进行重命名,并在不改变现有编译方式的前提下,将待升级插件的代码所依赖的资源文件替换为重命名后的资源文件。在接入方接入SDK并使用该资源文件时,由于插件和宿主中所依赖的资源文件不相同,因此,就不会出现类转换错误的问题。进一步地,通过上述处理方式能够保证在不增加开发成本的情况下,不会出现类转换错误,以及页面布局错乱的问题。
通过上述描述可知,在本公开实施例中,首先目标软件工具开发包SDK中待升级功能所对应的待升级插件。然后,在资源合并结果中确定待升级插件所依赖的第三方的资源文件,并在该资源文件中确定待升级插件所依赖的原始用户界面UI(User Interface)库之后,将该原始用户界面UI库替换为重命名后的UI库,从而得到使用重命名之后的UI库的新资源文件。在重命名之后,向服务器发布对应的产物。
在本公开的一个可选实施方式中,在图1所示实施例的基础上,还包括如下步骤:
步骤S11:在所述宿主工程中添加所述待升级插件依赖的所述资源文件。
步骤S12:建立所述待升级插件和所述宿主工程中的资源文件之间的依赖关系。
在本公开实施例中,在编译得到插件APK之后,还可以在目标软件工具开发包SDK所属宿主工程中添加待升级插件依赖的所述资源文件。例如,可以在宿主工程中添加该资源文件中的原始用户界面UI库。之后,可以建立待升级插件和宿主工程中所添加的资源文件之间的依赖关系。
具体实施时,可以在将原始用户界面UI库添加至宿主工程之后,在宿主工程中添加指示标识,以通过该指示标识确定依赖于该原始用户界面UI库的插件为待升级插件。
在插件开发的过程中,对待升级插件所依赖的资源文件进行重命名之后,使得待升级插件能够依赖使用重命名之后的资源文件。但是,由于重命名之后的资源文件可能还会依赖重命名前的资源文件。因此,还需要在宿主工程中添加该重命名前的资源文件,以使该待升级插件能够依赖该重命名前的资源文件。通过上述操作,在插件运行过程中,不会因为缺少资源而导致出现运行错误,或者运行失败等问题。
也就是说,待升级插件除了依赖原本要使用的资源文件(例如,原始用户界面UI库)以外,还需要依赖一份刚刚重命名之后的资源文件。此时,就需要将重命名前的资源文件添加至宿主工程中。
通过上述描述可知,通过将待升级插件中依赖的资源文件替换为重命名后的资源文件,并在宿主工程中添加原始的资源文件的方式,能够解决由于宿主和插件中包含相同资源库导致的类转换错误的问题。同时,在插件运行过程中也不会因为缺少原始用户界面UI库中的资源而导致出现运行错误,或者运行失败等问题。
在本公开的一个可选实施方式中,在所述目标软件工具开发包SDK所属宿主工程中添加待升级插件依赖的所述资源文件之后,且在对所述待升 级插件所对应的插件工程进行编译之前,还可以将目标插件属性参数设置为预设数值。其中,设置为所述预设数值的目标属性参数表示在待升级插件所对应的插件工程编译之前将原始的资源文件保存至指定资源目录中。
具体地,在本公开实施例中,目标插件属性参数可以为isShinkResources属性。也就是说,可以将待升级插件的isShinkResources属性参数的参数值设置为true(即,上述预设数值)。采用该设置方式,能够保证在待升级插件的资源编译(compile)过程中,会保留一份编译前的资源文件在资源合并编译任务的指定资源目录下。其中,该指定资源目录可以为以下资源目录:(build/intermediates/mergednot-compiled-resources)目录。其中,该资源目录为用于存储该资源合并编译任务的编译产物的目录。
参见图2,图2示出了本公开实施例所提供的SDK升级方法中,对待升级插件依赖的原始用户界面UI库进行重命名处理的具体方法的流程图。
在一个可选实施方式中,在图1所示实施例的基础上,如图2所示,在将所述资源合并结果中的所述资源文件替换为重命名后的资源文件之前,本公开实施例所提供的方法还包括如下步骤:
步骤S201,遍历所述资源合并结果中第一指定目录下的资源布局文件。
步骤S202,根据所述资源布局文件中包含的资源标识信息在所述资源合并结果中确定所述待升级插件依赖的所述资源文件。
在确定出待升级插件依赖的第三方的资源文件,以及对该资源文件进行重命名处理,得到重命名后的资源文件之后,可以获取资源合并编译任务的资源合并结果。并在该资源合并结果中查找待升级插件所依赖的资源文件。这里,可以通过上述步骤S201和步骤S202所描述的方式在资源合并结果中查找待升级插件所依赖的资源文件。在查找到该资源文件之后,就可以将该资源文件替换为重命名后的资源文件。
在本公开实施例中,如果待升级插件所依赖的资源文件中包含多个资源库,则可以对该资源文件中的全部资源库进行替换,还可以选择对该资源文件中的部分资源库进行替换。
举例来说,如果选择对该资源文件中的部分资源库进行替换,假设该部分资源库为待升级插件所依赖的原始用户界面UI库(以下简称UI库)。 此时,就可以通过上述步骤S201和步骤S202所描述的方式在资源合并结果中查找待升级插件所依赖的资源文件,并在该资源文件中查找上述UI库,将该资源文件中的UI库替换为重命名后的UI库,从而得到使用重命名之后的UI库的资源文件。
在宿主工程和插件工程的编译的过程中,包含资源合并编译任务(mergeResources)和资源链接任务(processResources)。这里,资源合并编译任务是指在宿主工程的编译阶段将待升级插件所依赖的资源合并为一个文件(即,上述资源合并结果)。其中,该资源合并结果存放在第一指定目录(build/intermediates/mergednot-compiled-resources目录)中。资源链接任务表示在插件工程的编译过程中链接资源合并编译任务的资源合并结果的任务。其中,资源链接任务(processResources)将在下述实施方式中进行介绍。
通过上述描述可知,在本公开实施例中,由于将待升级插件的isShinkResources属性参数的参数值设置为true。因此,在执行资源合并编译任务之后,编译之前的资源文件就会保存在第一指定目录中。此时,在待升级插件依赖的资源文件进行重命名处理时,就可以获取资源合并编译任务的资源合并结果,并在第一指定目录中遍历所述资源合并处理结果中的资源文件。
例如,可以从存储资源合并编译任务(mergeResources)的产物的第一指定目录(build/intermediates/merged-not-compiled-resources)中,遍历layout资源文件,从而找到需要替换的资源文件。在得到需要替换的资源文件之后,就可以对待替换的资源文件执行替换操作,从而使得替换之后的资源文件为重命名后资源文件,从而得到重命名后资源文件。例如,可以对资源文件中待替换的UI库执行替换操作,从得到使用重命名之后的UI库的资源文件。
参见图3,图3示出了本公开实施例所提供的SDK升级方法中,另一种对待升级插件依赖的原始用户界面UI库进行重命名的具体方法的流程图。
在本公开的一个可选实施方式中,在图1所描述技术方案,以及图2所描述技术方案的基础上,如图3所示,将所述资源文件进行重命名处理,得到重命名后的资源文件,还包括如下过程:
步骤S301,确定所述资源合并结果中存储所述资源文件的第二XML文件。
步骤S302,将所述第二XML文件的文件参数的参数值替换为重命名后的资源文件的文件名,得到所述重命名后的资源文件;所述文件参数包括:标签值value和/或对象属性名name。
在本公开实施例中,可以获取包含该待替换的资源文件的可扩展标记语言XML文件,也即第二XML文件。之后,确定第二XML文件的文件参数,其中,所述文件参数包括:标签值value和/或对象属性名name。接下来,可以将文件参数中的目标文件参数的名称修改为重命名后资源文件的名称。例如,可以将文件参数中的目标文件参数的名称修改为重命名后UI库的名称,从而得到使用重命名后UI库的资源文件。其中,目标文件参数为文件参数中名称与修改前资源文件的名称相同的参数。
在一个可选的实施方式中,可以通过以下步骤确定所述XML文件的文件参数的参数值,具体包括:
首先,将所述第二XML文件转换为文档对象。
然后,在所述文档对象中获取所述文件参数的参数值。
在本公开实施例中,可以将需要替换的资源文件对应的第二XML文件转换为文档对象(即,document对象)。然后,在文档对象中获取第二XML文件的文件参数,即标签值value和/或对象属性名name。并按照替换规则,通过DOM库对标签值value和/或对象属性名name进行替换。其中,替换规则可以表示为将文件参数中名称为修改前资源文件的名称的目标文件参数均修改为重命名后资源文件的名称。例如,可以将文件参数中名称为原始UI库的包名的目标文件参数均修改为重命名之后的UI库的包名,从而实现将原始用户界面UI库的包名修改为重命名之后的包名,得到重命名之后的UI库。
在本公开实施例中,在得到重命名后的资源文件之后,可以获取资源合并编译任务的资源合并结果,并将该资源合并结果中的资源文件替换为重命名后的资源文件。
具体实施时,可以在第一指定目录中遍历layout资源文件,从而找到待替换的资源文件,并将该待替换的资源文件替换为重命名后的资源文件,第一指定目录可以为(build/intermediates/merged-not-compiled-resources)目录。
在本公开中,对待升级插件依赖的资源文件进行重命名可以理解为对资源文件所在XML文件中涉及资源文件的名称的参数的进行修改,从而实现将资源文件的名称修改为预先设定的名称。此时,在将原始的资源文件依赖到宿主中之后,就可以实现宿主和插件不存在相同的依赖库,也就不会出现类转换错误的问题。
在本公开实施例中,在按照上述所描述的方式对待升级插件依赖的资源文件进行重命名处理,可以得到重命名后的资源文件。之后,可以实现将待升级插件所依赖的资源文件替换为重命名之后的资源文件。在对待升级插件中依赖该资源文件的代码包进行重命名处理之后,就可以基于重命名后的资源文件和重命名后的代码包编译得到插件APK。
参见图4,图4示出了本公开实施例所提供的SDK升级方法中,将待升级插件所依赖的原始用户界面UI库替换为重命名之后的UI库的具体方法的流程图。
在本公开的一个可选实施方式中,在图1至图3所描述技术方案的基础上,如图4所示,该方法还包括如下过程:
步骤S401,在将所述SDK的宿主工程的资源合并编译任务的资源合并结果中的所述资源文件替换为所述重命名后的资源文件之后,将所述重命名后的资源文件保存至第一XML文件中,其中,所述第一XML文件与第二XML文件位于不同的存储目录中,所述第二XML文件为所述资源合并结果中存储所述资源文件的XML文件。
步骤S402,对所述第一XML文件进行编译,得到所述临时文件,其中,所述临时文件的文件名为所述重命名后的资源文件的文件名。
步骤S403,将所述临时文件存放在所述资源合并编译任务的第二指定目录下。
在本公开实施例中,在将所述SDK的宿主工程的资源合并编译任务的资源合并结果中的所述资源文件替换为所述重命名后的资源文件之后,可以将重命名之后的资源文件保存为另一个目录下的同名XML文件(即,上述第一XML文件)。
在将重命名之后的资源文件保存为另一个目录(即,上述第二指定目录)下的同名XML文件之后,得到新的XML资源文件(即,上述第一XML文件)。其中,在实现页面功能时,若需要使用资源文件中的原始用户界面UI库,此时,通过新的XML资源文件可以将使用原始用户界面UI库替换成对重命名之后的UI库的使用。此时,就可以将该新的XML资源文件,通过aapt2进行编译(compile),从而生成编译后的.flat文件(资源编译后产生的临时文件)。然后将这些临时文件复制替换到原本mergeResources任务的产物目录build/intermediates/res/merged(即,第二指定目录)中。最终,在资源链接任务(processResources)进行链接资源(link)的时候就会用新资源文件进行资源链接link,从而欺骗了资源链接任务(processResources),插件中最终使用的资源已经被重命名了。
在将临时文件存放在资源合并编译任务的第二指定目录下之后,就可以调用所述资源合并结果中所述重命名后的资源文件。
具体实施时,可以通过所述SDK的宿主工程的资源链接任务在所述资源合并结果中调用所述重命名后的资源文件,并对所述待升级插件中依赖所述重命名后的资源文件的代码包进行重命名。
需要说明的是,在本公开实施方式中,在宿主工程和插件工程的编译的过程中,包含资源合并编译任务(mergeResources)和资源链接任务(processResources)。其中,资源链接任务表示在插件编译过程中链接资源编译任务结果的任务。也即,资源合并编译任务表示在插件编译过程中对待升级插件所依赖资源库进行合并的任务,资源链接任务表示在进行链接link资源时链接资源编译任务结果。
通过上述实施方式中,在本公开实施例中,可以通过gradle插件,在资源合并编译任务(mergeResources)和资源链接任务(processResources)之间插入一个任务task。从而,通过该任务task在资源合并编译任务执行结束之后,确定资源合并编译任务的资源合并结果,并在第一指定目录中遍历所述资源合并结果中的资源文件。接下来,将第一指定目录中的资源文件替换为所述重命名后的资源文件。在此情况下,在资源链接任务(processResources)进行链接资源(link)的时候就会用重命名后的资源文件进行资源链接link,从而欺骗了资源链接任务(processResources),插件中最终使用的资源已经被重命名了。通过该方式能够保证在不增加开发成本的情况下,不会出现类转换错误,以及页面布局错乱的问题。
在本公开实施方式中,在调用所述资源合并结果中所述重命名后的资源文件之后,可以对所述待升级插件中依赖所述重命名后的资源文件的代码包进行重命名,具体包括如下过程:
将所述待升级插件中的目标代码包的名称替换为所述重命名后资源文件的名称。其中,所述目标代码包中所包含的代码为用于调用资源文件的代码。
在本公开实施例中,不仅要修改资源文件中的文件参数,还需要修改待升级插件中用来调用资源文件的代码(即目标代码包)的名称,从而实现目标代码包的名称和重命名后的资源文件的包名是相同的。此时,就可以通过重命名后的代码对重命名后的资源文件中的资源进行调用。
具体地,在本公开实施例中,可以通过Java字节码操控框架ASM修改待升级插件中的类,从而将使用了资源文件中的代码全部进行重命名。上述对目标代码包的重命名过程包括自研代码和更底层的依赖代码。本公开中按照上述操作最终生成的APK中其实使用的就是重命名后的资源文件,但开发过程中还是正常按照依赖原资源文件的方式进行开发,不会对开发过程造成任何侵入。
综上,本公开所描述的技术方案在插件化方案的基础上,解决了页面复杂SDK自升级插件开发过程中可以正常使用第三方UI依赖库来简化开发工作量的问题。同时,通过重命名rename的方式,由gradle插件将插件 中对原资源文件的引用换成对rename后的资源文件引用,从而避免了可能的class类转换错误,页面布局错乱的问题。
实施例二
参见图5所示,为本公开实施例提供的另一种SDK升级方法的流程图,所述方法包括如下过程,具体描述为:
步骤S501,确定软件工具开发包SDK的待升级插件依赖的第三方的资源文件,与步骤S102相同,此处不再详细赘述。
步骤S502,将资源文件进行重命名处理,得到重命名后的资源文件,其中,在修改完成之后,就可以对外发布(例如,向服务器发布)对应的产物,例如,aar格式的数据包或者jar格式的数据包。
步骤S503,在目标软件工具开发包SDK所属宿主工程添加原始的资源文件。其中,在添加之后,在对待升级插件进行编译时,就会将待升级插件中所依赖的原始的资源文件删除,例如,将原始用户界面UI库删除。
步骤S504,将待升级插件的isShinkResources属性参数的参数值设置为true。
步骤S505,执行资源合并编译任务,并得到资源合并处理结果。
步骤S506,执行ModifyResForRulesTask任务,从资源合并编译任务的产物的第一指定目录(build/intermediates/merged-not-compiled-resources)中,遍历layout资源文件,从而找到待替换的资源文件。其中,ModifyResForRulesTask任务即为上述任务task。
步骤S507,将需要替换的资源文件转换重命名后的资源文件。
这里,可以通过以下方式对资源文件进行重命名处理,得到重命名后的资源文件,具体包括:
将需要替换的资源文件对应的第二XML文件转换为文档对象(即,document对象)。然后,在文档对象中获取第二XML文件的文件参数,即标签值value和/或对象属性名name。并按照替换规则,通过DOM库对标签值value和/或对象属性名name进行替换。其中,替换规则可以表示为将文件参数中名称为修改前资源文件的名称的目标文件参数均修改为重命名后资源文件的名称。
步骤S508,在替换之后,将重命名后的资源文件库保存为另一个目录下的同名xml文件得到使用重命名后的资源文件。
步骤S509,通过aapt2对新的重命名后的资源文件进行编译(compile),生成编译后的.flat文件(即,上述临时文件)。
步骤S510,将临时文件复制替换到原本mergeResources任务的产物目录build/intermediates/res/merged中(即,上述第二指定目录)。
步骤S511,在资源链接任务(processResources)进行链接资源(link)的时候就会用重命名后的资源文件进行资源链接link。
步骤S512,将待升级插件中的目标代码包的名称替换为重命名后的资源文件的名称,从而得到完整的重命名之后的待升级插件的APK。
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。
基于同一发明构思,本公开实施例中还提供了与SDK升级方法对应的SDK升级装置。由于本公开实施例中的装置解决问题的原理与本公开实施例上述SDK升级方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。
实施例五
参照图6所示,为本公开实施例提供的一种SDK升级装置的架构示意图,所述装置包括:确定单元61、第一重命名单元62、替换单元63、第二重命名单元64和编译单元65;其中,
确定单元61,用于确定软件工具开发包SDK的待升级插件依赖的第三方的资源文件;
第一重命名单元62,用于将所述资源文件进行重命名处理,得到重命名后的资源文件;
替换单元63,用于将所述SDK的宿主工程的资源合并编译任务的资源合并结果中的所述资源文件替换为所述重命名后的资源文件;
第二重命名单元64,用于调用所述资源合并结果中所述重命名后的资源文件,并对所述待升级插件中依赖所述重命名后的资源文件的代码包进行重命名;
编译单元65,用于基于所述重命名后的资源文件和重命名后的所述代码包编译得到插件APK;所述插件APK用于对所述SDK进行升级处理。
在本公开技术方案中,可以将待升级插件所依赖的第三方的资源文件替换为重命名之后的资源文件,并对待升级插件中依赖重命名后的资源文件的代码包进行重命名,以基于重命名后的资源文件和代码包编译得到插件APK。通过该处理方式,可以将待升级插件所使用的资源文件进行重命名,并在不改变现有编译方式的前提下,将待升级插件的代码所依赖的资源文件替换为重命名后的资源文件。在接入方接入SDK并使用该资源文件时,由于插件和宿主中所依赖的资源文件不相同,因此,就不会出现类转换错误的问题,进一步地通过上述处理方式能够保证在不增加开发成本的情况下,不会出现类转换错误,以及页面布局错乱的问题。
一种可能的实施方式中,该装置还用于:在将所述资源合并结果中的所述资源文件替换为重命名后的资源文件之前,遍历所述资源合并结果中第一指定目录下的资源布局文件;根据所述资源布局文件中包含的资源标识信息在所述资源合并结果中确定所述待升级插件依赖的所述资源文件。
一种可能的实施方式中,该装置还用于:在将所述SDK的宿主工程的资源合并编译任务的资源合并结果中的所述资源文件替换为所述重命名后的资源文件之后,将所述重命名后的资源文件保存至第一XML文件中,其中,所述第一XML文件与第二XML文件位于不同的存储目录中,所述第二XML文件为所述资源合并结果中存储所述资源文件的XML文件;对所述第一XML文件进行编译,得到所述临时文件,其中,所述临时文件的文件名为所述重命名后的资源文件的文件名;将所述临时文件存放在所述资源合并编译任务的第二指定目录下。
一种可能的实施方式中,第一重命名单元,用于确定资源合并结果中存储所述资源文件的第二XML文件;将所述第二XML文件的文件参数的 参数值替换为重命名后的资源文件的文件名,得到重命名后的资源文件;所述文件参数包括:标签值value和/或对象属性名name。
一种可能的实施方式中,第一重命名单元,用于:将所述第二XML文件转换为文档对象;在所述文档对象中获取所述文件参数的参数值。
一种可能的实施方式中,该装置还用于:在所述宿主工程中添加所述待升级插件依赖的所述资源文件;建立所述待升级插件和所述宿主工程中的资源文件之间的依赖关系。
一种可能的实施方式中,第二重命名单元,用于:通过所述SDK的宿主工程的资源链接任务在所述资源合并结果中调用所述重命名后的资源文件。
实施例六
基于同一技术构思,本公开实施例还提供了一种计算机设备。参照图7所示,为本公开实施例提供的计算机设备700的结构示意图,包括处理器701、存储器702、和总线703。其中,存储器702用于存储执行指令,包括内存7021和外部存储器7022;这里的内存7021也称内存储器,用于暂时存放处理器701中的运算数据,以及与硬盘等外部存储器7022交换的数据,处理器701通过内存7021与外部存储器7022进行数据交换,当计算机设备700运行时,处理器701与存储器702之间通过总线703通信,使得处理器701在执行以下指令:
确定软件工具开发包SDK的待升级插件依赖的第三方的资源文件,并将所述资源文件进行重命名处理,得到重命名后的资源文件;将所述SDK的宿主工程的资源合并编译任务的资源合并结果中的所述资源文件替换为所述重命名后的资源文件;调用所述资源合并结果中所述重命名后的资源文件,并对所述待升级插件中依赖所述重命名后的资源文件的代码包进行重命名;基于所述重命名后的资源文件和所述重命名后的代码包编译得到插件APK;所述插件APK用于对所述SDK进行升级处理。
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施 例中所述的SDK升级方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。
本公开实施例所提供的SDK升级方法的计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行上述方法实施例中所述的SDK升级方法的步骤,具体可参见上述方法实施例,在此不再赘述。
本公开实施例还提供一种计算机程序,该计算机程序被处理器执行时实现前述实施例的任意一种方法。该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统和装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。

Claims (11)

  1. 一种SDK自升级方法,其特征在于,包括:
    确定软件工具开发包SDK的待升级插件依赖的第三方的资源文件,并将所述资源文件进行重命名处理,得到重命名后的资源文件;
    将所述SDK的宿主工程的资源合并编译任务的资源合并结果中的所述资源文件替换为所述重命名后的资源文件;
    调用所述资源合并结果中所述重命名后的资源文件,并对所述待升级插件中依赖所述重命名后的资源文件的代码包进行重命名;
    基于所述重命名后的资源文件和重命名后的所述代码包编译得到插件APK;所述插件APK用于对所述SDK进行升级处理。
  2. 根据权利要求1所述的方法,其特征在于,在将所述资源合并结果中的所述资源文件替换为所述重命名后的资源文件之前,所述方法还包括:
    遍历所述资源合并结果中第一指定目录下的资源布局文件;
    根据所述资源布局文件中包含的资源标识信息在所述资源合并结果中确定所述待升级插件依赖的所述资源文件。
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在将所述SDK的宿主工程的资源合并编译任务的资源合并结果中的所述资源文件替换为所述重命名后的资源文件之后,将所述重命名后的资源文件保存至第一XML文件中,其中,所述第一XML文件与第二XML文件位于不同的存储目录中,所述第二XML文件为所述资源合并结果中存储所述资源文件的XML文件;
    对所述第一XML文件进行编译,得到临时文件,其中,所述临时文件的文件名为所述重命名后的资源文件的文件名;
    将所述临时文件存放在所述资源合并编译任务的第二指定目录下。
  4. 根据权利要求1所述的方法,其特征在于,所述将所述资源文件进行重命名处理,得到重命名后的资源文件,包括:
    确定资源合并结果中存储所述资源文件的第二XML文件;
    将所述第二XML文件的文件参数的参数值替换为重命名后的资源文件的文件名,得到重命名后的资源文件;所述文件参数包括:标签值value和/或对象属性名name。
  5. 根据权利要求4所述的方法,其特征在于,通过以下步骤确定所述XML文件的文件参数的参数值,包括:
    将所述第二XML文件转换为文档对象;
    在所述文档对象中获取所述文件参数的参数值。
  6. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在所述宿主工程中添加所述待升级插件依赖的所述资源文件;
    建立所述待升级插件和所述宿主工程中的资源文件之间的依赖关系。
  7. 根据权利要求1所述的方法,其特征在于,所述调用所述资源合并结果中所述重命名后的资源文件,包括:
    通过所述SDK的宿主工程的资源链接任务在所述资源合并结果中调用所述重命名后的资源文件。
  8. 一种SDK升级装置,其特征在于,包括:
    确定单元,用于确定软件工具开发包SDK的待升级插件依赖的第三方的资源文件;
    第一重命名单元,用于将所述资源文件进行重命名处理,得到重命名后的资源文件;
    替换单元,用于将所述SDK的宿主工程的资源合并编译任务的资源合并结果中的所述资源文件替换为所述重命名后的资源文件;
    第二重命名单元,用于调用所述资源合并结果中所述重命名后的资源文件,并对所述待升级插件中依赖所述重命名后的资源文件的代码包进行重命名;
    编译单元,用于基于所述重命名后的资源文件和重命名后的所述代码包编译得到插件APK;所述插件APK用于对所述SDK进行升级处理。
  9. 一种计算机设备,其特征在于,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当计算机设备运行时, 所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行如权利要求1至7任一项所述的SDK升级方法的步骤。
  10. 一种计算机可读存储介质,其特征在于,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如权利要求1至7任一项所述的SDK升级方法的步骤。
  11. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1至7任一项所述的SDK升级方法的步骤。
PCT/CN2023/082413 2022-04-26 2023-03-20 一种sdk升级方法、装置以及计算机设备 WO2023207418A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210446034.8A CN114911497A (zh) 2022-04-26 2022-04-26 一种sdk升级方法、装置以及计算机设备
CN202210446034.8 2022-04-26

Publications (1)

Publication Number Publication Date
WO2023207418A1 true WO2023207418A1 (zh) 2023-11-02

Family

ID=82765087

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/082413 WO2023207418A1 (zh) 2022-04-26 2023-03-20 一种sdk升级方法、装置以及计算机设备

Country Status (2)

Country Link
CN (1) CN114911497A (zh)
WO (1) WO2023207418A1 (zh)

Families Citing this family (1)

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

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110502222A (zh) * 2019-07-23 2019-11-26 北京字节跳动网络技术有限公司 外发依赖内部基础库的aar方法、装置、介质和设备
CN111258587A (zh) * 2020-01-17 2020-06-09 苏宁云计算有限公司 一种安卓应用插件化的实现方法、装置、设备及存储介质
US20200210488A1 (en) * 2018-12-31 2020-07-02 Microsoft Technology Licensing, Llc Automatic resource management for build systems
CN113157651A (zh) * 2021-03-23 2021-07-23 广州宸祺出行科技有限公司 一种安卓工程项目的资源文件批量重命名的方法、系统、设备和介质
CN113407165A (zh) * 2021-06-29 2021-09-17 北京字节跳动网络技术有限公司 Sdk的生成和自升级方法、装置、可读介质和设备
CN114911497A (zh) * 2022-04-26 2022-08-16 北京字跳网络技术有限公司 一种sdk升级方法、装置以及计算机设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200210488A1 (en) * 2018-12-31 2020-07-02 Microsoft Technology Licensing, Llc Automatic resource management for build systems
CN110502222A (zh) * 2019-07-23 2019-11-26 北京字节跳动网络技术有限公司 外发依赖内部基础库的aar方法、装置、介质和设备
CN111258587A (zh) * 2020-01-17 2020-06-09 苏宁云计算有限公司 一种安卓应用插件化的实现方法、装置、设备及存储介质
CN113157651A (zh) * 2021-03-23 2021-07-23 广州宸祺出行科技有限公司 一种安卓工程项目的资源文件批量重命名的方法、系统、设备和介质
CN113407165A (zh) * 2021-06-29 2021-09-17 北京字节跳动网络技术有限公司 Sdk的生成和自升级方法、装置、可读介质和设备
CN114911497A (zh) * 2022-04-26 2022-08-16 北京字跳网络技术有限公司 一种sdk升级方法、装置以及计算机设备

Also Published As

Publication number Publication date
CN114911497A (zh) 2022-08-16

Similar Documents

Publication Publication Date Title
US9122490B2 (en) Code dependency calculation
CN109918055B (zh) 一种应用程序的生成方法及设备
JP4972082B2 (ja) 開発者がシステム上の周知のロケーションを容易に発見し、または拡張するための能力
KR101795844B1 (ko) 런타임 시스템
TWI536263B (zh) 將作業系統之原始應用程式介面投射至其它程式語言
US10114745B2 (en) Assisted garbage collection in a virtual machine
US10684846B2 (en) Using semantic annotations to control compatibility behaviors
JP6338714B2 (ja) 柔軟性の高いメタデータの合成
CN112817657B (zh) 一种应用程序启动项加载方法、装置、系统及存储介质
WO2023207418A1 (zh) 一种sdk升级方法、装置以及计算机设备
CN106796521B (zh) 独立于产品发布的api版本控制
WO2023202299A1 (zh) 一种sdk升级方法、装置以及计算机设备
US11537367B1 (en) Source code conversion from application program interface to policy document
CN111176717A (zh) 生成安装包的方法、装置及电子设备
US8606766B2 (en) Method and system to handle java class versioning
CN109558121B (zh) 接口驱动程序的开发方法、装置、设备及存储介质
US20110231837A1 (en) Virtual application package reconstitution
CN113515303A (zh) 一种项目转型方法、装置和设备
CN111158777A (zh) 组件调用方法、装置及计算机可读存储介质
CN111352631A (zh) 一种接口兼容性检测方法及装置
CN115220873A (zh) 一种在Android系统中运行Open Harmony应用的方法
CN111045746A (zh) 代码扩展方法和框架
CN111782196A (zh) 基于mvp架构的开发方法及装置
US20230385075A1 (en) Networked Universal Code Package Provider
JP2007522558A (ja) ユーザ定義タイプの継承をサポートするためのシステムおよび方法

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: 23794853

Country of ref document: EP

Kind code of ref document: A1