• Stars
    star
    302
  • Rank 138,030 (Top 3 %)
  • Language
    C++
  • License
    MIT License
  • Created over 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a C++ library and command-line tools for Zip(Jar,Apk) file Diff & Patch; create minimal delta/differential; support Jar sign(apk v1 sign) & apk v2,v3 sign .

ApkDiffPatch

release license PRs Welcome +issue Welcome

Build Status Build status

a C++ library and command-line tools for Zip(Jar,Apk) file Diff & Patch; create minimal delta/differential; support Jar sign(Apk v1 sign) & Apk v2 sign & Apk v3 sign .
You can use this library (and Android NDK) to delta update your Apk.
( not support zip64, and only support decode Deflated code; dependent libraries HDiffPatch, zlib, lzma. )
[中文说明]


Releases/Binaries

Download from last release : Command line app for Windows , Linux , MacOS; and .so .java for Android.

usage:

  • ZipDiff(oldZip,newZip,out diffData)
    release the diffData for update oldZip;

  • ZipPatch(oldZip,diffData,out newZip)
    ok , got the newZip;
    ZipPatch() requires 4*(decompress stream memory) + ref old decompress memory + O(1), also ref old decompress can use temp disk file without memory;
    ZipPatch() support multi-thread parallel compress mode when writing zip file, which requires more and more memory! (NOTE: patch by multi-thread need ApkNormalized zip files)

  • NOTE:
    if your need newZip(patch result) file byte by byte equal, Released newZip := ApkNormalized(newZip) before run ZipDiff, AND You should not modify the zlib version (unless it is certified compatible);
    if your apk(or jar) file used Jar sign(Apk v1 sign), is same as zip file;
    if your apk used Apk v2 sign(or Apk v3 sign), Released newZip := AndroidSDK#apksigner(ApkNormalized(AndroidSDK#apksigner(newZip))) before ZipDiff;

  • NOTE:
    ApkDiffPath can't be used in the Android app store, because it requires re-signing apk;
    sfpatcher like archive-patcher, is designed for Android app store, but patch is much faster than archive-patcher.


Why ApkDiffPatch

Why need ApkDiffPatch or Google Play's archive-patcher after having BsDiff or HDiffPatch?

ApkDiffPatch   : v1.0
archive-patcher: v1.0  ( test by https://github.com/googlesamples/apk-patch-size-estimator )
BsDiff         : v4.3
HDiffPatch     : v2.2.6
=========================================================================================================
                                                          BsDiff HDiffPatch archive-patcher ApkDiffPatch
          oldVersion              newVersion      newSize  (bzip2)  (+zlib)    (+gzip)   (+zlib)  (+lzma)
---------------------------------------------------------------------------------------------------------
chrome-63-0-3239-111.apk chrome-64-0-3282-123.apk 43879588 32916357 32621974  18776996  15995242 13896562
chrome-64-0-3282-123.apk chrome-64-0-3282-137.apk 43879588 28895294 28538751   1357320   1341073  1149331
chrome-64-0-3282-137.apk chrome-65-0-3325-109.apk 43592997 31771385 31540550  16427116  14415021 12356765
google-maps-9-70-0.apk   google-maps-9-71-0.apk   50568872 37992141 37531799  17293163  14562607 11430622
google-maps-9-71-0.apk   google-maps-9-72-0.apk   54342938 41897706 41475595  21301751  18752320 14066134
weixin660android1200.apk weixin661android1220.apk 61301316 17565557 17372003   1927833   1794219  1659286
weixin661android1220.apk weixin662android1240.apk 63595334 38349926 38025483  22100454  18392769 15556315
weixin662android1240.apk weixin663android1260.apk 63595326 11614415 11531258   1044656    937920   940060
weixin663android1260.apk weixin665android1280.apk 63669882 21423459 21176790   9621032   9003472  7392063
---------------------------------------------------------------------------------------------------------
Average Compression                                100.0%    56.3%    55.8%     23.5%     20.4%    16.8%
=========================================================================================================

Contact

[email protected]

More Repositories

1

HDiffPatch

a C\C++ library and command-line tools for Diff & Patch between binary files or directories(folder); cross-platform; runs fast; create small delta/differential; support large files and limit memory requires when diff & patch.
C++
1,503
star
2

UnityAndroidHotUpdate

I no longer install and use Unity3D. (Unity3D热更新。provide a way to hot update Unity app on Android, support code&resources, not need lua js or IL runtime etc..., will not disturb your project development; just loading the new version apk file to achieve. )
C++
189
star
3

HPatchLite

Lite version of HDiffPatch, tiny code & ram requirements when patch on embedded systems,MCU,NB-IoT,...
C
81
star
4

sfpatcher

stable & fast to patch apk archives, used by Android app store. 为安卓应用商店使用而优化的apk增量更新算法。
72
star
5

FractalBlizzard2

分形风暴2,用来绘制精美的自定义分形图片.
Pascal
50
star
6

demoForHssBlog

demo's source code for my blog: http://blog.csdn.net/housisong
C++
40
star
7

tinyuz

tiny code & ram requirements when decompress on embedded systems,MCU,NB-IoT,...
C++
35
star
8

hsynz

hsynz is a library for delta update using sync algorithm, like zsync. rsync over http(s); implement the sync algorithm on client side, and server side only need http(s) cdn. support compressor zstd & libdeflate & zlib, support large file & directory(folder), support muti-thread.
C++
33
star
9

DGL

Delphi泛型库--DGL(The Delphi Generic Library)
Pascal
27
star
10

libfrg

FRG is an image format(like PNG or JPG or ETC2 or ASTC etc.),for optimize load image time (loading from disk and decoding to display).
C++
25
star
11

lzma

(Unofficial) Git mirror of 7zip & LZMA SDK release v23.01, https://www.7-zip.org . some changes for HDiffPatch.
C++
13
star
12

libmd5

(Unofficial) Git mirror of md5 SDK https://sourceforge.net/projects/libmd5-rfc
C
2
star