Hard repair:
Works directly modify the source code, re-issued version;
Cold repair:
Patch packages using dynamic libraries and hook technology, complete code in question at program startup repair; Case: iOS reverse engineering;
Features: does not modify the original code, the patch is released, currently does not support dynamic publishing;
Hot Fix:
The direct successor to the heat inside the executable file to start the repair mechanisms;
Dynamic thermal engine repair after home inspection program started in patches, complete dynamic hook;
principle:
1, contains the update check engine repair;
2, the redirection message; will need to be modified to add new features and functionality to redirect JPForwardInvocation;
Treatment functions JPForwardInvocation distinguish the modified and non-modified;
Modified function will eventually call js be interpreted;
3, modified js contains features that will eventually be interpreted as oc execution;
This method has been successfully invoked what processes will go through it?
This is basically a process Patch method call.
First, click on the button calls handlebtn method not found IMP message forwarding process to go through resolveInstanceMethod-> forwardingTargetForSelector-> forwardInvocation and other methods, because the final forwardInvocation became JPForwardInvocation method is used method swizzling conversion, so JPForwardInvocation is called.
First look whether there is a method corresponding JPSelector, if you call the original forward method does not exist, if there is a call JPSelector corresponding IMP.
Remember when we said on a patch (ie demo.js) loading method JSValue Patch will be stored in the form of a list __JSOverrideMethods inside the OC.
IMP function is to find the JPSelector Patch method stores in JSValue form, and then call it.
https://www.mobilezhao.com/?tag=jspatch