一种Android diff patch方案,支持Bsdiffpatch和Hdiffpatch两种算法。
用法:
BsDiffPatch
IDiffPatch bsDiffPatch = new BSDiffPatch(); bsDiffPatch.init(getApplicationContext()); //diff bsDiffPatch.diff(oldFilePath, newFilePath, diffFilePath); //patch bsDiffPatch.patch(oldFilePath, diffFilePath, gennewFilePath);
HDiffPatch
IDiffPatch hDiffPatch = new HDiffPatch(); hDiffPatch.init(getApplicationContext()); //diff hDiffPatch.diff(oldFilePath, newFilePath, diffFilePath); //patch hDiffPatch.patch(oldFilePath, diffFilePath, gennewFilePath);