housisong
housisong
当前我的开源补丁项目都没有支持原地更新的特性。 这需要一个新的算法,在diff阶段就按照约束对覆盖线进行规划,补丁包大小可能会增大作为代价。 涉及到原地更新算法的设计,就涉及到非常多约束和策略的选择; 不同的需求可能有完全不同的设计目标、取舍和实现方案。 我尝试过一些简单的实现策略,但由于我没有合适的使用场景所以没有作为正式代码发布。 我最近想完成2种最简单的方案(发布在[HPatchLite](https://github.com/sisong/HPatchLite)项目上),不知道是否适合你们的场景,可能需要一些试验。
刚给 [HPatchLite](https://github.com/sisong/HPatchLite)项目添加了2种最简单的原地更新方案,你可以看看是否满足需求; 有一个实际的单片机项目配合开发完成,效果还可以。
> a diff can be created without the original source to be present, only it's signature. hdiffpatch lib have a demo [hsynz](https://github.com/sisong/hsynz), only used new data's hash datas(signature), to create...
I added a cmdline demo [$hsign_diff](https://github.com/sisong/hsynz/releases) for this (like [rsync](https://github.com/RsyncProject/rsync)) ; 1. create oldFile's hash signature file(.hsyni): `$hsync_make oldFile oldFile.hsyni` 2. create [hpatchz](https://github.com/sisong/HDiffPatch/releases)'s diffFile: `$hsign_diff oldFile.hsyni newFile diffFile -c-zstd` 3....
代码没有对相同输入作特别处理。相同文件,也会在补丁包中保存一些元信息。
apk 文件需要用库提供的标准化程序处理过,并重新签名。
now, apksigner v35 will automatically realigned apk's uncompressed files ): and the alignment is different from zipalign! for all uncompressed files, apksigner v35 will adding align tag+ align bytes+align multiple...
No; apksigner v35 will re-enforce 16k page size alignment regardless of whether 16k page size alignment has been adapted.
有可能做到,但可能会有其他问题; 1. 下载可能失败hsyni文件,无法继续:解决办法可能是自动使用一个临时文件保存下载到的hsyni数据。 1. 不知道hsynz:可以将hsynz的url保存到hsyni文件中,或者可以考虑将hsyni和hsynz文件合并成一个文件。 当前没有这个的修改计划,建议你自己对hsynz进行部分修改并实现自己的应用层。
When hpatchz executes dir-patch, the first step is to create the newly added and modified files; The second step is to copy all the unchanged old files to the new...