Skip to content

Commit ef5c864

Browse files
update agp升级至8.x,报名调整,1.0.3版本
1 parent e6e1ac1 commit ef5c864

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+156
-182
lines changed

app/build.gradle

Lines changed: 0 additions & 64 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
plugins {
2+
alias(libs.plugins.xeonyu.application)
3+
}
4+
5+
android {
6+
namespace = "com.yzq.bsdiff.demo"
7+
defaultConfig {
8+
applicationId = "com.yzq.bsdiff.demo"
9+
versionCode = 1
10+
versionName = "0.0.1"
11+
ndk {
12+
abiFilters += listOf("arm64-v8a", "armeabi-v7a")
13+
}
14+
}
15+
16+
buildTypes {
17+
release {
18+
isMinifyEnabled = true
19+
isShrinkResources = true
20+
isDebuggable = true
21+
proguardFiles(
22+
getDefaultProguardFile("proguard-android-optimize.txt"),
23+
"proguard-rules.pro"
24+
)
25+
}
26+
}
27+
28+
29+
}
30+
31+
dependencies {
32+
implementation(libs.androidx.core.ktx)
33+
implementation(libs.androidx.appcompat)
34+
implementation(libs.google.material)
35+
implementation(libs.androidx.constraintlayout)
36+
implementation(libs.kotlinx.coroutines.android)
37+
implementation(libs.androidx.activity.ktx)
38+
implementation(libs.androidx.lifecycle.livedata.ktx)
39+
implementation(libs.androidx.lifecycle.viewmodel.ktx)
40+
implementation(libs.utilcodex)
41+
42+
43+
// 依赖远程库
44+
// implementation("com.xeonyu:bsdiff:1.0.3-SNAPSHOT")
45+
implementation(libs.xeonyu.bsdiff)
46+
// 依赖本地库
47+
// implementation(project(":bsdiff"))
48+
}

app/proguard-rules.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add project specific ProGuard rules here.
22
# You can control the set of applied configuration files using the
3-
# proguardFiles setting in build.gradle.
3+
# proguardFiles setting in build.gradle.kts.
44
#
55
# For more details, see
66
# http://developer.android.com/guide/developing/tools/proguard.html

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.xeon.xeonbsdiff.demo">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<application
65
android:allowBackup="true"
@@ -10,9 +9,8 @@
109
android:supportsRtl="true"
1110
android:theme="@style/Theme.XeonBsDiff">
1211
<activity
13-
android:name="com.xeon.demo.MainActivity"
12+
android:name=".MainActivity"
1413
android:exported="true"
15-
android:label="@string/app_name"
1614
android:theme="@style/Theme.XeonBsDiff.NoActionBar">
1715
<intent-filter>
1816
<action android:name="android.intent.action.MAIN" />

app/src/main/java/com/xeon/demo/MainActivity.kt renamed to app/src/main/java/com/yzq/bsdiff/demo/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package com.xeon.demo
1+
package com.yzq.bsdiff.demo
22

33
import android.os.Bundle
44
import androidx.activity.viewModels
55
import androidx.appcompat.app.AppCompatActivity
6-
import com.xeon.xeonbsdiff.demo.databinding.ActivityMainBinding
6+
import com.yzq.bsdiff.demo.databinding.ActivityMainBinding
77

88
/**
99
* @description: MainActiviy

app/src/main/java/com/xeon/demo/MainViewModel.kt renamed to app/src/main/java/com/yzq/bsdiff/demo/MainViewModel.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package com.xeon.demo
1+
package com.yzq.bsdiff.demo
22

33
import androidx.lifecycle.ViewModel
44
import androidx.lifecycle.viewModelScope
55
import com.blankj.utilcode.util.FileUtils
66
import com.blankj.utilcode.util.LogUtils
77
import com.blankj.utilcode.util.PathUtils
88
import com.blankj.utilcode.util.ToastUtils
9-
import com.xeon.bsdiff.utils.XeonBsDiffUtil
9+
import com.yzq.bsdiff.BsDiffTool
1010
import kotlinx.coroutines.CoroutineExceptionHandler
1111
import kotlinx.coroutines.Dispatchers
1212
import kotlinx.coroutines.launch
@@ -31,19 +31,19 @@ class MainViewModel : ViewModel() {
3131
}
3232

3333
/*文件后缀名*/
34-
private val suffix = "apk"
34+
private val suffix = "txt"
3535

3636
/*旧文件*/
37-
private val oldFile = File(PathUtils.getExternalAppFilesPath(), "old.${suffix}")
37+
private val oldFile = File(PathUtils.getInternalAppFilesPath(), "old.${suffix}")
3838

3939
/*新文件*/
40-
private val newFile = File(PathUtils.getExternalAppFilesPath(), "new.${suffix}")
40+
private val newFile = File(PathUtils.getInternalAppFilesPath(), "new.${suffix}")
4141

4242
/*补丁文件*/
43-
private val patchFile = File(PathUtils.getExternalAppFilesPath(), "patch.${suffix}")
43+
private val patchFile = File(PathUtils.getInternalAppFilesPath(), "patch.${suffix}")
4444

4545
/*合并后的文件*/
46-
private val combineFile = File(PathUtils.getExternalAppFilesPath(), "combine.${suffix}")
46+
private val combineFile = File(PathUtils.getInternalAppFilesPath(), "combine.${suffix}")
4747

4848
/*生成补丁文件*/
4949
fun fileDiff() {
@@ -57,7 +57,7 @@ class MainViewModel : ViewModel() {
5757
}
5858

5959
/*生成补丁包,耗时操作,记得放在子线程 返回值 0表示成功*/
60-
val result = XeonBsDiffUtil.bsdiff(
60+
val result = BsDiffTool.diff(
6161
newFile.absolutePath,//新文件path
6262
oldFile.absolutePath,//旧文件path
6363
patchFile.absolutePath//补丁文件path
@@ -86,7 +86,7 @@ class MainViewModel : ViewModel() {
8686
return@withContext
8787
}
8888
/*合并补丁包,耗时操作,记得放在子线程 返回值 0表示成功*/
89-
val result = XeonBsDiffUtil.bspatch(
89+
val result = BsDiffTool.patch(
9090
oldFile.absolutePath,
9191
patchFile.absolutePath,
9292
combineFile.absolutePath

app/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
66
android:orientation="vertical"
7-
tools:context="com.xeon.demo.MainActivity">
7+
tools:context="com.yzq.bsdiff.demo.MainActivity">
88

99

1010
<androidx.appcompat.widget.AppCompatButton

bsdiff/build.gradle.kts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
plugins {
2+
alias(libs.plugins.xeonyu.library)
3+
alias(libs.plugins.vanniktechPublish)
4+
}
5+
6+
android {
7+
namespace = "com.yzq.bsdiff"
8+
9+
defaultConfig {
10+
minSdk = 21
11+
externalNativeBuild {
12+
cmake {
13+
cppFlags("")
14+
}
15+
}
16+
}
17+
externalNativeBuild {
18+
cmake {
19+
path = file("src/main/cpp/CMakeLists.txt")
20+
version = "3.10.2"
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)