修改文档

This commit is contained in:
SL 2023-06-20 19:38:53 +08:00
parent a50fd382b2
commit 380f4a157b
7 changed files with 47 additions and 9 deletions

View File

@ -1,6 +1,11 @@
# 悟空IM Android sdk 源码
该项目是一个完全自定义协议的即时通讯sdk。
## [详细文档](http://githubim.com "文档")
## 官方Demo
悟空团队官方基于本sdk编写了一个Android项目该项目覆盖了sdk所有方法的使用及演示流程。[跳转到Demo](https://github.com/WuKongIM/TangSengDaoDaoAndroid)
## 快速入门
**Gradle**
@ -8,7 +13,7 @@
[![](https://jitpack.io/v/WuKongIM/WuKongIMAndroidSDK.svg)](https://jitpack.io/#WuKongIM/WuKongIMAndroidSDK)
```
implementation 'com.github.WuKongIM:WuKongIMAndroidSDK:1.0.1'
implementation 'com.github.WuKongIM:WuKongIMAndroidSDK:1.0.2'
```
jitpack还需在主程序的`build.gradle`文件中添加:
@ -21,19 +26,49 @@ allprojects {
}
}
```
由于sdk内使用了sqlcipher加密数据库和curve25519加密算法需将库添加到项目中
```
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.**
-keep class com.xinbida.wukongim.**{*;}
#数据库加密
-keep,includedescriptorclasses class net.sqlcipher.** { *; }
-keep,includedescriptorclasses interface net.sqlcipher.** { *; }
#--------- 混淆dh curve25519-------
-keep class org.whispersystems.curve25519.**{*;}
-keep class org.whispersystems.** { *; }
-keep class org.thoughtcrime.securesms.** { *; }
```
**初始化sdk**
```
WKIM.getInstance().init(context, uid, token);
```
**初始化IP**
```
WKIM.getInstance().getConnectionManager().addOnGetIpAndPortListener(new IGetIpAndPort() {
@Override
public void getIP(IGetSocketIpAndPortListener iGetSocketIpAndPortListener) {
// 可请求接口后返回到sdk
iGetSocketIpAndPortListener.onGetSocketIpAndPort("xxx.xxx.xxx",6666);
}
});
```
**连接服务端**
```
WKIM.getInstance().getConnectionManager().connection();
```
**发消息**
```
WKIM.getInstance().getConnectionManager().sendMessage(new WKTextContent("我是文本消息"), channelID, channelType);
@ -84,6 +119,3 @@ WKIM.getInstance().getCMDManager().addCmdListener("listener_key", new ICMDListen
}
});
```
## [详细文档信息点击这里](http://githubim.com "文档")

View File

@ -8,6 +8,6 @@
<versions>
<version>1.0.1</version>
</versions>
<lastUpdated>20230619101429</lastUpdated>
<lastUpdated>20230620112658</lastUpdated>
</versioning>
</metadata>

View File

@ -1 +1 @@
0b8c0fccab1fa9b8d5ea4208275b3e0a
68684efbe4367ca3e93e9e2de3b4bbe6

View File

@ -1 +1 @@
77cd7adf77b6e7834245e0313c1b623742ea8061
204705418f2c471bd0cc45d0c1ed7aac895e0473

View File

@ -1 +1 @@
c8b4564b86ca8a9dd5055e53fa89444023a21c194a03422440129089c1a5c075
423550f9f280d46f4dcfe91d2d1700d51221f95b141e3b0c24d5d6dc69242450

View File

@ -1 +1 @@
9304a6dddf512c7d08c918ea7d6f68685ae992329d3aa33a8016f8627a0bdceee9edd868d15999a0a98d6d263c0259fd26c911d9366d92ce51da65ff763e4ac2
59c51a68cbd57fa15cad20c4443378061195145dfb48aa343450fa3c05239bfcd08d3f479b1000bef3aaa622ee53f9672a60462d569dfd824e42199d38cc07cf

View File

@ -41,6 +41,12 @@
-keepclassmembers class com.xinbida.wukongim.db.WKDBHelper$DatabaseHelper {
public *;
}
#--------- 混淆dh curve25519-------
-keep class org.whispersystems.curve25519.**{*;}
-keep class org.whispersystems.** { *; }
-keep class org.thoughtcrime.securesms.** { *; }
# sqlcipher
-keep,includedescriptorclasses class net.sqlcipher.** { *; }
-keep,includedescriptorclasses interface net.sqlcipher.** { *; }