TTPatch is a lightweight thermal update framework

The principle of

Dynamic call/replace/new method /Class based on JavaScript+ Runtime

background

Because the old company 58 version iteration block, many requirements, resulting in a lot of requirements development quality and testing quality is not high. There are a lot of little bugs on the line that can be a headache. So there’s a thermal repair wheel.

Mature solutions for the industry

The following is a list of some personal understanding, not comprehensive, please understand.

  1. lua.
  2. JavaScript.
  3. OcAs script, Didi solution (open source).

Hot updates are well established in game development, and the idea is similar regardless of how they are implemented.

The Object C Code is converted into an intermediate language and delivered, and then executed locally. The intermediate language achieves the purpose of dynamic invocation through the dynamic implementation of Object C.

As a technical selection, JavaScript is chosen as the intermediate language because it is developed by RN in 58.

See here a lot of students will ask, excuse me you withJSPatchWhat’s the difference?

The principle is that JavaScript is implemented as an intermediate language, but the technical details are different. Some take a cue from JSPatch.

whyJSPatchYou can’t stand trial. YourTTPatchCan you get a trial?

First of all, the open source version of JSPatchgithub has been removed from the shelves, and apps that integrate the open source version have almost never been approved. But a paid version is still available. This shows that the hot update method with JavaScript as the intermediate language itself is not blocked. And I understand that many large factories also integrate hot update modules. So hot updates don’t work because of JSPatch itself. For details, see the review terms for rejected hot updates.

On the shelves

At present, several apps have been successfully launched with TTPatch integration.

The project schedule

Supports 80% hot update/hot repair scenarios

To prevent it from happeningJSPatchThe tragedy of the proposed group to understand the shelf problem

This project will continue to maintain

The project addressgithub

Your STAR is the driving force of my development.


1. Use documentation

2. Basic usage

3. Online tools

4. Frequently Asked Questions

5. Advanced usage

On the shelves

Risk: Please cooperate with the server delivery switch to determine whether to initialize the TTPatch module through the configuration of the APP

Please add questions to group :978337686

1. Feature list

features Note limit
The system Block signature can be manually set Such as WKWebView some system levelblockThe signature is missing and cannot be invoked dynamically
Replace the specifiedObjectCMethod implementation Both instance and static methods can be implemented interchangeably
Dynamically create methods for Native/Js calls The method signature is passed in
supportblock ObjectCThe incomingJS.JSThe incomingObjectCHave support
Support for adding attributes Is existingclassAdd attributes
Support for base data types Non-id type, for exampleint.boolHave support
Support pure deliveryJSpage pureJSCode mapping native code, dynamic publishing
Implementation agreement Added on 01 April 2020
Support real wireless preview Detailed instructions
supportNativeThe code toJSThe script Online address
Native network requests are supported Use the sample

2. Install

CocoaPods Pod 0.6.0

  1. Add to Podfilepod 'TTPatch'.
  2. performpod installpod update.
  3. Import the “TTPatch. H”

Demo project: example.xcodeProj

Running effect drawing

Online patch delivery execution

After the patch is restarted, load the delivered patch

Your love is my motivation to update