当前位置:网站首页>Bsdiff and bspatch incremental updates
Bsdiff and bspatch incremental updates
2022-07-26 04:35:00 【___ Bozi mi pro】
With Android ecology , Technology is becoming more and more mature , There is a lot of market at present Android It's a big project , The team is large , Gradually, many component-based plug-in technologies have been derived .
At the same time, because Android Installation package apk It's also growing , Every time I release , User update apk The environment is complex , If full update download apk In the case of using traffic , Bad network environment and so on , It's very bad for the user experience .
First, distinguish the following concepts
Componentization : Put the common module code , extract lib Engineering or jar To achieve the effect of reuse .
pluggable : The purpose is to extract the modules or functions that need to be implemented as an independent , Reduce the size of the host , When you need to use the corresponding function, load the corresponding module . It's about dynamic agents ,ClassLoader, And the other one apk Loading resources . for example :360 Of DroidPlugin ( recommend )
Hot repair : Often from repair bug From the angle of , It's important to fix the known... Without the need for a second install application bug( Key words involved :Hook technology 、 Dynamic agents, etc ). for example : Ali AndFix.
Incremental updating :APK Incremental renewal is a lot of big factories APP Technology adopted .bsdiff The library generates patch files to download with the old version APK Synthesize to generate a new version APK Principle (ligbspatch.so). Mobile phone games app Incremental updates are used more . for example :SmartAppUpdates

bsdiff Generate patch -> bzip2 Compress -> android download patch -> bzip2 decompression patch -> bspatch Merge patch -> new apk
bsdiff It's not for apk Incremental update design , It can differentiate and merge any binary file .
bzip2 The function of Huffman is to compress the file losslessly ( Compress the differential packet for network transmission ) And decompress .
technological process :
- On the server side , Generate two versions apk The difference subcontract of ;
- In the mobile client , Use the installed apk Synthesis with this differential package , Get a new version of apk;
- Verify the newly synthesized apk Is the document complete ,MD5 or SHA1 Whether it is right , If right , Then guide the user to install ;
Common commands
bsdiff Generate patch package command :bsdiff oldfile newfile patchfile for example : bsdiff xx_v1.0.apk xx_v2.0.apk xx.patch
bspatch Generate a new APK: command : bspatch oldfile newfile patchfile for example : bsdiff xx_v1.0.apk xx_v2.0.apk xx.patch
Use
Android Incremental updating ——bsdiff&bspatch
shortcoming :
Incremental upgrade is not the perfect way to upgrade , There are at least two shortcomings :
Incremental upgrade is based on the difference between two application versions to generate patches , You can't guarantee users to upgrade to the latest in time every time , So you have to make a difference between each version you release and the latest version , So that all versions of users can differential upgrade , This operation is more cumbersome than the original package upgrade , However, it can be generated in batches through automated scripts .
The prerequisite for a successful incremental upgrade is , The user's mobile terminal must have a version that allows you to copy it and is consistent with the version that your server uses for differential apk, So there is , for example , Built in system apk Can't get , No incremental upgrade ; For some versions consistent with your differential version , But the content has been modified ( For example, cracked version apk), In this way, incremental upgrade is not possible , To prevent compositing patch errors , Best to pass md5 Or in some other way patch Check the integrity of the package .
边栏推荐
- Creative design principle of youth maker Education
- 一个sql server查询截止某个日期最新的记录
- Wu Enda's machine learning after class exercises - linear regression
- 2022杭电多校第二场 A.Static Query on Tree(树剖)
- Weights & Biases (二)
- UE4 键盘控制开关灯
- Threadpooltaskexecutor and ThreadPoolExecutor
- MySQL usage
- How to build an automated testing framework?
- Array sort 1
猜你喜欢

机器学习之信用卡欺诈检测

数据仓库

Creative design principle of youth maker Education

How to build an automated testing framework?

Phaser (I): platform jumping collection game

UE4 switching of control rights of multiple roles

UE4 keyboard control switch light

Recursive implementation of exponential enumeration

Authentication Encyclopedia (cookies, sessions, tokens, JWT, single sign on), in-depth understanding and understanding of authentication

Add watermark to ffmpeg video
随机推荐
Matlab drawing
P-norm (2-norm is Euclidean norm)
Offline installation of idea plug-in (continuous update)
Postman imports curl, exports curl, and exports corresponding language codes
【UOJ 429】串串划分(Runs)(容斥)+ 有关 Lyndon Tree 及其应用的小小记录
MapReduce中分区数与ReduceTask个数关系比较
Use of anonymous functions
2022 Henan Mengxin League game (3): Henan University a - corn cannon
Sangi diagram of machine learning (for user behavior analysis)
七、RESTful
UE4 controls the rotation of objects by pressing keys
Compiled by egg serialize JS
data warehouse
Creative design principle of youth maker Education
Scroll view pull-down refresh and pull-up load (bottom)
egg-sequelize TS编写
[uoj 429] runs (inclusive) + a little record about Lyndon tree and its application
UE4 键盘控制开关灯
Recursive implementation of exponential enumeration
Getting started with mongodb Basics