mirror of
https://gitee.com/farsunset/cim.git
synced 2025-07-27 18:40:33 +08:00
1.服务端springboot升级2.1.4,protobuf升级3.7.0
2.android sdk升级,适配android8.0+,修复一些之前的兼容性问题
This commit is contained in:
parent
3f3d7e95e9
commit
0cd80d9d83
@ -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+,修复一些之前的兼容性问题
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -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>
|
||||||
|
Binary file not shown.
Binary file not shown.
BIN
cim_for_mina/cim-android-sdk/libs/protobuf-java-3.7.0.jar
Normal file
BIN
cim_for_mina/cim-android-sdk/libs/protobuf-java-3.7.0.jar
Normal file
Binary file not shown.
@ -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();
|
||||||
|
@ -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
|
||||||
|
@ -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)) {
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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.
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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>
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
boot.validation.initialized=true
|
||||||
|
eclipse.preferences.version=1
|
@ -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'
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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);
|
|
||||||
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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}")
|
||||||
|
@ -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) {
|
||||||
|
@ -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.
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
BIN
cim_for_mina/cim-client-android/.idea/caches/gradle_models.ser
generated
Normal file
BIN
cim_for_mina/cim-client-android/.idea/caches/gradle_models.ser
generated
Normal file
Binary file not shown.
12
cim_for_mina/cim-client-android/.idea/gradle.xml
generated
12
cim_for_mina/cim-client-android/.idea/gradle.xml
generated
@ -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>
|
||||||
|
28
cim_for_mina/cim-client-android/.idea/misc.xml
generated
28
cim_for_mina/cim-client-android/.idea/misc.xml
generated
@ -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" />
|
||||||
|
6
cim_for_mina/cim-client-android/.idea/vcs.xml
generated
Normal file
6
cim_for_mina/cim-client-android/.idea/vcs.xml
generated
Normal 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>
|
@ -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'
|
|
||||||
}
|
}
|
||||||
|
BIN
cim_for_mina/cim-client-android/app/libs/cim-android-sdk-3.6.jar
Normal file
BIN
cim_for_mina/cim-client-android/app/libs/cim-android-sdk-3.6.jar
Normal file
Binary file not shown.
@ -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" />
|
||||||
@ -14,11 +13,11 @@
|
|||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@drawable/icon"
|
android:icon="@drawable/icon"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/GlobeTheme" >
|
android:theme="@style/GlobeTheme">
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.SplanshActivity"
|
android:name=".ui.SplanshActivity"
|
||||||
android:alwaysRetainTaskState="true"
|
android:alwaysRetainTaskState="true"
|
||||||
android:screenOrientation="portrait" >
|
android:screenOrientation="portrait">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
@ -29,7 +28,7 @@
|
|||||||
android:name=".ui.SystemMessageActivity"
|
android:name=".ui.SystemMessageActivity"
|
||||||
android:alwaysRetainTaskState="true"
|
android:alwaysRetainTaskState="true"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="portrait" >
|
android:screenOrientation="portrait">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="com.farsunset.cim.look.notify" />
|
<action android:name="com.farsunset.cim.look.notify" />
|
||||||
|
|
||||||
@ -47,25 +46,30 @@
|
|||||||
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*************************************** -->
|
||||||
|
|
||||||
<!--消息接受广播注册-->
|
<!--消息接受广播注册-->
|
||||||
<receiver android:name="com.farsunset.ichat.example.receiver.CIMPushManagerReceiver">
|
<receiver android:name="com.farsunset.ichat.example.receiver.CIMPushManagerReceiver">
|
||||||
<intent-filter android:priority="0x7fffffff">
|
<intent-filter android:priority="0x7fffffff">
|
||||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/> <!-- 网络变化广播 -->
|
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> <!-- 网络变化广播 -->
|
||||||
<action android:name="com.farsunset.cim.MESSAGE_RECEIVED"/><!-- 消息广播action -->
|
<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_FAILED" /> <!-- 发送sendbody失败广播-->
|
||||||
<action android:name="com.farsunset.cim.SENT_SUCCESSED"/> <!-- 发送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_RECOVERY" /> <!--重新连接 -->
|
||||||
<action android:name="com.farsunset.cim.CONNECTION_CLOSED"/> <!-- 链接意外关闭广播 -->
|
<action android:name="com.farsunset.cim.CONNECTION_CLOSED" /> <!-- 链接意外关闭广播 -->
|
||||||
<action android:name="com.farsunset.cim.CONNECTION_FAILED"/> <!-- 链接失败广播 -->
|
<action android:name="com.farsunset.cim.CONNECTION_FAILED" /> <!-- 链接失败广播 -->
|
||||||
<action android:name="com.farsunset.cim.CONNECTION_SUCCESSED"/> <!-- 链接成功广播-->
|
<action android:name="com.farsunset.cim.CONNECTION_SUCCESSED" /> <!-- 链接成功广播-->
|
||||||
<action android:name="com.farsunset.cim.REPLY_RECEIVED"/> <!-- 发送sendbody成功后获得replaybody回应广播 -->
|
<action android:name="com.farsunset.cim.REPLY_RECEIVED" /> <!-- 发送sendbody成功后获得replaybody回应广播 -->
|
||||||
|
|
||||||
<!-- 【可选】 一些常用的系统广播,增强pushservice的复活机会-->
|
<!-- 【可选】 一些常用的系统广播,增强pushservice的复活机会-->
|
||||||
<action android:name="android.intent.action.USER_PRESENT" />
|
<action android:name="android.intent.action.USER_PRESENT" />
|
||||||
|
@ -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");
|
* 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 *
|
||||||
* *
|
* *
|
||||||
***************************************************************************************
|
* **************************************************************************************
|
||||||
*/
|
*/
|
||||||
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;
|
||||||
|
|
||||||
public class MessageTimeDescComparator implements Comparator<Message>{
|
import java.util.Comparator;
|
||||||
|
|
||||||
|
public class MessageTimeDescComparator implements Comparator<Message> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compare(Message arg0, Message arg1) {
|
public int compare(Message arg0, Message arg1) {
|
||||||
|
|
||||||
return (int) (arg1.getTimestamp() - arg0.getTimestamp()) ;
|
return (int) (arg1.getTimestamp() - arg0.getTimestamp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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");
|
* 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 *
|
||||||
* *
|
* *
|
||||||
***************************************************************************************
|
* **************************************************************************************
|
||||||
*/
|
*/
|
||||||
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,24 +66,24 @@ 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) {
|
||||||
|
|
||||||
final Message msg = getItem(position);
|
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.textMsgType)).setText("系统消息");
|
||||||
|
|
||||||
((TextView) chatItemView.findViewById(R.id.time)).setText(getDateTimeString(Long.valueOf(msg.getTimestamp())));
|
((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);
|
((ImageView) chatItemView.findViewById(R.id.headImageView)).setImageResource(R.drawable.icon);
|
||||||
|
|
||||||
return chatItemView;
|
return chatItemView;
|
||||||
@ -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));
|
||||||
}
|
}
|
||||||
|
@ -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");
|
* 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 *
|
||||||
* *
|
* *
|
||||||
***************************************************************************************
|
* **************************************************************************************
|
||||||
*/
|
*/
|
||||||
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;
|
public abstract class CIMMonitorActivity extends Activity implements CIMEventListener {
|
||||||
import android.net.NetworkInfo;
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -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();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -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");
|
* 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 *
|
||||||
* *
|
* *
|
||||||
***************************************************************************************
|
* **************************************************************************************
|
||||||
*/
|
*/
|
||||||
package com.farsunset.ichat.example.app;
|
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";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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");
|
* 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 *
|
||||||
* *
|
* *
|
||||||
***************************************************************************************
|
* **************************************************************************************
|
||||||
*/
|
*/
|
||||||
package com.farsunset.ichat.example.receiver;
|
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,25 +54,30 @@ 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 ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = "系统消息";
|
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, channelId);
|
||||||
final NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
|
|
||||||
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
|
||||||
|
@ -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");
|
* 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 *
|
||||||
* *
|
* *
|
||||||
***************************************************************************************
|
* **************************************************************************************
|
||||||
*/
|
*/
|
||||||
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 {
|
||||||
@ -70,19 +77,18 @@ public class LoginActivity extends CIMMonitorActivity implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnectionSuccessed(boolean autoBind) {
|
public void onConnectionSuccessed(boolean autoBind) {
|
||||||
if(!autoBind)
|
if (!autoBind)
|
||||||
CIMPushManager.bindAccount(this, accountEdit.getText().toString().trim());
|
CIMPushManager.bindAccount(this, accountEdit.getText().toString().trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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");
|
* 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 *
|
||||||
* *
|
* *
|
||||||
***************************************************************************************
|
* **************************************************************************************
|
||||||
*/
|
*/
|
||||||
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;
|
||||||
@ -34,33 +34,33 @@ import com.farsunset.ichat.example.R;
|
|||||||
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;
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
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);
|
final View view = View.inflate(this, R.layout.activity_splansh, null);
|
||||||
setContentView(view);
|
setContentView(view);
|
||||||
AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);
|
AlphaAnimation aa = new AlphaAnimation(0.3f, 1.0f);
|
||||||
aa.setDuration(2000);
|
aa.setDuration(2000);
|
||||||
view.startAnimation(aa);
|
view.startAnimation(aa);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnectionSuccessed(boolean autoBind) {
|
public void onConnectionSuccessed(boolean autoBind) {
|
||||||
|
|
||||||
Intent intent = new Intent(SplanshActivity.this,LoginActivity.class);
|
Intent intent = new Intent(SplanshActivity.this, LoginActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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");
|
* 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 *
|
||||||
* *
|
* *
|
||||||
***************************************************************************************
|
* **************************************************************************************
|
||||||
*/
|
*/
|
||||||
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,7 +40,9 @@ 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;
|
||||||
|
|
||||||
public class SystemMessageActivity extends CIMMonitorActivity implements OnClickListener{
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class SystemMessageActivity extends CIMMonitorActivity implements OnClickListener {
|
||||||
|
|
||||||
protected ListView chatListView;
|
protected ListView chatListView;
|
||||||
protected SystemMsgListViewAdapter adapter;
|
protected SystemMsgListViewAdapter adapter;
|
||||||
@ -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"));
|
||||||
@ -108,40 +108,28 @@ 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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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" />
|
||||||
|
@ -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" />
|
||||||
|
@ -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>
|
@ -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>
|
@ -3,13 +3,13 @@
|
|||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:background="@drawable/login_bg"
|
android:background="@drawable/login_bg"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/scrollAreaLayout"
|
android:id="@+id/scrollAreaLayout"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/face"
|
android:id="@+id/face"
|
||||||
@ -23,7 +23,7 @@
|
|||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/loginInputView"
|
android:id="@+id/loginInputView"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content" >
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/input"
|
android:id="@+id/input"
|
||||||
@ -32,7 +32,7 @@
|
|||||||
android:layout_marginLeft="15.0dip"
|
android:layout_marginLeft="15.0dip"
|
||||||
android:layout_marginRight="15.0dip"
|
android:layout_marginRight="15.0dip"
|
||||||
android:layout_marginTop="6.0dip"
|
android:layout_marginTop="6.0dip"
|
||||||
android:background="@drawable/login_input" >
|
android:background="@drawable/login_input">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -62,7 +62,6 @@
|
|||||||
android:singleLine="true" />
|
android:singleLine="true" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -73,7 +72,7 @@
|
|||||||
android:layout_alignRight="@id/input"
|
android:layout_alignRight="@id/input"
|
||||||
android:layout_below="@id/input"
|
android:layout_below="@id/input"
|
||||||
android:layout_marginTop="20.0dip"
|
android:layout_marginTop="20.0dip"
|
||||||
android:padding="1.0dip" >
|
android:padding="1.0dip">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/login"
|
android:id="@+id/login"
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:background="@drawable/splash_bg" >
|
android:background="@drawable/splash_bg">
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -3,17 +3,22 @@
|
|||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
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>
|
@ -4,7 +4,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:focusable="false"
|
android:focusable="false"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
@ -13,13 +13,13 @@
|
|||||||
android:layout_marginRight="10.0dip"
|
android:layout_marginRight="10.0dip"
|
||||||
android:layout_marginTop="15.0dip"
|
android:layout_marginTop="15.0dip"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/skin_msgbox_bg_top"
|
android:background="@drawable/skin_msgbox_bg_top"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textMsgType"
|
android:id="@+id/textMsgType"
|
||||||
@ -49,14 +49,13 @@
|
|||||||
android:background="@drawable/common_msgbox_bg"
|
android:background="@drawable/common_msgbox_bg"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:padding="10dip" >
|
android:padding="10dip">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
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
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:background="@drawable/skin_header_bar_bg"
|
android:background="@drawable/skin_header_bar_bg"
|
||||||
android:padding="0.0px" >
|
android:padding="0.0px">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/TOP_BACK_BUTTON"
|
android:id="@+id/TOP_BACK_BUTTON"
|
||||||
@ -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"
|
||||||
|
@ -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>
|
||||||
|
@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
cim_for_mina/cim-client-android/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
cim_for_mina/cim-client-android/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
6
cim_for_mina/cim-client-android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
cim_for_mina/cim-client-android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal 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
|
100
cim_for_mina/cim-client-android/gradlew
vendored
100
cim_for_mina/cim-client-android/gradlew
vendored
@ -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
|
# Attempt to set APP_HOME
|
||||||
# Resolve links: $0 may be a link
|
# Resolve links: $0 may be a link
|
||||||
PRG="$0"
|
PRG="$0"
|
||||||
@ -60,6 +24,46 @@ cd "`dirname \"$PRG\"`/" >/dev/null
|
|||||||
APP_HOME="`pwd -P`"
|
APP_HOME="`pwd -P`"
|
||||||
cd "$SAVED" >/dev/null
|
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
|
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" "$@"
|
||||||
|
14
cim_for_mina/cim-client-android/gradlew.bat
vendored
14
cim_for_mina/cim-client-android/gradlew.bat
vendored
@ -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
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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
Loading…
x
Reference in New Issue
Block a user