mirror of
https://gitee.com/farsunset/cim.git
synced 2025-07-26 01:31:46 +08:00
修改6.0动态权限的问题,重新实现deviceId
This commit is contained in:
parent
26719c70e8
commit
13805095b5
@ -1 +1 @@
|
||||
3.4.0
|
||||
3.1.0
|
@ -1,7 +1,7 @@
|
||||
### 说明:
|
||||
此开源版本为基础功能版本,只有消息推送的基础功能!netty版本,和mina版本结构和功能完全一致,大家可以选择自己喜欢的或者合适的版本学习或者使用!
|
||||
|
||||
### 侣信专业版2.4.0版本发布
|
||||
### 侣信专业版2.3.0版本发布
|
||||
### [http://farsunset.com](http://farsunset.com)
|
||||
|
||||
|
||||
|
@ -5,6 +5,6 @@
|
||||
<classpathentry kind="lib" path="libs/log4j-1.2.17.jar"/>
|
||||
<classpathentry kind="lib" path="libs/mina-core-2.0.16.jar"/>
|
||||
<classpathentry kind="lib" path="libs/protobuf-java-3.2.0.jar"/>
|
||||
<classpathentry kind="lib" path="D:/devtools/dev/android-sdk-windows/platforms/android-21/android.jar"/>
|
||||
<classpathentry kind="lib" path="D:/devtools/android-sdk-windows/platforms/android-22/android.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
@ -33,6 +33,8 @@ class CIMCacheManager {
|
||||
|
||||
public static final String KEY_ACCOUNT = "KEY_ACCOUNT";
|
||||
|
||||
public static final String KEY_DEVICE_ID = "KEY_DEVICE_ID";
|
||||
|
||||
public static final String KEY_MANUAL_STOP = "KEY_MANUAL_STOP";
|
||||
|
||||
public static final String KEY_CIM_DESTROYED = "KEY_CIM_DESTROYED";
|
||||
|
@ -26,7 +26,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.farsunset.cim.sdk.android.constant.CIMConstant;
|
||||
import com.farsunset.cim.sdk.android.model.SentBody;
|
||||
@ -125,12 +125,16 @@ public class CIMPushManager {
|
||||
CIMCacheManager.putBoolean(context,CIMCacheManager.KEY_MANUAL_STOP, false);
|
||||
CIMCacheManager.putString(context,CIMCacheManager.KEY_ACCOUNT, account);
|
||||
|
||||
String imei = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
|
||||
imei += context.getPackageName();
|
||||
String deviceId = CIMCacheManager.getString(context,CIMCacheManager.KEY_DEVICE_ID);
|
||||
if(TextUtils.isEmpty(deviceId)) {
|
||||
deviceId = UUID.randomUUID().toString().replaceAll("-", "");
|
||||
CIMCacheManager.putString(context,CIMCacheManager.KEY_DEVICE_ID, deviceId);
|
||||
}
|
||||
|
||||
SentBody sent = new SentBody();
|
||||
sent.setKey(CIMConstant.RequestKey.CLIENT_BIND);
|
||||
sent.put("account", account);
|
||||
sent.put("deviceId",UUID.nameUUIDFromBytes(imei.getBytes()).toString().replaceAll("-", ""));
|
||||
sent.put("deviceId",deviceId);
|
||||
sent.put("channel", "android");
|
||||
sent.put("device",android.os.Build.MODEL);
|
||||
sent.put("version",getVersionName(context));
|
||||
|
Binary file not shown.
@ -11,7 +11,7 @@
|
||||
<li style="height: 50px; text-align: center; margin-top: 10px;">
|
||||
<div class="btn-group" style="margin-top: 5px;">
|
||||
<a type="button" class="btn btn-danger" target="_blank"
|
||||
href="javascript:openWebclient();">Web CIM</a>
|
||||
href="javascript:openWebclient();">CIM for Web</a>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
@ -33,6 +33,8 @@ class CIMCacheManager {
|
||||
|
||||
public static final String KEY_ACCOUNT = "KEY_ACCOUNT";
|
||||
|
||||
public static final String KEY_DEVICE_ID = "KEY_DEVICE_ID";
|
||||
|
||||
public static final String KEY_MANUAL_STOP = "KEY_MANUAL_STOP";
|
||||
|
||||
public static final String KEY_CIM_DESTROYED = "KEY_CIM_DESTROYED";
|
||||
|
@ -201,9 +201,6 @@ class CIMConnectorManager extends SimpleChannelInboundHandler<Object> {
|
||||
loopGroup.shutdownGracefully();
|
||||
}
|
||||
|
||||
|
||||
CIMCacheToolkit.destroy();
|
||||
|
||||
manager = null;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.farsunset.cim.sdk.android.constant.CIMConstant;
|
||||
import com.farsunset.cim.sdk.android.model.SentBody;
|
||||
@ -125,12 +125,16 @@ public class CIMPushManager {
|
||||
CIMCacheManager.putBoolean(context,CIMCacheManager.KEY_MANUAL_STOP, false);
|
||||
CIMCacheManager.putString(context,CIMCacheManager.KEY_ACCOUNT, account);
|
||||
|
||||
String imei = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
|
||||
imei += context.getPackageName();
|
||||
String deviceId = CIMCacheManager.getString(context,CIMCacheManager.KEY_DEVICE_ID);
|
||||
if(TextUtils.isEmpty(deviceId)) {
|
||||
deviceId = UUID.randomUUID().toString().replaceAll("-", "");
|
||||
CIMCacheManager.putString(context,CIMCacheManager.KEY_DEVICE_ID, deviceId);
|
||||
}
|
||||
|
||||
SentBody sent = new SentBody();
|
||||
sent.setKey(CIMConstant.RequestKey.CLIENT_BIND);
|
||||
sent.put("account", account);
|
||||
sent.put("deviceId",UUID.nameUUIDFromBytes(imei.getBytes()).toString().replaceAll("-", ""));
|
||||
sent.put("deviceId",deviceId);
|
||||
sent.put("channel", "android");
|
||||
sent.put("device",android.os.Build.MODEL);
|
||||
sent.put("version",getVersionName(context));
|
||||
|
Binary file not shown.
@ -11,7 +11,7 @@
|
||||
<li style="height: 50px; text-align: center; margin-top: 10px;">
|
||||
<div class="btn-group" style="margin-top: 5px;">
|
||||
<a type="button" class="btn btn-danger" target="_blank"
|
||||
href="javascript:openWebclient();">Web CIM</a>
|
||||
href="javascript:openWebclient();">CIM for Web</a>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
BIN
doc/CIM客户端文档.doc
Normal file
BIN
doc/CIM客户端文档.doc
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user