hot update in android

hot update process

1. Serious crash detected online

2. Pull a bugfix branch and fix the problem on the branch

3. Jenkins build and patch generation.

4. The app pushes or actively pulls patch files

5. Merge the bufix code into the master.

Introduction to mainstream hot update frameworks

1.Dexposed

Comes with logging, performance monitoring and more.

Alibaba's non-intrusive hot update framework.

The form of the hook. You can hook our custom functions or hook Android functions.

2.AndFix

From Ali. Only focus on hot updates.

3.NuWa

Problems based on DEX subcontracting

By traversing the dex, when the same dex is the same, the front one will be selected.

4. Meituan's robots

3. The principle of hot update

1. Android class loading mechanism.

1. PathClassLoader mainly loads the system

2.DexClassLoader 

2. Hot Repair Mechanism

1.DexElements

2. ClassLoader will traverse this array

Mainly by creating a dex file array of dexelements in classload, and finding the corresponding class file according to the online crash location. Then package this class file into a dex file and put it at the front of the dex file array. This will make dexclassloader not load the problematic dex file when loading the dex file. Instead, only the dex file that we repaired will be loaded.

3.

Guess you like

Origin blog.csdn.net/howlaa/article/details/128839469