From 7c8624ac0d3fccafd786cc93f4e9ec785df20cee Mon Sep 17 00:00:00 2001 From: SL Date: Mon, 5 May 2025 10:36:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BC=98=E5=8C=96=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/kotlinc.xml | 2 +- README.md | 8 -- app/build.gradle | 12 ++- build.gradle | 16 ++- wkim/.idea/libraries/libs.xml | 10 ++ wkim/build.gradle | 99 +++++++++++++------ .../main/java/com/xinbida/wukongim/WKIM.java | 2 +- 7 files changed, 104 insertions(+), 45 deletions(-) create mode 100644 wkim/.idea/libraries/libs.xml diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index e805548..8d81632 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/README.md b/README.md index aa9eb8c..fab34d8 100644 --- a/README.md +++ b/README.md @@ -28,14 +28,6 @@ allprojects { } ``` -由于sdk内使用了sqlcipher加密数据库和curve25519加密算法,需将库添加到项目中 -```groovy -implementation "net.zetetic:android-database-sqlcipher:4.5.3" -implementation "androidx.sqlite:sqlite-ktx:2.3.1" -implementation 'org.whispersystems:curve25519-android:0.5.0' -implementation 'org.whispersystems:signal-protocol-android:2.8.1' -``` - **混淆** ``` -dontwarn com.xinbida.wukongim.** diff --git a/app/build.gradle b/app/build.gradle index 7627a33..8dc6790 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -33,11 +33,15 @@ android { } dependencies { + implementation platform("org.jetbrains.kotlin:kotlin-bom:$kotlin_version") + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation project(':wkim') - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'com.google.android.material:material:1.12.0' - implementation 'androidx.constraintlayout:constraintlayout:2.2.0' - implementation 'org.jetbrains:annotations:23.0.0' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'com.google.android.material:material:1.11.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'org.jetbrains:annotations:24.1.0' implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.7' implementation 'com.github.li-xiaojun:XPopup:2.9.19' implementation('com.github.bumptech.glide:glide:4.16.0') { diff --git a/build.gradle b/build.gradle index ad95fae..63663ba 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,24 @@ import org.gradle.internal.jvm.Jvm buildscript { - ext.kotlin_version = '1.9.20' + ext.kotlin_version = '1.9.22' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.7.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20" + classpath 'com.android.tools.build:gradle:8.2.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + configurations.all { + resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version" + resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + resolutionStrategy.force "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" } } diff --git a/wkim/.idea/libraries/libs.xml b/wkim/.idea/libraries/libs.xml new file mode 100644 index 0000000..de22c4f --- /dev/null +++ b/wkim/.idea/libraries/libs.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/wkim/build.gradle b/wkim/build.gradle index baa6463..6f37861 100644 --- a/wkim/build.gradle +++ b/wkim/build.gradle @@ -4,24 +4,6 @@ plugins { id 'maven-publish' } -afterEvaluate { - publishing { - publications { - maven(MavenPublication) { - afterEvaluate { artifact(tasks.getByName("bundleReleaseAar")) } - groupId = 'com.xinbida.wukongim' - artifactId = 'WKIMLib_loca' - version = '1.0.7' - } - } - repositories { - maven { - url = uri('../repository') - } - } - } -} - android { compileSdk 34 defaultConfig { @@ -39,20 +21,81 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = '17' } buildFeatures.buildConfig = true namespace 'com.xinbida.wukongim' } -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - api files('libs/xSocket-2.8.15.jar') - implementation 'com.android.support:multidex:1.0.3' - implementation "net.zetetic:android-database-sqlcipher:4.5.3" - implementation "androidx.sqlite:sqlite-ktx:2.4.0" - implementation 'org.whispersystems:curve25519-android:0.5.0' - implementation 'org.whispersystems:signal-protocol-android:2.8.1' +configurations { + // 创建一个新的配置用于嵌入依赖 + embedded + implementation.extendsFrom(embedded) +} + +dependencies { + implementation platform("org.jetbrains.kotlin:kotlin-bom:$kotlin_version") + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + + // 使用 embedded 配置来包含需要打包进 AAR 的依赖 + embedded files('libs/xSocket-2.8.15.jar') + embedded "net.zetetic:android-database-sqlcipher:4.5.4" + embedded "androidx.sqlite:sqlite-ktx:2.5.0" + embedded 'org.whispersystems:curve25519-android:0.5.0' + embedded 'org.whispersystems:signal-protocol-android:2.8.1' + + // multidex 通常不需要打包进去,保持 implementation + implementation 'com.android.support:multidex:1.0.3' +} + +afterEvaluate { + publishing { + publications { + release(MavenPublication) { + from components.release + + // 配置 pom 以包含传递依赖 + pom { + name = 'WKIMLib' + description = 'WuKong IM Android Library' + + licenses { + license { + name = 'The Apache License, Version 2.0' + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + } + + groupId = 'com.xinbida.wukongim' + artifactId = 'WKIMLib_local' + version = '1.0.7' + } + } + repositories { + maven { + name = 'localRepo' + url = uri("${project.rootDir}/repository") + } + } + } +} + +android.libraryVariants.all { variant -> + def name = variant.name.capitalize() + task("generate${name}Javadoc", type: Javadoc) { + description "Generates Javadoc for $variant.name." + source = variant.sourceSets.collect { it.java.sourceFiles }.inject { m, i -> m + i } + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + classpath += configurations.implementation + options.addStringOption('Xdoclint:none', '-quiet') + options.addStringOption('encoding', 'UTF-8') + options.addStringOption('charSet', 'UTF-8') + } } diff --git a/wkim/src/main/java/com/xinbida/wukongim/WKIM.java b/wkim/src/main/java/com/xinbida/wukongim/WKIM.java index 2299a22..717e336 100644 --- a/wkim/src/main/java/com/xinbida/wukongim/WKIM.java +++ b/wkim/src/main/java/com/xinbida/wukongim/WKIM.java @@ -18,7 +18,7 @@ import com.xinbida.wukongim.utils.CryptoUtils; * 5/20/21 5:25 PM */ public class WKIM { - private final String Version = "V1.3.3"; + private final String Version = "V1.4.0"; private WKIM() {