diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 0899fc9..0000000 --- a/app/build.gradle +++ /dev/null @@ -1,64 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' -} - -android { - compileSdk 33 - defaultConfig { - applicationId "com.xeon.xeonbsdiff.demo" - minSdk 21 - targetSdk 33 - versionCode 1 - versionName "0.0.1" - ndk { - abiFilters "armeabi-v7a", "arm64-v8a" - } - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' - } - buildFeatures { - viewBinding true - } - - sourceSets { - main { - jniLibs.srcDirs = ['src/main/libs'] - } - } - -} - -dependencies { - - implementation 'androidx.core:core-ktx:1.7.0' - implementation 'androidx.appcompat:appcompat:1.3.1' - implementation 'com.google.android.material:material:1.4.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.1' - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2-native-mt' - implementation "androidx.activity:activity-ktx:1.4.0" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0" - implementation "com.blankj:utilcodex:1.30.6" - /*依赖远程库*/ -// implementation "io.github.yuzhiqiang1993:xeon_bsdiff:1.0.1" - implementation "com.xeonyu:bsdiff:1.0.2" - - - /*依赖本地库*/ -// implementation project(path: ':xeon_bsdiff') - - -} \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..9fcc3ec --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,48 @@ +plugins { + alias(libs.plugins.xeonyu.application) +} + +android { + namespace = "com.yzq.bsdiff.demo" + defaultConfig { + applicationId = "com.yzq.bsdiff.demo" + versionCode = 1 + versionName = "0.0.1" + ndk { + abiFilters += listOf("arm64-v8a", "armeabi-v7a") + } + } + + buildTypes { + release { + isMinifyEnabled = true + isShrinkResources = true + isDebuggable = true + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + + +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) + implementation(libs.google.material) + implementation(libs.androidx.constraintlayout) + implementation(libs.kotlinx.coroutines.android) + implementation(libs.androidx.activity.ktx) + implementation(libs.androidx.lifecycle.livedata.ktx) + implementation(libs.androidx.lifecycle.viewmodel.ktx) + implementation(libs.utilcodex) + + + // 依赖远程库 +// implementation("com.xeonyu:bsdiff:1.0.3-SNAPSHOT") + implementation(libs.xeonyu.bsdiff) + // 依赖本地库 + // implementation(project(":bsdiff")) +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 481bb43..ff59496 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,6 +1,6 @@ # Add project specific ProGuard rules here. # You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. +# proguardFiles setting in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5e3969c..d3b82e1 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + diff --git a/app/src/main/java/com/xeon/demo/MainActivity.kt b/app/src/main/java/com/yzq/bsdiff/demo/MainActivity.kt similarity index 90% rename from app/src/main/java/com/xeon/demo/MainActivity.kt rename to app/src/main/java/com/yzq/bsdiff/demo/MainActivity.kt index 73e2e8a..bbafdbf 100644 --- a/app/src/main/java/com/xeon/demo/MainActivity.kt +++ b/app/src/main/java/com/yzq/bsdiff/demo/MainActivity.kt @@ -1,9 +1,9 @@ -package com.xeon.demo +package com.yzq.bsdiff.demo import android.os.Bundle import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity -import com.xeon.xeonbsdiff.demo.databinding.ActivityMainBinding +import com.yzq.bsdiff.demo.databinding.ActivityMainBinding /** * @description: MainActiviy diff --git a/app/src/main/java/com/xeon/demo/MainViewModel.kt b/app/src/main/java/com/yzq/bsdiff/demo/MainViewModel.kt similarity index 87% rename from app/src/main/java/com/xeon/demo/MainViewModel.kt rename to app/src/main/java/com/yzq/bsdiff/demo/MainViewModel.kt index fa7228d..e902b91 100644 --- a/app/src/main/java/com/xeon/demo/MainViewModel.kt +++ b/app/src/main/java/com/yzq/bsdiff/demo/MainViewModel.kt @@ -1,4 +1,4 @@ -package com.xeon.demo +package com.yzq.bsdiff.demo import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope @@ -6,7 +6,7 @@ import com.blankj.utilcode.util.FileUtils import com.blankj.utilcode.util.LogUtils import com.blankj.utilcode.util.PathUtils import com.blankj.utilcode.util.ToastUtils -import com.xeon.bsdiff.utils.XeonBsDiffUtil +import com.yzq.bsdiff.BsDiffTool import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -31,19 +31,19 @@ class MainViewModel : ViewModel() { } /*文件后缀名*/ - private val suffix = "apk" + private val suffix = "txt" /*旧文件*/ - private val oldFile = File(PathUtils.getExternalAppFilesPath(), "old.${suffix}") + private val oldFile = File(PathUtils.getInternalAppFilesPath(), "old.${suffix}") /*新文件*/ - private val newFile = File(PathUtils.getExternalAppFilesPath(), "new.${suffix}") + private val newFile = File(PathUtils.getInternalAppFilesPath(), "new.${suffix}") /*补丁文件*/ - private val patchFile = File(PathUtils.getExternalAppFilesPath(), "patch.${suffix}") + private val patchFile = File(PathUtils.getInternalAppFilesPath(), "patch.${suffix}") /*合并后的文件*/ - private val combineFile = File(PathUtils.getExternalAppFilesPath(), "combine.${suffix}") + private val combineFile = File(PathUtils.getInternalAppFilesPath(), "combine.${suffix}") /*生成补丁文件*/ fun fileDiff() { @@ -57,7 +57,7 @@ class MainViewModel : ViewModel() { } /*生成补丁包,耗时操作,记得放在子线程 返回值 0表示成功*/ - val result = XeonBsDiffUtil.bsdiff( + val result = BsDiffTool.diff( newFile.absolutePath,//新文件path oldFile.absolutePath,//旧文件path patchFile.absolutePath//补丁文件path @@ -86,7 +86,7 @@ class MainViewModel : ViewModel() { return@withContext } /*合并补丁包,耗时操作,记得放在子线程 返回值 0表示成功*/ - val result = XeonBsDiffUtil.bspatch( + val result = BsDiffTool.patch( oldFile.absolutePath, patchFile.absolutePath, combineFile.absolutePath diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 73636b6..0b6f212 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context="com.xeon.demo.MainActivity"> + tools:context="com.yzq.bsdiff.demo.MainActivity"> + + + \ No newline at end of file diff --git a/xeon_bsdiff/src/main/cpp/CMakeLists.txt b/bsdiff/src/main/cpp/CMakeLists.txt similarity index 100% rename from xeon_bsdiff/src/main/cpp/CMakeLists.txt rename to bsdiff/src/main/cpp/CMakeLists.txt diff --git a/xeon_bsdiff/src/main/cpp/bsdiff.c b/bsdiff/src/main/cpp/bsdiff.c similarity index 100% rename from xeon_bsdiff/src/main/cpp/bsdiff.c rename to bsdiff/src/main/cpp/bsdiff.c diff --git a/xeon_bsdiff/src/main/cpp/bspatch.c b/bsdiff/src/main/cpp/bspatch.c similarity index 100% rename from xeon_bsdiff/src/main/cpp/bspatch.c rename to bsdiff/src/main/cpp/bspatch.c diff --git a/xeon_bsdiff/src/main/cpp/bzip2/Makefile b/bsdiff/src/main/cpp/bzip2/Makefile similarity index 100% rename from xeon_bsdiff/src/main/cpp/bzip2/Makefile rename to bsdiff/src/main/cpp/bzip2/Makefile diff --git a/xeon_bsdiff/src/main/cpp/bzip2/blocksort.c b/bsdiff/src/main/cpp/bzip2/blocksort.c similarity index 100% rename from xeon_bsdiff/src/main/cpp/bzip2/blocksort.c rename to bsdiff/src/main/cpp/bzip2/blocksort.c diff --git a/xeon_bsdiff/src/main/cpp/bzip2/bzlib.c b/bsdiff/src/main/cpp/bzip2/bzlib.c similarity index 100% rename from xeon_bsdiff/src/main/cpp/bzip2/bzlib.c rename to bsdiff/src/main/cpp/bzip2/bzlib.c diff --git a/xeon_bsdiff/src/main/cpp/bzip2/bzlib.h b/bsdiff/src/main/cpp/bzip2/bzlib.h similarity index 100% rename from xeon_bsdiff/src/main/cpp/bzip2/bzlib.h rename to bsdiff/src/main/cpp/bzip2/bzlib.h diff --git a/xeon_bsdiff/src/main/cpp/bzip2/bzlib_private.h b/bsdiff/src/main/cpp/bzip2/bzlib_private.h similarity index 100% rename from xeon_bsdiff/src/main/cpp/bzip2/bzlib_private.h rename to bsdiff/src/main/cpp/bzip2/bzlib_private.h diff --git a/xeon_bsdiff/src/main/cpp/bzip2/compress.c b/bsdiff/src/main/cpp/bzip2/compress.c similarity index 100% rename from xeon_bsdiff/src/main/cpp/bzip2/compress.c rename to bsdiff/src/main/cpp/bzip2/compress.c diff --git a/xeon_bsdiff/src/main/cpp/bzip2/crctable.c b/bsdiff/src/main/cpp/bzip2/crctable.c similarity index 100% rename from xeon_bsdiff/src/main/cpp/bzip2/crctable.c rename to bsdiff/src/main/cpp/bzip2/crctable.c diff --git a/xeon_bsdiff/src/main/cpp/bzip2/decompress.c b/bsdiff/src/main/cpp/bzip2/decompress.c similarity index 100% rename from xeon_bsdiff/src/main/cpp/bzip2/decompress.c rename to bsdiff/src/main/cpp/bzip2/decompress.c diff --git a/xeon_bsdiff/src/main/cpp/bzip2/huffman.c b/bsdiff/src/main/cpp/bzip2/huffman.c similarity index 100% rename from xeon_bsdiff/src/main/cpp/bzip2/huffman.c rename to bsdiff/src/main/cpp/bzip2/huffman.c diff --git a/xeon_bsdiff/src/main/cpp/bzip2/randtable.c b/bsdiff/src/main/cpp/bzip2/randtable.c similarity index 100% rename from xeon_bsdiff/src/main/cpp/bzip2/randtable.c rename to bsdiff/src/main/cpp/bzip2/randtable.c diff --git a/xeon_bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/cache-v2 b/bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/cache-v2 similarity index 100% rename from xeon_bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/cache-v2 rename to bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/cache-v2 diff --git a/xeon_bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/cmakeFiles-v1 b/bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/cmakeFiles-v1 similarity index 100% rename from xeon_bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/cmakeFiles-v1 rename to bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/cmakeFiles-v1 diff --git a/xeon_bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/codemodel-v2 b/bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/codemodel-v2 similarity index 100% rename from xeon_bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/codemodel-v2 rename to bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/codemodel-v2 diff --git a/xeon_bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/toolchains-v1 b/bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/toolchains-v1 similarity index 100% rename from xeon_bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/toolchains-v1 rename to bsdiff/src/main/cpp/cmake-build-debug/.cmake/api/v1/query/toolchains-v1 diff --git a/xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeCache.txt b/bsdiff/src/main/cpp/cmake-build-debug/CMakeCache.txt similarity index 100% rename from xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeCache.txt rename to bsdiff/src/main/cpp/cmake-build-debug/CMakeCache.txt diff --git a/xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/3.24.2/CMakeSystem.cmake b/bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/3.24.2/CMakeSystem.cmake similarity index 100% rename from xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/3.24.2/CMakeSystem.cmake rename to bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/3.24.2/CMakeSystem.cmake diff --git a/xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/3.24.2/CompilerIdC/CMakeCCompilerId.c b/bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/3.24.2/CompilerIdC/CMakeCCompilerId.c similarity index 100% rename from xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/3.24.2/CompilerIdC/CMakeCCompilerId.c rename to bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/3.24.2/CompilerIdC/CMakeCCompilerId.c diff --git a/xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/3.24.2/CompilerIdCXX/CMakeCXXCompilerId.cpp b/bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/3.24.2/CompilerIdCXX/CMakeCXXCompilerId.cpp similarity index 100% rename from xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/3.24.2/CompilerIdCXX/CMakeCXXCompilerId.cpp rename to bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/3.24.2/CompilerIdCXX/CMakeCXXCompilerId.cpp diff --git a/xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/clion-Debug-log.txt b/bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/clion-Debug-log.txt similarity index 100% rename from xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/clion-Debug-log.txt rename to bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/clion-Debug-log.txt diff --git a/xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/clion-environment.txt b/bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/clion-environment.txt similarity index 100% rename from xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/clion-environment.txt rename to bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/clion-environment.txt diff --git a/xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/cmake.check_cache b/bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/cmake.check_cache similarity index 100% rename from xeon_bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/cmake.check_cache rename to bsdiff/src/main/cpp/cmake-build-debug/CMakeFiles/cmake.check_cache diff --git a/xeon_bsdiff/src/main/cpp/xeon_bsdiff.cpp b/bsdiff/src/main/cpp/xeon_bsdiff.cpp similarity index 80% rename from xeon_bsdiff/src/main/cpp/xeon_bsdiff.cpp rename to bsdiff/src/main/cpp/xeon_bsdiff.cpp index 1580070..ea591a1 100644 --- a/xeon_bsdiff/src/main/cpp/xeon_bsdiff.cpp +++ b/bsdiff/src/main/cpp/xeon_bsdiff.cpp @@ -13,7 +13,8 @@ extern int bspatch_main(int argc, char *argv[]); */ extern "C" JNIEXPORT jint JNICALL -Java_com_xeon_bsdiff_utils_XeonBsDiffUtil_bsdiff(JNIEnv *env, jobject thiz, jstring new_file_path, jstring old_file_path, jstring patch_file_path) { +Java_com_yzq_bsdiff_BsDiffTool_diff(JNIEnv *env, jobject thiz, jstring new_file_path, + jstring old_file_path, jstring patch_file_path) { const char *newFile = env->GetStringUTFChars(new_file_path, nullptr); const char *oldFile = env->GetStringUTFChars(old_file_path, nullptr); @@ -33,7 +34,9 @@ Java_com_xeon_bsdiff_utils_XeonBsDiffUtil_bsdiff(JNIEnv *env, jobject thiz, jstr */ extern "C" JNIEXPORT jint JNICALL -Java_com_xeon_bsdiff_utils_XeonBsDiffUtil_bspatch(JNIEnv *env, jobject thiz, jstring old_file_path, jstring patch_file_path, jstring combine_file_path) { +Java_com_yzq_bsdiff_BsDiffTool_patch(JNIEnv *env, jobject thiz, jstring old_file_path, + jstring patch_file_path, + jstring combine_file_path) { const char *oldFile = env->GetStringUTFChars(old_file_path, nullptr); const char *patchFile = env->GetStringUTFChars(patch_file_path, nullptr); const char *combineFile = env->GetStringUTFChars(combine_file_path, nullptr); diff --git a/bsdiff/src/main/java/com/yzq/bsdiff/BsDiffTool.kt b/bsdiff/src/main/java/com/yzq/bsdiff/BsDiffTool.kt new file mode 100644 index 0000000..065ea47 --- /dev/null +++ b/bsdiff/src/main/java/com/yzq/bsdiff/BsDiffTool.kt @@ -0,0 +1,38 @@ +package com.yzq.bsdiff + +/** + * @description: BsDiff工具类 + * @author : yuzhiqiang (zhiqiang.yu.xeon@gmail.com) + * @date : 2021/11/16 + * @time : 22:12 + */ + +object BsDiffTool { + + init { + kotlin.runCatching { + System.loadLibrary("xeon_bsdiff") + } + + } + + + /** + * 生成差分包 + * @param newFilePath String 新文件地址 + * @param oldFilePath String 旧文件地址 + * @param patchFilePath String 生成的差分包地址 + * @return Int 0表示成功 + */ + external fun diff(newFilePath: String, oldFilePath: String, patchFilePath: String): Int + + /** + * 合并差分包 + * @param oldFilePath String 旧文件地址 + * @param patchFilePath String 补丁文件地址 + * @param combineFilePath String 合并后的新文件地址 + * @return Int 0表示成功 + */ + external fun patch(oldFilePath: String, patchFilePath: String, combineFilePath: String): Int + +} \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 097e974..0000000 --- a/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -plugins { - id 'com.android.application' version '7.4.2' apply false - id 'com.android.library' version '7.4.2' apply false - id 'org.jetbrains.kotlin.android' version '1.8.0' apply false - /*发布插件*/ - id "com.vanniktech.maven.publish" version "0.25.1" -} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..07cbb59 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + alias(libs.plugins.android.application) apply false + alias(libs.plugins.android.library) apply false + alias(libs.plugins.kotlin.android) apply false + + alias(libs.plugins.vanniktechPublish) apply false +} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bce591e..9053418 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue Mar 28 16:39:03 CST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle.kts similarity index 58% rename from settings.gradle rename to settings.gradle.kts index db07828..b9986fa 100644 --- a/settings.gradle +++ b/settings.gradle.kts @@ -1,21 +1,30 @@ pluginManagement { repositories { + mavenLocal() google() mavenCentral() gradlePluginPortal() } } + dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { /*发布到本地仓库时测试用*/ -// mavenLocal() + mavenLocal() /*发布到snapshot仓库时使用*/ -// maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' } + maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") } google() mavenCentral() } + + versionCatalogs { + create("libs") { + from("com.xeonyu:version-catalog:0.0.5") + } + } } + rootProject.name = "XeonBsDiff" -include ':app' -include ':xeon_bsdiff' +include(":app") +include(":bsdiff") diff --git a/xeon_bsdiff/build.gradle b/xeon_bsdiff/build.gradle deleted file mode 100644 index fb221bc..0000000 --- a/xeon_bsdiff/build.gradle +++ /dev/null @@ -1,42 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id "com.vanniktech.maven.publish" -} - -android { - compileSdk 33 - - defaultConfig { - minSdk 21 - targetSdk 33 - versionCode 1 - versionName "1.0.0" - consumerProguardFiles "consumer-rules.pro" - externalNativeBuild { - cmake { - cppFlags '' - } - } - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' - } - externalNativeBuild { - cmake { - path file('src/main/cpp/CMakeLists.txt') - version '3.10.2' - } - } -} \ No newline at end of file diff --git a/xeon_bsdiff/src/main/AndroidManifest.xml b/xeon_bsdiff/src/main/AndroidManifest.xml deleted file mode 100644 index 91ef76d..0000000 --- a/xeon_bsdiff/src/main/AndroidManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/xeon_bsdiff/src/main/java/com/xeon/bsdiff/utils/XeonBsDiffUtil.kt b/xeon_bsdiff/src/main/java/com/xeon/bsdiff/utils/XeonBsDiffUtil.kt deleted file mode 100644 index 4f1715b..0000000 --- a/xeon_bsdiff/src/main/java/com/xeon/bsdiff/utils/XeonBsDiffUtil.kt +++ /dev/null @@ -1,37 +0,0 @@ -package com.xeon.bsdiff.utils - -/** - * @description: BsDiff工具类 - * @author : yuzhiqiang (zhiqiang.yu.xeon@gmail.com) - * @date : 2021/11/16 - * @time : 22:12 - */ - -object XeonBsDiffUtil { - - init { - kotlin.runCatching { - System.loadLibrary("xeon_bsdiff") - } - - } - - /** - * 生成补丁包 - * @param newFilePath String 新文件的地址 - * @param oldFilePath String 旧文件的地址 - * @param patchFilePath String 生成的补丁文件地址 - * @return Int - */ - external fun bsdiff(newFilePath: String, oldFilePath: String, patchFilePath: String): Int - - /** - * 合并差分包 - * @param oldFilePath String 旧文件地址 - * @param patchFilePath String 补丁文件地址 - * @param combineFilePath String 合并后的新文件地址 - * @return Int - */ - external fun bspatch(oldFilePath: String, patchFilePath: String, combineFilePath: String): Int - -} \ No newline at end of file