android-diffpatch
android-diffpatch copied to clipboard
diffpatch with android
android-diffpatch
diffpatch with android
Getting Started
BsDiffPatch
website: http://www.daemonology.net/bsdiff/
- write in the build.gradle as follows:
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
- copy
app/libs/armeabi-v7a/libbsdiffpatch.so
to your project. - copy
app/src/main/java/com/github/snowdream/bsdiffpatch
andapp/src/main/java/com/github/snowdream/diffpatch
to your project, with the exact package and filename.
HDiffPatch
website:https://github.com/sisong/HDiffPatch
- write in the build.gradle as follows:
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
- copy
app/libs/armeabi-v7a/libhdiffpatch.so
to your project. - copy
app/src/main/java/com/github/snowdream/hdiffpatch
andapp/src/main/java/com/github/snowdream/diffpatch
to your project, with the exact package and filename.
Usage
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);
License
Copyright (C) 2016 snowdream <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.