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 are shown in the 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 rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the 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. Moreover, 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 "include" and variations thereof as used herein are 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". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing the devices, modules or units, and are not used for limiting the devices, modules or units to be different devices, modules or units, and also for limiting the sequence or interdependence relationship of the functions executed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
To make 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 the technical solutions of the embodiments of the present disclosure and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated 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 for hot repair of a software development kit, where the method is performed by a computer device, and the computer device may be a server, and the server may be an independent physical server, a physical server cluster, or a virtual server. As shown in fig. 1, the method includes:
step S110, acquiring an application context of an application program accessed to a software development kit to be repaired; step S120, 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; step S130, transmitting the access path to a preset patch plug-in to obtain a new preset patch plug-in; step S140, based on the new preset patch plug-in, generating a patch package of the target modification object of the to-be-repaired software development kit, so that the application program obtains the identification information of the resource variable of the target modification object by running the patch package to complete the hot repair of the to-be-repaired software development kit, wherein the preset patch plug-in is used for performing the hot repair on the to-be-repaired software development kit.
When an Application (APP) accesses (i.e., loads) an SDK (Software Development Kit), there is generally an initialization process, and the SDK needs to store an application context (i.e., APP context) in a global public class and provide a path for accessing the application context, i.e., determine an access path of the application context, so that the application context can be conveniently obtained in the SDK, i.e., provide 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 application context in the global public class.
The application program can quickly realize a certain function depending on the SDK, the SDK is a code set for realizing a certain function, and the SDK can be considered as a function package set for realizing a corresponding function of the application program. The SDK hot repair is used for performing a corresponding function in the hot repair application program through the SDK, and a corresponding patch package is generated each time the SDK hot repair is performed, and the specific SDK hot repair is completed through the patch package, that is, the SDK hot repair is used for hot repairing the SDK accessed or loaded in the application program.
After the access path of the application context is determined, the preset patch plug-in may be adjusted according to the access path, for example, the access path is transferred to the preset patch plug-in to obtain a new preset patch plug-in, where the preset patch plug-in is used for performing thermal repair on the software development kit to be repaired, and the preset patch plug-in is a preset patch plug-in used for generating a patch package, that is, the preset patch plug-in is adjusted to obtain a new preset patch plug-in (i.e., a new preset patch plug-in), so that in a subsequent process of generating a patch according to the new preset patch plug-in, a generation process of a resource identifier does not need to be modified, and also no additional operation is needed to be performed on resources, thereby providing a precondition guarantee for accurately searching resources in the subsequent process.
After the preset patch plug-in is adjusted, a patch package of the target modification object for SDK hot repair may be generated according to the new preset patch plug-in, for example, when the target modification object in the SDK is hot repaired, a patch package of the target modification object to be hot repaired in the SDK may be automatically generated by the preset patch plug-in. After the patch package of the target modification object of the SDK hot repair is generated, the application program may obtain the identification information of the resource variable of the target modification object by running the patch package, thereby completing the SDK hot repair. The identification information of the resource variable of the target modification object can be searched in the SDK when the patch package is operated, so that the searching step of the resource is delayed to the time of operating the patch package.
In the process of searching for the resource of the target modification object, the corresponding resource variable can be searched for according to the identification information by acquiring the identification information of the resource variable of the target modification object, so that the corresponding resource can be searched for according to the resource variable. It should be noted that the target modification object may be a method, a function, a program, and the like to be modified for implementing a certain function.
The method provided by the embodiment of the disclosure, according to the path for searching the application context of the application program in the global public class, by transferring the access path to the preset patch plug-in, a new preset patch plug-in can be obtained for adjustment, therefore, in the process of subsequently generating the patch package according to the new preset patch plug-in, the generation process of the resource identifier is not required to be modified, and the additional operation on the resource is not required, so that the identification information of the resource variable of the target modification object can be accurately acquired by the application program in the process of running the patch package, therefore, the searching step of the resources is delayed to be carried out at the running time, when the patch generated based on the new preset patch plug-in is effective, the correct resource identification can be conveniently found, so that the correct resource can be found, and the usability of the software development kit in thermal repair is enlarged.
The following describes the method of the embodiments of the present disclosure:
in a possible implementation manner, before the access path is delivered to the preset patch plug-in, the following processing may be further performed: and keeping the global public class and the access path to keep the original codes of the global public class and the access path.
In the process of compiling 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 still be modified. When the APP accesses the SDK, the resources in the APP and the resources in the SDK are rearranged, and finally, the immutable identification information is generated for each resource, that is, the identification information of the resources may be changeable in the APP, so that the patch may not find the corresponding resource according to the identification information of the resources 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, and 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 held by a corresponding keep function, so as to keep the original codes of the global public class and the access path, and ensure that the global public class and the access path are not changed in the SDK generation process and the APP accesses the SDK.
In practical application, the access path may be transmitted to the preset patch plug-in a form of a character string, so as to obtain a new preset patch plug-in. The preset patch plug-in is a plug-in for generating a patch package, and a corresponding patch package can be generated by operating the preset patch plug-in, wherein in the process of generating the patch package, the access path needs 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 preset patch plug-in may be a plug-in of the automatic generation patch of the Robust, and equivalently, the preset patch plug-in includes an auto-patch plug-in of the automatic generation patch of the Robust. In practical applications, the plug-in of automatic patch generation of Robust can be adjusted or modified by using google native interface. In the adjusting or modifying process, the plug-in of the Robust for automatically generating the patch can be adjusted or modified by transmitting the access path to the plug-in of the Robust for automatically generating the patch in a character string mode, so that in the subsequent process of generating the patch according to the patch plug-in, the generation process of the resource identifier is not required to be modified, the resource is not required to be additionally operated, and the precondition guarantee is provided for accurately searching the resource subsequently.
In one possible implementation, in the process of generating the patch package of the target modification object of the hot fix of the software development kit to be fixed based on the new predetermined patch plug-in, the following processing may be performed: and obtaining each variable in the target modification object through the new preset patch plug-in, screening out at least one resource variable from each variable, and generating a patch package of the target modification object for the thermal repair of the software development kit to be repaired according to the at least one resource variable.
The generation of the patch package by running a new preset patch plug-in (for example, the auto-patch plug-in of Robust) is to adjust or correct a method, a function, a program and the like for realizing a certain function, wherein the method, the function, the program and the like for realizing the certain function are released online along with the release of the application program, that is, the generated patch is to adjust or correct the method, the function, the program and the like for realizing the certain function which is released online.
In the process of generating a patch package by running a new preset patch plug-in (e.g., an auto-patch plug-in for automatic generation of a patch by Robust), in order to ensure that a generated patch can accurately find a resource corresponding to a target modification object, all variables in the target modification object (e.g., a modified method, a modified function, a modified program, etc.) may be read in the process of generating the patch package, and resource variables therein are filtered out from all the read variables, that is, all the resource variables included in the target modification object are screened out from all the variables included in the target modification object.
After screening out the resource variables included in the target modification object, a patch package of the target modification object for SDK hot repair can be generated according to the resource variables.
In a possible implementation manner, in the process of generating a patch package of a target modification object of thermal repair of a software development kit to be repaired according to at least one resource variable by using 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 by using the new preset patch plug-in, and the patch package of the target modification object of thermal repair of the software development kit to be repaired 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 out each resource variable included in the target modification object, not only the variable name corresponding to each resource variable needs to be identified and determined, but also the resource type corresponding to each resource variable needs to be identified and determined, and at the same time, the package name (i.e., the application package name) of the application program corresponding to each resource variable needs to be identified and determined. The identification process can be executed through a new preset patch plug-in, and the variable name, the resource type and the application package name corresponding to at least one resource variable are identified and determined through the new preset patch plug-in, which is equivalent to re-adjusting, correcting or improving the new preset patch plug-in, namely, re-adjusting the new preset patch plug-in by identifying and determining the variable name, the resource type and the application package name corresponding to at least one resource variable through the new preset patch plug-in.
In an optional manner, in the process of identifying and determining the application package names corresponding to the 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 according to the access path by calling a method getPackageName for obtaining the package names. In other words, in practical applications, the getPackageName method may be called to find the package name of the APP accessing the SDK according to the obtained access path of the APP context (i.e., the path for finding the application context in the global public class).
In an optional 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 respectively according to application package names corresponding to the at least one resource variable respectively; and then, 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.
In other words, the identification information correctly corresponding to the resource variable can be obtained in the operation process of the SDK according to the variable name of the resource variable, the resource type of the resource variable, and the package name of the application program in which the resource variable is located, so that the corresponding resource can be found according to the identification information, and the resource can be found.
In practical application, the getIdentifier method of Resource (Resource management class) is called by taking the three information, namely 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, as parameters, so as to dynamically acquire the identification information corresponding to the Resource variable correctly when the SDK runs. When the SDK is running, the resources in the SDK and the APP are in the same application package, so that the resource packages corresponding to the resource variables can be conveniently determined according to the application package names (i.e., the package names of the application programs) corresponding to the resource variables, where the resource packages may be the resource packages of the SDK or the APP, so that the identification information of the resource variables can be correctly found from the corresponding resource packages, and the corresponding resources can be found according to the identification information.
One embodiment of the present disclosure provides a method for hot repair of a software development kit, where the method is performed by a computer device, and the computer device may be a terminal, and the terminal may be a desktop device or a mobile terminal. As shown in fig. 2, the method includes:
step S201, obtaining a patch package of a target modification object of thermal restoration of a software development kit to be restored, 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 an application context of an application program in a global public class, the global public class stores the application context, and the application program is the application program accessed to the software development kit to be restored;
step S202, the patch package is operated, and the identification information of the resource variable of the target modification object is obtained, so that the hot repair of the software development kit to be repaired is completed.
The method for performing thermal repair on a software development kit on a terminal device side provided in the embodiment of the present disclosure corresponds to the method for performing thermal repair on a software development kit on a server side provided in the embodiment of the present disclosure, and therefore, it can be understood that the processing steps for performing thermal repair on a software development kit on a server side correspond to the steps for performing thermal repair on a software development kit on a terminal device side, that is, the relevant contents of the steps for performing thermal repair on a software development kit on a terminal device side are also applicable to the processing steps for performing thermal repair on a software development kit on a server side, and are not described herein again, where specific descriptions of the corresponding steps for performing thermal repair on a software development kit on a server side can be referred to the corresponding descriptions in the foregoing.
In a possible implementation manner, the patch package is generated by a new preset patch plug-in according to at least one resource variable of the variables screened from the acquired target modification object.
In a possible implementation manner, the patch package is generated by a new preset patch plug-in according to a variable name, a resource type and an application package name respectively corresponding to at least one resource variable.
In a possible implementation manner, the running the patch package to obtain 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 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. 3 is a schematic process diagram of the method according to the embodiment of the present application, where in fig. 3, the method includes:
step S301: when the APP is initialized, the SDK stores the application context in a global common class, that is, the SDK needs to store the application context (application context, abbreviated as APP context) in the global common class when the APP is initialized, and provides an access path for acquiring the application context from the global common class.
Step S302: and (4) keeper holding the global public class and the access path, namely keeping the global public class and the access path so as to keep the original codes of the global public class and the access path.
Step S303: and transforming auto-patch plug-ins in the Robust, and transmitting an access path of the app context, namely, transmitting the access path to the auto-patch plug-ins of the Robust in a character string manner to adjust the preset patch plug-ins according to the access path, wherein the preset patch plug-ins comprise auto-patch plug-ins of the Robust.
Step S304: reading the modified method, finding the resource variables in the modified method, namely reading all the variables in the target modified object (such as the modified method) in the process of generating the patch, and filtering the resource variables from the read all the variables.
Step S305: and finding out the variable name, the resource type and the APP package name, namely identifying and determining the variable name corresponding to each resource variable, identifying and determining the resource type corresponding to each resource variable, and identifying and determining the package name (namely the application package name) of the application program corresponding to each resource variable.
Step S306: and searching identification information corresponding to the Resource variable in the APP through a getIdentifier interface of the native Resource class, namely calling a getIdentifier method of the Resource management class Resource, and acquiring the identification information of the Resource variable from the application program 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 SDK hot repair, since the identification information of the resource when the SDK hot repair is generated is still a variable, the identification information may change when the SDK hot repair is really accessed to the APP, and therefore, when a patch (patch) is generated, the variable cannot be directly used, but a query interface is called, and the identification information of the resource is searched when the SDK runs.
By the method, the problem that the patch cannot find the correct resource to cause the issue of the patch to be invalid due to the fact that the patch (patch) generated by the SDK hot repair cannot find the correct resource is solved, and the patch can find the correct resource without performing extra operation except logic modification on the resource in the process of generating the patch by a developer, so that the usability of the SDK hot repair is improved. In addition, the method has no invasion to the APP access party, and the APP does not need to reserve a list of the identification information of the modified resources; in addition, the problem can be found in the compiling period when the SDK packaging flow does not need to be modified invasively and conflicts with the resources on the APP side.
One embodiment of the present disclosure provides a method for generating a patch package, which is performed by a computer device, which may be a server, which may be a standalone physical server, a cluster of physical servers, or a virtual server. As shown in fig. 4, the method includes:
step S410, based on the target patch plug-in, generating a patch package of a target modification object of the thermal repair of the software development kit to be repaired, wherein the target patch plug-in is obtained by adjusting the original patch plug-in based on an access path, the access path is a path for searching an application context in the global public class obtained by storing the application context in the global public class, the application context is an application context of an application program accessed to the software development kit to be repaired, and the original patch plug-in is used for performing thermal repair on the software development kit to be repaired.
The target patch plug-in is equivalent to a new preset patch plug-in obtained by adjusting an original preset patch plug-in based on the access path, the new preset patch plug-in the following text is the target patch plug-in, and the preset patch plug-in is the original patch plug-in.
The generation of the patch package by running a new preset patch plug-in (for example, the auto-patch plug-in of Robust) is to adjust or correct a method, a function, a program and the like for realizing a certain function, wherein the method, the function, the program and the like for realizing the certain function are released online along with the release of the application program, that is, the generated patch is to adjust or correct the method, the function, the program and the like for realizing the certain function which is released online.
In the process of generating a patch package by running a new preset patch plug-in (e.g., an auto-patch plug-in for automatic generation of a patch by Robust), in order to ensure that a generated patch can accurately find a resource corresponding to a target modification object, all variables in the target modification object (e.g., a modified method, a modified function, a modified program, etc.) may be read in the process of generating the patch package, and resource variables therein are filtered out from all the read variables, that is, all the resource variables included in the target modification object are screened out from all the variables included in the target modification object.
After screening out the resource variables included in the target modification object, a patch package of the target modification object for SDK hot repair can be generated according to the resource variables.
Fig. 5 is a schematic structural diagram of a thermal repair apparatus of a software development kit according to another embodiment of the present 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 an application program accessed to a software development kit to be repaired;
the second processing module is used for saving the used 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 thermal repair of the software development kit to be repaired based on a new preset patch plug-in, so that the application program can obtain the identification information of the 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, wherein the preset patch plug-in is a running patch package used 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 a possible implementation manner, the apparatus further includes a fifth processing module;
and the fifth processing module is used for keeping the global public class and the access path so as to keep the original codes of the global public class and the access path.
In a possible implementation manner, the third processing module may be specifically configured to pass the access path to the pre-patch plug-in the form of a character string.
In a possible implementation manner, when the third processing module generates a patch package of the target modification object to be repaired by hot-repairing the software development kit to be repaired based on the new preset patch plug-in, the third processing module is configured to:
and acquiring each variable in the target modification object through a new preset patch plug-in, screening out at least one resource variable from each variable, and generating a patch package of the target modification object for the thermal repair of the software development kit to be repaired according to the at least one resource variable.
In a possible implementation manner, when the third processing module generates, by using a new preset patch plug-in, a patch package of a target modification object of the hot fix of the software development kit to be fixed according to at least one resource variable, the third processing module is configured to:
identifying and determining a variable name, a resource type and an application package name 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 the thermal repair of the software development kit to be repaired 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 a possible implementation manner, when identifying and determining the application package names corresponding to the at least one resource variable, the third processing module is configured to:
and acquiring application package names respectively corresponding to at least one resource variable according to the access path by calling a method getPackagename for acquiring the package names.
The apparatus provided by the disclosed embodiments, based on a path for finding an application context of an application in a global common class, by transferring the access path to the preset patch plug-in, a new preset patch plug-in can be obtained for adjustment, therefore, in the process of subsequently generating the patch package according to the new preset patch plug-in, the generation process of the resource identifier is not required to be modified, and the additional operation on the resource is not required, so that the identification information of the resource variable of the target modification object can be accurately acquired by the application program in the process of running the patch package, therefore, the searching step of the resources is delayed to be carried out at the running time, when the patch generated based on the new preset patch plug-in is effective, the correct resource identification can be conveniently found, so that the correct resource can be found, and the usability of the software development kit in thermal repair is enlarged.
It should be noted that this embodiment is an apparatus embodiment corresponding to the above-mentioned embodiment of the hot repair method of the software development kit, and this embodiment can be implemented in cooperation with the above-mentioned embodiment of the hot repair method of the software development kit. The related technical details mentioned in the embodiment of the hot repair method of the software development kit are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the above-described method item embodiments.
Fig. 6 is a schematic structural diagram of a thermal repair apparatus of a software development kit according to yet another embodiment of the present disclosure, as shown in fig. 6, the apparatus 600 may include an obtaining module 601 and an executing module 602, where:
an obtaining module 601, configured to obtain a patch package of a target modification object for thermal 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 global public class stores the application context, and the application program is an application program accessed to the software development kit to be repaired;
the running module 602 is configured to run the patch package, and obtain identification information of a resource variable of the target modification object, so as to complete thermal repair of the to-be-repaired software development kit.
In a possible implementation manner, the patch package is generated by the new preset patch plug-in according to at least one resource variable of the variables screened from the acquired target modification object.
In a possible implementation manner, the patch package is generated by 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 a possible implementation manner, when the running module runs the patch package and acquires the identification information of the resource variable of the target modification object, the running module is configured to:
determining resource packages corresponding to at least one resource variable respectively according to application package names corresponding to the at least one resource variable respectively;
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 a 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 a patch package of a target modification object for thermal repair of a software development kit to be repaired based on a target patch plug-in, 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 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 thermal repair of the software development kit to be repaired.
It should be noted that this embodiment is an apparatus embodiment corresponding to the above method for generating a patch package, and this embodiment may be implemented in cooperation with the above method for generating a patch package. The related technical details mentioned in the above method item for generating a patch package are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related technical details mentioned in the present embodiment can also be applied to the above method item for generating a patch package.
Referring now to FIG. 8, shown is a schematic diagram of an electronic device 800 suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
The electronic device comprises a memory and a processor, wherein the processor may be referred to as the processing device 801 described below, and the memory comprises at least one of a Read Only Memory (ROM)802, a Random Access Memory (RAM)803, and a storage device 808, which are described in the following, and are specifically as follows:
as shown in fig. 8, an electronic device 800 may include a processing means (e.g., central processing unit, graphics processor, etc.) 801 that may perform various appropriate actions and processes in accordance with 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 necessary for the operation of the electronic apparatus 800 are also stored. The processing apparatus 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 bus 804.
Generally, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage 808 including, for example, magnetic tape, hard disk, etc.; and a communication device 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 illustrates an electronic device 800 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the 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 illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 809, or installed from the storage means 808, or installed from the ROM 802. The computer program, when executed by the processing apparatus 801, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 present 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 contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled 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, 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; then, the access path is transmitted to a preset patch plug-in unit to obtain a new preset patch plug-in unit; and then, based on the new preset patch plug-in, generating a patch package of the target modification object of the to-be-repaired software development kit, so that the application program can obtain the identification information of the resource variable of the target modification object by running the patch package to complete the hot repair of the to-be-repaired software development kit, wherein the preset patch plug-in is used for performing the hot repair on the to-be-repaired software development kit.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart 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 described in the embodiments of the present disclosure may be implemented by software or hardware. For example, the obtaining module may be further described as a module that obtains 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 herein above 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: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), 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. A 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 for hot-fix of a software development kit, including:
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;
and generating a patch package of the target modification object of the thermal repair of the software development kit to be repaired based on the new preset patch plug-in, so that the application program can obtain the identification information of the 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, wherein the preset patch plug-in is used for performing the thermal repair on the software development kit to be repaired.
In a possible implementation manner, before the passing the access path to the preset patch plug-in, the method further includes:
and keeping the global public class and the access path to keep the original codes of the global public class and the access path.
In one possible implementation manner, generating a patch package of a target modification object to be repaired by hot-repairing 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 out at least one resource variable from each variable, and generating a patch package of the target modification object for the thermal repair of the software development kit to be repaired according to the at least one resource variable.
In a possible implementation manner, generating, by a new preset patch plug-in, a patch package of a target modification object of a hot fix of a software development kit to be fixed according to at least one resource variable includes:
identifying and determining a variable name, a resource type and an application package name 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 the thermal repair of the software development kit to be repaired 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 a possible implementation manner, determining, by a new preset patch plug-in, application package names corresponding to at least one resource variable respectively includes:
and acquiring application package names respectively corresponding to at least one resource variable according to the access path by calling a method getPackagename for acquiring the package names.
According to one or more embodiments of the present disclosure, there is provided a method for hot-fix of a software development kit, including:
acquiring a patch package of a target modification object of thermal restoration of a software development kit to be restored, 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 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 the application program accessed into the software development kit to be restored;
and running the patch package to acquire the identification information of the resource variable of the target modification object so as to complete the hot repair of the software development kit to be repaired.
In a possible implementation manner, the patch package is generated by a new preset patch plug-in according to at least one resource variable of the variables screened from the acquired target modification object.
In a possible implementation manner, the patch package is generated by a new preset patch plug-in according to a variable name, a resource type and an application package name respectively corresponding to at least one resource variable.
In a possible implementation manner, the running the patch package to obtain 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 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.
According to one or more embodiments of the present disclosure, there is provided a method of generating a patch package, including:
and generating a patch package of a target modification object of the thermal repair of the software development kit to be repaired based on the 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 a path for searching 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 the application context of an application program accessed to the software development kit to be repaired, and the original patch plug-in is used for performing thermal repair on the software development kit to be repaired.
According to one or more embodiments of the present disclosure, there is provided a thermal repair apparatus of a software development kit, including:
the first processing module is used for acquiring the application context of an application program accessed to a software development kit to be repaired;
the second processing module is used for saving the used 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 thermal repair of the software development kit to be repaired based on a new preset patch plug-in, so that the application program can obtain the identification information of the 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, wherein the preset patch plug-in is a running patch package used 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 a possible implementation manner, the apparatus further includes a fifth processing module;
and the fifth processing module is used for keeping the global public class and the access path so as to keep the original codes of the global public class and the access path.
In a possible implementation manner, the third processing module may be specifically configured to pass the access path to the pre-patch plug-in the form of a character string.
In a possible implementation manner, when the third processing module generates a patch package of the target modification object to be repaired by hot-repairing the software development kit to be repaired based on the new preset patch plug-in, the third processing module is configured to:
and acquiring each variable in the target modification object through a new preset patch plug-in, screening out at least one resource variable from each variable, and generating a patch package of the target modification object for the thermal repair of the software development kit to be repaired according to the at least one resource variable.
In a possible implementation manner, when the third processing module generates, by using a new preset patch plug-in, a patch package of a target modification object of the hot fix of the software development kit to be fixed according to at least one resource variable, the third processing module is configured to:
identifying and determining a variable name, a resource type and an application package name 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 the thermal repair of the software development kit to be repaired 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 a possible implementation manner, when identifying and determining the application package names corresponding to the at least one resource variable, the third processing module is configured to:
and acquiring application package names respectively corresponding to at least one resource variable according to the access path by calling a method getPackagename for acquiring the package names.
According to one or more embodiments of the present disclosure, there is provided a thermal repair apparatus of a software development kit, including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a patch package of a target modification object of thermal 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 an application context of an application program in a global public class, the global public class is stored with the application context, and the application program is the application program accessed into the software development kit to be restored;
and the running module is used for running the patch package and acquiring the identification information of the resource variable of the target modification object so as to complete the hot repair of the software development kit to be repaired.
In a possible implementation manner, the patch package is generated by a new preset patch plug-in according to at least one resource variable of the variables screened from the acquired target modification object.
In a possible implementation manner, the patch package is generated by a new preset patch plug-in according to a variable name, a resource type and an application package name respectively corresponding to at least one resource variable.
In a possible implementation manner, when the running module runs the patch package and acquires the identification information of the resource variable of the target modification object, the running module is configured to:
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 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.
According to one or more embodiments of the present disclosure, there is provided a patch package generating apparatus including:
the generation module is used for generating a patch package of a target modification object of the thermal restoration of the software development kit to be restored based on the target patch plug-in, wherein the target patch plug-in is obtained by adjusting the 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 the application context of an application program accessed into the software development kit to be restored, and the original patch plug-in is used for performing the thermal restoration on the software development kit to be restored.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while 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. Under 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 limitations on the scope of the 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 disclosed as example forms of implementing the claims.