Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method for loading patches based on class files in Android system

An Android system and file loading technology, applied in the direction of program loading/starting, program control design, instruments, etc., can solve the problems of reducing APP application performance, crashes, errors, etc.

Active Publication Date: 2017-11-07
ZHONGGUANG REDIANYUN TECH CO LTD
View PDF6 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, this technology has the following problems in actual operation: modify a certain class, package it into dex, insert it into the classloader, and an error occurs when loading the class, because the first-level relationship, that is, the referrer, is marked with the CLASS_ISPREVERIFIED flag. When this flag is selected, it is necessary to verify the dex
[0004] The above method can achieve hot patch repair very well, but the problem existing in the existing technology is that marking a certain class with the CLASS_ISPREVERIFIED mark is to improve the application performance of the APP. When the mark is rigidly prevented from being marked, the application performance of the APP will be reduced. , and there will be crashes after startup

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for loading patches based on class files in Android system
  • Method for loading patches based on class files in Android system
  • Method for loading patches based on class files in Android system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0053] Embodiment 1 of the present invention provides a method for loading patches based on class files in an Android system, such as figure 1 As shown, the method includes the following steps:

[0054] A method for loading patches based on class files in an Android system, characterized in that the method comprises the steps of:

[0055] S1: Obtain the patch package;

[0056] S2: Obtain the first dex file where the class to be patched is located, and mark the class to be patched in the first dex file;

[0057] S3: subpackage the first dex file found in step S2, and obtain a second dex file composed of classes related to the class to be patched and a third dex file composed of other classes in the first dex file;

[0058] S4: the patch package is loaded into a patch class through the class loader and inserted into the second dex file obtained in step S3 to form a fourth dex file, and the class in the fourth dex file is assigned back to the third dex file by reflection;

[0...

Embodiment 2

[0062] Embodiment 2 of the present invention provides a method for loading patches based on class files in an Android system, which is basically the same as that of Embodiment 1, the difference is that, as figure 2 As shown, the method also includes:

[0063] S6: Receive the silent message pushed by the push server at all times, the silent message includes the patch parameters of the latest patch version of the application, and the patch parameters include the unique identifier of the patch;

[0064] S7: Compare the patch data corresponding to the patch unique identifier obtained in step S6 with the patch data of the patch package obtained in step S1, and if the comparison is consistent, proceed to steps S2-S5;

[0065] S8: When the comparison in step S7 is inconsistent, judge whether the patch data corresponding to the patch unique identifier obtained in step S6 is the update data of the patch data in the patch package obtained in step S1, if yes, go to step S9, if not, reac...

Embodiment 3

[0074] Embodiment 3 of the present invention provides a method for loading patches based on class files in an Android system, which is basically the same as that of Embodiment 1, the difference is that, as image 3 As shown, the following steps are performed before step S1:

[0075] S0: Determine whether the application program is running on the client for the first time, if yes, go to step S01:

[0076] S01: Determine whether the client has locally stored a patch package of the application program, if yes, perform steps S2-5 for the patch package in the application program, and if not, perform steps S1-S5;

[0077] S02: When step S0 judges no, count the number G of patch versions released by the application, and compare it with the number G1 of the number of times the client updates the application patch version, if 3 / 5G<G1≤G, go to step S1- 5. If G1≤3 / 5G, go to step S03;

[0078] S03: Determine whether to obtain the patch package according to the patch package weight value...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a method for loading patches based on class files. The method includes the steps that a patch pack is obtained from a server first; a to-be-patch class is found from dex files; subpackage processing is carried out on the first dex file to obtain the second dex file and the third dex file, the patch class is loaded into the patch class to be inserted into the second dex file to form a new fourth dex file, a jump instruction is inserted between the to-be-patched class and the previous class adjacent to the to-be-patched class, the jump instruction executes the patch class, and a jump instruction is inserted in front of the patch class by determining the to-be-patched class; when a program is executed to the position, the program is directly skipped to execute the patch type, and then a patch of an application is updated. By means of the method, the patch of the application can be effectively repaired, and when the patch is repaired, the phenomena of dead halt, slow response, system breakdown and the like are avoided, and the operation efficiency of the whole application and the use experience of a user are improved.

Description

technical field [0001] The invention belongs to the field of APP patch loading, in particular to a method for loading patches based on class files in an Android system. Background technique [0002] In the prior art, after an Android application is released, a serious bug is suddenly discovered and needs to be repaired. At this time, the Android application needs to be repaired. The specific operations are repackaging the APP, testing, and switching to various application markets and channels package, prompt user to upgrade, user download, overwrite installation. Sometimes just to modify a line of code, it also needs to pay a huge cost to change the package and re-release. For users, the repeated upgrade, re-download and installation process of an Android application greatly reduces the user experience. In order to solve the problems existing in the existing technology, QZone proposes a hot patch dynamic repair technology. This technology sends a patch to the user, and the...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/445
CPCG06F9/44526
Inventor 纪琦华蒲珂曾泽基李哲山赵永超胡彬方宏蔡忠善
Owner ZHONGGUANG REDIANYUN TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products