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序列化方式更加高效
-------------------------------------------------------------------------------------------
版本: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="lib" path="libs/log4j-1.2.17.jar"/>
<classpathentry kind="lib" path="libs/mina-core-2.0.16.jar"/>
<classpathentry kind="lib" path="libs/protobuf-java-3.2.0.jar"/>
<classpathentry kind="lib" path="C:/Program Files/Android/android-sdk-windows/platforms/android-24/android.jar"/>
<classpathentry kind="lib" path="C:/Program Files/Android/android-sdk-windows/platforms/android-26/android.jar"/>
<classpathentry kind="lib" path="libs/protobuf-java-3.7.0.jar"/>
<classpathentry kind="output" path="bin"/>
</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 CONTENT_URI = "content://%s.cim.provider";
public static void remove(Context context, String key) {
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) {
@ -56,14 +59,14 @@ class CIMCacheManager {
ContentValues values = new ContentValues();
values.put("value", value);
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) {
String value = null;
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()) {
value = cursor.getString(0);
cursor.close();

View File

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

View File

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

View File

@ -27,6 +27,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Build;
import android.text.TextUtils;
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(CIMPushService.KEY_DELAYED_TIME, delayedTime);
serviceIntent.setAction(ACTION_CREATE_CIM_CONNECTION);
context.startService(serviceIntent);
startServiceCompat(context,serviceIntent);
}
public static void setLoggerEnable(Context context,boolean enable) {
Intent serviceIntent = new Intent(context, CIMPushService.class);
serviceIntent.putExtra(CIMPushService.KEY_LOGGER_ENABLE, enable);
serviceIntent.setAction(ACTION_SET_LOGGER_EANABLE);
context.startService(serviceIntent);
startServiceCompat(context,serviceIntent);
}
protected static void connect(Context context, long delayedTime) {
@ -181,7 +181,7 @@ public class CIMPushManager {
Intent serviceIntent = new Intent(context, CIMPushService.class);
serviceIntent.putExtra(KEY_SEND_BODY, 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);
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);
serviceIntent.setAction(ACTION_DESTORY);
context.startService(serviceIntent);
startServiceCompat(context,serviceIntent);
}
@ -250,4 +250,12 @@ public class CIMPushManager {
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;
import android.app.Notification;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import java.util.concurrent.Semaphore;
import com.farsunset.cim.sdk.android.filter.CIMLoggingFilter;
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";
private CIMConnectorManager manager;
private KeepAliveBroadcastReceiver keepAliveReceiver;
private Semaphore semaphore = new Semaphore(1,true);
@Override
public void onCreate() {
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() {
@Override
public void handleMessage(android.os.Message message) {
connectionHandler.removeMessages(0);
String host = message.getData().getString(CIMCacheManager.KEY_CIM_SERVIER_HOST);
int port = message.getData().getInt(CIMCacheManager.KEY_CIM_SERVIER_PORT, 0);
manager.connect(host, port);
semaphore.release();
}
};
@Override
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);
String action = intent.getAction();
if (CIMPushManager.ACTION_CREATE_CIM_CONNECTION.equals(action)) {
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);
}
handleConnection(intent);
}
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 (!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 isDestroyed = CIMCacheManager.getBoolean(getApplicationContext(),CIMCacheManager.KEY_CIM_DESTROYED);
@ -106,18 +153,6 @@ public class CIMPushService extends Service {
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
@ -125,4 +160,31 @@ public class CIMPushService extends Service {
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");
* you may not use this file except in compliance with the License.

View File

@ -15,6 +15,11 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<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()
}
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 {
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 {
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-undertow:2.0.4.RELEASE'
compile 'org.springframework.boot:spring-boot-starter-freemarker:2.0.4.RELEASE'
compile 'com.google.protobuf:protobuf-java:3.6.0'
compile 'org.springframework.boot:spring-boot-starter-web:2.1.4.RELEASE'
compile 'org.springframework.boot:spring-boot-starter-freemarker:2.1.4.RELEASE'
compile 'com.google.protobuf:protobuf-java:3.7.0'
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 'org.apache.commons:commons-lang3:3.5'
compile 'com.squareup.okhttp3:okhttp:3.10.0'

View File

@ -4,9 +4,10 @@ import java.io.IOException;
import java.util.HashMap;
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.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -22,23 +23,27 @@ public class CIMConfig implements CIMRequestHandler {
@Value("${cim.server.port}")
private int port;
@Autowired
@Resource
private BindHandler bindHandler;
@Autowired
@Resource
private SessionClosedHandler closedHandler;
private HashMap<String,CIMRequestHandler> appHandlerMap = new HashMap<>();
@Resource
private ApplicationContext applicationContext;
private HashMap<String,Class<? extends CIMRequestHandler>> appHandlerMap = new HashMap<>();
@PostConstruct
private void initHandler() {
/*
* 账号绑定handler
*/
appHandlerMap.put("client_bind", bindHandler);
appHandlerMap.put("client_bind", BindHandler.class);
/*
* 连接关闭handler
*/
appHandlerMap.put("client_closed", closedHandler);
appHandlerMap.put("client_closed", SessionClosedHandler.class);
}
@Bean
@ -53,7 +58,7 @@ public class CIMConfig implements CIMRequestHandler {
@Override
public void process(CIMSession session, SentBody body) {
CIMRequestHandler handler = appHandlerMap.get(body.getKey());
CIMRequestHandler handler = findHandlerByKey(body.getKey());
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");
* 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");
* 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");
* you may not use this file except in compliance with the License.
@ -21,7 +21,8 @@
*/
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.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@ -31,7 +32,7 @@ import com.farsunset.cim.service.impl.CIMSessionServiceImpl;
@RequestMapping("/console/session")
public class SessionController {
@Autowired
@Resource
private CIMSessionServiceImpl sessionManager;
@RequestMapping(value = "/list.action")
@ -39,16 +40,4 @@ public class SessionController {
model.addAttribute("sessionList", sessionManager.queryAll());
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");
* you may not use this file except in compliance with the License.
@ -21,7 +21,8 @@
*/
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.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@ -40,10 +41,10 @@ public class MessageController {
@Autowired
@Resource
private SystemMessagePusher systemMessagePusher;
@Autowired
@Resource
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");
* 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");
* 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");
* 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 javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@ -49,7 +50,7 @@ public class BindHandler implements CIMRequestHandler {
protected final Logger logger = LoggerFactory.getLogger(BindHandler.class);
@Autowired
@Resource
private CIMSessionServiceImpl sessionManager;
@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");
* you may not use this file except in compliance with the License.
@ -22,9 +22,10 @@
package com.farsunset.cim.handler;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
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);
@Autowired
@Resource
private CIMSessionServiceImpl sessionManager;
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");
* 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");
* 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 org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@ -43,14 +44,14 @@ public class DefaultMessagePusher implements CIMMessagePusher {
@Value("${server.host}")
private String host;
@Autowired
@Resource
private DefaultSessionManager sessionManager;
@Autowired
@Resource
private MessageDispatcherImpl messageDispatcher;
@Autowired
@Resource
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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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">
<option name="linkedExternalProjectsSettings">
<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="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" />
</GradleProjectSettings>
</option>

View File

@ -1,29 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<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 name="CMakeSettings">
<configurations>
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
</configurations>
</component>
<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" />

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

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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.WRITE_EXTERNAL_STORAGE" />
@ -14,11 +13,11 @@
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/GlobeTheme" >
android:theme="@style/GlobeTheme">
<activity
android:name=".ui.SplanshActivity"
android:alwaysRetainTaskState="true"
android:screenOrientation="portrait" >
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -29,7 +28,7 @@
android:name=".ui.SystemMessageActivity"
android:alwaysRetainTaskState="true"
android:launchMode="singleTask"
android:screenOrientation="portrait" >
android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.farsunset.cim.look.notify" />
@ -47,25 +46,30 @@
android:screenOrientation="portrait" />
<!-- ****************************************CIM推送配置 begin*************************************** -->
<service android:name="com.farsunset.cim.sdk.android.CIMPushService" android:process=":cimpush" />
<provider android:name="com.farsunset.cim.sdk.android.CIMCacheProvider"
android:authorities="com.farsunset.cim.provider"
<service
android:name="com.farsunset.cim.sdk.android.CIMPushService"
android:process=":cimpush" />
<provider
android:name="com.farsunset.cim.sdk.android.CIMCacheProvider"
android:authorities="com.farsunset.ichat.example.cim.provider"
android:process=":cimpush"
android:exported="false" />
<!-- android:authorities="${package}.cim.provider"-->
<!-- ****************************************CIM推送配置 end*************************************** -->
<!--消息接受广播注册-->
<receiver android:name="com.farsunset.ichat.example.receiver.CIMPushManagerReceiver">
<intent-filter android:priority="0x7fffffff">
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/> <!-- 网络变化广播 -->
<action android:name="com.farsunset.cim.MESSAGE_RECEIVED"/><!-- 消息广播action -->
<action android:name="com.farsunset.cim.SENT_FAILED"/> <!-- 发送sendbody失败广播-->
<action android:name="com.farsunset.cim.SENT_SUCCESSED"/> <!-- 发送sendbody成功广播 -->
<action android:name="com.farsunset.cim.CONNECTION_RECOVERY"/> <!--重新连接 -->
<action android:name="com.farsunset.cim.CONNECTION_CLOSED"/> <!-- 链接意外关闭广播 -->
<action android:name="com.farsunset.cim.CONNECTION_FAILED"/> <!-- 链接失败广播 -->
<action android:name="com.farsunset.cim.CONNECTION_SUCCESSED"/> <!-- 链接成功广播-->
<action android:name="com.farsunset.cim.REPLY_RECEIVED"/> <!-- 发送sendbody成功后获得replaybody回应广播 -->
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> <!-- 网络变化广播 -->
<action android:name="com.farsunset.cim.MESSAGE_RECEIVED" /><!-- 消息广播action -->
<action android:name="com.farsunset.cim.SENT_FAILED" /> <!-- 发送sendbody失败广播-->
<action android:name="com.farsunset.cim.SENT_SUCCESSED" /> <!-- 发送sendbody成功广播 -->
<action android:name="com.farsunset.cim.CONNECTION_RECOVERY" /> <!--重新连接 -->
<action android:name="com.farsunset.cim.CONNECTION_CLOSED" /> <!-- 链接意外关闭广播 -->
<action android:name="com.farsunset.cim.CONNECTION_FAILED" /> <!-- 链接失败广播 -->
<action android:name="com.farsunset.cim.CONNECTION_SUCCESSED" /> <!-- 链接成功广播-->
<action android:name="com.farsunset.cim.REPLY_RECEIVED" /> <!-- 发送sendbody成功后获得replaybody回应广播 -->
<!-- 【可选】 一些常用的系统广播增强pushservice的复活机会-->
<action android:name="android.intent.action.USER_PRESENT" />

View File

@ -1,38 +1,37 @@
/**
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.
*
***************************************************************************************
* <p>
* **************************************************************************************
* *
* Website : http://www.farsunset.com *
* *
***************************************************************************************
* **************************************************************************************
*/
package com.farsunset.ichat.example.adapter;
import java.util.Comparator;
import com.farsunset.cim.sdk.android.model.Message;
public class MessageTimeDescComparator implements Comparator<Message>{
import java.util.Comparator;
public class MessageTimeDescComparator implements Comparator<Message> {
@Override
public int compare(Message arg0, Message arg1) {
return (int) (arg1.getTimestamp() - arg0.getTimestamp()) ;
return (int) (arg1.getTimestamp() - arg0.getTimestamp());
}
}

View File

@ -1,29 +1,26 @@
/**
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.
*
***************************************************************************************
* <p>
* **************************************************************************************
* *
* Website : http://www.farsunset.com *
* *
***************************************************************************************
* **************************************************************************************
*/
package com.farsunset.ichat.example.adapter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import android.annotation.SuppressLint;
import android.view.LayoutInflater;
import android.view.View;
@ -31,10 +28,15 @@ import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.farsunset.cim.sdk.android.model.Message;
import com.farsunset.ichat.example.R;
import com.farsunset.ichat.example.ui.SystemMessageActivity;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
public class SystemMsgListViewAdapter extends BaseAdapter {
@ -64,24 +66,24 @@ public class SystemMsgListViewAdapter extends BaseAdapter {
}
@Override
public void notifyDataSetChanged()
{
public void notifyDataSetChanged() {
//Collections.sort(list, new MessageTimeDescComparator());
}
@SuppressLint("ViewHolder")
@Override
public View getView(int position, View chatItemView, ViewGroup parent) {
final Message msg = getItem(position);
chatItemView =LayoutInflater.from(scactivity).inflate(R.layout.item_chat_sysmsg, null);
chatItemView = LayoutInflater.from(scactivity).inflate(R.layout.item_chat_sysmsg, null);
((TextView) chatItemView.findViewById(R.id.textMsgType)).setText("系统消息");
((TextView) chatItemView.findViewById(R.id.time)).setText(getDateTimeString(Long.valueOf(msg.getTimestamp())));
((TextView) chatItemView.findViewById(R.id.content)).setText(msg.getContent() );
((TextView) chatItemView.findViewById(R.id.content)).setText(msg.getContent());
((ImageView) chatItemView.findViewById(R.id.headImageView)).setImageResource(R.drawable.icon);
return chatItemView;
@ -94,8 +96,8 @@ public class SystemMsgListViewAdapter extends BaseAdapter {
public void setList(List<Message> 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");
return sdf.format(new Date(t));
}

View File

@ -1,49 +1,42 @@
/**
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.
*
***************************************************************************************
* <p>
* **************************************************************************************
* *
* Website : http://www.farsunset.com *
* *
***************************************************************************************
* **************************************************************************************
*/
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.CIMListenerManager;
import com.farsunset.cim.sdk.android.model.Message;
import com.farsunset.cim.sdk.android.model.ReplyBody;
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{
CommonBaseControl commonBaseControl;
public void onCreate(Bundle savedInstanceState)
{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
CIMListenerManager.registerMessageListener(this);
commonBaseControl = new CommonBaseControl(this);
}
@Override
@ -59,36 +52,20 @@ public abstract class CIMMonitorActivity extends Activity implements CIMEven
CIMListenerManager.registerMessageListener(this);
}
public void showProgressDialog(String title,String content)
{
commonBaseControl.showProgressDialog(title, content);
@Override
public void onMessageReceived(Message arg0) {
}
public void hideProgressDialog()
{
commonBaseControl.hideProgressDialog();
}
public void showToask(String hint){
commonBaseControl.showToask(hint);
}
@Override
public void onMessageReceived(Message arg0){};
@Override
public void onNetworkChanged(NetworkInfo info){}
public void onNetworkChanged(NetworkInfo info) {
}
/**
* 与服务端断开连接时回调,不要在里面做连接服务端的操作
*/
@Override
public void onConnectionClosed() {}
public void onConnectionClosed() {
}
@Override
public void onConnectionFailed() {
@ -105,11 +82,13 @@ public abstract class CIMMonitorActivity extends Activity implements CIMEven
*/
@Override
public void onConnectionSuccessed(boolean arg0) {}
public void onConnectionSuccessed(boolean arg0) {
}
@Override
public void onReplyReceived(ReplyBody arg0) {}
public void onReplyReceived(ReplyBody arg0) {
}
@Override
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,53 +1,36 @@
/**
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.
*
***************************************************************************************
* <p>
* **************************************************************************************
* *
* Website : http://www.farsunset.com *
* *
***************************************************************************************
* **************************************************************************************
*/
package com.farsunset.ichat.example.app;
public interface Constant {
//服务端IP地址
public static final String CIM_SERVER_HOST = "192.168.1.106";
//注意这里的端口不是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";
String CIM_SERVER_HOST = "192.168.50.80";
//注意这里的端口不是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,28 +1,29 @@
/**
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.
*
***************************************************************************************
* <p>
* **************************************************************************************
* *
* Website : http://www.farsunset.com *
* *
***************************************************************************************
* **************************************************************************************
*/
package com.farsunset.ichat.example.receiver;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
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.ui.SystemMessageActivity;
import static android.R.id.message;
import static com.farsunset.ichat.example.R.id.content;
/**
* 消息入口所有消息都会经过这里
* @author 3979434
@ -47,7 +45,6 @@ import static com.farsunset.ichat.example.R.id.content;
*/
public final class CIMPushManagerReceiver extends CIMEventBroadcastReceiver {
private NotificationManager notificationManager;
//当收到消息时会执行onMessageReceived这里是消息第一入口
@ -57,25 +54,30 @@ public final class CIMPushManagerReceiver extends CIMEventBroadcastReceiver {
//调用分发消息监听
CIMListenerManager.notifyOnMessageReceived(message);
//以开头的为动作消息无须显示,如被强行下线消息Constant.TYPE_999
if(message.getAction().startsWith("9"))
{
return ;
//以开头的为动作消息无须显示,如被强行下线消息Constant.ACTION_999
if (message.getAction().startsWith("9")) {
return;
}
showNotify(context,message);
showNotify(context, message);
}
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 = "系统消息";
PendingIntent contentIntent = PendingIntent.getActivity(context,1, new Intent(context,SystemMessageActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
PendingIntent contentIntent = PendingIntent.getActivity(context, 1, new Intent(context, SystemMessageActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId);
builder.setAutoCancel(true);
builder.setDefaults(Notification.DEFAULT_ALL);
builder.setWhen(msg.getTimestamp());
@ -116,7 +118,6 @@ public final class CIMPushManagerReceiver extends CIMEventBroadcastReceiver {
}
@Override
public void onConnectionFailed() {
// TODO Auto-generated method stub

View File

@ -1,26 +1,27 @@
/**
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.
*
***************************************************************************************
* <p>
* **************************************************************************************
* *
* Website : http://www.farsunset.com *
* *
***************************************************************************************
* **************************************************************************************
*/
package com.farsunset.ichat.example.ui;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
@ -28,17 +29,18 @@ import android.view.View.OnClickListener;
import android.widget.Button;
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.constant.CIMConstant;
import com.farsunset.cim.sdk.android.model.ReplyBody;
public class LoginActivity extends CIMMonitorActivity implements
OnClickListener {
import com.farsunset.ichat.example.R;
import com.farsunset.ichat.example.app.CIMMonitorActivity;
import com.farsunset.ichat.example.app.Constant;
public class LoginActivity extends CIMMonitorActivity implements OnClickListener {
EditText accountEdit;
Button loginButton;
ProgressDialog progressDialog;
@Override
public void onCreate(Bundle savedInstanceState) {
@ -49,6 +51,11 @@ public class LoginActivity extends CIMMonitorActivity implements
private void initViews() {
progressDialog = new ProgressDialog(this);
progressDialog.setTitle("提示");
progressDialog.setMessage("正在登录,请稍候......");
progressDialog.setCancelable(false);
progressDialog.setCanceledOnTouchOutside(false);
accountEdit = (EditText) this.findViewById(R.id.account);
loginButton = (Button) this.findViewById(R.id.login);
loginButton.setOnClickListener(this);
@ -58,7 +65,7 @@ public class LoginActivity extends CIMMonitorActivity implements
private void doLogin() {
if (!"".equals(accountEdit.getText().toString().trim())) {
showProgressDialog("提示", "正在登陆,请稍后......");
progressDialog.show();
if (CIMPushManager.isConnected(this)) {
CIMPushManager.bindAccount(this, accountEdit.getText().toString().trim());
} else {
@ -70,19 +77,18 @@ public class LoginActivity extends CIMMonitorActivity implements
@Override
public void onConnectionSuccessed(boolean autoBind) {
if(!autoBind)
if (!autoBind)
CIMPushManager.bindAccount(this, accountEdit.getText().toString().trim());
}
@Override
public void onReplyReceived(final ReplyBody reply) {
if (reply.getKey().equals(CIMConstant.RequestKey.CLIENT_BIND)) {
if (reply.getCode().equals(CIMConstant.ReturnCode.CODE_200)) {
hideProgressDialog();
progressDialog.dismiss();
/*
* 收到code为200的回应 账号绑定成功
*/
if (reply.getKey().equals(CIMConstant.RequestKey.CLIENT_BIND) && reply.getCode().equals(CIMConstant.ReturnCode.CODE_200)) {
Intent intent = new Intent(this, SystemMessageActivity.class);
intent.putExtra("account", accountEdit.getText().toString().trim());
startActivity(intent);
@ -90,28 +96,16 @@ public class LoginActivity extends CIMMonitorActivity implements
}
}
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.login:
doLogin();
break;
}
}
@Override
public void onBackPressed() {
CIMPushManager.destroy(this);
this.finish();
super.onBackPressed();
}

View File

@ -1,32 +1,32 @@
/**
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.
*
***************************************************************************************
* <p>
* **************************************************************************************
* *
* Website : http://www.farsunset.com *
* *
***************************************************************************************
* **************************************************************************************
*/
package com.farsunset.ichat.example.ui;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.widget.Toast;
import com.farsunset.cim.sdk.android.CIMPushManager;
import com.farsunset.ichat.example.BuildConfig;
@ -34,33 +34,33 @@ import com.farsunset.ichat.example.R;
import com.farsunset.ichat.example.app.CIMMonitorActivity;
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);
CIMPushManager.setLoggerEnable(this,BuildConfig.DEBUG);
CIMPushManager.setLoggerEnable(this, BuildConfig.DEBUG);
//连接服务端
CIMPushManager.connect(SplanshActivity.this,Constant.CIM_SERVER_HOST, Constant.CIM_SERVER_PORT);
CIMPushManager.connect(SplanshActivity.this, Constant.CIM_SERVER_HOST, Constant.CIM_SERVER_PORT);
final View view = View.inflate(this, R.layout.activity_splansh, null);
setContentView(view);
AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);
AlphaAnimation aa = new AlphaAnimation(0.3f, 1.0f);
aa.setDuration(2000);
view.startAnimation(aa);
}
@Override
public void onConnectionSuccessed(boolean autoBind) {
Intent intent = new Intent(SplanshActivity.this,LoginActivity.class);
Intent intent = new Intent(SplanshActivity.this, LoginActivity.class);
startActivity(intent);
finish();
}
@ -71,8 +71,9 @@ public class SplanshActivity extends CIMMonitorActivity{
finish();
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,29 +1,26 @@
/**
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* 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.
*
***************************************************************************************
* <p>
* **************************************************************************************
* *
* Website : http://www.farsunset.com *
* *
***************************************************************************************
* **************************************************************************************
*/
package com.farsunset.ichat.example.ui;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.NetworkInfo;
@ -32,6 +29,8 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.farsunset.cim.sdk.android.CIMPushManager;
import com.farsunset.cim.sdk.android.constant.CIMConstant;
import com.farsunset.cim.sdk.android.model.Message;
@ -41,7 +40,9 @@ import com.farsunset.ichat.example.adapter.SystemMsgListViewAdapter;
import com.farsunset.ichat.example.app.CIMMonitorActivity;
import com.farsunset.ichat.example.app.Constant;
public class SystemMessageActivity extends CIMMonitorActivity implements OnClickListener{
import java.util.ArrayList;
public class SystemMessageActivity extends CIMMonitorActivity implements OnClickListener {
protected ListView chatListView;
protected SystemMsgListViewAdapter adapter;
@ -71,24 +72,24 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick
adapter = new SystemMsgListViewAdapter(this, list);
chatListView.setAdapter(adapter);
showToask("登录成功,请通过后台页面发送消息吧^_^");
Toast.makeText(this,"登录成功,请通过后台页面发送消息吧^_^",Toast.LENGTH_LONG).show();
}
//收到消息
@Override
public void onMessageReceived(Message message) {
if(message.getAction().equals(Constant.MessageType.TYPE_999))
{
if (message.getAction().equals(Constant.MessageAction.ACTION_999)) {
//返回登录页面停止接受消息
CIMPushManager.stop(this);
this.showToask("你被迫下线!");
Toast.makeText(this,"你被系统强制下线!",Toast.LENGTH_LONG).show();
Intent intent = new Intent(this, LoginActivity.class);
startActivity(intent);
this.finish();
}else
{
} else {
MediaPlayer.create(this, R.raw.classic).start();
list.add(message);
adapter.notifyDataSetChanged();
@ -99,8 +100,7 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick
}
//获取离线消息代码示例前提是服务端要实现此功能,建议使用http 接口拉去大量的离线消息
private void getOfflineMessage()
{
private void getOfflineMessage() {
SentBody sent = new SentBody();
sent.setKey(CIMConstant.RequestKey.CLIENT_PULL_MESSAGE);
sent.put("account", this.getIntent().getStringExtra("account"));
@ -108,40 +108,28 @@ public class SystemMessageActivity extends CIMMonitorActivity implements OnClick
}
@Override
public void onNetworkChanged(NetworkInfo info){
public void onNetworkChanged(NetworkInfo info) {
if(info ==null)
{
showToask("网络已断开");
}else
{
showToask("网络已恢复,重新连接....");
if (info == null) {
Toast.makeText(this,"网络已断开!",Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this,"网络已恢复,重新连接....",Toast.LENGTH_LONG).show();
}
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.TOP_BACK_BUTTON: {
onBackPressed();
break;
}
}
}
@Override
public void onBackPressed() {
//返回登录页面停止接受消息
CIMPushManager.stop(this);
Intent intent = new Intent(this, LoginActivity.class);
startActivity(intent);
this.finish();
startActivity(new Intent(this, LoginActivity.class));
super.onBackPressed();
}

View File

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

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<selector 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_pressed="true" android:drawable="@drawable/skin_common_btn_blue_bg_pressed" />
<item android:drawable="@drawable/skin_common_btn_blue_unpressed" />

View File

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

View File

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

View File

@ -3,13 +3,13 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/login_bg"
android:orientation="vertical" >
android:orientation="vertical">
<LinearLayout
android:id="@+id/scrollAreaLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
android:orientation="vertical">
<ImageView
android:id="@+id/face"
@ -23,7 +23,7 @@
<RelativeLayout
android:id="@+id/loginInputView"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/input"
@ -32,7 +32,7 @@
android:layout_marginLeft="15.0dip"
android:layout_marginRight="15.0dip"
android:layout_marginTop="6.0dip"
android:background="@drawable/login_input" >
android:background="@drawable/login_input">
<TextView
android:layout_width="wrap_content"
@ -62,7 +62,6 @@
android:singleLine="true" />
</RelativeLayout>
<LinearLayout
@ -73,7 +72,7 @@
android:layout_alignRight="@id/input"
android:layout_below="@id/input"
android:layout_marginTop="20.0dip"
android:padding="1.0dip" >
android:padding="1.0dip">
<Button
android:id="@+id/login"

View File

@ -2,6 +2,6 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/splash_bg" >
android:background="@drawable/splash_bg">
</RelativeLayout>

View File

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

View File

@ -4,7 +4,7 @@
android:layout_height="wrap_content"
android:clickable="false"
android:focusable="false"
android:orientation="vertical" >
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
@ -13,13 +13,13 @@
android:layout_marginRight="10.0dip"
android:layout_marginTop="15.0dip"
android:clickable="true"
android:orientation="vertical" >
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/skin_msgbox_bg_top"
android:orientation="horizontal" >
android:orientation="horizontal">
<TextView
android:id="@+id/textMsgType"
@ -49,14 +49,13 @@
android:background="@drawable/common_msgbox_bg"
android:clickable="true"
android:focusable="true"
android:padding="10dip" >
android:padding="10dip">
<ImageView
android:id="@+id/headImageView"
android:layout_width="50dip"
android:layout_height="50dip"
android:layout_centerVertical="true"
/>
android:layout_centerVertical="true" />
<TextView

View File

@ -3,7 +3,7 @@
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="@drawable/skin_header_bar_bg"
android:padding="0.0px" >
android:padding="0.0px">
<TextView
android:id="@+id/TOP_BACK_BUTTON"
@ -21,8 +21,7 @@
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="14.0sp"
android:visibility="gone"
/>
android:visibility="gone" />
<TextView
android:id="@+id/TITLE_TEXT"

View File

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

View File

@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
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
// in the individual module build.gradle files
@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
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,42 +6,6 @@
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@ -60,6 +24,46 @@ cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
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.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@ -85,7 +89,7 @@ location of your Java installation."
fi
# 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`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@ -150,11 +154,19 @@ if $cygwin ; then
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")
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
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
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
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
if defined JAVA_HOME goto findJavaFromJavaHome
@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail
: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 "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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");
* 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