CN112650521B - Software development kit SDK thermal restoration method and device and electronic equipment - Google Patents

Software development kit SDK thermal restoration method and device and electronic equipment Download PDF

Info

Publication number
CN112650521B
CN112650521B CN202011580635.5A CN202011580635A CN112650521B CN 112650521 B CN112650521 B CN 112650521B CN 202011580635 A CN202011580635 A CN 202011580635A CN 112650521 B CN112650521 B CN 112650521B
Authority
CN
China
Prior art keywords
resource
patch
software development
development kit
package
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011580635.5A
Other languages
Chinese (zh)
Other versions
CN112650521A (en
Inventor
魏君成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Douyin Vision Co Ltd
Original Assignee
Douyin Vision Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Douyin Vision Co Ltd filed Critical Douyin Vision Co Ltd
Priority to CN202011580635.5A priority Critical patent/CN112650521B/en
Publication of CN112650521A publication Critical patent/CN112650521A/en
Application granted granted Critical
Publication of CN112650521B publication Critical patent/CN112650521B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management

Abstract

The embodiment of the disclosure relates to the technical field of computers, and discloses a Software Development Kit (SDK) thermal repair method, a device and electronic equipment, wherein the SDK thermal repair method comprises the following steps: acquiring an application context of an application program accessed to a software development kit to be repaired; then, the application context is saved in the global public class, and an access path of the application context is provided, wherein the access path is a path for searching the application context in the global public class; then, the access path is transmitted to a preset patch plug-in to obtain a new preset patch plug-in; and generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on the new preset patch plug-in, so that the application program can complete the hot repair of the software development kit to be repaired by running the patch package and acquiring the identification information of the resource variable of the target modification object, wherein the preset patch plug-in is used for carrying out the hot repair of the software development kit to be repaired.

Description

Software development kit SDK thermal restoration method and device and electronic equipment
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a Software Development Kit (SDK) hot repair method, a device and electronic equipment.
Background
There are few hot repair solutions for SDK (Software Development Kit ) levels on the market, and many problems in the SDK hot repair process need to be solved by fumbling, for example, the problem that resource references are not effective in a patch (patch package) generated by SDK hot repair.
Aiming at the problem that the reference to the resource is not effective in the patch generated by the SDK hot repair, the closest solution is to multiplex the processing mode of the resource in the hot update plug-in: firstly, changing the resource identification in the SDK into a non-7 f beginning by using aapt2 (Android Asset Packaging Tool, tool for compiling and packaging resources), so that the resource identification cannot conflict with the resource of the APP (application program) itself (if the conflict is generated, the resource coverage is performed); then, the resource identification in the SDK is fixed by utilizing the resource fixing function of aapt2, so that when the patch is generated, the resource in the SDK can still be found through the resource identification.
However, in the implementation process, the inventor of the present disclosure finds that the implementation process of the solution is complex, and has some drawbacks, such as version dependency problem due to the function dependent on aapt2, and resource coverage when there is resource conflict between APP and SDK, so that the subsequent use process still cannot find the correct resource, so a new technical solution is needed to solve the problem of resource searching in thermal repair of SDK.
Disclosure of Invention
The purpose of the embodiments of the present disclosure is to address at least one of the above technical shortcomings, and to provide this summary section to introduce concepts in a simplified form that are further described below in the detailed description section. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In one aspect, a method for hot repair of a software development kit is provided, comprising:
acquiring an application context of an application program accessed to a software development kit to be repaired;
saving the application context into a global public class and providing an access path of the application context, wherein the access path is a path for searching the application context in the global public class;
transmitting the access path to a preset patch plug-in to obtain a new preset patch plug-in;
based on a new preset patch plug-in, generating a patch package of a target modification object of the hot repair of the software development kit to be repaired, so that an application program obtains identification information of a resource variable of the target modification object by running the patch package to finish the hot repair of the software development kit to be repaired, wherein the preset patch plug-in is used for carrying out the hot repair on the software development kit to be repaired.
In one aspect, a method for hot repair of a software development kit is provided, comprising:
the method comprises the steps that a patch package of a target modification object of hot repair of a software development kit to be repaired is obtained, the patch package is generated based on a new preset patch plug-in, the new preset patch plug-in is obtained by transmitting an access path to the preset patch plug-in, the access path is a path for searching application context of an application program in a global public class, the application context is stored in the global public class, and the application program is an application program accessed into the software development kit to be repaired;
and running the patch package, and acquiring the identification information of the resource variable of the target modification object to finish the hot repair of the software development kit to be repaired.
In one aspect, a method of generating a patch package is provided, including:
generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on a target patch plug-in, wherein the target patch plug-in is obtained by transmitting an access path into an original preset patch plug-in, the access path is a path for searching an application context in a global public class, the access path is a path for searching the application context in the global public class, the application context is an application context of an application program accessing the software development kit to be repaired, and the original patch plug-in is used for carrying out the hot repair of the software development kit to be repaired.
In one aspect, a software development kit SDK thermal repair apparatus is provided, including:
the first processing module is used for acquiring the application context of the application program through the SDK;
the second processing module is used for storing the application context into the global public class and providing an access path of the application context, wherein the access path is a path for searching the application context in the global public class;
the third processing module is used for transmitting the access path to a preset patch plug-in to obtain a new preset patch plug-in;
and the fourth processing module is used for generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on a new preset patch plug-in, so that an application program obtains the identification information of the resource variable of the target modification object by running the patch package to finish the hot repair of the software development kit to be repaired, wherein the preset patch plug-in is used for carrying out the hot repair on the software development kit to be repaired.
In one aspect, a software development kit SDK thermal repair apparatus is provided, including:
the system comprises an acquisition module, a restoration module and a restoration module, wherein the acquisition module is used for acquiring a patch package of a target modification object of hot restoration of a software development kit to be restored, the patch package is generated based on a new preset patch plug-in, the new preset patch plug-in is obtained by transmitting an access path to the preset patch plug-in, the access path is a path for searching application context of an application program in a global public class, the application context is stored in the global public class, and the application program is an application program accessed into the software development kit to be restored;
And the operation module is used for operating the patch package and acquiring the identification information of the resource variable of the target modification object to finish the hot repair of the software development kit to be repaired.
In one aspect, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the resource lookup method for hot repairing of the software development kit SDK described above when executing the program.
In one aspect, an apparatus for generating a patch package is provided, including:
the generating module is used for generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on a target patch plug-in, wherein the target patch plug-in is obtained by adjusting an original patch plug-in based on an access path, the access path is obtained by storing an application context into a global public class, the application context is an application context of an application program accessing the software development kit to be repaired, and the original patch plug-in is used for hot repairing the software development kit to be repaired.
In one aspect, a computer readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the method of hot fix of a software development kit described above.
According to the method provided by the embodiment of the disclosure, according to the path of the application context of the application program searched in the global public class, the access path is transmitted to the preset patch plug-in, so that the new preset patch plug-in can be obtained for adjustment, the generation process of the resource identification is not required to be modified in the process of generating the patch package according to the new preset patch plug-in, and additional operation is not required to be carried out on the resource, the application program can accurately acquire the identification information of the resource variable of the target modification object in the process of running the patch package, the searching step of the resource is delayed to be carried out in the running process, the fact that the correct resource identification can be conveniently searched when the patch generated based on the new preset patch plug-in is effective is ensured, the correct resource is further searched, and the hot repairing usability of the software development kit is enlarged.
Additional aspects and advantages of embodiments of the disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a flow chart of a method for thermal remediation of an SDK according to one embodiment of the present disclosure;
FIG. 2 is a flow chart of a method for thermally repairing an SDK according to yet another embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a process of SDK thermal remediation according to an embodiment of the present disclosure;
FIG. 4 is a flow chart of a thermal SDK repair method according to yet another embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a thermal SDK repair device according to one embodiment of the present disclosure;
FIG. 6 is a schematic diagram of an SDK thermal repair device according to another embodiment of the disclosure;
FIG. 7 is a schematic diagram of an SDK thermal repair device according to another embodiment of the disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are used merely to distinguish one device, module, or unit from another device, module, or unit, and are not intended to limit the order or interdependence of the functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the embodiments of the present disclosure will be described in further detail below with reference to the accompanying drawings.
The following describes in detail, with specific embodiments, a technical solution of an embodiment of the present disclosure and how the technical solution of the embodiment of the present disclosure solves the foregoing technical problems. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
One embodiment of the present disclosure provides a method of hot fix of a software development kit, which is performed by a computer device, which may be a server, which may be a separate physical server, a cluster of physical servers, or a virtual server. As shown in fig. 1, the method includes:
step S110, acquiring an application context of an application program accessed into a software development kit to be repaired; step S120, the application context is saved in a global public class, and an access path of the application context is provided, wherein the access path is a path for searching the application context in the global public class; step S130, transmitting the access path to a preset patch plug-in to obtain a new preset patch plug-in; step S140, generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on a new preset patch plug-in, so that an application program obtains the identification information of the resource variable of the target modification object by running the patch package to finish the hot repair of the software development kit to be repaired, wherein the preset patch plug-in is used for carrying out the hot repair on the software development kit to be repaired.
An application program (i.e., APP) accesses (i.e., loads) an SDK (Software Development Kit ) generally has an initialization process, and the SDK needs to store its application context (i.e., application context, abbreviated as APP context) in a global public class when the APP is initialized, and provides a path for accessing the application context, i.e., determining an access path for the application context, so that the application context can be conveniently obtained in the SDK, i.e., an access path for conveniently obtaining the application context from the global public class in the SDK, i.e., the access path is a path for searching the global public class for the application context.
The application program can quickly realize certain functions by depending on the SDK, the SDK is a code set for realizing the certain functions, and the SDK can be considered as a function package set for realizing the corresponding functions of the application program. The SDK thermal restoration is used for corresponding functions realized by the SDK in the thermal restoration application program, a corresponding patch package is generated every time the SDK thermal restoration is carried out, and specific SDK thermal restoration is finished through the patch package, namely, the SDK thermal restoration is used for thermally restoring the SDK accessed or loaded in the application program.
After determining the access path of the application context, the preset patch plug-in can be adjusted according to the access path, for example, the access path is transmitted to the preset patch plug-in to obtain a new preset patch plug-in, wherein the preset patch plug-in is used for performing thermal restoration on the software development kit to be restored, and the preset patch plug-in is a preset patch plug-in used for generating the patch package, namely, the preset patch plug-in is adjusted, so that the new preset patch plug-in (namely, the new preset patch plug-in) is obtained, and in the subsequent process of generating the patch according to the new preset patch plug-in, the generation process of the resource identifier is not required to be modified, and additional operation is not required to be performed on the resource, so that a precondition is provided for the subsequent accurate searching of the resource.
After the preset patch plug-in is adjusted, a patch package of the target modification object of the thermal restoration of the SDK can be generated according to the new preset patch plug-in, for example, when the target modification object in the SDK is thermally restored, the patch package of the target modification object to be thermally restored in the SDK can be automatically generated through the preset patch plug-in. After generating the patch package of the target modification object of the SDK thermal restoration, the application program can acquire the identification information of the resource variable of the target modification object by running the patch package, thereby completing the SDK thermal restoration. The method comprises the steps of searching the identification information of the resource variable of the target modification object in the SDK when the patch package is operated, and then, searching the identification information of the resource variable of the target modification object in the SDK when the patch package is operated, wherein the resource in the SDK and the resource in the APP are under the same application package when the patch package is operated, so that the resource of the target modification object can be conveniently and accurately found, and the usability of hot repair of the SDK is enlarged.
In the process of searching the resource of the target modification object, the corresponding resource variable can be searched according to the identification information by acquiring the identification information of the resource variable of the target modification object, so that the corresponding resource is searched according to the resource variable. It should be noted that the target modification object may be a method, a function, a program, or the like to be modified for realizing a certain function.
According to the method provided by the embodiment of the disclosure, according to the path of the application context of the application program searched in the global public class, the access path is transmitted to the preset patch plug-in, so that the new preset patch plug-in can be obtained for adjustment, the generation process of the resource identification is not required to be modified in the process of generating the patch package according to the new preset patch plug-in, and additional operation is not required to be carried out on the resource, the application program can accurately acquire the identification information of the resource variable of the target modification object in the process of running the patch package, the searching step of the resource is delayed to be carried out in the running process, the fact that the correct resource identification can be conveniently searched when the patch generated based on the new preset patch plug-in is effective is ensured, the correct resource is further searched, and the hot repairing usability of the software development kit is enlarged.
The following describes the method of the embodiments of the present disclosure in detail:
in one possible implementation, before passing the access path into the pre-patch plug-in, the following process may also be performed: and carrying out the holding processing on the global public class and the access path so as to hold the original codes of the global public class and the access path.
In the compiling process of the SDK, the resources are organized into an R.Java file, the R.Java file contains the identification information of each resource, and the identification information of each resource is a static variable and can be modified. When the APP accesses the SDK, the resources in the APP and the resources in the SDK are rearranged, and finally, invariable identification information is generated for each resource, that is, the identification information of the resource may be changeable in the APP, and then, the patch may not find the corresponding resource according to the identification information of the resource in the SDK.
In view of this, in order to avoid that when the APP accesses the SDK, the global public class, the access path for searching the application context in the global public class, and the like are rearranged, so that the identification information of the resource is changed, the global public class and the access path (i.e. the path for searching the application context in the global public class) may be kept, for example, the global public class and the access path are kept by holding the global public class and the access path by a corresponding keep function, so that the original codes of the global public class and the access path are kept, and it is ensured that the global public class and the access path are not changed in the SDK generation process and the APP access SDK process.
In practical application, the access path can be transmitted to the preset patch plug-in the form of character strings, so that a new preset patch plug-in is obtained. The preset patch plug-in is a plug-in for generating the patch package, and the corresponding patch package can be generated by running the preset patch plug-in, wherein in the process of generating the patch package, the access path is required to be transmitted to the preset patch plug-in, so that the preset patch plug-in can generate the corresponding patch package based on the access path.
The pre-patch plug-in may be a plug-in of a Robust auto-patch, corresponding to the pre-patch plug-in including a Robust auto-patch plug-in. In practical applications, the plug-in of the automatically generated patch of Robust may be adapted or remodeled using google native interface. In the adjustment or transformation process, the plug-in of the Robust automatic generation patch can be adjusted or transformed by transmitting the access path to the plug-in of the Robust automatic generation patch in the form of a character string, so that the subsequent generation process of the resource identification is not required to be transformed, additional operation is not required, and precondition guarantee is provided for the subsequent accurate resource searching.
In one possible implementation, in generating a patch package of a target modification object of a hot fix of a software development kit to be repaired based on a new predetermined patch plug-in, the following processing may be performed: and obtaining each variable in the target modification object through a new preset patch plug-in, screening at least one resource variable from each variable, and generating a patch package of the target modification object of the hot repair of the software development kit to be repaired according to the at least one resource variable.
The patch package is generated by running a new preset patch plug-in (for example, an auto-patch plug-in of a robot) to adjust or correct a method, a function, a program, etc. for implementing a certain function, wherein the method, the function, the program, etc. for implementing the certain function are released and come online along with the release of an application program, that is, the generated patch is used for adjusting or correcting the method, the function, the program, etc. for implementing the certain function which has been released and comes online.
In the process of running a new preset patch plug-in (such as an automatic generation patch auto-patch plug-in of a Robust) to generate a patch package, in order to ensure that the generated patch can accurately find resources corresponding to a target modification object, all variables in the target modification object (such as a modified method, a modified function, a modified program and the like) can be read in the process of generating the patch package, and the resource variables in the read variables are filtered out, namely, all the resource variables included in the target modification object are screened out from all the variables included in the target modification object.
After each resource variable included in the target modification object is screened out, a patch package of the target modification object of the SDK hot repair can be generated according to each resource variable.
In one possible implementation manner, in the process of generating a patch package of a target modification object of thermal restoration of a software development kit to be restored according to at least one resource variable through a new preset patch plug-in, a variable name, a resource type and an application package name respectively corresponding to the at least one resource variable can be identified and determined through the new preset patch plug-in, and the patch package of the target modification object of thermal restoration of the software development kit to be restored is generated according to the variable name, the resource type and the application package name respectively corresponding to the at least one resource variable; wherein the application package name is the package name of the application program where the at least one resource variable is located.
In the process of obtaining the identification information of the resource variable of the target modification object by running the patch package through the new preset patch plug-in, after screening each resource variable included in the target modification object, not only the variable name corresponding to each resource variable is required to be identified and determined, but also the resource type corresponding to each resource variable is required to be identified and determined, and meanwhile, the package name (namely the application package name) of the application program corresponding to each resource variable is required to be identified and determined. The identification process can be performed through a new preset patch plug-in, and the variable names, the resource types and the application package names corresponding to at least one resource variable are identified and determined through the new preset patch plug-in, which is equivalent to readjusting, correcting or improving the new preset patch plug-in, which is equivalent to identifying and determining the variable names, the resource types and the application package names corresponding to at least one resource variable through the new preset patch plug-in, so as to readjust the new preset patch plug-in.
In an optional manner, in the process of identifying and determining the application package names corresponding to at least one resource variable respectively through the new preset patch plug-in, the application package names corresponding to the at least one resource variable respectively can be obtained by calling a method getPackageName for obtaining the package names according to the access path. In other words, in practical application, the getPackageName method may be called to find the packet name of the APP accessing the SDK according to the access path of the obtained APP context (i.e. the path for finding the application context in the global public class).
In an alternative manner, in the process of obtaining the identification information of at least one resource variable according to the variable name, the resource type and the application package name respectively corresponding to the at least one resource variable, the following processing may be performed: firstly, determining resource packages corresponding to at least one resource variable according to application package names corresponding to the at least one resource variable respectively; then, the identification information of at least one Resource variable is obtained from the corresponding Resource package according to the variable name and the Resource type respectively corresponding to the at least one Resource variable by calling the getIdentifier method of the Resource management class Resource.
In other words, the identification information correctly corresponding to the resource variable can be obtained in the SDK operation process according to the variable name of the resource variable, the resource type of the resource variable and the package name of the application program where the resource variable is located, so that the corresponding resource is searched according to the identification information, and the searching of the resource is completed.
In practical application, the getIdentifier method of Resource (Resource management class) can be called by taking three information of the variable name of the Resource variable, the Resource type of the Resource variable and the packet name of the application program where the Resource variable is located as parameters, so that identification information corresponding to the Resource variable correctly can be dynamically obtained when the SDK runs. When the SDK is operated, the resources in the SDK and the APP are under the same application package, so that the resource packages corresponding to the resource variables respectively can be conveniently determined according to the application package names (namely package names of application programs) corresponding to the resource variables respectively, and the resource packages can be the resource packages of the SDK or the APP, so that the identification information of the resource variables can be correctly searched from the corresponding resource packages, and the corresponding resources can be further searched according to the identification information.
One embodiment of the present disclosure provides a method of hot fix of a software development kit, which is performed by a computer device, which may be a terminal, which may be a desktop device or a mobile terminal. As shown in fig. 2, the method includes:
Step S201, a patch package of a target modification object of hot repair of a software development kit to be repaired is obtained, the patch package is generated based on a new preset patch plug-in, the new preset patch plug-in is obtained by transmitting an access path to the preset patch plug-in, the access path is a path for searching application context of an application program in a global public class, the application context is stored in the global public class, and the application program is an application program accessed into the software development kit to be repaired;
step S202, a patch package is operated, and identification information of a resource variable of a target modification object is obtained to finish hot repair of a software development kit to be repaired.
The method for thermally repairing a software development kit on a terminal device side provided by the embodiments of the present disclosure corresponds to the method for thermally repairing a software development kit on a server side provided by the embodiments of the present disclosure, and therefore, it can be understood that the processing steps of the thermal repair of the software development kit on the server side correspond to the steps of the thermal repair of the software development kit on the terminal device side, that is, the relevant contents of the steps of the thermal repair of the software development kit on the terminal device side are also adapted to the processing steps of the thermal repair of the software development kit on the server side, and detailed descriptions of the corresponding steps of the thermal repair of the software development kit on the server side are not repeated herein, where the specific descriptions of the corresponding steps of the thermal repair of the software development kit on the server side can be found in the foregoing corresponding descriptions.
In one possible implementation, the patch package is generated by a new preset patch plug-in according to at least one resource variable in each variable screened from the acquired target modification object.
In one possible implementation manner, the patch package is generated through a new preset patch plug-in according to a variable name, a resource type and an application package name which are respectively corresponding to at least one resource variable.
In one possible implementation manner, running the patch package, obtaining the identification information of the resource variable of the target modification object includes:
determining resource packages corresponding to the at least one resource variable respectively according to the application package names corresponding to the at least one resource variable respectively;
and acquiring the identification information of at least one Resource variable from the corresponding Resource package according to the variable name and the Resource type respectively corresponding to the at least one Resource variable by calling a getIdentifier method of the Resource management class Resource.
Wherein, fig. 3 shows a schematic process diagram of a method according to an embodiment of the present application, and in fig. 3, the method includes:
step S301: when the APP is initialized, the SDK stores the application context in a global public class, namely the SDK needs to store the application context (application context, abbreviated as APP context) in the global public class when the APP is initialized, and provides an access path for acquiring the application context from the global public class.
Step S302: the keep holds the global public class and the access path, namely, the global public class and the access path are kept so as to keep the original codes of the global public class and the access path.
Step S303: the auto-patch plug-ins in the Robust are modified, and an access path of the app context is transmitted, namely, the access path is transmitted to the auto-patch plug-ins of the Robust in the form of character strings, so that the preset patch plug-ins are adjusted according to the access path, wherein the preset patch plug-ins comprise the auto-patch plug-ins of the Robust.
Step S304: the modified method is read, the resource variable is found, namely, in the process of generating the patch, all variables in the target modification object (such as the modified method) are read, and the resource variable is filtered from all the read variables.
Step S305: and finding out the variable names, the resource types and the APP package names, namely identifying and determining the variable names corresponding to the resource variables respectively, identifying and determining the resource types corresponding to the resource variables respectively, and identifying and determining the package names (namely application package names) of the application programs corresponding to the resource variables respectively.
Step S306: the corresponding identification information of the Resource variable in the APP is searched through the getIdentifier interface of the original Resource class, namely, the identification information of the Resource variable is obtained from the application program by calling the getIdentifier method of the Resource management class according to the variable name of the Resource variable, the Resource type and the package name of the application program.
From the process shown in fig. 3, it can be seen that: for the hot repair of the SDK, since the identification information of the resource at the time of generation is still a variable, the identification information may change when the SDK is actually accessed to the APP, so that the variable cannot be directly used when a patch (patch) is generated, but a query interface is called, and the identification information of the resource is searched at the time of running the SDK.
By the method, the problem that the patch generated by the SDK thermal restoration cannot find the correct resource and the resource is not effective due to the fact that the patch is issued is solved, and a developer can find the correct resource without carrying out additional operations except modifying logic on the resource in the process of generating the patch, so that the usability of the SDK thermal restoration is enlarged. In addition, the method is completely non-invasive to the APP access party, and the APP does not need to reserve a list of the identification information of the modified resource; in addition, the problem can be found at the compiling period when the SDK packaging flow does not need invasive modification or modification and conflicts with the resources on the APP side.
One embodiment of the present disclosure provides a method of generating a patch package, the method performed by a computer device, which may be a server, which may be a separate physical server, a cluster of physical servers, or a virtual server. As shown in fig. 4, the method includes:
In step S410, a patch package of a target modification object of the hot repair of the software development kit to be repaired is generated based on the target patch plug-in, wherein the target patch plug-in is obtained by adjusting an original patch plug-in based on an access path, the access path is a path for searching an application context in a global public class obtained by saving the application context in the global public class, and the application context is an application context of an application program accessing the software development kit to be repaired, wherein the original patch plug-in is used for hot repairing the software development kit to be repaired.
The target patch plug-in is equivalent to a new preset patch plug-in obtained by adjusting the original preset patch plug-in based on the access path, and the new preset patch plug-in is the target patch plug-in hereinafter, and the preset patch plug-in is the original patch plug-in.
The patch package is generated by running a new preset patch plug-in (for example, an auto-patch plug-in of a robot) to adjust or correct a method, a function, a program, etc. for implementing a certain function, wherein the method, the function, the program, etc. for implementing the certain function are released and come online along with the release of an application program, that is, the generated patch is used for adjusting or correcting the method, the function, the program, etc. for implementing the certain function which has been released and comes online.
In the process of running a new preset patch plug-in (such as an automatic generation patch auto-patch plug-in of a Robust) to generate a patch package, in order to ensure that the generated patch can accurately find resources corresponding to a target modification object, all variables in the target modification object (such as a modified method, a modified function, a modified program and the like) can be read in the process of generating the patch package, and the resource variables in the read variables are filtered out, namely, all the resource variables included in the target modification object are screened out from all the variables included in the target modification object.
After each resource variable included in the target modification object is screened out, a patch package of the target modification object of the SDK hot repair can be generated according to each resource variable.
Fig. 5 is a schematic structural diagram of a thermal repairing apparatus of a software development kit according to another embodiment of the disclosure, as shown in fig. 5, the apparatus 500 may include a first processing module 501, a second processing module 502, a third processing module 503, and a fourth processing module 504, where:
the first processing module is used for acquiring the application context of the application program accessed to the software development kit to be repaired;
the second processing module is used for storing the application context into the global public class and providing an access path of the application context, wherein the access path is a path for searching the application context in the global public class;
The third processing module is used for transmitting the access path to a preset patch plug-in to obtain a new preset patch plug-in;
the fourth processing module is configured to generate a patch package of a target modification object of the thermal repair of the software development kit to be repaired based on a new preset patch plug-in, so that the application program obtains identification information of a resource variable of the target modification object by running the patch package to complete the thermal repair of the software development kit to be repaired, where the preset patch plug-in is a running patch package for performing thermal repair on the software development kit to be repaired, and obtains the identification information of the resource variable of the target modification object to complete the thermal repair of the software development kit to be repaired.
In one possible implementation, the apparatus further includes a fifth processing module;
and the fifth processing module is used for carrying out the holding processing on the global public class and the access path so as to hold the original codes of the global public class and the access path.
In one possible implementation, the third processing module may be specifically configured to transfer the access path to the preset patch plug-in a string form.
In one possible implementation manner, the third processing module is configured to, when generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on the new preset patch plug-in:
And acquiring each variable in the target modification object through a new preset patch plug-in, screening at least one resource variable from each variable, and generating a patch package of the target modification object of the hot repair of the software development kit to be repaired according to the at least one resource variable.
In one possible implementation manner, the third processing module is configured to, when generating, by using the new preset patch plug-in, a patch package of the target modification object of the hot repair of the software development kit to be repaired according to at least one resource variable:
identifying and determining variable names, resource types and application package names respectively corresponding to at least one resource variable through a new preset patch plug-in, and generating a patch package of a target modification object of hot repair of the software development kit to be repaired according to the variable names, the resource types and the application package names respectively corresponding to the at least one resource variable;
wherein the application package name is the package name of the application program where the at least one resource variable is located.
In one possible implementation manner, the third processing module is configured to, when identifying and determining application packet names corresponding to at least one resource variable respectively:
and acquiring the application package names respectively corresponding to the at least one resource variable according to the access path by calling the method getPackageName for acquiring the package names.
According to the device provided by the embodiment of the disclosure, the access path is transmitted to the preset patch plug-in according to the path of the application context of the application program in the global public class, so that the new preset patch plug-in can be obtained for adjustment, and therefore, in the process of generating the patch package according to the new preset patch plug-in, the generation process of the resource identification is not required to be modified, and additional operation is not required to be carried out on the resource, the application program can accurately acquire the identification information of the resource variable of the target modification object in the process of operating the patch package, and therefore, the resource searching step is delayed to be carried out when the patch generated based on the new preset patch plug-in is effective, the correct resource identification can be conveniently searched, the correct resource is further searched, and the hot repairing usability of the software development kit is enlarged.
It should be noted that, the present embodiment is an apparatus item embodiment corresponding to the above-mentioned hot repair method item embodiment of the software development kit, and the present embodiment may be implemented in cooperation with the above-mentioned hot repair method item embodiment of the software development kit. The related technical details mentioned in the hot repair method embodiment of the software development kit are still valid in this embodiment, and in order to reduce repetition, a detailed description is omitted here. Accordingly, the related technical details mentioned in the present embodiment may also be applied in the above-described method item embodiments.
Fig. 6 is a schematic structural diagram of a thermal repairing apparatus of a software development kit according to another embodiment of the disclosure, as shown in fig. 6, the apparatus 600 may include an obtaining module 601 and an operating module 602, where:
the obtaining module 601 is configured to obtain a patch package of a target modification object of a hot repair of a software development kit to be repaired, where the patch package is generated based on a new preset patch plug-in, the new preset patch plug-in is obtained by transmitting an access path to the preset patch plug-in, the access path is a path for searching an application context of an application program in a global public class, the application context is stored in the global public class, and the application program is an application program accessing the software development kit to be repaired;
the operation module 602 is configured to operate the patch package, and obtain identification information of a resource variable of the target modification object to complete hot repair of the software development kit to be repaired.
In one possible implementation, the patch package is generated by the new preset patch plug-in according to at least one resource variable in each variable screened from the acquired target modification object.
In one possible implementation manner, the patch package is generated through the new preset patch plug-in according to the variable name, the resource type and the application package name corresponding to the at least one resource variable respectively.
In one possible implementation manner, when the running module runs the patch package, the running module is used for obtaining the identification information of the resource variable of the target modification object:
determining at least one resource packet corresponding to each resource variable according to the application packet name corresponding to each at least one resource variable;
and acquiring the identification information of at least one Resource variable from a corresponding Resource package according to the variable name and the Resource type respectively corresponding to the at least one Resource variable by calling a getIdentifier method of the Resource management class Resource.
Fig. 7 is a schematic structural diagram of an apparatus for generating a patch package according to another embodiment of the present disclosure, as shown in fig. 7, the apparatus 700 may include a generating module 701, where:
the generating module 701 is configured to generate, based on a target patch plug-in, a patch package of a target modification object of a hot repair of a software development kit to be repaired, where the target patch plug-in is obtained by adjusting an original patch plug-in based on an access path, the access path is obtained by saving an application context into a global public class, the application context is an application context of an application program accessing the software development kit to be repaired, and the original patch plug-in is used for hot repairing the software development kit to be repaired.
It should be noted that, this embodiment is an apparatus item embodiment corresponding to the above-mentioned method item embodiment for generating a patch package, and this embodiment may be implemented in cooperation with the above-mentioned method item embodiment for generating a patch package. The related technical details mentioned in the above-mentioned method item embodiment for generating a patch package are still valid in this embodiment, and in order to reduce repetition, details are not repeated here. Accordingly, the related technical details mentioned in this embodiment may also be applied to the above-mentioned method item embodiment for generating a patch package.
Referring now to fig. 8, a schematic diagram of an electronic device 800 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 8 is merely an example, and should not be construed to limit the functionality and scope of use of the embodiments of the present disclosure in any way.
The electronic device comprises a memory and a processor, wherein the processor herein may be referred to as the processing means 801 described below, the memory comprising at least one of Read Only Memory (ROM) 802, random Access Memory (RAM) 803, and storage means 808, as specifically described below:
As shown in fig. 8, the electronic device 800 may include a processing means (e.g., a central processor, a graphics processor, etc.) 801, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage means 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
In general, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, etc.; storage 808 including, for example, magnetic tape, hard disk, etc.; communication means 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 8 shows an electronic device 800 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication device 809, or installed from storage device 808, or installed from ROM 802. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 801.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring an application context of an application program accessed to a software development kit to be repaired; then, the application context is saved in the global public class, and an access path of the application context is provided, wherein the access path is a path for searching the application context in the global public class; then, the access path is transmitted to a preset patch plug-in to obtain a new preset patch plug-in; and generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on the new preset patch plug-in, so that the application program can complete the hot repair of the software development kit to be repaired by running the patch package and acquiring the identification information of the resource variable of the target modification object, wherein the preset patch plug-in is used for carrying out the hot repair of the software development kit to be repaired.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the module or the unit is not limited to the unit itself in some cases, for example, the acquiring module may also be described as "a module for acquiring at least one event processing manner corresponding to a predetermined live event when the occurrence of the predetermined live event is detected".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a method of hot repair of a software development kit, comprising:
acquiring an application context of an application program accessed to a software development kit to be repaired;
saving the application context into a global public class and providing an access path of the application context, wherein the access path is a path for searching the application context in the global public class;
transmitting the access path to a preset patch plug-in to obtain a new preset patch plug-in;
based on a new preset patch plug-in, generating a patch package of a target modification object of the hot repair of the software development kit to be repaired, so that an application program obtains identification information of a resource variable of the target modification object by running the patch package to finish the hot repair of the software development kit to be repaired, wherein the preset patch plug-in is used for carrying out the hot repair on the software development kit to be repaired.
In one possible implementation, before passing the access path into the pre-patch plug-in, the method further includes:
and carrying out the holding processing on the global public class and the access path so as to hold the original codes of the global public class and the access path.
In one possible implementation, generating a patch package of a target modification object of a hot fix of a software development kit to be repaired based on a new preset patch plug-in includes:
And acquiring each variable in the target modification object through a new preset patch plug-in, screening at least one resource variable from each variable, and generating a patch package of the target modification object of the hot repair of the software development kit to be repaired according to the at least one resource variable.
In one possible implementation manner, by using a new preset patch plug-in, generating a patch package of a target modification object of hot repair of a software development kit to be repaired according to at least one resource variable, including:
identifying and determining variable names, resource types and application package names respectively corresponding to at least one resource variable through a new preset patch plug-in, and generating a patch package of a target modification object of hot repair of the software development kit to be repaired according to the variable names, the resource types and the application package names respectively corresponding to the at least one resource variable;
wherein the application package name is the package name of the application program where the at least one resource variable is located.
In one possible implementation manner, determining, through new preset patch plug-in identification, application package names corresponding to at least one resource variable respectively includes:
and acquiring the application package names respectively corresponding to the at least one resource variable according to the access path by calling the method getPackageName for acquiring the package names.
According to one or more embodiments of the present disclosure, there is provided a method of hot repair of a software development kit, comprising:
the method comprises the steps of obtaining a patch package of a target modification object of hot repair of a software development kit to be repaired, wherein the patch package is generated based on a new preset patch plug-in, the new preset patch plug-in is obtained by transmitting an access path to the preset patch plug-in, the access path is a path for searching application context of an application program in a global public class, the application context is stored in the global public class, and the application program is an application program accessed into the software development kit to be repaired;
and running the patch package, and acquiring the identification information of the resource variable of the target modification object to finish the hot repair of the software development kit to be repaired.
In one possible implementation, the patch package is generated by a new preset patch plug-in according to at least one resource variable in each variable screened from the acquired target modification object.
In one possible implementation manner, the patch package is generated through a new preset patch plug-in according to a variable name, a resource type and an application package name which are respectively corresponding to at least one resource variable.
In one possible implementation manner, running the patch package, obtaining the identification information of the resource variable of the target modification object includes:
determining resource packages corresponding to the at least one resource variable respectively according to the application package names corresponding to the at least one resource variable respectively;
and acquiring the identification information of at least one Resource variable from the corresponding Resource package according to the variable name and the Resource type respectively corresponding to the at least one Resource variable by calling a getIdentifier method of the Resource management class Resource.
According to one or more embodiments of the present disclosure, there is provided a method of generating a patch package, including:
generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on a target patch plug-in, wherein the target patch plug-in is obtained by transmitting an access path into an original preset patch plug-in, the access path is obtained by searching a path of an application context in a global public class, the access path is obtained by storing the application context into the global public class, the application context is an application context of an application program accessing the software development kit to be repaired, and the original patch plug-in is used for carrying out the hot repair of the software development kit to be repaired.
According to one or more embodiments of the present disclosure, there is provided a thermal remediation device of a software development kit, including:
the first processing module is used for acquiring the application context of the application program accessed to the software development kit to be repaired;
the second processing module is used for storing the application context into the global public class and providing an access path of the application context, wherein the access path is a path for searching the application context in the global public class;
the third processing module is used for transmitting the access path to a preset patch plug-in to obtain a new preset patch plug-in;
the fourth processing module is configured to generate a patch package of a target modification object of the thermal repair of the software development kit to be repaired based on a new preset patch plug-in, so that the application program obtains identification information of a resource variable of the target modification object by running the patch package to complete the thermal repair of the software development kit to be repaired, where the preset patch plug-in is a running patch package for performing thermal repair on the software development kit to be repaired, and obtains the identification information of the resource variable of the target modification object to complete the thermal repair of the software development kit to be repaired.
In one possible implementation, the apparatus further includes a fifth processing module;
and the fifth processing module is used for carrying out the holding processing on the global public class and the access path so as to hold the original codes of the global public class and the access path.
In one possible implementation, the third processing module may be specifically configured to transfer the access path to the preset patch plug-in a string form.
In one possible implementation manner, the third processing module is configured to, when generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on the new preset patch plug-in:
and acquiring each variable in the target modification object through a new preset patch plug-in, screening at least one resource variable from each variable, and generating a patch package of the target modification object of the hot repair of the software development kit to be repaired according to the at least one resource variable.
In one possible implementation manner, the third processing module is configured to, when generating, by using the new preset patch plug-in, a patch package of the target modification object of the hot repair of the software development kit to be repaired according to at least one resource variable:
Identifying and determining variable names, resource types and application package names respectively corresponding to at least one resource variable through a new preset patch plug-in, and generating a patch package of a target modification object of hot repair of the software development kit to be repaired according to the variable names, the resource types and the application package names respectively corresponding to the at least one resource variable;
wherein the application package name is the package name of the application program where the at least one resource variable is located.
In one possible implementation manner, the third processing module is configured to, when identifying and determining application packet names corresponding to at least one resource variable respectively:
and acquiring the application package names respectively corresponding to the at least one resource variable according to the access path by calling the method getPackageName for acquiring the package names.
According to one or more embodiments of the present disclosure, there is provided a thermal remediation device of a software development kit, including:
the system comprises an acquisition module, a restoration module and a restoration module, wherein the acquisition module is used for acquiring a patch package of a target modification object of hot restoration of a software development kit to be restored, the patch package is generated based on a new preset patch plug-in, the new preset patch plug-in is obtained by transmitting an access path to the preset patch plug-in, the access path is a path for searching application context of an application program in a global public class, the application context is stored in the global public class, and the application program is an application program accessed into the software development kit to be restored;
And the operation module is used for operating the patch package and acquiring the identification information of the resource variable of the target modification object to finish the hot repair of the software development kit to be repaired.
In one possible implementation, the patch package is generated by a new preset patch plug-in according to at least one resource variable in each variable screened from the acquired target modification object.
In one possible implementation manner, the patch package is generated through a new preset patch plug-in according to a variable name, a resource type and an application package name which are respectively corresponding to at least one resource variable.
In one possible implementation manner, when the running module runs the patch package, the running module is used for obtaining the identification information of the resource variable of the target modification object:
determining resource packages corresponding to the at least one resource variable respectively according to the application package names corresponding to the at least one resource variable respectively;
and acquiring the identification information of at least one Resource variable from the corresponding Resource package according to the variable name and the Resource type respectively corresponding to the at least one Resource variable by calling a getIdentifier method of the Resource management class Resource.
According to one or more embodiments of the present disclosure, there is provided a patch package generating apparatus including:
The generating module is used for generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on a target patch plug-in, wherein the target patch plug-in is obtained by adjusting an original patch plug-in based on an access path, the access path is obtained by storing an application context into a global public class, the application context is an application context of an application program accessing the software development kit to be repaired, and the original patch plug-in is used for hot repairing the software development kit to be repaired.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (15)

1. A method for hot fix of a software development kit, comprising:
acquiring an application context of an application program accessed to a software development kit to be repaired;
saving the application context into a global public class and providing an access path of the application context, wherein the access path is a path for searching the application context in the global public class;
transmitting the access path to a preset patch plug-in to obtain a new preset patch plug-in; the access path is transmitted to the preset patch plug-in the form of character strings;
and generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on the new preset patch plug-in, so that the application program obtains the identification information of the resource variable of the target modification object by running the patch package to finish the hot repair of the software development kit to be repaired, wherein the preset patch plug-in is used for carrying out the hot repair of the software development kit to be repaired.
2. The method of claim 1, further comprising, prior to said passing said access path into a pre-patch plug-in:
and carrying out holding processing on the global public class and the access path so as to hold the original codes of the global public class and the access path.
3. The method of claim 1, wherein generating a patch package of the target modification object for the thermal repair of the software development kit to be repaired based on the new pre-set patch plug-in comprises:
and acquiring each variable in the target modification object through the new preset patch plug-in, screening at least one resource variable from the variables, and generating a patch package of the target modification object of the hot repair of the software development kit to be repaired according to at least one resource variable.
4. A method according to claim 3, wherein generating, by the new pre-patch plug-in, a patch package of the target modification object of the hot fix of the software development kit to be repaired from at least one of the resource variables comprises:
identifying and determining variable names, resource types and application package names corresponding to at least one resource variable respectively through the new preset patch plug-in, and generating a patch package of a target modification object of hot repair of a software development kit to be repaired according to the variable names, the resource types and the application package names corresponding to at least one resource variable respectively;
The application package name is the package name of the application program where at least one resource variable is located.
5. The method according to claim 4, wherein said determining, by the new preset patch plug-in identification, application package names to which at least one of the resource variables corresponds respectively, comprises:
and acquiring at least one application package name respectively corresponding to the resource variables according to the access path by calling a method getPackageName for acquiring the package name.
6. A method for hot fix of a software development kit, comprising:
obtaining a patch package of a target modification object of hot repair of a software development kit to be repaired, wherein the patch package is generated based on a new preset patch plug-in, the new preset patch plug-in is obtained by transmitting an access path to the preset patch plug-in, the access path is a path for searching application context of an application program in a global public class, the application context is stored in the global public class, and the application program is an application program accessed into the software development kit to be repaired; the access path is transmitted to the preset patch plug-in the form of character strings;
And running the patch package, and acquiring the identification information of the resource variable of the target modification object to finish the hot repair of the software development kit to be repaired.
7. The method of claim 6, wherein the patch package is generated by the new pre-patch plug-in from at least one of the resource variables selected from the obtained target modification object.
8. The method of claim 7, wherein the patch package is generated by the new preset patch plug-in according to a variable name, a resource type and an application package name corresponding to at least one of the resource variables.
9. The method according to claim 7 or 8, wherein running the patch package and obtaining the identification information of the resource variable of the target modification object includes:
determining at least one resource packet corresponding to the resource variable according to the application packet name corresponding to the at least one resource variable;
and acquiring the identification information of at least one Resource variable from a corresponding Resource package according to the variable name and the Resource type respectively corresponding to at least one Resource variable by calling a getIdentifier method of the Resource management class Resource.
10. A method of generating a patch package, comprising:
generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on a target patch plug-in, wherein the target patch plug-in is obtained by transmitting an access path to an original preset patch plug-in, the access path is obtained by searching a path of an application context in a global public class, the access path is obtained by storing the application context in the global public class, the application context is an application context of an application program accessing the software development kit to be repaired, and the original preset patch plug-in is used for carrying out the hot repair on the software development kit to be repaired; the access path is transmitted to the original preset patch plug-in the form of a character string.
11. A thermal remediation device for a software development kit, comprising:
the first processing module is used for acquiring the application context of the application program accessed to the software development kit to be repaired;
the second processing module is used for storing the application context into a global public class and providing an access path of the application context, wherein the access path is a path for searching the application context in the global public class;
The third processing module is used for transmitting the access path to a preset patch plug-in to obtain a new preset patch plug-in; the access path is transmitted to the preset patch plug-in the form of character strings;
and the fourth processing module is used for generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on the new preset patch plug-in, so that the application program can complete the hot repair of the software development kit to be repaired by running the patch package to acquire the identification information of the resource variable of the target modification object, wherein the preset patch plug-in is used for carrying out the hot repair of the software development kit to be repaired.
12. A thermal remediation device for a software development kit, comprising:
the system comprises an acquisition module, a restoration module and a restoration module, wherein the acquisition module is used for acquiring a patch package of a target modification object of hot restoration of a software development kit to be restored, the patch package is generated based on a new preset patch plug-in, the new preset patch plug-in is obtained by transmitting an access path to the preset patch plug-in, the access path is a path for searching application context of an application program in a global public class, the application context is stored in the global public class, and the application program is an application program accessed into the software development kit to be restored; the access path is transmitted to the preset patch plug-in the form of character strings; and the operation module is used for operating the patch package and acquiring the identification information of the resource variable of the target modification object to finish the hot repair of the software development kit to be repaired.
13. An apparatus for generating a patch package, comprising:
the generating module is used for generating a patch package of a target modification object of the hot repair of the software development kit to be repaired based on a target patch plug-in, wherein the target patch plug-in is obtained by adjusting an original preset patch plug-in based on an access path, the access path is obtained by storing an application context into a global public class, the application context is an application context of an application program accessing the software development kit to be repaired, and the original preset patch plug-in is used for carrying out the hot repair of the software development kit to be repaired; the access path is transmitted to the original preset patch plug-in the form of a character string.
14. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any one of claims 1 to 10 when executing the program.
15. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the method of any of claims 1 to 10.
CN202011580635.5A 2020-12-28 2020-12-28 Software development kit SDK thermal restoration method and device and electronic equipment Active CN112650521B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011580635.5A CN112650521B (en) 2020-12-28 2020-12-28 Software development kit SDK thermal restoration method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011580635.5A CN112650521B (en) 2020-12-28 2020-12-28 Software development kit SDK thermal restoration method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112650521A CN112650521A (en) 2021-04-13
CN112650521B true CN112650521B (en) 2023-11-10

Family

ID=75363512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011580635.5A Active CN112650521B (en) 2020-12-28 2020-12-28 Software development kit SDK thermal restoration method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112650521B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113407165B (en) * 2021-06-29 2023-04-07 抖音视界有限公司 SDK generation and self-upgrade method, device, readable medium and equipment
CN113961226B (en) * 2021-10-20 2023-11-07 抖音视界有限公司 Software development kit repairing method, terminal, server and equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032631A (en) * 2018-07-12 2018-12-18 腾讯科技(深圳)有限公司 Application program service packs acquisition methods, device, computer equipment and storage medium
CN110297655A (en) * 2019-06-21 2019-10-01 百度在线网络技术(北京)有限公司 Generate method, apparatus, equipment and the storage medium of service packs
CN111078262A (en) * 2018-10-18 2020-04-28 百度在线网络技术(北京)有限公司 Application thermal restoration method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032631A (en) * 2018-07-12 2018-12-18 腾讯科技(深圳)有限公司 Application program service packs acquisition methods, device, computer equipment and storage medium
CN111078262A (en) * 2018-10-18 2020-04-28 百度在线网络技术(北京)有限公司 Application thermal restoration method and device
CN110297655A (en) * 2019-06-21 2019-10-01 百度在线网络技术(北京)有限公司 Generate method, apparatus, equipment and the storage medium of service packs

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Android App功能插件化机制的研究与实现;熊建芬;《CNKI》;第4.2.1节 *

Also Published As

Publication number Publication date
CN112650521A (en) 2021-04-13

Similar Documents

Publication Publication Date Title
CN109062563B (en) Method and device for generating page
CN110851139B (en) Method and device for checking codes and electronic equipment
CN112650521B (en) Software development kit SDK thermal restoration method and device and electronic equipment
CN110960855B (en) Communication protocol code updating method and device, electronic equipment and storage medium
CN113835992B (en) Memory leakage processing method and device, electronic equipment and computer storage medium
CN112965761B (en) Data processing method, system, electronic equipment and storage medium
CN112214408A (en) Dependency conflict detection method and device, electronic equipment and computer readable medium
CN112115153A (en) Data processing method, device, equipment and storage medium
CN111625422B (en) Thread monitoring method, thread monitoring device, electronic equipment and computer readable storage medium
CN110673986A (en) Memory operation abnormity capturing method, device, terminal and storage medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN114595065A (en) Data acquisition method and device, storage medium and electronic equipment
CN113900721A (en) Operating system starting method and device and electronic equipment
US20240095022A1 (en) Hotfix method, apparatus, device and storage medium
CN111338666A (en) Method, device, medium and electronic equipment for realizing application program upgrading
CN112416303B (en) Software development kit hot repair method and device and electronic equipment
CN112395363B (en) Data synchronization method, device, equipment and readable storage medium
CN111506904B (en) Method and device for online bug repair
CN114327453B (en) Page display method, device, equipment and storage medium
CN110908882A (en) Performance analysis method and device of application program, terminal equipment and medium
CN113391860B (en) Service request processing method and device, electronic equipment and computer storage medium
CN112882921B (en) Fault simulation method and device
CN114428925A (en) Page rendering method and device, electronic equipment and computer readable medium
CN113032046A (en) Method, device and equipment for repairing so file and storage medium
CN111240657A (en) Method and device for generating SDK and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

GR01 Patent grant
GR01 Patent grant