当前位置:网站首页>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 .
边栏推荐
- Support proxy direct connection to Oracle database, jumpserver fortress v2.24.0 release
- QT compilation error sorting and remote module Download
- UE4 获取玩家控制权的两种方式
- 【UOJ 429】串串划分(Runs)(容斥)+ 有关 Lyndon Tree 及其应用的小小记录
- Autocomplete prevents the form from automatically filling in
- 9、 File upload and download
- 建设面向青少年的创客教育实验室
- Network Security Learning - permission promotion 2
- How does win11 22h2 skip networking and Microsoft account login?
- The auxiliary role of rational cognitive educational robot in teaching and entertainment
猜你喜欢
随机推荐
这种是我的vs没连上数据库吗
Integrated architecture of performance and cost: modular architecture
Comparison of the relationship between the number of partitions and the number of reducetask in MapReduce
Autocomplete prevents the form from automatically filling in
Threadpooltaskexecutor and ThreadPoolExecutor
11、 Exception handler
Compiled by egg serialize TS
建设面向青少年的创客教育实验室
自动化测试框架该如何搭建?
2022 a.static query on tree (tree section)
autocomplete禁止表单自动填充
How does win11 22h2 skip networking and Microsoft account login?
Sangi diagram of machine learning (for user behavior analysis)
Scroll view pull-down refresh and pull-up load (bottom)
[300 + selected interview questions from big companies continued to share] big data operation and maintenance sharp knife interview question column (VIII)
Keil V5 installation and use
Array sort 2
十、拦截器
力扣每日一题-第42天-661. 图片平滑器
Throttling anti shake function of JS handwritten function









