fix:Delete unknown message format

This commit is contained in:
SL 2024-08-29 15:56:05 +08:00
parent 564727d44f
commit fda3423353
3 changed files with 8 additions and 26 deletions

View File

@ -34,8 +34,8 @@ android {
buildTypes { buildTypes {
release { release {
zipAlignEnabled true zipAlignEnabled false
minifyEnabled true minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
} }
@ -52,7 +52,7 @@ dependencies {
api files('libs/xSocket-2.8.15.jar') api files('libs/xSocket-2.8.15.jar')
implementation 'com.android.support:multidex:1.0.3' implementation 'com.android.support:multidex:1.0.3'
implementation "net.zetetic:android-database-sqlcipher:4.5.3" implementation "net.zetetic:android-database-sqlcipher:4.5.3"
implementation "androidx.sqlite:sqlite:2.3.1" implementation "androidx.sqlite:sqlite-ktx:2.4.0"
implementation 'org.whispersystems:curve25519-android:0.5.0' implementation 'org.whispersystems:curve25519-android:0.5.0'
implementation 'org.whispersystems:signal-protocol-android:2.8.1' implementation 'org.whispersystems:signal-protocol-android:2.8.1'
} }

View File

@ -1,7 +1,6 @@
package com.xinbida.wukongim.manager; package com.xinbida.wukongim.manager;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
@ -43,8 +42,6 @@ import com.xinbida.wukongim.interfaces.IUploadAttachmentListener;
import com.xinbida.wukongim.interfaces.IUploadMsgExtraListener; import com.xinbida.wukongim.interfaces.IUploadMsgExtraListener;
import com.xinbida.wukongim.message.MessageHandler; import com.xinbida.wukongim.message.MessageHandler;
import com.xinbida.wukongim.message.WKConnection; import com.xinbida.wukongim.message.WKConnection;
import com.xinbida.wukongim.message.WKRead;
import com.xinbida.wukongim.message.type.WKMsgContentType;
import com.xinbida.wukongim.message.type.WKSendMsgResult; import com.xinbida.wukongim.message.type.WKSendMsgResult;
import com.xinbida.wukongim.msgmodel.WKFormatErrorContent; import com.xinbida.wukongim.msgmodel.WKFormatErrorContent;
import com.xinbida.wukongim.msgmodel.WKImageContent; import com.xinbida.wukongim.msgmodel.WKImageContent;
@ -52,7 +49,6 @@ import com.xinbida.wukongim.msgmodel.WKMessageContent;
import com.xinbida.wukongim.msgmodel.WKMsgEntity; import com.xinbida.wukongim.msgmodel.WKMsgEntity;
import com.xinbida.wukongim.msgmodel.WKReply; import com.xinbida.wukongim.msgmodel.WKReply;
import com.xinbida.wukongim.msgmodel.WKTextContent; import com.xinbida.wukongim.msgmodel.WKTextContent;
import com.xinbida.wukongim.msgmodel.WKUnknownContent;
import com.xinbida.wukongim.msgmodel.WKVideoContent; import com.xinbida.wukongim.msgmodel.WKVideoContent;
import com.xinbida.wukongim.msgmodel.WKVoiceContent; import com.xinbida.wukongim.msgmodel.WKVoiceContent;
import com.xinbida.wukongim.utils.DateUtils; import com.xinbida.wukongim.utils.DateUtils;
@ -183,7 +179,7 @@ public class MsgManager extends BaseManager {
if (jsonObject == null) jsonObject = new JSONObject(); if (jsonObject == null) jsonObject = new JSONObject();
WKMessageContent baseContentMsgModel = getContentMsgModel(contentType, jsonObject); WKMessageContent baseContentMsgModel = getContentMsgModel(contentType, jsonObject);
if (baseContentMsgModel == null){ if (baseContentMsgModel == null){
baseContentMsgModel = new WKUnknownContent(); baseContentMsgModel = new WKMessageContent();
} }
//解析@成员列表 //解析@成员列表
if (jsonObject.has("mention")) { if (jsonObject.has("mention")) {
@ -270,7 +266,7 @@ public class MsgManager extends BaseManager {
} catch (IllegalAccessException | InstantiationException | NoSuchMethodException | } catch (IllegalAccessException | InstantiationException | NoSuchMethodException |
InvocationTargetException e) { InvocationTargetException e) {
WKLoggerUtils.getInstance().e(TAG, "getContentMsgModel error" + e.getLocalizedMessage()); WKLoggerUtils.getInstance().e(TAG, "getContentMsgModel error" + e.getLocalizedMessage());
return new WKUnknownContent(); return null;
} }
} }
try { try {
@ -280,9 +276,9 @@ public class MsgManager extends BaseManager {
} }
} catch (IllegalAccessException | InstantiationException e) { } catch (IllegalAccessException | InstantiationException e) {
WKLoggerUtils.getInstance().e(TAG, "getContentMsgModel decodeMsg error"); WKLoggerUtils.getInstance().e(TAG, "getContentMsgModel decodeMsg error");
return new WKUnknownContent(); return null;
} }
return new WKUnknownContent(); return null;
} }
private long getOrNearbyMsgSeq(long orderSeq) { private long getOrNearbyMsgSeq(long orderSeq) {

View File

@ -1,14 +0,0 @@
package com.xinbida.wukongim.msgmodel;
import com.xinbida.wukongim.message.type.WKMsgContentType;
public class WKUnknownContent extends WKMessageContent{
public WKUnknownContent(){
this.type = WKMsgContentType.WK_CONTENT_FORMAT_ERROR;
}
@Override
public String getDisplayContent() {
return "[未知消息]";
}
}