1.服务端springboot升级2.1.4,protobuf升级3.7.0

2.android sdk升级,适配android8.0+,修复一些之前的兼容性问题
This commit is contained in:
远方夕阳 2019-04-17 17:42:53 +08:00
parent 3f3d7e95e9
commit 0cd80d9d83
223 changed files with 9474 additions and 9113 deletions

View File

@ -43,6 +43,15 @@ CIM是基于mina和netty框架下的推送系统我们平常使用第三方
2.全面重写websocket的实现全面拥抱protobuf替换json序列化方式更加高效 2.全面重写websocket的实现全面拥抱protobuf替换json序列化方式更加高效
-------------------------------------------------------------------------------------------
版本:3.6.0/时间:2019-04-17
1.服务端springboot升级2.1.4,protobuf升级3.7.0
2.android sdk升级适配android8.0+,修复一些之前的兼容性问题

View File

@ -4,7 +4,7 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="libs/log4j-1.2.17.jar"/> <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/mina-core-2.0.16.jar"/>
<classpathentry kind="lib" path="libs/protobuf-java-3.2.0.jar"/> <classpathentry kind="lib" path="C:/Program Files/Android/android-sdk-windows/platforms/android-26/android.jar"/>
<classpathentry kind="lib" path="C:/Program Files/Android/android-sdk-windows/platforms/android-24/android.jar"/> <classpathentry kind="lib" path="libs/protobuf-java-3.7.0.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

View File

@ -45,9 +45,12 @@ class CIMCacheManager {
public static final String KEY_CIM_CONNECTION_STATE = "KEY_CIM_CONNECTION_STATE"; public static final String KEY_CIM_CONNECTION_STATE = "KEY_CIM_CONNECTION_STATE";
public static final String CONTENT_URI = "content://%s.cim.provider";
public static void remove(Context context, String key) { public static void remove(Context context, String key) {
ContentResolver resolver = context.getContentResolver(); ContentResolver resolver = context.getContentResolver();
resolver.delete(Uri.parse(CIMCacheProvider.CONTENT_URI), key, null); resolver.delete(Uri.parse(String.format(CONTENT_URI,context.getPackageName())), key, null);
} }
public static void putString(Context context, String key, String value) { public static void putString(Context context, String key, String value) {
@ -56,14 +59,14 @@ class CIMCacheManager {
ContentValues values = new ContentValues(); ContentValues values = new ContentValues();
values.put("value", value); values.put("value", value);
values.put("key", key); values.put("key", key);
resolver.insert(Uri.parse(CIMCacheProvider.CONTENT_URI), values); resolver.insert(Uri.parse(String.format(CONTENT_URI,context.getPackageName())), values);
} }
public static String getString(Context context, String key) { public static String getString(Context context, String key) {
String value = null; String value = null;
ContentResolver resolver = context.getContentResolver(); ContentResolver resolver = context.getContentResolver();
Cursor cursor = resolver.query(Uri.parse(CIMCacheProvider.CONTENT_URI), new String[] { key }, null, null, null); Cursor cursor = resolver.query(Uri.parse(String.format(CONTENT_URI,context.getPackageName())), new String[] { key }, null, null, null);
if (cursor != null && cursor.moveToFirst()) { if (cursor != null && cursor.moveToFirst()) {
value = cursor.getString(0); value = cursor.getString(0);
cursor.close(); cursor.close();

View File

@ -29,7 +29,6 @@ import android.database.MatrixCursor;
import android.net.Uri; import android.net.Uri;
public class CIMCacheProvider extends ContentProvider { public class CIMCacheProvider extends ContentProvider {
public static final String CONTENT_URI = "content://com.farsunset.cim.provider";
static final String MODEL_KEY = "PRIVATE_CIM_CONFIG"; static final String MODEL_KEY = "PRIVATE_CIM_CONFIG";
@Override @Override

View File

@ -32,6 +32,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.net.NetworkInfo; import android.net.NetworkInfo;
import android.os.Build;
/** /**
* 消息入口所有消息都会经过这里 * 消息入口所有消息都会经过这里
@ -125,11 +126,18 @@ public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver {
} }
private void startPushService() { private void startPushService() {
Intent intent = new Intent(context, CIMPushService.class); Intent intent = new Intent(context, CIMPushService.class);
intent.setAction(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE); intent.setAction(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(intent);
} else {
context.startService(intent); context.startService(intent);
} }
}
private void onInnerConnectionClosed() { private void onInnerConnectionClosed() {
CIMCacheManager.putBoolean(context, CIMCacheManager.KEY_CIM_CONNECTION_STATE, false); CIMCacheManager.putBoolean(context, CIMCacheManager.KEY_CIM_CONNECTION_STATE, false);
if (CIMConnectorManager.isNetworkConnected(context)) { if (CIMConnectorManager.isNetworkConnected(context)) {

View File

@ -27,6 +27,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Build;
import android.text.TextUtils; import android.text.TextUtils;
import com.farsunset.cim.sdk.android.constant.CIMConstant; import com.farsunset.cim.sdk.android.constant.CIMConstant;
@ -83,15 +84,14 @@ public class CIMPushManager {
serviceIntent.putExtra(CIMCacheManager.KEY_CIM_SERVIER_PORT, port); serviceIntent.putExtra(CIMCacheManager.KEY_CIM_SERVIER_PORT, port);
serviceIntent.putExtra(CIMPushService.KEY_DELAYED_TIME, delayedTime); serviceIntent.putExtra(CIMPushService.KEY_DELAYED_TIME, delayedTime);
serviceIntent.setAction(ACTION_CREATE_CIM_CONNECTION); serviceIntent.setAction(ACTION_CREATE_CIM_CONNECTION);
context.startService(serviceIntent); startServiceCompat(context,serviceIntent);
} }
public static void setLoggerEnable(Context context,boolean enable) { public static void setLoggerEnable(Context context,boolean enable) {
Intent serviceIntent = new Intent(context, CIMPushService.class); Intent serviceIntent = new Intent(context, CIMPushService.class);
serviceIntent.putExtra(CIMPushService.KEY_LOGGER_ENABLE, enable); serviceIntent.putExtra(CIMPushService.KEY_LOGGER_ENABLE, enable);
serviceIntent.setAction(ACTION_SET_LOGGER_EANABLE); serviceIntent.setAction(ACTION_SET_LOGGER_EANABLE);
context.startService(serviceIntent); startServiceCompat(context,serviceIntent);
} }
protected static void connect(Context context, long delayedTime) { protected static void connect(Context context, long delayedTime) {
@ -181,7 +181,7 @@ public class CIMPushManager {
Intent serviceIntent = new Intent(context, CIMPushService.class); Intent serviceIntent = new Intent(context, CIMPushService.class);
serviceIntent.putExtra(KEY_SEND_BODY, body); serviceIntent.putExtra(KEY_SEND_BODY, body);
serviceIntent.setAction(ACTION_SEND_REQUEST_BODY); serviceIntent.setAction(ACTION_SEND_REQUEST_BODY);
context.startService(serviceIntent); startServiceCompat(context,serviceIntent);
} }
@ -201,7 +201,7 @@ public class CIMPushManager {
Intent serviceIntent = new Intent(context, CIMPushService.class); Intent serviceIntent = new Intent(context, CIMPushService.class);
serviceIntent.setAction(ACTION_CLOSE_CIM_CONNECTION); serviceIntent.setAction(ACTION_CLOSE_CIM_CONNECTION);
context.startService(serviceIntent); startServiceCompat(context,serviceIntent);
} }
@ -217,7 +217,7 @@ public class CIMPushManager {
Intent serviceIntent = new Intent(context, CIMPushService.class); Intent serviceIntent = new Intent(context, CIMPushService.class);
serviceIntent.setAction(ACTION_DESTORY); serviceIntent.setAction(ACTION_DESTORY);
context.startService(serviceIntent); startServiceCompat(context,serviceIntent);
} }
@ -250,4 +250,12 @@ public class CIMPushManager {
return versionName; return versionName;
} }
private static void startServiceCompat(Context context,Intent intent) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(intent);
} else {
context.startService(intent);
}
}
} }

View File

@ -21,12 +21,19 @@
*/ */
package com.farsunset.cim.sdk.android; package com.farsunset.cim.sdk.android;
import android.app.Notification;
import android.app.Service; import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.os.IBinder; import android.os.IBinder;
import android.os.Message; import android.os.Message;
import java.util.concurrent.Semaphore;
import com.farsunset.cim.sdk.android.filter.CIMLoggingFilter; import com.farsunset.cim.sdk.android.filter.CIMLoggingFilter;
import com.farsunset.cim.sdk.android.model.SentBody; import com.farsunset.cim.sdk.android.model.SentBody;
@ -41,46 +48,42 @@ public class CIMPushService extends Service {
public final static String KEY_LOGGER_ENABLE = "KEY_LOGGER_ENABLE"; public final static String KEY_LOGGER_ENABLE = "KEY_LOGGER_ENABLE";
private CIMConnectorManager manager; private CIMConnectorManager manager;
private KeepAliveBroadcastReceiver keepAliveReceiver;
private Semaphore semaphore = new Semaphore(1,true);
@Override @Override
public void onCreate() { public void onCreate() {
manager = CIMConnectorManager.getManager(this.getApplicationContext()); manager = CIMConnectorManager.getManager(this.getApplicationContext());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
keepAliveReceiver = new KeepAliveBroadcastReceiver();
registerReceiver(keepAliveReceiver, keepAliveReceiver.getIntentFilter());
}
} }
Handler connectionHandler = new Handler() { Handler connectionHandler = new Handler() {
@Override @Override
public void handleMessage(android.os.Message message) { public void handleMessage(android.os.Message message) {
connectionHandler.removeMessages(0);
String host = message.getData().getString(CIMCacheManager.KEY_CIM_SERVIER_HOST); String host = message.getData().getString(CIMCacheManager.KEY_CIM_SERVIER_HOST);
int port = message.getData().getInt(CIMCacheManager.KEY_CIM_SERVIER_PORT, 0); int port = message.getData().getInt(CIMCacheManager.KEY_CIM_SERVIER_PORT, 0);
manager.connect(host, port); manager.connect(host, port);
semaphore.release();
} }
}; };
@Override @Override
public int onStartCommand(Intent intent, int flags, int startId) { public int onStartCommand(Intent intent, int flags, int startId) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForeground(this.hashCode(), new Notification.Builder(this,null).build());
}
intent = (intent == null ? new Intent(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE) : intent); intent = (intent == null ? new Intent(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE) : intent);
String action = intent.getAction(); String action = intent.getAction();
if (CIMPushManager.ACTION_CREATE_CIM_CONNECTION.equals(action)) { if (CIMPushManager.ACTION_CREATE_CIM_CONNECTION.equals(action)) {
handleConnection(intent);
long delayMillis = intent.getLongExtra(KEY_DELAYED_TIME, 0);
if (delayMillis > 0) {
Message msg = connectionHandler.obtainMessage();
msg.what = 0;
msg.setData(intent.getExtras());
connectionHandler.sendMessageDelayed(msg, delayMillis);
} else {
String host = intent.getStringExtra(CIMCacheManager.KEY_CIM_SERVIER_HOST);
int port = intent.getIntExtra(CIMCacheManager.KEY_CIM_SERVIER_PORT, 0);
manager.connect(host, port);
}
} }
if (CIMPushManager.ACTION_SEND_REQUEST_BODY.equals(action)) { if (CIMPushManager.ACTION_SEND_REQUEST_BODY.equals(action)) {
@ -97,7 +100,51 @@ public class CIMPushService extends Service {
} }
if (CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE.equals(action)) { if (CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE.equals(action)) {
if (!manager.isConnected()) { handleKeepAlive();
}
if (CIMPushManager.ACTION_SET_LOGGER_EANABLE.equals(action)) {
boolean enable = intent.getBooleanExtra(KEY_LOGGER_ENABLE, true);
CIMLoggingFilter.getLogger().debugMode(enable);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
stopForeground(true);
}
return super.onStartCommand(intent, flags, startId);
}
private void handleConnection(Intent intent) {
long delayMillis = intent.getLongExtra(KEY_DELAYED_TIME, 0);
if (delayMillis <= 0) {
String host = intent.getStringExtra(CIMCacheManager.KEY_CIM_SERVIER_HOST);
int port = intent.getIntExtra(CIMCacheManager.KEY_CIM_SERVIER_PORT, 0);
manager.connect(host, port);
return;
}
if(!semaphore.tryAcquire()) {
return;
}
Message msg = connectionHandler.obtainMessage();
msg.what = 0;
msg.setData(intent.getExtras());
connectionHandler.sendMessageDelayed(msg, delayMillis);
}
private void handleKeepAlive() {
if (manager.isConnected()) {
CIMLoggingFilter.getLogger().connectState(true);
return;
}
boolean isManualStop = CIMCacheManager.getBoolean(getApplicationContext(),CIMCacheManager.KEY_MANUAL_STOP); boolean isManualStop = CIMCacheManager.getBoolean(getApplicationContext(),CIMCacheManager.KEY_MANUAL_STOP);
boolean isDestroyed = CIMCacheManager.getBoolean(getApplicationContext(),CIMCacheManager.KEY_CIM_DESTROYED); boolean isDestroyed = CIMCacheManager.getBoolean(getApplicationContext(),CIMCacheManager.KEY_CIM_DESTROYED);
@ -106,18 +153,6 @@ public class CIMPushService extends Service {
CIMPushManager.connect(this, 0); CIMPushManager.connect(this, 0);
} else {
CIMLoggingFilter.getLogger().connectState(true);
}
}
if (CIMPushManager.ACTION_SET_LOGGER_EANABLE.equals(action)) {
boolean enable = intent.getBooleanExtra(KEY_LOGGER_ENABLE, true);
CIMLoggingFilter.getLogger().debugMode(enable);
}
return START_STICKY;
} }
@Override @Override
@ -125,4 +160,31 @@ public class CIMPushService extends Service {
return null; return null;
} }
@Override
public void onDestroy() {
super.onDestroy();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
unregisterReceiver(keepAliveReceiver);
}
}
public class KeepAliveBroadcastReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context arg0, Intent arg1) {
handleKeepAlive();
}
public IntentFilter getIntentFilter() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Intent.ACTION_POWER_CONNECTED);
intentFilter.addAction(Intent.ACTION_POWER_DISCONNECTED);
intentFilter.addAction(Intent.ACTION_SCREEN_ON);
intentFilter.addAction(Intent.ACTION_USER_PRESENT);
return intentFilter;
}
}
} }

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -15,6 +15,11 @@
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>

View File

@ -0,0 +1,2 @@
boot.validation.initialized=true
eclipse.preferences.version=1

View File

@ -3,7 +3,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.4.RELEASE") classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.4.RELEASE")
} }
} }
@ -18,34 +18,15 @@ jar {
repositories { repositories {
jcenter() jcenter()
maven {
url 'https://repo.spring.io/libs-milestone'
} }
}
configurations {
//all*.exclude group: 'com.fasterxml.jackson.core' , module: 'jackson-databind'
all*.exclude group: 'com.fasterxml.jackson.datatype'
all*.exclude group: 'com.fasterxml.jackson.module'
all*.exclude group: 'org.yaml'
all*.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
all*.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-jdbc'
all*.exclude group: 'org.apache.tomcat'
all*.exclude group: 'io.undertow', module: 'undertow-websockets-jsr'
all*.exclude group: 'org.jboss.spec.javax.websocket'
all*.exclude group: 'org.jboss.spec.javax.transaction'
all*.exclude group: 'org.glassfish'
}
dependencies { dependencies {
compile fileTree(dir: 'libs', include: '*.jar') compile fileTree(dir: 'libs', include: '*.jar')
compile 'org.springframework.boot:spring-boot-starter-web:2.0.4.RELEASE' compile 'org.springframework.boot:spring-boot-starter-web:2.1.4.RELEASE'
compile 'org.springframework.boot:spring-boot-starter-undertow:2.0.4.RELEASE' compile 'org.springframework.boot:spring-boot-starter-freemarker:2.1.4.RELEASE'
compile 'org.springframework.boot:spring-boot-starter-freemarker:2.0.4.RELEASE' compile 'com.google.protobuf:protobuf-java:3.7.0'
compile 'com.google.protobuf:protobuf-java:3.6.0'
compile 'com.google.code.gson:gson:2.8.5' compile 'com.google.code.gson:gson:2.8.5'
compile 'org.apache.mina:mina-core:2.0.19' compile 'org.apache.mina:mina-core:2.0.20'
compile 'commons-io:commons-io:2.6' compile 'commons-io:commons-io:2.6'
compile 'org.apache.commons:commons-lang3:3.5' compile 'org.apache.commons:commons-lang3:3.5'
compile 'com.squareup.okhttp3:okhttp:3.10.0' compile 'com.squareup.okhttp3:okhttp:3.10.0'

View File

@ -4,9 +4,10 @@ import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -22,23 +23,27 @@ public class CIMConfig implements CIMRequestHandler {
@Value("${cim.server.port}") @Value("${cim.server.port}")
private int port; private int port;
@Autowired @Resource
private BindHandler bindHandler; private BindHandler bindHandler;
@Autowired
@Resource
private SessionClosedHandler closedHandler; private SessionClosedHandler closedHandler;
private HashMap<String,CIMRequestHandler> appHandlerMap = new HashMap<>(); @Resource
private ApplicationContext applicationContext;
private HashMap<String,Class<? extends CIMRequestHandler>> appHandlerMap = new HashMap<>();
@PostConstruct @PostConstruct
private void initHandler() { private void initHandler() {
/* /*
* 账号绑定handler * 账号绑定handler
*/ */
appHandlerMap.put("client_bind", bindHandler); appHandlerMap.put("client_bind", BindHandler.class);
/* /*
* 连接关闭handler * 连接关闭handler
*/ */
appHandlerMap.put("client_closed", closedHandler); appHandlerMap.put("client_closed", SessionClosedHandler.class);
} }
@Bean @Bean
@ -53,7 +58,7 @@ public class CIMConfig implements CIMRequestHandler {
@Override @Override
public void process(CIMSession session, SentBody body) { public void process(CIMSession session, SentBody body) {
CIMRequestHandler handler = appHandlerMap.get(body.getKey()); CIMRequestHandler handler = findHandlerByKey(body.getKey());
if(handler == null) {return ;} if(handler == null) {return ;}
@ -61,4 +66,13 @@ public class CIMConfig implements CIMRequestHandler {
} }
private CIMRequestHandler findHandlerByKey(String key){
Class<? extends CIMRequestHandler> handlerClass = appHandlerMap.get(key);
if (handlerClass==null){
return null;
}
return applicationContext.getBean(handlerClass);
}
} }

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2033 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -21,7 +21,8 @@
*/ */
package com.farsunset.cim.admin.controller; package com.farsunset.cim.admin.controller;
import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.Resource;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -31,7 +32,7 @@ import com.farsunset.cim.service.impl.CIMSessionServiceImpl;
@RequestMapping("/console/session") @RequestMapping("/console/session")
public class SessionController { public class SessionController {
@Autowired @Resource
private CIMSessionServiceImpl sessionManager; private CIMSessionServiceImpl sessionManager;
@RequestMapping(value = "/list.action") @RequestMapping(value = "/list.action")
@ -39,16 +40,4 @@ public class SessionController {
model.addAttribute("sessionList", sessionManager.queryAll()); model.addAttribute("sessionList", sessionManager.queryAll());
return "console/session/manage"; return "console/session/manage";
} }
/*public void offline() throws IOException {
String account = ServletActionContext.getRequest().getParameter("account");
Message msg = new Message();
msg.setAction(CIMConstant.MessageAction.ACTION_999);// 强行下线消息类型
msg.setReceiver(account);
// 向客户端 发送消息
ContextHolder.getBean(SystemMessagePusher.class).push(msg);
}*/
} }

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -21,7 +21,8 @@
*/ */
package com.farsunset.cim.api.controller; package com.farsunset.cim.api.controller;
import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -40,10 +41,10 @@ public class MessageController {
@Autowired @Resource
private SystemMessagePusher systemMessagePusher; private SystemMessagePusher systemMessagePusher;
@Autowired @Resource
private DefaultMessagePusher defaultMessagePusher; private DefaultMessagePusher defaultMessagePusher;

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2033 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2033 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -23,9 +23,10 @@ package com.farsunset.cim.handler;
import java.util.Objects; import java.util.Objects;
import javax.annotation.Resource;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -49,7 +50,7 @@ public class BindHandler implements CIMRequestHandler {
protected final Logger logger = LoggerFactory.getLogger(BindHandler.class); protected final Logger logger = LoggerFactory.getLogger(BindHandler.class);
@Autowired @Resource
private CIMSessionServiceImpl sessionManager; private CIMSessionServiceImpl sessionManager;
@Value("${server.host}") @Value("${server.host}")

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,9 +22,10 @@
package com.farsunset.cim.handler; package com.farsunset.cim.handler;
import javax.annotation.Resource;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.farsunset.cim.sdk.server.constant.CIMConstant; import com.farsunset.cim.sdk.server.constant.CIMConstant;
@ -44,7 +45,7 @@ public class SessionClosedHandler implements CIMRequestHandler {
protected final Logger logger = LoggerFactory.getLogger(SessionClosedHandler.class); protected final Logger logger = LoggerFactory.getLogger(SessionClosedHandler.class);
@Autowired @Resource
private CIMSessionServiceImpl sessionManager; private CIMSessionServiceImpl sessionManager;
public void process(CIMSession ios, SentBody message) { public void process(CIMSession ios, SentBody message) {

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -23,7 +23,8 @@ package com.farsunset.cim.push;
import java.util.Objects; import java.util.Objects;
import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -43,14 +44,14 @@ public class DefaultMessagePusher implements CIMMessagePusher {
@Value("${server.host}") @Value("${server.host}")
private String host; private String host;
@Autowired @Resource
private DefaultSessionManager sessionManager; private DefaultSessionManager sessionManager;
@Autowired @Resource
private MessageDispatcherImpl messageDispatcher; private MessageDispatcherImpl messageDispatcher;
@Autowired @Resource
private ApnsService apnsService; private ApnsService apnsService;

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2033 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2033 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2033 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2033 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2033 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

Binary file not shown.

View File

@ -3,15 +3,11 @@
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
<option name="distributionType" value="LOCAL" /> <compositeConfiguration>
<compositeBuild compositeDefinitionSource="SCRIPT" />
</compositeConfiguration>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="C:/Program Files/gradle-4.5" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" /> <option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings> </GradleProjectSettings>
</option> </option>

View File

@ -1,29 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="NullableNotNullManager"> <component name="CMakeSettings">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" /> <configurations>
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" /> <configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
<option name="myNullables"> </configurations>
<value>
<list size="5">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

View File

@ -1,12 +1,12 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion 25 compileSdkVersion 28
buildToolsVersion "25.0.2" buildToolsVersion "28.0.3"
defaultConfig { defaultConfig {
applicationId "com.farsunset.ichat.example" applicationId "com.farsunset.ichat.example"
minSdkVersion 14 minSdkVersion 14
targetSdkVersion 21 targetSdkVersion 26
versionCode 31 versionCode 31
versionName "3.1.0" versionName "3.1.0"
} }
@ -17,8 +17,6 @@ android {
} }
} }
lintOptions { lintOptions {
checkReleaseBuilds false checkReleaseBuilds false
abortOnError false abortOnError false
@ -26,10 +24,8 @@ android {
} }
dependencies { dependencies {
compile fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1' implementation 'com.android.support:appcompat-v7:28.0.0'
compile 'com.google.protobuf:protobuf-java:3.3.0' implementation 'com.google.protobuf:protobuf-java:3.7.0'
compile 'org.apache.mina:mina-core:2.0.16' implementation 'org.apache.mina:mina-core:2.0.20'
compile 'org.slf4j:slf4j-api:1.7.24'
compile 'org.slf4j:slf4j-nop:1.7.24'
} }

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.farsunset.ichat.example" package="com.farsunset.ichat.example">
>
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@ -47,11 +46,16 @@
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<!-- ****************************************CIM推送配置 begin*************************************** --> <!-- ****************************************CIM推送配置 begin*************************************** -->
<service android:name="com.farsunset.cim.sdk.android.CIMPushService" android:process=":cimpush" /> <service
<provider android:name="com.farsunset.cim.sdk.android.CIMCacheProvider" android:name="com.farsunset.cim.sdk.android.CIMPushService"
android:authorities="com.farsunset.cim.provider" android:process=":cimpush" />
<provider
android:name="com.farsunset.cim.sdk.android.CIMCacheProvider"
android:authorities="com.farsunset.ichat.example.cim.provider"
android:process=":cimpush" android:process=":cimpush"
android:exported="false" /> android:exported="false" />
<!-- android:authorities="${package}.cim.provider"-->
<!-- ****************************************CIM推送配置 end*************************************** --> <!-- ****************************************CIM推送配置 end*************************************** -->
<!--消息接受广播注册--> <!--消息接受广播注册-->

View File

@ -1,18 +1,18 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* * <p>
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* * <p>
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* * <p>
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* * <p>
* ************************************************************************************** * **************************************************************************************
* * * *
* Website : http://www.farsunset.com * * Website : http://www.farsunset.com *
@ -21,10 +21,10 @@
*/ */
package com.farsunset.ichat.example.adapter; package com.farsunset.ichat.example.adapter;
import java.util.Comparator;
import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.Message;
import java.util.Comparator;
public class MessageTimeDescComparator implements Comparator<Message> { public class MessageTimeDescComparator implements Comparator<Message> {
@Override @Override
@ -34,5 +34,4 @@ public class MessageTimeDescComparator implements Comparator<Message>{
} }
} }

View File

@ -1,18 +1,18 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* * <p>
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* * <p>
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* * <p>
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* * <p>
* ************************************************************************************** * **************************************************************************************
* * * *
* Website : http://www.farsunset.com * * Website : http://www.farsunset.com *
@ -21,9 +21,6 @@
*/ */
package com.farsunset.ichat.example.adapter; package com.farsunset.ichat.example.adapter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -31,10 +28,15 @@ import android.view.ViewGroup;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.Message;
import com.farsunset.ichat.example.R; import com.farsunset.ichat.example.R;
import com.farsunset.ichat.example.ui.SystemMessageActivity; import com.farsunset.ichat.example.ui.SystemMessageActivity;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
public class SystemMsgListViewAdapter extends BaseAdapter { public class SystemMsgListViewAdapter extends BaseAdapter {
@ -64,10 +66,10 @@ public class SystemMsgListViewAdapter extends BaseAdapter {
} }
@Override @Override
public void notifyDataSetChanged() public void notifyDataSetChanged() {
{
//Collections.sort(list, new MessageTimeDescComparator()); //Collections.sort(list, new MessageTimeDescComparator());
} }
@SuppressLint("ViewHolder") @SuppressLint("ViewHolder")
@Override @Override
public View getView(int position, View chatItemView, ViewGroup parent) { public View getView(int position, View chatItemView, ViewGroup parent) {
@ -94,8 +96,8 @@ public class SystemMsgListViewAdapter extends BaseAdapter {
public void setList(List<Message> list) { public void setList(List<Message> list) {
this.list = list; this.list = list;
} }
public static String getDateTimeString(long t)
{ public static String getDateTimeString(long t) {
SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
return sdf.format(new Date(t)); return sdf.format(new Date(t));
} }

View File

@ -1,18 +1,18 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* * <p>
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* * <p>
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* * <p>
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* * <p>
* ************************************************************************************** * **************************************************************************************
* * * *
* Website : http://www.farsunset.com * * Website : http://www.farsunset.com *
@ -22,28 +22,21 @@
package com.farsunset.ichat.example.app; package com.farsunset.ichat.example.app;
import android.app.Activity;
import android.net.NetworkInfo;
import android.os.Bundle;
import com.farsunset.cim.sdk.android.CIMEventListener; import com.farsunset.cim.sdk.android.CIMEventListener;
import com.farsunset.cim.sdk.android.CIMListenerManager; import com.farsunset.cim.sdk.android.CIMListenerManager;
import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.Message;
import com.farsunset.cim.sdk.android.model.ReplyBody; import com.farsunset.cim.sdk.android.model.ReplyBody;
import com.farsunset.cim.sdk.android.model.SentBody; import com.farsunset.cim.sdk.android.model.SentBody;
import android.app.Activity;
import android.net.NetworkInfo;
import android.os.Bundle;
public abstract class CIMMonitorActivity extends Activity implements CIMEventListener { public abstract class CIMMonitorActivity extends Activity implements CIMEventListener {
public void onCreate(Bundle savedInstanceState) {
CommonBaseControl commonBaseControl;
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
CIMListenerManager.registerMessageListener(this); CIMListenerManager.registerMessageListener(this);
commonBaseControl = new CommonBaseControl(this);
} }
@Override @Override
@ -59,36 +52,20 @@ public abstract class CIMMonitorActivity extends Activity implements CIMEven
CIMListenerManager.registerMessageListener(this); CIMListenerManager.registerMessageListener(this);
} }
@Override
public void showProgressDialog(String title,String content) public void onMessageReceived(Message arg0) {
{
commonBaseControl.showProgressDialog(title, content);
} }
public void hideProgressDialog()
{
commonBaseControl.hideProgressDialog();
}
public void showToask(String hint){
commonBaseControl.showToask(hint);
}
@Override @Override
public void onMessageReceived(Message arg0){}; public void onNetworkChanged(NetworkInfo info) {
}
@Override
public void onNetworkChanged(NetworkInfo info){}
/** /**
* 与服务端断开连接时回调,不要在里面做连接服务端的操作 * 与服务端断开连接时回调,不要在里面做连接服务端的操作
*/ */
@Override @Override
public void onConnectionClosed() {} public void onConnectionClosed() {
}
@Override @Override
public void onConnectionFailed() { public void onConnectionFailed() {
@ -105,11 +82,13 @@ public abstract class CIMMonitorActivity extends Activity implements CIMEven
*/ */
@Override @Override
public void onConnectionSuccessed(boolean arg0) {} public void onConnectionSuccessed(boolean arg0) {
}
@Override @Override
public void onReplyReceived(ReplyBody arg0) {} public void onReplyReceived(ReplyBody arg0) {
}
@Override @Override
public void onSentSuccessed(SentBody sentBody) { public void onSentSuccessed(SentBody sentBody) {

View File

@ -1,78 +0,0 @@
/**
* Copyright 2013-2023 Xia Jun(3979434@qq.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
***************************************************************************************
* *
* Website : http://www.farsunset.com *
* *
***************************************************************************************
*/
package com.farsunset.ichat.example.app;
import android.app.ProgressDialog;
import android.content.Context;
import android.widget.Toast;
public class CommonBaseControl {
private ProgressDialog progressDialog;
Context mMontent;
public CommonBaseControl(Context content)
{
this.mMontent = content;
}
public void showProgressDialog(String title,String message)
{
if(progressDialog==null)
{
progressDialog = ProgressDialog.show(mMontent, title, message, true, true);
}else if(progressDialog.isShowing())
{
progressDialog.setTitle(title);
progressDialog.setMessage(message);
}
progressDialog.show();
}
public void hideProgressDialog()
{
if(progressDialog!=null&&progressDialog.isShowing())
{
progressDialog.dismiss();
}
}
public void showToask(String hint){
Toast toast=Toast.makeText(mMontent,hint,Toast.LENGTH_SHORT);
toast.show();
}
}

View File

@ -1,18 +1,18 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* * <p>
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* * <p>
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* * <p>
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* * <p>
* ************************************************************************************** * **************************************************************************************
* * * *
* Website : http://www.farsunset.com * * Website : http://www.farsunset.com *
@ -24,30 +24,13 @@ package com.farsunset.ichat.example.app;
public interface Constant { public interface Constant {
//服务端IP地址 //服务端IP地址
public static final String CIM_SERVER_HOST = "192.168.1.106"; String CIM_SERVER_HOST = "192.168.50.80";
//注意这里的端口不是tomcat的端口CIM端口在服务端spring-cim.xml中配置的没改动就使用默认的23456
public static final int CIM_SERVER_PORT = 23456;
public static interface MessageType{
//用户之间的普通消息
public static final String TYPE_0 = "0";
//注意这里的端口不是tomcat的端口没改动就使用默认的23456
int CIM_SERVER_PORT = 23456;
interface MessageAction {
//下线类型 //下线类型
String TYPE_999 = "999"; String ACTION_999 = "999";
} }
public static interface MessageStatus{
//消息未读
public static final String STATUS_0 = "0";
//消息已经读取
public static final String STATUS_1 = "1";
}
} }

View File

@ -1,18 +1,18 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* * <p>
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* * <p>
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* * <p>
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* * <p>
* ************************************************************************************** * **************************************************************************************
* * * *
* Website : http://www.farsunset.com * * Website : http://www.farsunset.com *
@ -23,6 +23,7 @@ package com.farsunset.ichat.example.receiver;
import android.app.Notification; import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.Context; import android.content.Context;
@ -37,9 +38,6 @@ import com.farsunset.cim.sdk.android.model.ReplyBody;
import com.farsunset.ichat.example.R; import com.farsunset.ichat.example.R;
import com.farsunset.ichat.example.ui.SystemMessageActivity; import com.farsunset.ichat.example.ui.SystemMessageActivity;
import static android.R.id.message;
import static com.farsunset.ichat.example.R.id.content;
/** /**
* 消息入口所有消息都会经过这里 * 消息入口所有消息都会经过这里
* @author 3979434 * @author 3979434
@ -47,7 +45,6 @@ import static com.farsunset.ichat.example.R.id.content;
*/ */
public final class CIMPushManagerReceiver extends CIMEventBroadcastReceiver { public final class CIMPushManagerReceiver extends CIMEventBroadcastReceiver {
private NotificationManager notificationManager;
//当收到消息时会执行onMessageReceived这里是消息第一入口 //当收到消息时会执行onMessageReceived这里是消息第一入口
@ -57,9 +54,8 @@ public final class CIMPushManagerReceiver extends CIMEventBroadcastReceiver {
//调用分发消息监听 //调用分发消息监听
CIMListenerManager.notifyOnMessageReceived(message); CIMListenerManager.notifyOnMessageReceived(message);
//以开头的为动作消息无须显示,如被强行下线消息Constant.TYPE_999 //以开头的为动作消息无须显示,如被强行下线消息Constant.ACTION_999
if(message.getAction().startsWith("9")) if (message.getAction().startsWith("9")) {
{
return; return;
} }
@ -67,15 +63,21 @@ public final class CIMPushManagerReceiver extends CIMEventBroadcastReceiver {
} }
private void showNotify(Context context, Message msg) {
private void showNotify(Context context , Message msg) NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
{
String channelId = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
channelId = "system";
NotificationChannel channel = new NotificationChannel(channelId, "message", NotificationManager.IMPORTANCE_DEFAULT);
channel.enableLights(true); //是否在桌面icon右上角展示小红点   
notificationManager.createNotificationChannel(channel);
}
this.notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
String title = "系统消息"; String title = "系统消息";
PendingIntent contentIntent = PendingIntent.getActivity(context, 1, new Intent(context, SystemMessageActivity.class), PendingIntent.FLAG_UPDATE_CURRENT); PendingIntent contentIntent = PendingIntent.getActivity(context, 1, new Intent(context, SystemMessageActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context); final NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId);
builder.setAutoCancel(true); builder.setAutoCancel(true);
builder.setDefaults(Notification.DEFAULT_ALL); builder.setDefaults(Notification.DEFAULT_ALL);
builder.setWhen(msg.getTimestamp()); builder.setWhen(msg.getTimestamp());
@ -116,7 +118,6 @@ public final class CIMPushManagerReceiver extends CIMEventBroadcastReceiver {
} }
@Override @Override
public void onConnectionFailed() { public void onConnectionFailed() {
// TODO Auto-generated method stub // TODO Auto-generated method stub

View File

@ -1,18 +1,18 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* * <p>
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* * <p>
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* * <p>
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* * <p>
* ************************************************************************************** * **************************************************************************************
* * * *
* Website : http://www.farsunset.com * * Website : http://www.farsunset.com *
@ -21,6 +21,7 @@
*/ */
package com.farsunset.ichat.example.ui; package com.farsunset.ichat.example.ui;
import android.app.ProgressDialog;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
@ -28,17 +29,18 @@ import android.view.View.OnClickListener;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import com.farsunset.ichat.example.R;
import com.farsunset.ichat.example.app.CIMMonitorActivity;
import com.farsunset.ichat.example.app.Constant;
import com.farsunset.cim.sdk.android.CIMPushManager; import com.farsunset.cim.sdk.android.CIMPushManager;
import com.farsunset.cim.sdk.android.constant.CIMConstant; import com.farsunset.cim.sdk.android.constant.CIMConstant;
import com.farsunset.cim.sdk.android.model.ReplyBody; import com.farsunset.cim.sdk.android.model.ReplyBody;
public class LoginActivity extends CIMMonitorActivity implements import com.farsunset.ichat.example.R;
OnClickListener { import com.farsunset.ichat.example.app.CIMMonitorActivity;
import com.farsunset.ichat.example.app.Constant;
public class LoginActivity extends CIMMonitorActivity implements OnClickListener {
EditText accountEdit; EditText accountEdit;
Button loginButton; Button loginButton;
ProgressDialog progressDialog;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -49,6 +51,11 @@ public class LoginActivity extends CIMMonitorActivity implements
private void initViews() { private void initViews() {
progressDialog = new ProgressDialog(this);
progressDialog.setTitle("提示");
progressDialog.setMessage("正在登录,请稍候......");
progressDialog.setCancelable(false);
progressDialog.setCanceledOnTouchOutside(false);
accountEdit = (EditText) this.findViewById(R.id.account); accountEdit = (EditText) this.findViewById(R.id.account);
loginButton = (Button) this.findViewById(R.id.login); loginButton = (Button) this.findViewById(R.id.login);
loginButton.setOnClickListener(this); loginButton.setOnClickListener(this);
@ -58,7 +65,7 @@ public class LoginActivity extends CIMMonitorActivity implements
private void doLogin() { private void doLogin() {
if (!"".equals(accountEdit.getText().toString().trim())) { if (!"".equals(accountEdit.getText().toString().trim())) {
showProgressDialog("提示", "正在登陆,请稍后......"); progressDialog.show();
if (CIMPushManager.isConnected(this)) { if (CIMPushManager.isConnected(this)) {
CIMPushManager.bindAccount(this, accountEdit.getText().toString().trim()); CIMPushManager.bindAccount(this, accountEdit.getText().toString().trim());
} else { } else {
@ -77,12 +84,11 @@ public class LoginActivity extends CIMMonitorActivity implements
@Override @Override
public void onReplyReceived(final ReplyBody reply) { public void onReplyReceived(final ReplyBody reply) {
progressDialog.dismiss();
if (reply.getKey().equals(CIMConstant.RequestKey.CLIENT_BIND)) { /*
* 收到code为200的回应 账号绑定成功
if (reply.getCode().equals(CIMConstant.ReturnCode.CODE_200)) { */
if (reply.getKey().equals(CIMConstant.RequestKey.CLIENT_BIND) && reply.getCode().equals(CIMConstant.ReturnCode.CODE_200)) {
hideProgressDialog();
Intent intent = new Intent(this, SystemMessageActivity.class); Intent intent = new Intent(this, SystemMessageActivity.class);
intent.putExtra("account", accountEdit.getText().toString().trim()); intent.putExtra("account", accountEdit.getText().toString().trim());
startActivity(intent); startActivity(intent);
@ -90,28 +96,16 @@ public class LoginActivity extends CIMMonitorActivity implements
} }
} }
}
@Override @Override
public void onClick(View v) { public void onClick(View v) {
switch (v.getId()) {
case R.id.login:
doLogin(); doLogin();
break;
}
} }
@Override @Override
public void onBackPressed() { public void onBackPressed() {
CIMPushManager.destroy(this); CIMPushManager.destroy(this);
this.finish(); super.onBackPressed();
} }

View File

@ -1,18 +1,18 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* * <p>
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* * <p>
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* * <p>
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* * <p>
* ************************************************************************************** * **************************************************************************************
* * * *
* Website : http://www.farsunset.com * * Website : http://www.farsunset.com *
@ -22,11 +22,11 @@
package com.farsunset.ichat.example.ui; package com.farsunset.ichat.example.ui;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.animation.AlphaAnimation; import android.view.animation.AlphaAnimation;
import android.widget.Toast;
import com.farsunset.cim.sdk.android.CIMPushManager; import com.farsunset.cim.sdk.android.CIMPushManager;
import com.farsunset.ichat.example.BuildConfig; import com.farsunset.ichat.example.BuildConfig;
@ -36,9 +36,8 @@ import com.farsunset.ichat.example.app.Constant;
public class SplanshActivity extends CIMMonitorActivity { public class SplanshActivity extends CIMMonitorActivity {
boolean initComplete = false;
public void onCreate(Bundle savedInstanceState) public void onCreate(Bundle savedInstanceState) {
{
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -57,6 +56,7 @@ public class SplanshActivity extends CIMMonitorActivity{
} }
@Override @Override
public void onConnectionSuccessed(boolean autoBind) { public void onConnectionSuccessed(boolean autoBind) {
@ -71,8 +71,9 @@ public class SplanshActivity extends CIMMonitorActivity{
finish(); finish();
CIMPushManager.destroy(this); CIMPushManager.destroy(this);
} }
public void onConnectionFailed(Exception e){
showToask("连接服务器失败请检查当前设备是否能连接上服务器IP和端口"); @Override
public void onConnectionFailed() {
Toast.makeText(this,"连接服务器失败请检查当前设备是否能连接上服务器IP和端口",Toast.LENGTH_LONG).show();
} }
} }

View File

@ -1,18 +1,18 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* * <p>
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* * <p>
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* * <p>
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* * <p>
* ************************************************************************************** * **************************************************************************************
* * * *
* Website : http://www.farsunset.com * * Website : http://www.farsunset.com *
@ -21,9 +21,6 @@
*/ */
package com.farsunset.ichat.example.ui; package com.farsunset.ichat.example.ui;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import android.content.Intent; import android.content.Intent;
import android.media.MediaPlayer; import android.media.MediaPlayer;
import android.net.NetworkInfo; import android.net.NetworkInfo;
@ -32,6 +29,8 @@ import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.farsunset.cim.sdk.android.CIMPushManager; import com.farsunset.cim.sdk.android.CIMPushManager;
import com.farsunset.cim.sdk.android.constant.CIMConstant; import com.farsunset.cim.sdk.android.constant.CIMConstant;
import com.farsunset.cim.sdk.android.model.Message; import com.farsunset.cim.sdk.android.model.Message;
@ -41,6 +40,8 @@ import com.farsunset.ichat.example.adapter.SystemMsgListViewAdapter;
import com.farsunset.ichat.example.app.CIMMonitorActivity; import com.farsunset.ichat.example.app.CIMMonitorActivity;
import com.farsunset.ichat.example.app.Constant; import com.farsunset.ichat.example.app.Constant;
import java.util.ArrayList;
public class SystemMessageActivity extends CIMMonitorActivity implements OnClickListener { public class SystemMessageActivity extends CIMMonitorActivity implements OnClickListener {
protected ListView chatListView; protected ListView chatListView;
@ -71,24 +72,24 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick
adapter = new SystemMsgListViewAdapter(this, list); adapter = new SystemMsgListViewAdapter(this, list);
chatListView.setAdapter(adapter); chatListView.setAdapter(adapter);
showToask("登录成功,请通过后台页面发送消息吧^_^"); Toast.makeText(this,"登录成功,请通过后台页面发送消息吧^_^",Toast.LENGTH_LONG).show();
} }
//收到消息 //收到消息
@Override @Override
public void onMessageReceived(Message message) { public void onMessageReceived(Message message) {
if(message.getAction().equals(Constant.MessageType.TYPE_999)) if (message.getAction().equals(Constant.MessageAction.ACTION_999)) {
{
//返回登录页面停止接受消息 //返回登录页面停止接受消息
CIMPushManager.stop(this); CIMPushManager.stop(this);
this.showToask("你被迫下线!"); Toast.makeText(this,"你被系统强制下线!",Toast.LENGTH_LONG).show();
Intent intent = new Intent(this, LoginActivity.class); Intent intent = new Intent(this, LoginActivity.class);
startActivity(intent); startActivity(intent);
this.finish(); this.finish();
}else } else {
{
MediaPlayer.create(this, R.raw.classic).start(); MediaPlayer.create(this, R.raw.classic).start();
list.add(message); list.add(message);
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
@ -99,8 +100,7 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick
} }
//获取离线消息代码示例前提是服务端要实现此功能,建议使用http 接口拉去大量的离线消息 //获取离线消息代码示例前提是服务端要实现此功能,建议使用http 接口拉去大量的离线消息
private void getOfflineMessage() private void getOfflineMessage() {
{
SentBody sent = new SentBody(); SentBody sent = new SentBody();
sent.setKey(CIMConstant.RequestKey.CLIENT_PULL_MESSAGE); sent.setKey(CIMConstant.RequestKey.CLIENT_PULL_MESSAGE);
sent.put("account", this.getIntent().getStringExtra("account")); sent.put("account", this.getIntent().getStringExtra("account"));
@ -110,38 +110,26 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick
@Override @Override
public void onNetworkChanged(NetworkInfo info) { public void onNetworkChanged(NetworkInfo info) {
if(info ==null) if (info == null) {
{ Toast.makeText(this,"网络已断开!",Toast.LENGTH_LONG).show();
showToask("网络已断开"); } else {
Toast.makeText(this,"网络已恢复,重新连接....",Toast.LENGTH_LONG).show();
}else
{
showToask("网络已恢复,重新连接....");
} }
} }
@Override @Override
public void onClick(View v) { public void onClick(View v) {
switch (v.getId()) {
case R.id.TOP_BACK_BUTTON: {
onBackPressed(); onBackPressed();
break;
}
}
} }
@Override @Override
public void onBackPressed() { public void onBackPressed() {
//返回登录页面停止接受消息 //返回登录页面停止接受消息
CIMPushManager.stop(this); CIMPushManager.stop(this);
startActivity(new Intent(this, LoginActivity.class));
Intent intent = new Intent(this, LoginActivity.class); super.onBackPressed();
startActivity(intent);
this.finish();
} }

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<selector <selector xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:color="#ff000000" /> <item android:state_pressed="true" android:color="#ff000000" />
<item android:state_focused="true" android:color="#ff000000" /> <item android:state_focused="true" android:color="#ff000000" />
<item android:color="#ff2f4e62" /> <item android:color="#ff2f4e62" />

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<selector <selector xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:drawable="@drawable/skin_common_btn_blue_unpressed" /> <item android:state_enabled="false" android:drawable="@drawable/skin_common_btn_blue_unpressed" />
<item android:state_pressed="true" android:drawable="@drawable/skin_common_btn_blue_bg_pressed" /> <item android:state_pressed="true" android:drawable="@drawable/skin_common_btn_blue_bg_pressed" />
<item android:drawable="@drawable/skin_common_btn_blue_unpressed" /> <item android:drawable="@drawable/skin_common_btn_blue_unpressed" />

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<selector <selector xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/skin_msgbox_bg_pressed" /> <item android:state_pressed="true" android:drawable="@drawable/skin_msgbox_bg_pressed" />
<item android:drawable="@drawable/skin_msgbox_bg_nor" /> <item android:drawable="@drawable/skin_msgbox_bg_nor" />
</selector> </selector>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<selector <selector xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/skin_header_btn_back_press" /> <item android:state_pressed="true" android:drawable="@drawable/skin_header_btn_back_press" />
<item android:drawable="@drawable/skin_header_btn_back_normal" /> <item android:drawable="@drawable/skin_header_btn_back_normal" />
</selector> </selector>

View File

@ -62,7 +62,6 @@
android:singleLine="true" /> android:singleLine="true" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout

View File

@ -4,16 +4,21 @@
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:background="@color/window_bg" android:background="@color/window_bg"
android:orientation="vertical"> android:orientation="vertical">
<include android:layout_width="fill_parent"
<include
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/header" android:id="@+id/header"
layout="@layout/layout_global_top_header" /> layout="@layout/layout_global_top_header" />
<TextView android:layout_width="fill_parent"
<TextView
android:layout_width="fill_parent"
android:gravity="center" android:gravity="center"
android:text="请调用接口,或者在后台页面,推送一条消息到客户端" android:text="请调用接口,或者在后台页面,推送一条消息到客户端"
android:textSize="13sp" android:textSize="13sp"
android:textColor="#4A4876" android:textColor="#4A4876"
android:layout_height="40dip" /> android:layout_height="40dip" />
<ListView <ListView
android:id="@+id/chat_list" android:id="@+id/chat_list"
android:layout_width="fill_parent" android:layout_width="fill_parent"
@ -21,6 +26,5 @@
android:cacheColorHint="@null" android:cacheColorHint="@null"
android:divider="#00000000" android:divider="#00000000"
android:listSelector="#00000000" android:listSelector="#00000000"
android:dividerHeight="10dip" android:dividerHeight="10dip" />
/>
</LinearLayout> </LinearLayout>

View File

@ -55,8 +55,7 @@
android:id="@+id/headImageView" android:id="@+id/headImageView"
android:layout_width="50dip" android:layout_width="50dip"
android:layout_height="50dip" android:layout_height="50dip"
android:layout_centerVertical="true" android:layout_centerVertical="true" />
/>
<TextView <TextView

View File

@ -21,8 +21,7 @@
android:singleLine="true" android:singleLine="true"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="14.0sp" android:textSize="14.0sp"
android:visibility="gone" android:visibility="gone" />
/>
<TextView <TextView
android:id="@+id/TITLE_TEXT" android:id="@+id/TITLE_TEXT"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">CIM示例</string> <string name="app_name">CIM推送</string>
</resources> </resources>

View File

@ -3,9 +3,10 @@
buildscript { buildscript {
repositories { repositories {
jcenter() jcenter()
google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.3.0' classpath 'com.android.tools.build:gradle:3.3.2'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
@ -15,6 +16,7 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
jcenter() jcenter()
google()
} }
} }

Binary file not shown.

View File

@ -0,0 +1,6 @@
#Wed Apr 17 14:12:04 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
############################################################################## ##############################################################################
## ##
@ -6,12 +6,30 @@
## ##
############################################################################## ##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Attempt to set APP_HOME
DEFAULT_JVM_OPTS="" # Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle" APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"` APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD="maximum"
@ -30,6 +48,7 @@ die ( ) {
cygwin=false cygwin=false
msys=false msys=false
darwin=false darwin=false
nonstop=false
case "`uname`" in case "`uname`" in
CYGWIN* ) CYGWIN* )
cygwin=true cygwin=true
@ -40,26 +59,11 @@ case "`uname`" in
MINGW* ) MINGW* )
msys=true msys=true
;; ;;
NONSTOP* )
nonstop=true
;;
esac esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
@ -85,7 +89,7 @@ location of your Java installation."
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n` MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@ -150,11 +154,19 @@ if $cygwin ; then
esac esac
fi fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules # Escape application args
function splitJvmOpts() { save () {
JVM_OPTS=("$@") for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
} }
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS APP_ARGS=$(save "$@")
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" # Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

View File

@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell @rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=. if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome
@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail goto fail
:init :init
@rem Get command-line arguments, handling Windowz variants @rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args :win9xME_args
@rem Slurp the command line arguments. @rem Slurp the command line arguments.
@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%* set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute :execute
@rem Setup the command line @rem Setup the command line

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
/** /**
* Copyright 2013-2023 Xia Jun(3979434@qq.com). * Copyright 2013-2019 Xia Jun(3979434@qq.com).
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

Some files were not shown because too many files have changed in this diff Show More