Method of solving iOS hot-fix problem of and user terminal

A user terminal, hot repair technology, applied in user identity/authority verification, platform integrity maintenance, digital data protection, etc.

CN107391171AActive Publication Date: 2017-11-24GUANGDONG YOUMAI INFORMATION COMM TECH
2 Cites 13 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2017-11-24

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention discloses a method of solving an iOS hot-fix problem and a user terminal. According to the method, on the one hand, a method of querying whether an Objective-C class method exists is also realized through avoiding a respondsToSelector method and a performSelector method and using class_getInstanceMethod and class_getClassMethod methods in a runtime Library, and NSInvocation and forwardInvocation are applied to realize redirection of messages, and also to realize forwarding and invoking of the messages. Through relieving a sensitivity function problem existing in current open source technology, the method can enable a product with a hot-fix function to successfully pass strict examination and verification of Apple Inc..
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the field of IOS software development, in particular to the field of hot repair function development. Background technique

[0002] As a technical means to quickly solve IT product online abnormalities, hot repair is very important for mobile applications, especially on the iOS platform, because Apple's review cycle is generally longer, if you release a new version to fix the problems that occurred in the previous version Abnormal problems require a longer cycle, which leads to the spread of abnormalities, which not only affects the normal use of App functions, but also seriously damages the reputation of the product and user experience, resulting in the loss of users. In the open source technical solution, the iOS platform realizes hot There are also many open source technologies for repair functions, such as the popular JSPatch, Weex, RN, etc., but around March 8, 2017, Apple issued a stern warning to products using these hot...

Examples

Embodiment 1

[0070] refer to figure 1 , the present invention provides a kind of method for solving iOS heat repair problem, comprises the following steps:

[0071] S001. Obtain an encrypted hotfix file from the server;

[0072] S002. Decrypt the encrypted MD5 digital signature in the encrypted hot repair file to obtain the MD5 digital signature;

[0073] S003. Comparing the value of the MD5 digital signature with the MD5 value obtained by calculating the encrypted hot repair file, if they are the same, then execute step S004, and if they are not the same, then end the process;

[0074] S004. Decrypt the encrypted hot repair file and load it into the memory to generate a hot repair JavaScript script;

[0075] S101. Analyzing the hot-fix JavaScript script in the memory to generate a hot-fix analysis script;

[0076] S201. Load the hot-fix analysis script through JavaScriptCore, and use the closure to call back the Objective-C information referenced in the hot-fix analysis script to Objec...

Embodiment 2

[0120] Such as image 3 As shown, the present invention provides a user terminal, including:

[0121] memory for storing program instructions;

[0122] a processor for executing the program instructions to perform the following steps:

[0123] S101. Analyzing the hot-fix JavaScript script in the memory to generate a hot-fix analysis script;

[0124] S201. Load the hot-fix analysis script through JavaScriptCore, and use the closure to call back the Objective-C information referenced in the hot-fix analysis script to Objective-C;

[0125]S301. Determine whether there is a class corresponding to the class name in the information in Objective-C through the NSClassFromString method, if yes, execute step S401, if not, dynamically create a corresponding class in Objective-C, and execute step S401;

[0126] S401. Replace and cache the message redirection method forwardInvocation of the class in Objective-C corresponding to the class name in the information and its parent class;

...