mirror of
https://github.com/WuKongIM/WuKongIMAndroidSDK
synced 2025-06-06 17:50:53 +00:00
fix:新增设置设备方法
This commit is contained in:
parent
ea8c1f0443
commit
ce1086b471
1
.idea/inspectionProfiles/Project_Default.xml
generated
1
.idea/inspectionProfiles/Project_Default.xml
generated
@ -1,6 +1,7 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
<component name="InspectionProjectProfileManager">
|
||||||
<profile version="1.0">
|
<profile version="1.0">
|
||||||
<option name="myName" value="Project Default" />
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="AndroidLintUnsafeImplicitIntentLaunch" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||||
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
|
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,com.wukong.im.db.WKDBHelper,rawQuery" />
|
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,com.wukong.im.db.WKDBHelper,rawQuery" />
|
||||||
</inspection_tool>
|
</inspection_tool>
|
||||||
|
@ -18,7 +18,7 @@ import com.xinbida.wukongim.utils.CryptoUtils;
|
|||||||
* 5/20/21 5:25 PM
|
* 5/20/21 5:25 PM
|
||||||
*/
|
*/
|
||||||
public class WKIM {
|
public class WKIM {
|
||||||
private final String Version = "V1.2.3";
|
private final String Version = "V1.3.3";
|
||||||
|
|
||||||
private WKIM() {
|
private WKIM() {
|
||||||
|
|
||||||
@ -34,6 +34,7 @@ public class WKIM {
|
|||||||
|
|
||||||
private boolean isDebug = false;
|
private boolean isDebug = false;
|
||||||
private boolean isWriteLog = false;
|
private boolean isWriteLog = false;
|
||||||
|
private String deviceId = "";
|
||||||
|
|
||||||
public boolean isDebug() {
|
public boolean isDebug() {
|
||||||
return isDebug;
|
return isDebug;
|
||||||
@ -43,6 +44,10 @@ public class WKIM {
|
|||||||
return isWriteLog;
|
return isWriteLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDeviceID(){
|
||||||
|
return deviceId;
|
||||||
|
}
|
||||||
|
|
||||||
public void setWriteLog(boolean isWriteLog) {
|
public void setWriteLog(boolean isWriteLog) {
|
||||||
this.isWriteLog = isWriteLog;
|
this.isWriteLog = isWriteLog;
|
||||||
}
|
}
|
||||||
@ -60,7 +65,9 @@ public class WKIM {
|
|||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
return Version;
|
return Version;
|
||||||
}
|
}
|
||||||
|
public void setDeviceId(String deviceID){
|
||||||
|
this.deviceId = deviceID;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 初始化IM
|
* 初始化IM
|
||||||
*
|
*
|
||||||
|
@ -1330,6 +1330,11 @@ public class MsgManager extends BaseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String createClientMsgNO() {
|
public String createClientMsgNO() {
|
||||||
return UUID.randomUUID().toString().replaceAll("-", "") + "1";
|
String deviceId = WKIM.getInstance().getDeviceID();
|
||||||
|
if (TextUtils.isEmpty(deviceId)) {
|
||||||
|
deviceId = "unknown";
|
||||||
|
}
|
||||||
|
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
|
||||||
|
return uuid + "_" + deviceId + "_1";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user