diff --git a/CIM客户端文档.doc b/CIM客户端文档.doc index 9612ce0..efeef27 100644 Binary files a/CIM客户端文档.doc and b/CIM客户端文档.doc differ diff --git a/CIM服务端及辅助文档.doc b/CIM服务端及辅助文档.doc index 6786432..2bcf28c 100644 Binary files a/CIM服务端及辅助文档.doc and b/CIM服务端及辅助文档.doc differ diff --git a/README.md b/README.md index 27c080a..b3888e2 100644 --- a/README.md +++ b/README.md @@ -61,10 +61,10 @@ CIMPushManager.init(context,"125.12.35.231",28888); * 设置一个账号登录到服务端 * @param account 用户唯一ID */ -public static void setAccount(Context context,String account) +public static void bindAccount(Context context,String account) 示例 -CIMPushManager.setAccount(context,"xiyang"); +CIMPushManager.bindAccount(context,"xiyang"); diff --git a/cim_for_netty/1.1.0.VERSION b/cim_for_netty/2.0.0.VERSION similarity index 100% rename from cim_for_netty/1.1.0.VERSION rename to cim_for_netty/2.0.0.VERSION diff --git a/cim_for_netty/cim-android-sdk/.classpath b/cim_for_netty/cim-android-sdk/.classpath new file mode 100644 index 0000000..a9e92ae --- /dev/null +++ b/cim_for_netty/cim-android-sdk/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/cim_for_netty/cim-android-sdk/.project b/cim_for_netty/cim-android-sdk/.project new file mode 100644 index 0000000..4719939 --- /dev/null +++ b/cim_for_netty/cim-android-sdk/.project @@ -0,0 +1,17 @@ + + + cim-android-sdk + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMDataConfig.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMCacheTools.java similarity index 93% rename from cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMDataConfig.java rename to cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMCacheTools.java index d38c502..b629023 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMDataConfig.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMCacheTools.java @@ -1,12 +1,14 @@ +/** + * probject:cim-android-sdk + * @version 2.0.0 + * + * @author 3979434@qq.com + */ package com.farsunset.cim.client.android; import android.content.Context; -/** - * - * @author 3979434 - * - */ - class CIMDataConfig { + + class CIMCacheTools { public static String CIM_CONFIG_INFO = "CIM_CONFIG_INFO"; diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMConnectorManager.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMConnectorManager.java similarity index 60% rename from cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMConnectorManager.java rename to cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMConnectorManager.java index 7935368..410238b 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMConnectorManager.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMConnectorManager.java @@ -1,310 +1,306 @@ -package com.farsunset.cim.client.android; -import java.net.InetSocketAddress; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import org.jboss.netty.bootstrap.ClientBootstrap; -import org.jboss.netty.channel.Channel; -import org.jboss.netty.channel.ChannelHandlerContext; -import org.jboss.netty.channel.ChannelPipeline; -import org.jboss.netty.channel.ChannelPipelineFactory; -import org.jboss.netty.channel.ChannelStateEvent; -import org.jboss.netty.channel.Channels; -import org.jboss.netty.channel.ExceptionEvent; -import org.jboss.netty.channel.MessageEvent; -import org.jboss.netty.channel.SimpleChannelUpstreamHandler; -import org.jboss.netty.channel.WriteCompletionEvent; -import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory; - -import android.content.Context; -import android.content.Intent; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; - -import com.farsunset.cim.nio.filter.ClientMessageDecoder; -import com.farsunset.cim.nio.filter.ClientMessageEncoder; -import com.farsunset.cim.nio.mutual.Message; -import com.farsunset.cim.nio.mutual.ReplyBody; -import com.farsunset.cim.nio.mutual.SentBody; - -/** - * 连接服务端管理,cim核心处理类,管理连接,以及消息处理 - * - * @author 3979434@qq.com - */ -class CIMConnectorManager { - - private Channel channel;; - - Context context; - - ClientBootstrap bootstrap; - - static CIMConnectorManager manager; - - // 消息广播action - public static final String ACTION_MESSAGE_RECEIVED = "com.farsunset.cim.MESSAGE_RECEIVED"; - - // 发送sendbody失败广播 - public static final String ACTION_SENT_FAILED = "com.farsunset.cim.SENT_FAILED"; - - // 发送sendbody成功广播 - public static final String ACTION_SENT_SUCCESS = "com.farsunset.cim.SENT_SUCCESS"; - // 链接意外关闭广播 - public static final String ACTION_CONNECTION_CLOSED = "com.farsunset.cim.CONNECTION_CLOSED"; - // 链接失败广播 - public static final String ACTION_CONNECTION_FAILED = "com.farsunset.cim.CONNECTION_FAILED"; - // 链接成功广播 - public static final String ACTION_CONNECTION_SUCCESS = "com.farsunset.cim.CONNECTION_SUCCESS"; - // 发送sendbody成功后获得replaybody回应广播 - public static final String ACTION_REPLY_RECEIVED = "com.farsunset.cim.REPLY_RECEIVED"; - // 网络变化广播 - public static final String ACTION_NETWORK_CHANGED = "android.net.conn.CONNECTIVITY_CHANGE"; - - // 未知异常 - public static final String ACTION_UNCAUGHT_EXCEPTION = "com.farsunset.cim.UNCAUGHT_EXCEPTION"; - - // CIM连接状态 - public static final String ACTION_CONNECTION_STATUS = "com.farsunset.cim.CONNECTION_STATUS"; - - - private ExecutorService executor; - - - private CIMConnectorManager(Context ctx) { - context = ctx; - executor = Executors.newFixedThreadPool(3); - - - bootstrap = new ClientBootstrap( - new NioClientSocketChannelFactory( - Executors.newCachedThreadPool(), - Executors.newCachedThreadPool())); - - bootstrap.setPipelineFactory(new ChannelPipelineFactory() { - public ChannelPipeline getPipeline() throws Exception { - return Channels.pipeline( - new ClientMessageDecoder(), - new ClientMessageEncoder(), - channelUpstreamHandler); - } - }); - - - } - - public synchronized static CIMConnectorManager getManager(Context context) { - if (manager == null) { - manager = new CIMConnectorManager(context); - } - return manager; - - } - - private synchronized void syncConnection(final String cimServerHost,final int cimServerPort) { - try { - - if(isConnected()){ - return ; - } - - channel = bootstrap.connect(new InetSocketAddress(cimServerHost, cimServerPort)).getChannel(); //这里的IP和端口,根据自己情况修改 - - } catch (Exception e) { - - Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_FAILED); - intent.putExtra("exception", e); - context.sendBroadcast(intent); - - System.out.println("******************CIM连接服务器失败 "+cimServerHost+":"+cimServerPort); - - } - - } - - public void connect(final String cimServerHost, final int cimServerPort) { - - - if (!netWorkAvailable(context)) { - - Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_FAILED); - intent.putExtra("exception", new NetWorkDisableException()); - context.sendBroadcast(intent); - - return; - } - - Future future = executor.submit(new Runnable() { - @Override - public void run() { - syncConnection(cimServerHost, cimServerPort); - } - }); - try { - if(future.get()!=null) - { - connect(cimServerHost,cimServerPort); - } - } catch (Exception e) { - - connect(cimServerHost,cimServerPort); - e.printStackTrace(); - } - } - - public void send(final SentBody body) { - - - executor.execute(new Runnable() { - @Override - public void run() { - - android.os.Message msg = new android.os.Message(); - msg.getData().putSerializable("body", body); - - if(channel!=null && channel.isConnected()) - { - boolean isDone = channel.write(body).awaitUninterruptibly(5000); - if (!isDone) { - - Intent intent = new Intent(); - intent.setAction(ACTION_SENT_FAILED); - intent.putExtra("exception", new WriteToClosedSessionException()); - intent.putExtra("sentBody", body); - context.sendBroadcast(intent); - } - }else - { - - Intent intent = new Intent(); - intent.setAction(ACTION_SENT_FAILED); - intent.putExtra("exception", new CIMSessionDisableException()); - intent.putExtra("sentBody", body); - context.sendBroadcast(intent); - } - } - }); - } - - public void destroy() { - if (manager.channel != null) { - manager.channel.close(); - } - bootstrap.shutdown(); - bootstrap.releaseExternalResources(); - manager = null; - } - - public boolean isConnected() { - if (channel == null) { - return false; - } - return channel.isConnected() ; - } - - public void deliverIsConnected() { - Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_STATUS); - intent.putExtra(CIMPushManager.KEY_CIM_CONNECTION_STATUS, isConnected()); - context.sendBroadcast(intent); - } - - - - public void closeSession() - { - if(channel!=null) - { - channel.close(); - } - } - - - SimpleChannelUpstreamHandler channelUpstreamHandler = new SimpleChannelUpstreamHandler() { - - @Override - public void channelConnected( ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { - - System.out.println("******************CIM连接服务器成功:"+ctx.getChannel().getLocalAddress()); - - Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_SUCCESS); - context.sendBroadcast(intent); - - } - - - @Override - public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent event) throws Exception { - - System.out.println("******************CIM与服务器断开连接:"+ctx.getChannel().getLocalAddress()); - if(channel.getId()==ctx.getChannel().getId()) - { - Intent intent = new Intent(); - intent.setAction(ACTION_CONNECTION_CLOSED); - context.sendBroadcast(intent); - - } - } - - - - @Override - public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) - throws Exception { - - Intent intent = new Intent(); - intent.setAction(ACTION_UNCAUGHT_EXCEPTION); - intent.putExtra("exception", e.getCause()); - context.sendBroadcast(intent); - } - - @Override - public void messageReceived(ChannelHandlerContext ctx, MessageEvent event) - throws Exception { - - if (event.getMessage() instanceof Message) { - - Intent intent = new Intent(); - intent.setAction(ACTION_MESSAGE_RECEIVED); - intent.putExtra("message", (Message) event.getMessage()); - context.sendBroadcast(intent); - - } - if (event.getMessage() instanceof ReplyBody) { - - - Intent intent = new Intent(); - intent.setAction(ACTION_REPLY_RECEIVED); - intent.putExtra("replyBody", (ReplyBody) event.getMessage()); - context.sendBroadcast(intent); - } - } - - @Override - public void writeComplete(ChannelHandlerContext ctx, WriteCompletionEvent event) - throws Exception { - - Intent intent = new Intent(); - intent.setAction(ACTION_SENT_SUCCESS); - //intent.putExtra("sentBody", null); - context.sendBroadcast(intent); - - - } - }; - - public static boolean netWorkAvailable(Context context) { - try { - ConnectivityManager nw = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); - NetworkInfo networkInfo = nw.getActiveNetworkInfo(); - return networkInfo != null; - } catch (Exception e) {} - - return false; - } - - +package com.farsunset.cim.client.android; +import io.netty.bootstrap.Bootstrap; +import io.netty.channel.Channel; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInitializer; +import io.netty.channel.ChannelOption; +import io.netty.channel.ChannelPipeline; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.SocketChannel; +import io.netty.channel.socket.nio.NioSocketChannel; +import io.netty.handler.codec.serialization.ClassResolvers; + +import java.net.InetSocketAddress; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import android.content.Context; +import android.content.Intent; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; + +import com.farsunset.cim.client.constant.CIMConstant; +import com.farsunset.cim.client.exception.CIMSessionDisableException; +import com.farsunset.cim.client.exception.NetWorkDisableException; +import com.farsunset.cim.client.exception.WriteToClosedSessionException; +import com.farsunset.cim.client.filter.ClientMessageDecoder; +import com.farsunset.cim.client.filter.ClientMessageEncoder; +import com.farsunset.cim.client.model.Message; +import com.farsunset.cim.client.model.ReplyBody; +import com.farsunset.cim.client.model.SentBody; + +/** + * 连接服务端管理,cim核心处理类,管理连接,以及消息处理 + * + * @author 3979434@qq.com + */ +@io.netty.channel.ChannelHandler.Sharable +class CIMConnectorManager extends SimpleChannelInboundHandler { + + private Channel channel;; + + Context context; + + Bootstrap bootstrap; + EventLoopGroup loopGroup ; + static CIMConnectorManager manager; + + // 消息广播action + public static final String ACTION_MESSAGE_RECEIVED = "com.farsunset.cim.MESSAGE_RECEIVED"; + + // 发送sendbody失败广播 + public static final String ACTION_SENT_FAILED = "com.farsunset.cim.SENT_FAILED"; + + // 发送sendbody成功广播 + public static final String ACTION_SENT_SUCCESS = "com.farsunset.cim.SENT_SUCCESS"; + // 链接意外关闭广播 + public static final String ACTION_CONNECTION_CLOSED = "com.farsunset.cim.CONNECTION_CLOSED"; + // 链接失败广播 + public static final String ACTION_CONNECTION_FAILED = "com.farsunset.cim.CONNECTION_FAILED"; + // 链接成功广播 + public static final String ACTION_CONNECTION_SUCCESS = "com.farsunset.cim.CONNECTION_SUCCESS"; + // 发送sendbody成功后获得replaybody回应广播 + public static final String ACTION_REPLY_RECEIVED = "com.farsunset.cim.REPLY_RECEIVED"; + // 网络变化广播 + public static final String ACTION_NETWORK_CHANGED = "android.net.conn.CONNECTIVITY_CHANGE"; + + // 未知异常 + public static final String ACTION_UNCAUGHT_EXCEPTION = "com.farsunset.cim.UNCAUGHT_EXCEPTION"; + + // CIM连接状态 + public static final String ACTION_CONNECTION_STATUS = "com.farsunset.cim.CONNECTION_STATUS"; + + + private ExecutorService executor; + + + private CIMConnectorManager(Context ctx) { + context = ctx; + executor = Executors.newFixedThreadPool(3); + bootstrap = new Bootstrap(); + loopGroup = new NioEventLoopGroup(); + bootstrap.group(loopGroup); + bootstrap.channel(NioSocketChannel.class); + bootstrap.handler(new ChannelInitializer() { + @Override + public void initChannel(SocketChannel ch) throws Exception { + ChannelPipeline pipeline = ch.pipeline(); + pipeline.addLast(new ClientMessageDecoder(ClassResolvers.cacheDisabled(null))); + pipeline.addLast(new ClientMessageEncoder()); + pipeline.addLast(CIMConnectorManager.this); + + } + }); + bootstrap.option(ChannelOption.TCP_NODELAY, true); + + } + + public synchronized static CIMConnectorManager getManager(Context context) { + if (manager == null) { + manager = new CIMConnectorManager(context); + } + return manager; + + } + + private synchronized void syncConnection(final String cimServerHost,final int cimServerPort) { + try { + + if(isConnected()){ + return ; + } + ChannelFuture channelFuture = bootstrap.connect(new InetSocketAddress(cimServerHost, cimServerPort)).sync(); //这里的IP和端口,根据自己情况修改 + channel = channelFuture.channel(); + } catch (Exception e) { + + Intent intent = new Intent(); + intent.setAction(ACTION_CONNECTION_FAILED); + intent.putExtra("exception", e); + context.sendBroadcast(intent); + + System.out.println("******************CIM连接服务器失败 "+cimServerHost+":"+cimServerPort); + + } + + } + + public void connect(final String cimServerHost, final int cimServerPort) { + + + if (!netWorkAvailable(context)) { + + Intent intent = new Intent(); + intent.setAction(ACTION_CONNECTION_FAILED); + intent.putExtra("exception", new NetWorkDisableException()); + context.sendBroadcast(intent); + + return; + } + + Future future = executor.submit(new Runnable() { + @Override + public void run() { + syncConnection(cimServerHost, cimServerPort); + } + }); + try { + if(future.get()!=null) + { + connect(cimServerHost,cimServerPort); + } + } catch (Exception e) { + + connect(cimServerHost,cimServerPort); + e.printStackTrace(); + } + } + + public void send(final SentBody body) { + + + executor.execute(new Runnable() { + @Override + public void run() { + + android.os.Message msg = new android.os.Message(); + msg.getData().putSerializable("body", body); + + if(channel!=null && channel.isActive()) + { + boolean isDone = channel.writeAndFlush(body).awaitUninterruptibly(5000); + if (!isDone) { + + Intent intent = new Intent(); + intent.setAction(ACTION_SENT_FAILED); + intent.putExtra("exception", new WriteToClosedSessionException()); + intent.putExtra("sentBody", body); + context.sendBroadcast(intent); + }else + { + Intent intent = new Intent(); + intent.setAction(ACTION_SENT_SUCCESS); + intent.putExtra("sentBody", body); + context.sendBroadcast(intent); + } + }else + { + + Intent intent = new Intent(); + intent.setAction(ACTION_SENT_FAILED); + intent.putExtra("exception", new CIMSessionDisableException()); + intent.putExtra("sentBody", body); + context.sendBroadcast(intent); + } + } + }); + } + + public void destroy() { + if (manager.channel != null) { + manager.channel.close(); + } + loopGroup.shutdownGracefully(); + manager = null; + } + + public boolean isConnected() { + if (channel == null) { + return false; + } + return channel.isActive() ; + } + + public void deliverIsConnected() { + Intent intent = new Intent(); + intent.setAction(ACTION_CONNECTION_STATUS); + intent.putExtra(CIMPushManager.KEY_CIM_CONNECTION_STATUS, isConnected()); + context.sendBroadcast(intent); + } + + + + public void closeSession() + { + if(channel!=null) + { + channel.close(); + } + } + + + + + @Override + public void channelActive( ChannelHandlerContext ctx) throws Exception { + + System.out.println("******************CIM连接服务器成功:"+ctx.channel().localAddress()); + + Intent intent = new Intent(); + intent.setAction(ACTION_CONNECTION_SUCCESS); + context.sendBroadcast(intent); + } + + + @Override + public void channelInactive(ChannelHandlerContext ctx) throws Exception { + + System.out.println("******************closeCIM与服务器断开连接:"+ctx.channel().localAddress()); + if(channel.id().asLongText().equals(ctx.channel().id().asLongText())) + { + Intent intent = new Intent(); + intent.setAction(ACTION_CONNECTION_CLOSED); + context.sendBroadcast(intent); + + } + } + + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { + + Intent intent = new Intent(); + intent.setAction(ACTION_UNCAUGHT_EXCEPTION); + intent.putExtra("exception", cause.getCause()); + context.sendBroadcast(intent); + } + + @Override + protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception { + + if (msg instanceof Message) { + Intent intent = new Intent(); + intent.setAction(ACTION_MESSAGE_RECEIVED); + intent.putExtra("message", (Message) msg); + context.sendBroadcast(intent); + + } + if (msg instanceof ReplyBody) { + Intent intent = new Intent(); + intent.setAction(ACTION_REPLY_RECEIVED); + intent.putExtra("replyBody", (ReplyBody) msg); + context.sendBroadcast(intent); + } + + //收到服务端发来的心跳请求命令,则马上回应服务器 + if (msg.equals(CIMConstant.CMD_HEARTBEAT_REQUEST)) { + ctx.writeAndFlush(CIMConstant.CMD_HEARTBEAT_RESPONSE); + } + } + + public static boolean netWorkAvailable(Context context) { + try { + ConnectivityManager nw = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); + NetworkInfo networkInfo = nw.getActiveNetworkInfo(); + return networkInfo != null; + } catch (Exception e) {} + + return false; + } + + + } \ No newline at end of file diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMEnventListenerReceiver.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMEventBroadcastReceiver.java similarity index 61% rename from cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMEnventListenerReceiver.java rename to cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMEventBroadcastReceiver.java index c55c43b..9a68fa5 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMEnventListenerReceiver.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMEventBroadcastReceiver.java @@ -1,188 +1,239 @@ -package com.farsunset.cim.client.android; - -import java.util.List; - -import android.app.ActivityManager; -import android.app.ActivityManager.RunningTaskInfo; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; -import android.os.Handler; -import com.farsunset.cim.nio.constant.CIMConstant; -import com.farsunset.cim.nio.mutual.Message; -import com.farsunset.cim.nio.mutual.ReplyBody; -import com.farsunset.cim.nio.mutual.SentBody; -/** - * 消息入口,所有消息都会经过这里 - * @author 3979434 - * - */ -public abstract class CIMEnventListenerReceiver extends BroadcastReceiver implements OnCIMMessageListener { - - - public Context context; - @Override - public void onReceive(Context ctx, Intent it) { - - context = ctx; - - if(it.getAction().equals(CIMConnectorManager.ACTION_NETWORK_CHANGED)) - { - ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService("connectivity"); - android.net.NetworkInfo info = connectivityManager.getActiveNetworkInfo(); - - onDevicesNetworkChanged(info); - } - - if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_CLOSED)) - { - dispatchConnectionClosed(); - } - - if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_FAILED)) - { - onConnectionFailed((Exception) it.getSerializableExtra("exception")); - } - - if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_SUCCESS)) - { - dispatchConnectionSucceed(); - } - - if(it.getAction().equals(CIMConnectorManager.ACTION_MESSAGE_RECEIVED)) - { - filterType999Message((Message)it.getSerializableExtra("message")); - } - - if(it.getAction().equals(CIMConnectorManager.ACTION_REPLY_RECEIVED)) - { - onReplyReceived((ReplyBody)it.getSerializableExtra("replyBody")); - } - - if(it.getAction().equals(CIMConnectorManager.ACTION_SENT_FAILED)) - { - onSentFailed((Exception) it.getSerializableExtra("exception"),(SentBody)it.getSerializableExtra("sentBody")); - } - - if(it.getAction().equals(CIMConnectorManager.ACTION_SENT_SUCCESS)) - { - onSentSucceed((SentBody)it.getSerializableExtra("sentBody")); - } - - if(it.getAction().equals(CIMConnectorManager.ACTION_UNCAUGHT_EXCEPTION)) - { - onUncaughtException((Exception)it.getSerializableExtra("exception")); - } - - if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_STATUS)) - { - onConnectionStatus(it.getBooleanExtra(CIMPushManager.KEY_CIM_CONNECTION_STATUS, false)); - } - - - } - - - private void dispatchConnectionClosed() { - - if(CIMConnectorManager.netWorkAvailable(context)) - { - CIMPushManager.init(context); - } - - onConnectionClosed(); - } - - - protected boolean isInBackground(Context context) { - List tasksInfo = ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE)).getRunningTasks(1); - if (tasksInfo.size() > 0) { - - if (context.getPackageName().equals( - tasksInfo.get(0).topActivity.getPackageName())) { - - return false; - } - } - return true; - } - - private void onConnectionFailed(Exception e){ - - if(CIMConnectorManager.netWorkAvailable(context)) - { - //间隔30秒后重连 - connectionHandler.sendMessageDelayed(connectionHandler.obtainMessage(), 30*1000); - } - } - - - Handler connectionHandler = new Handler() - { - @Override - public void handleMessage(android.os.Message message){ - - CIMPushManager.init(context); - } - - }; - - private void dispatchConnectionSucceed() { - - CIMPushManager.setAccount(context); - onConnectionSucceed(); - - } - - - - private void onUncaughtException(Throwable arg0) {} - - - - private void onDevicesNetworkChanged(NetworkInfo info) { - - if(info !=null) - { - CIMPushManager.init(context); - } - - onNetworkChanged(info); - } - - private void filterType999Message(com.farsunset.cim.nio.mutual.Message message) - { - if(CIMConstant.MessageType.TYPE_999.equals(message.getType())) - { - CIMDataConfig.putBoolean(context,CIMDataConfig.KEY_MANUAL_STOP,true); - } - - onMessageReceived(message); - } - - private void onSentFailed(Exception e, SentBody body){ - - //与服务端端开链接,重新连接 - if(e instanceof CIMSessionDisableException) - { - CIMPushManager.init(context); - }else - { - //发送失败 重新发送 - CIMPushManager.sendRequest(context, body); - } - - } - - private void onSentSucceed(SentBody body){} - - @Override - public abstract void onMessageReceived(com.farsunset.cim.nio.mutual.Message message); - @Override - public abstract void onReplyReceived(ReplyBody body); - - public abstract void onNetworkChanged(NetworkInfo info); - -} \ No newline at end of file +/** + * probject:cim-android-sdk + * @version 2.0.0 + * + * @author 3979434@qq.com + */ +package com.farsunset.cim.client.android; + +import java.util.List; + +import android.app.ActivityManager; +import android.app.ActivityManager.RunningTaskInfo; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; +import android.os.Handler; + +import com.farsunset.cim.client.constant.CIMConstant; +import com.farsunset.cim.client.exception.CIMSessionDisableException; +import com.farsunset.cim.client.model.Message; +import com.farsunset.cim.client.model.ReplyBody; +import com.farsunset.cim.client.model.SentBody; +/** + * 消息入口,所有消息都会经过这里 + */ +public abstract class CIMEventBroadcastReceiver extends BroadcastReceiver implements CIMEventListener { + + + public Context context; + @Override + public void onReceive(Context ctx, Intent it) { + + context = ctx; + + /* + * 操作事件广播,用于提高service存活率 + */ + if(it.getAction().equals(Intent.ACTION_USER_PRESENT) + ||it.getAction().equals(Intent.ACTION_POWER_CONNECTED) + ||it.getAction().equals(Intent.ACTION_POWER_DISCONNECTED) + ) + { + startPushService(); + } + + + /* + * 设备网络状态变化事件 + */ + if(it.getAction().equals(CIMConnectorManager.ACTION_NETWORK_CHANGED)) + { + ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); + android.net.NetworkInfo info = connectivityManager.getActiveNetworkInfo(); + onDevicesNetworkChanged(info); + } + + /* + * cim断开服务器事件 + */ + if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_CLOSED)) + { + if(CIMConnectorManager.netWorkAvailable(context)) + { + CIMPushManager.init(context); + } + onCIMConnectionClosed(); + } + + /* + * cim连接服务器失败事件 + */ + if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_FAILED)) + { + onConnectionFailed((Exception) it.getSerializableExtra("exception")); + } + + /* + * cim连接服务器成功事件 + */ + if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_SUCCESS)) + { + + + CIMPushManager.bindAccount(context); + + onCIMConnectionSucceed(); + } + + /* + * 收到推送消息事件 + */ + if(it.getAction().equals(CIMConnectorManager.ACTION_MESSAGE_RECEIVED)) + { + filterType999Message((Message)it.getSerializableExtra("message")); + } + + + /* + * 获取收到replybody成功事件 + */ + if(it.getAction().equals(CIMConnectorManager.ACTION_REPLY_RECEIVED)) + { + onReplyReceived((ReplyBody)it.getSerializableExtra("replyBody")); + } + + + /* + * 获取sendbody发送失败事件 + */ + if(it.getAction().equals(CIMConnectorManager.ACTION_SENT_FAILED)) + { + onSentFailed((Exception) it.getSerializableExtra("exception"),(SentBody)it.getSerializableExtra("sentBody")); + } + + /* + * 获取sendbody发送成功事件 + */ + if(it.getAction().equals(CIMConnectorManager.ACTION_SENT_SUCCESS)) + { + onSentSucceed((SentBody)it.getSerializableExtra("sentBody")); + } + + + /* + * 获取cim数据传输异常事件 + */ + if(it.getAction().equals(CIMConnectorManager.ACTION_UNCAUGHT_EXCEPTION)) + { + onUncaughtException((Exception)it.getSerializableExtra("exception")); + } + + /* + * 获取cim连接状态事件 + */ + if(it.getAction().equals(CIMConnectorManager.ACTION_CONNECTION_STATUS)) + { + onConnectionStatus(it.getBooleanExtra(CIMPushManager.KEY_CIM_CONNECTION_STATUS, false)); + } + } + + protected boolean isInBackground(Context context) { + List tasksInfo = ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE)).getRunningTasks(1); + if (tasksInfo.size() > 0) { + + if (context.getPackageName().equals( + tasksInfo.get(0).topActivity.getPackageName())) { + + return false; + } + } + return true; + } + + + private void startPushService() + { + Intent intent = new Intent(context, CIMPushService.class); + intent.putExtra(CIMPushManager.SERVICE_ACTION, CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE); + context.startService(intent); + } + + + + + private void onConnectionFailed(Exception e){ + + if(CIMConnectorManager.netWorkAvailable(context)) + { + //间隔30秒后重连 + connectionHandler.sendMessageDelayed(connectionHandler.obtainMessage(), 30*1000); + } + } + + + Handler connectionHandler = new Handler() + { + @Override + public void handleMessage(android.os.Message message){ + + CIMPushManager.init(context); + } + + }; + + + + private void onUncaughtException(Throwable arg0) {} + + + + private void onDevicesNetworkChanged(NetworkInfo info) { + + if(info !=null) + { + CIMPushManager.init(context); + } + + onNetworkChanged(info); + } + + private void filterType999Message(com.farsunset.cim.client.model.Message message) + { + if(CIMConstant.MessageType.TYPE_999.equals(message.getType())) + { + CIMCacheTools.putBoolean(context,CIMCacheTools.KEY_MANUAL_STOP,true); + } + + onMessageReceived(message); + } + + private void onSentFailed(Exception e, SentBody body){ + + //与服务端端开链接,重新连接 + if(e instanceof CIMSessionDisableException) + { + CIMPushManager.init(context); + }else + { + //发送失败 重新发送 + CIMPushManager.sendRequest(context, body); + } + + } + + private void onSentSucceed(SentBody body){} + + @Override + public abstract void onMessageReceived(com.farsunset.cim.client.model.Message message); + @Override + public abstract void onReplyReceived(ReplyBody body); + + public abstract void onNetworkChanged(NetworkInfo info); + + public abstract void onCIMConnectionSucceed(); + + public abstract void onCIMConnectionClosed(); +} diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/OnCIMMessageListener.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMEventListener.java similarity index 51% rename from cim_for_netty/cim-core/src/com/farsunset/cim/client/android/OnCIMMessageListener.java rename to cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMEventListener.java index 5fe4bf8..146a8a1 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/OnCIMMessageListener.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMEventListener.java @@ -1,23 +1,20 @@ - +/** + * probject:cim-android-sdk + * @version 2.0.0 + * + * @author 3979434@qq.com + */ package com.farsunset.cim.client.android; import android.net.NetworkInfo; -import com.farsunset.cim.nio.mutual.Message; -import com.farsunset.cim.nio.mutual.ReplyBody; +import com.farsunset.cim.client.model.Message; +import com.farsunset.cim.client.model.ReplyBody; /** *CIM 主要事件接口 - * 类名称:OnCIMMessageListener - * 类描述: - * 创建人: 3979434 - * 修改人: 3979434 - * 修改时间: 2014-4-28 下午5:07:47 - * 修改备注: - * @version 1.0.0 - * */ -public interface OnCIMMessageListener +public interface CIMEventListener { @@ -25,36 +22,36 @@ public interface OnCIMMessageListener * 当收到服务端推送过来的消息时调用 * @param message */ - public abstract void onMessageReceived(Message message); + public void onMessageReceived(Message message); /** * 当调用CIMPushManager.sendRequest()向服务端发送请求,获得相应时调用 * @param replybody */ - public abstract void onReplyReceived(ReplyBody replybody); + public void onReplyReceived(ReplyBody replybody); /** * 当手机网络发生变化时调用 * @param networkinfo */ - public abstract void onNetworkChanged(NetworkInfo networkinfo); + public void onNetworkChanged(NetworkInfo networkinfo); /** * 获取到是否连接到服务端 * 通过调用CIMPushManager.detectIsConnected()来异步获取 * */ - public abstract void onConnectionStatus(boolean isConnected); + public void onConnectionStatus(boolean isConnected); /** * 连接服务端成功 */ - public abstract void onConnectionSucceed(); + public void onCIMConnectionSucceed(); /** * 连接断开 */ - public abstract void onConnectionClosed(); + public void onCIMConnectionClosed(); } diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMListenerManager.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMListenerManager.java new file mode 100644 index 0000000..f2d2965 --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMListenerManager.java @@ -0,0 +1,101 @@ +/** + * probject:cim-android-sdk + * @version 2.0.0 + * + * @author 3979434@qq.com + */ +package com.farsunset.cim.client.android; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; + +import com.farsunset.cim.client.constant.CIMConstant; + +import android.app.Activity; +import android.content.Context; +import android.content.pm.ActivityInfo; +import android.content.pm.PackageManager; + + +/** + * CIM 消息监听器管理 + */ +public class CIMListenerManager { + + private static ArrayList cimListeners = new ArrayList(); + + + + public static void registerMessageListener(CIMEventListener listener,Context mcontext) { + + if (!cimListeners.contains(listener)) { + cimListeners.add(listener); + // 按照接收顺序倒序 + Collections.sort(cimListeners, new CIMMessageReceiveComparator(mcontext)); + } + } + + + public static void removeMessageListener(CIMEventListener listener) { + for (int i = 0; i < cimListeners.size(); i++) { + if (listener.getClass() == cimListeners.get(i).getClass()) { + cimListeners.remove(i); + } + } + } + + public static ArrayList getCIMListeners() { + return cimListeners; + } + + + + + + /** + * 消息接收activity的接收顺序排序,CIM_RECEIVE_ORDER倒序 + */ + static class CIMMessageReceiveComparator implements Comparator{ + + Context mcontext; + public CIMMessageReceiveComparator(Context ctx) + { + mcontext = ctx; + } + + @Override + public int compare(CIMEventListener arg1, CIMEventListener arg2) { + + Integer order1 = CIMConstant.CIM_DEFAULT_MESSAGE_ORDER; + Integer order2 = CIMConstant.CIM_DEFAULT_MESSAGE_ORDER; + ActivityInfo info; + if (arg1 instanceof Activity ) { + + try { + info = mcontext.getPackageManager() .getActivityInfo(((Activity)(arg1)).getComponentName(), PackageManager.GET_META_DATA); + if(info.metaData!=null) + { + order1 = info.metaData.getInt("CIM_RECEIVE_ORDER"); + } + + } catch (Exception e) {} + } + + if (arg1 instanceof Activity ) { + try { + info = mcontext.getPackageManager() .getActivityInfo(((Activity)(arg2)).getComponentName(), PackageManager.GET_META_DATA); + if(info.metaData!=null) + { + order2 = info.metaData.getInt("CIM_RECEIVE_ORDER"); + } + + } catch (Exception e) {} + } + + return order2.compareTo(order1); + } + + + } + +} \ No newline at end of file diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMPushManager.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMPushManager.java similarity index 57% rename from cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMPushManager.java rename to cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMPushManager.java index fd23002..039cbc5 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMPushManager.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMPushManager.java @@ -1,191 +1,215 @@ -package com.farsunset.cim.client.android; -import android.content.Context; -import android.content.Intent; -import android.telephony.TelephonyManager; -import java.util.UUID; -import com.farsunset.cim.nio.constant.CIMConstant; -import com.farsunset.cim.nio.mutual.SentBody; - -/** - * CIM 功能接口 - * - * @author 3979434@qq.com - */ -public class CIMPushManager { - - static String ACTION_CONNECTION_KEEPALIVE ="ACTION_CONNECTION_KEEPALIVE"; - - static String ACTION_CONNECTION ="ACTION_CONNECTION"; - - static String ACTION_CONNECTION_STATUS ="ACTION_CONNECTION_STATUS"; - - static String ACTION_SENDREQUEST ="ACTION_SENDREQUEST"; - - static String ACTION_DISCONNECTION ="ACTION_DISSENDREQUEST"; - - static String ACTION_DESTORY ="ACTION_DESTORY"; - - static String SERVICE_ACTION ="SERVICE_ACTION"; - - static String KEY_SEND_BODY ="KEY_SEND_BODY"; - - static String KEY_CIM_CONNECTION_STATUS ="KEY_CIM_CONNECTION_STATUS"; - - /** - * 初始化,连接服务端,在程序启动页或者 在Application里调用 - * @param context - * @param ip - * @param port - */ - public static void init(Context context,String ip,int port){ - - CIMDataConfig.putBoolean(context,CIMDataConfig.KEY_CIM_DESTORYED, false); - CIMDataConfig.putBoolean(context,CIMDataConfig.KEY_MANUAL_STOP, false); - - Intent serviceIntent = new Intent(context, CIMPushService.class); - serviceIntent.putExtra(CIMDataConfig.KEY_CIM_SERVIER_HOST, ip); - serviceIntent.putExtra(CIMDataConfig.KEY_CIM_SERVIER_PORT, port); - serviceIntent.putExtra(SERVICE_ACTION, ACTION_CONNECTION); - context.startService(serviceIntent); - CIMDataConfig.putString(context, CIMDataConfig.KEY_CIM_SERVIER_HOST, ip); - CIMDataConfig.putInt(context, CIMDataConfig.KEY_CIM_SERVIER_PORT, port); - } - - protected static void init(Context context){ - - boolean isManualStop = CIMDataConfig.getBoolean(context,CIMDataConfig.KEY_MANUAL_STOP); - boolean isManualDestory = CIMDataConfig.getBoolean(context,CIMDataConfig.KEY_CIM_DESTORYED); - - if(isManualStop || isManualDestory) - { - return ; - } - - String host = CIMDataConfig.getString(context, CIMDataConfig.KEY_CIM_SERVIER_HOST); - int port =CIMDataConfig.getInt(context, CIMDataConfig.KEY_CIM_SERVIER_PORT); - - init(context,host,port); - - } - - - /** - * 设置一个账号登录到服务端 - * @param account 用户唯一ID - */ - public static void setAccount(Context context,String account){ - - - boolean isManualDestory = CIMDataConfig.getBoolean(context,CIMDataConfig.KEY_CIM_DESTORYED); - if(isManualDestory || account==null || account.trim().length()==0) - { - return ; - } - - CIMDataConfig.putBoolean(context,CIMDataConfig.KEY_MANUAL_STOP, false); - CIMDataConfig.putString(context,CIMDataConfig.KEY_ACCOUNT, account); - - String imei = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId(); - imei += context.getPackageName(); - SentBody sent = new SentBody(); - sent.setKey(CIMConstant.RequestKey.CLIENT_BIND); - sent.put("account", account); - sent.put("deviceId",UUID.nameUUIDFromBytes(imei.getBytes()).toString().replaceAll("-", "")); - sent.put("channel", "android"); - sent.put("device",android.os.Build.MODEL); - - sendRequest(context,sent); - - - } - - protected static void setAccount(Context context){ - - - - String account = CIMDataConfig.getString(context,CIMDataConfig.KEY_ACCOUNT); - setAccount(context,account); - } - - - - /** - * 发送一个CIM请求 - * @param context - * @body - */ - public static void sendRequest(Context context,SentBody body){ - - boolean isManualStop = CIMDataConfig.getBoolean(context,CIMDataConfig.KEY_MANUAL_STOP); - boolean isManualDestory = CIMDataConfig.getBoolean(context,CIMDataConfig.KEY_CIM_DESTORYED); - - if(isManualStop || isManualDestory) - { - return ; - } - - Intent serviceIntent = new Intent(context, CIMPushService.class); - serviceIntent.putExtra(KEY_SEND_BODY, body); - serviceIntent.putExtra(SERVICE_ACTION, ACTION_SENDREQUEST); - context.startService(serviceIntent); - - } - - /** - * 停止接受推送,将会退出当前账号登录,端口与服务端的连接 - * @param context - */ - public static void stop(Context context){ - - boolean isManualDestory = CIMDataConfig.getBoolean(context,CIMDataConfig.KEY_CIM_DESTORYED); - if(isManualDestory){ - return ; - } - - CIMDataConfig.putBoolean(context,CIMDataConfig.KEY_MANUAL_STOP, true); - - Intent serviceIntent = new Intent(context, CIMPushService.class); - serviceIntent.putExtra(SERVICE_ACTION, ACTION_DISCONNECTION); - context.startService(serviceIntent); - - } - - - /** - * 完全销毁CIM,一般用于完全退出程序,调用resume将不能恢复 - * @param context - */ - public static void destory(Context context){ - - - CIMDataConfig.putBoolean(context,CIMDataConfig.KEY_CIM_DESTORYED, true); - CIMDataConfig.putString(context,CIMDataConfig.KEY_ACCOUNT, null); - - Intent serviceIntent = new Intent(context, CIMPushService.class); - serviceIntent.putExtra(SERVICE_ACTION, ACTION_DESTORY); - context.startService(serviceIntent); - - } - - - /** - * 重新恢复接收推送,重新连接服务端,并登录当前账号 - * @param context - */ - public static void resume(Context context){ - - boolean isManualDestory = CIMDataConfig.getBoolean(context,CIMDataConfig.KEY_CIM_DESTORYED); - if(isManualDestory){ - return ; - } - - setAccount(context); - } - - public void detectIsConnected(Context context){ - Intent serviceIntent = new Intent(context, CIMPushService.class); - serviceIntent.putExtra(SERVICE_ACTION, ACTION_CONNECTION_STATUS); - context.startService(serviceIntent); - } - +/** + * probject:cim-android-sdk + * @version 2.0.0 + * + * @author 3979434@qq.com + */ +package com.farsunset.cim.client.android; +import java.util.UUID; + +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager.NameNotFoundException; +import android.telephony.TelephonyManager; + +import com.farsunset.cim.client.constant.CIMConstant; +import com.farsunset.cim.client.model.SentBody; + +/** + * CIM 功能接口 + */ +public class CIMPushManager { + + static String ACTION_ACTIVATE_PUSH_SERVICE ="ACTION_ACTIVATE_PUSH_SERVICE"; + + static String ACTION_CONNECTION ="ACTION_CONNECTION"; + + static String ACTION_CONNECTION_STATUS ="ACTION_CONNECTION_STATUS"; + + static String ACTION_SENDREQUEST ="ACTION_SENDREQUEST"; + + static String ACTION_DISCONNECTION ="ACTION_DISSENDREQUEST"; + + static String ACTION_DESTORY ="ACTION_DESTORY"; + + static String SERVICE_ACTION ="SERVICE_ACTION"; + + static String KEY_SEND_BODY ="KEY_SEND_BODY"; + + static String KEY_CIM_CONNECTION_STATUS ="KEY_CIM_CONNECTION_STATUS"; + + /** + * 初始化,连接服务端,在程序启动页或者 在Application里调用 + * @param context + * @param ip + * @param port + */ + public static void init(Context context,String ip,int port){ + + CIMCacheTools.putBoolean(context,CIMCacheTools.KEY_CIM_DESTORYED, false); + CIMCacheTools.putBoolean(context,CIMCacheTools.KEY_MANUAL_STOP, false); + + CIMCacheTools.putString(context, CIMCacheTools.KEY_CIM_SERVIER_HOST, ip); + CIMCacheTools.putInt(context, CIMCacheTools.KEY_CIM_SERVIER_PORT, port); + + Intent serviceIntent = new Intent(context, CIMPushService.class); + serviceIntent.putExtra(CIMCacheTools.KEY_CIM_SERVIER_HOST, ip); + serviceIntent.putExtra(CIMCacheTools.KEY_CIM_SERVIER_PORT, port); + serviceIntent.putExtra(SERVICE_ACTION, ACTION_CONNECTION); + context.startService(serviceIntent); + + } + + protected static void init(Context context){ + + boolean isManualStop = CIMCacheTools.getBoolean(context,CIMCacheTools.KEY_MANUAL_STOP); + boolean isManualDestory = CIMCacheTools.getBoolean(context,CIMCacheTools.KEY_CIM_DESTORYED); + + if(isManualStop || isManualDestory) + { + return ; + } + + String host = CIMCacheTools.getString(context, CIMCacheTools.KEY_CIM_SERVIER_HOST); + int port =CIMCacheTools.getInt(context, CIMCacheTools.KEY_CIM_SERVIER_PORT); + + init(context,host,port); + + } + + + /** + * 设置一个账号登录到服务端 + * @param account 用户唯一ID + */ + public static void bindAccount(Context context,String account){ + + + boolean isManualDestory = CIMCacheTools.getBoolean(context,CIMCacheTools.KEY_CIM_DESTORYED); + if(isManualDestory || account==null || account.trim().length()==0) + { + return ; + } + + CIMCacheTools.putBoolean(context,CIMCacheTools.KEY_MANUAL_STOP, false); + CIMCacheTools.putString(context,CIMCacheTools.KEY_ACCOUNT, account); + + String imei = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId(); + imei += context.getPackageName(); + SentBody sent = new SentBody(); + sent.setKey(CIMConstant.RequestKey.CLIENT_BIND); + sent.put("account", account); + sent.put("deviceId",UUID.nameUUIDFromBytes(imei.getBytes()).toString().replaceAll("-", "")); + sent.put("channel", "android"); + sent.put("device",android.os.Build.MODEL); + sent.put("appVersion",getVersionName(context)); + sent.put("osVersion",android.os.Build.VERSION.RELEASE); + sendRequest(context,sent); + + + } + + + protected static void bindAccount(Context context){ + + + + String account = CIMCacheTools.getString(context,CIMCacheTools.KEY_ACCOUNT); + bindAccount(context,account); + } + + + + /** + * 发送一个CIM请求 + * @param context + * @body + */ + public static void sendRequest(Context context,SentBody body){ + + boolean isManualStop = CIMCacheTools.getBoolean(context,CIMCacheTools.KEY_MANUAL_STOP); + boolean isManualDestory = CIMCacheTools.getBoolean(context,CIMCacheTools.KEY_CIM_DESTORYED); + + if(isManualStop || isManualDestory) + { + return ; + } + + Intent serviceIntent = new Intent(context, CIMPushService.class); + serviceIntent.putExtra(KEY_SEND_BODY, body); + serviceIntent.putExtra(SERVICE_ACTION, ACTION_SENDREQUEST); + context.startService(serviceIntent); + + } + + /** + * 停止接受推送,将会退出当前账号登录,端口与服务端的连接 + * @param context + */ + public static void stop(Context context){ + + boolean isManualDestory = CIMCacheTools.getBoolean(context,CIMCacheTools.KEY_CIM_DESTORYED); + if(isManualDestory){ + return ; + } + + CIMCacheTools.putBoolean(context,CIMCacheTools.KEY_MANUAL_STOP, true); + + Intent serviceIntent = new Intent(context, CIMPushService.class); + serviceIntent.putExtra(SERVICE_ACTION, ACTION_DISCONNECTION); + context.startService(serviceIntent); + + } + + + /** + * 完全销毁CIM,一般用于完全退出程序,调用resume将不能恢复 + * @param context + */ + public static void destory(Context context){ + + + CIMCacheTools.putBoolean(context,CIMCacheTools.KEY_CIM_DESTORYED, true); + CIMCacheTools.putString(context,CIMCacheTools.KEY_ACCOUNT, null); + + Intent serviceIntent = new Intent(context, CIMPushService.class); + serviceIntent.putExtra(SERVICE_ACTION, ACTION_DESTORY); + context.startService(serviceIntent); + + } + + + /** + * 重新恢复接收推送,重新连接服务端,并登录当前账号 + * @param context + */ + public static void resume(Context context){ + + boolean isManualDestory = CIMCacheTools.getBoolean(context,CIMCacheTools.KEY_CIM_DESTORYED); + if(isManualDestory){ + return ; + } + + bindAccount(context); + } + + public static void detectIsConnected(Context context){ + Intent serviceIntent = new Intent(context, CIMPushService.class); + serviceIntent.putExtra(SERVICE_ACTION, ACTION_CONNECTION_STATUS); + context.startService(serviceIntent); + } + + + + private static String getVersionName(Context context) { + String versionName = null; + try { + PackageInfo mPackageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); + versionName = mPackageInfo.versionName; + } catch (NameNotFoundException e) { + } + return versionName; + } + } \ No newline at end of file diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMPushService.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMPushService.java similarity index 54% rename from cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMPushService.java rename to cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMPushService.java index c496539..5fe5206 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMPushService.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/android/CIMPushService.java @@ -1,15 +1,11 @@ package com.farsunset.cim.client.android; - -import android.app.AlarmManager; -import android.app.PendingIntent; import android.app.Service; import android.content.Intent; -import android.os.Binder; import android.os.IBinder; import android.util.Log; -import com.farsunset.cim.nio.mutual.SentBody; +import com.farsunset.cim.client.model.SentBody; /** @@ -19,18 +15,12 @@ import com.farsunset.cim.nio.mutual.SentBody; */ public class CIMPushService extends Service { - + protected final static int DEF_CIM_PORT = 28888; CIMConnectorManager manager; - AlarmManager localAlarmManager; - private IBinder binder=new CIMPushService.LocalBinder(); - PendingIntent localPendingIntent; @Override public void onCreate() { manager = CIMConnectorManager.getManager(this.getApplicationContext()); - localPendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(this, KeepAliveReceiver.class), PendingIntent.FLAG_CANCEL_CURRENT); - localAlarmManager = (AlarmManager)getSystemService(ALARM_SERVICE); - localAlarmManager.setRepeating(AlarmManager.RTC_WAKEUP, 300000L + System.currentTimeMillis(),300000L, localPendingIntent); } @@ -41,18 +31,18 @@ import com.farsunset.cim.nio.mutual.SentBody; if(intent==null) { intent = new Intent(CIMPushManager.ACTION_CONNECTION); - String host = CIMDataConfig.getString(this, CIMDataConfig.KEY_CIM_SERVIER_HOST); - int port =CIMDataConfig.getInt(this, CIMDataConfig.KEY_CIM_SERVIER_PORT); - intent.putExtra(CIMDataConfig.KEY_CIM_SERVIER_HOST, host); - intent.putExtra(CIMDataConfig.KEY_CIM_SERVIER_PORT, port); + String host = CIMCacheTools.getString(this, CIMCacheTools.KEY_CIM_SERVIER_HOST); + int port =CIMCacheTools.getInt(this, CIMCacheTools.KEY_CIM_SERVIER_PORT); + intent.putExtra(CIMCacheTools.KEY_CIM_SERVIER_HOST, host); + intent.putExtra(CIMCacheTools.KEY_CIM_SERVIER_PORT, port); } action = intent.getStringExtra(CIMPushManager.SERVICE_ACTION); if(CIMPushManager.ACTION_CONNECTION.equals(action)) { - String host = intent.getStringExtra(CIMDataConfig.KEY_CIM_SERVIER_HOST); - int port = intent.getIntExtra(CIMDataConfig.KEY_CIM_SERVIER_PORT, 28888); + String host = intent.getStringExtra(CIMCacheTools.KEY_CIM_SERVIER_HOST); + int port = intent.getIntExtra(CIMCacheTools.KEY_CIM_SERVIER_PORT, DEF_CIM_PORT); manager.connect(host,port); } @@ -68,8 +58,6 @@ import com.farsunset.cim.nio.mutual.SentBody; if(CIMPushManager.ACTION_DESTORY.equals(action)) { - localAlarmManager.cancel(localPendingIntent); - localPendingIntent.cancel(); manager.destroy(); this.stopSelf(); android.os.Process.killProcess(android.os.Process.myPid()); @@ -80,14 +68,14 @@ import com.farsunset.cim.nio.mutual.SentBody; manager.deliverIsConnected(); } - if(CIMPushManager.ACTION_CONNECTION_KEEPALIVE.equals(action)) + if(CIMPushManager.ACTION_ACTIVATE_PUSH_SERVICE.equals(action)) { if(!manager.isConnected()) { - Log.d(CIMPushService.class.getSimpleName(), "isConnected() = false "); - String host = intent.getStringExtra(CIMDataConfig.KEY_CIM_SERVIER_HOST); - int port = intent.getIntExtra(CIMDataConfig.KEY_CIM_SERVIER_PORT, 28888); + Log.d(CIMPushService.class.getSimpleName(), "cimpush isConnected() = false "); + String host = intent.getStringExtra(CIMCacheTools.KEY_CIM_SERVIER_HOST); + int port = intent.getIntExtra(CIMCacheTools.KEY_CIM_SERVIER_PORT, DEF_CIM_PORT); manager.connect(host,port); }else { @@ -98,18 +86,12 @@ import com.farsunset.cim.nio.mutual.SentBody; return Service.START_REDELIVER_INTENT; } - - + + @Override public IBinder onBind(Intent arg0) { - return binder; + return null; } - - public class LocalBinder extends Binder{ - - public CIMPushService getService() - { - return CIMPushService.this; - } - } + + } diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/constant/CIMConstant.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/constant/CIMConstant.java new file mode 100644 index 0000000..c1e85ef --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/constant/CIMConstant.java @@ -0,0 +1,68 @@ +/** + * probject:cim-android-sdk + * @version 2.0.0 + * + * @author 3979434@qq.com + */ +package com.farsunset.cim.client.constant; + +/** + * 常量 + */ +public interface CIMConstant { + + + public static String UTF8="UTF-8"; + + public static byte MESSAGE_SEPARATE='\b'; + + + public static int CIM_DEFAULT_MESSAGE_ORDER=1; + + public static class ReturnCode{ + + public static String CODE_404 ="404"; + + public static String CODE_403 ="403"; + + public static String CODE_405 ="405"; + + public static String CODE_200 ="200"; + + public static String CODE_206 ="206"; + + public static String CODE_500 ="500"; + + + } + + /** + * 服务端心跳请求命令 + */ + public static final String CMD_HEARTBEAT_REQUEST="cmd_server_hb_request"; + /** + * 客户端心跳响应命令 + */ + public static final String CMD_HEARTBEAT_RESPONSE ="cmd_client_hb_response"; + + + public static class RequestKey{ + + + public static String CLIENT_BIND ="client_bind"; + + public static String CLIENT_LOGOUT ="client_logout"; + + public static String CLIENT_OFFLINE_MESSAGE ="client_get_offline_message"; + + } + + + public static class MessageType{ + + //用户会 踢出下线消息类型 + public static String TYPE_999 ="999"; + + } + +} \ No newline at end of file diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMSessionDisableException.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/exception/CIMSessionDisableException.java similarity index 64% rename from cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMSessionDisableException.java rename to cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/exception/CIMSessionDisableException.java index 29dc437..831e66a 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMSessionDisableException.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/exception/CIMSessionDisableException.java @@ -1,4 +1,10 @@ -package com.farsunset.cim.client.android; +/** + * probject:cim-android-sdk + * @version 2.0.0 + * + * @author 3979434@qq.com + */ +package com.farsunset.cim.client.exception; public class CIMSessionDisableException extends Exception { diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/NetWorkDisableException.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/exception/NetWorkDisableException.java similarity index 63% rename from cim_for_netty/cim-core/src/com/farsunset/cim/client/android/NetWorkDisableException.java rename to cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/exception/NetWorkDisableException.java index 3162370..c5ed6ab 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/NetWorkDisableException.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/exception/NetWorkDisableException.java @@ -1,4 +1,10 @@ -package com.farsunset.cim.client.android; +/** + * probject:cim-android-sdk + * @version 2.0.0 + * + * @author 3979434@qq.com + */ +package com.farsunset.cim.client.exception; public class NetWorkDisableException extends Exception { diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/WriteToClosedSessionException.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/exception/WriteToClosedSessionException.java similarity index 69% rename from cim_for_netty/cim-core/src/com/farsunset/cim/client/android/WriteToClosedSessionException.java rename to cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/exception/WriteToClosedSessionException.java index 527f890..399723e 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/WriteToClosedSessionException.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/exception/WriteToClosedSessionException.java @@ -1,4 +1,10 @@ -package com.farsunset.cim.client.android; +/** + * probject:cim-android-sdk + * @version 2.0.0 + * + * @author 3979434@qq.com + */ +package com.farsunset.cim.client.exception; import java.io.Serializable; diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/filter/ClientMessageDecoder.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/filter/ClientMessageDecoder.java similarity index 69% rename from cim_for_netty/cim-core/src/com/farsunset/cim/nio/filter/ClientMessageDecoder.java rename to cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/filter/ClientMessageDecoder.java index d567ff4..65583de 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/filter/ClientMessageDecoder.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/filter/ClientMessageDecoder.java @@ -1,45 +1,50 @@ -package com.farsunset.cim.nio.filter; +package com.farsunset.cim.client.filter; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.serialization.ClassResolver; +import io.netty.handler.codec.serialization.ObjectDecoder; import java.io.ByteArrayInputStream; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; -import org.jboss.netty.buffer.ChannelBuffer; -import org.jboss.netty.channel.Channel; -import org.jboss.netty.channel.ChannelHandlerContext; -import org.jboss.netty.handler.codec.frame.FrameDecoder; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import com.farsunset.cim.nio.constant.CIMConstant; -import com.farsunset.cim.nio.mutual.Message; -import com.farsunset.cim.nio.mutual.ReplyBody; +import android.util.Log; + +import com.farsunset.cim.client.constant.CIMConstant; +import com.farsunset.cim.client.model.Message; +import com.farsunset.cim.client.model.ReplyBody; /** * 客户端消息解码 * @author 3979434@qq.com * */ -public class ClientMessageDecoder extends FrameDecoder { +public class ClientMessageDecoder extends ObjectDecoder { + public ClientMessageDecoder(ClassResolver classResolver) { + super(classResolver); + } + @Override - protected Object decode(ChannelHandlerContext arg0, Channel channel,ChannelBuffer buffer) throws Exception { + public Object decode(ChannelHandlerContext arg0, ByteBuf buffer) throws Exception { int length = buffer.readableBytes(); /** * CIMConstant.MESSAGE_SEPARATE 为消息界限 * 当一次收到多个消息时,以此分隔解析多个消息 */ - if (buffer.readable()&& length > 0 && CIMConstant.MESSAGE_SEPARATE == buffer.getByte(length-1)) { + if (buffer.isReadable()&& length > 0 && CIMConstant.MESSAGE_SEPARATE == buffer.getByte(length-1)) { byte[] data = new byte[length-1]; buffer.readBytes(data); - String message = new String(new String(data,CIMConstant.ENCODE_UTF8)); - - System.out.println("ClientMessageDecoder:" + message); - + String message = new String(new String(data,CIMConstant.UTF8)); + Log.i(ClientMessageDecoder.class.getSimpleName(), message.toString()); //将末尾的消息分隔符读取掉 buffer.readByte(); @@ -55,10 +60,13 @@ public class ClientMessageDecoder extends FrameDecoder { private Object mappingMessageObject(String message) throws Exception { - + if(message.equals(CIMConstant.CMD_HEARTBEAT_REQUEST))//如果是心跳请求命令则直接返回 + { + return CIMConstant.CMD_HEARTBEAT_REQUEST; + } DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); - Document doc = (Document) builder.parse(new ByteArrayInputStream(message.getBytes(CIMConstant.ENCODE_UTF8))); + Document doc = (Document) builder.parse(new ByteArrayInputStream(message.getBytes(CIMConstant.UTF8))); String name = doc.getDocumentElement().getTagName(); if (name.equals("reply")) { diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/filter/ClientMessageEncoder.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/filter/ClientMessageEncoder.java new file mode 100644 index 0000000..75cc455 --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/filter/ClientMessageEncoder.java @@ -0,0 +1,29 @@ +package com.farsunset.cim.client.filter; + + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; + +import android.util.Log; + +import com.farsunset.cim.client.constant.CIMConstant; + +/** + * 客户端消息发送前进行编码,可在此加密消息 + * @author 3979434@qq.com + * + */ +public class ClientMessageEncoder extends MessageToByteEncoder { + + @Override + protected void encode(ChannelHandlerContext ctx, Object message, ByteBuf out) throws Exception { + out.writeBytes(message.toString().getBytes(CIMConstant.UTF8)); + out.writeByte(CIMConstant.MESSAGE_SEPARATE); + Log.i(ClientMessageEncoder.class.getSimpleName(), message.toString()); + } + + + + +} diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/model/Message.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/model/Message.java new file mode 100644 index 0000000..0ea72e5 --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/model/Message.java @@ -0,0 +1,174 @@ +/** + * probject:cim-android-sdk + * @version 2.0.0 + * + * @author 3979434@qq.com + */ +package com.farsunset.cim.client.model; + +import java.io.Serializable; +/** + * 消息对象 + */ +public class Message implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 消息类型,用户自定义消息类别 + */ + private String mid; + + + /** + * 消息类型,用户自定义消息类别 + */ + private String type; + /** + * 消息标题 + */ + private String title; + /** + * 消息类容,于type 组合为任何类型消息,content 根据 format 可表示为 text,json ,xml数据格式 + */ + private String content; + + /** + * 消息发送者账号 + */ + private String sender; + /** + * 消息发送者接收者 + */ + private String receiver; + + /** + * 文件 url + */ + private String file; + /** + * 文件类型 + */ + private String fileType; + + /** + * content 内容格式 + */ + private String format = "txt"; + + + private long timestamp; + + + public Message() + { + timestamp = System.currentTimeMillis(); + } + public long getTimestamp() { + return timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getSender() { + return sender; + } + + public void setSender(String sender) { + this.sender = sender; + } + + public String getReceiver() { + return receiver; + } + + public void setReceiver(String receiver) { + this.receiver = receiver; + } + + public String getFile() { + return file; + } + + public void setFile(String file) { + this.file = file; + } + + public String getFileType() { + return fileType; + } + + public void setFileType(String fileType) { + this.fileType = fileType; + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + public String toString() + { + + StringBuffer buffer = new StringBuffer(); + buffer.append(""); + buffer.append(""); + buffer.append("").append(mid).append(""); + buffer.append("").append(type).append(""); + buffer.append("").append(this.getTitle()==null?"":this.getTitle()).append(""); + buffer.append(""); + buffer.append("").append(this.getFile()==null?"":this.getFile()).append(""); + buffer.append("").append(this.getFileType()==null?"":this.getFileType()).append(""); + buffer.append("").append(this.getSender()==null?"":this.getSender()).append(""); + buffer.append("").append(this.getReceiver()==null?"":this.getReceiver()).append(""); + buffer.append("").append(this.getFormat()==null?"":this.getFormat()).append(""); + buffer.append("").append(timestamp).append(""); + buffer.append(""); + return buffer.toString(); + } + public String toXmlString() + { + + return toString(); + } + + public String getMid() { + return mid; + } + + public void setMid(String mid) { + this.mid = mid; + } + + +} diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/mutual/ReplyBody.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/model/ReplyBody.java similarity index 94% rename from cim_for_netty/cim-core/src/com/farsunset/cim/nio/mutual/ReplyBody.java rename to cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/model/ReplyBody.java index dcf9c0e..0bc938f 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/mutual/ReplyBody.java +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/model/ReplyBody.java @@ -1,18 +1,19 @@ -package com.farsunset.cim.nio.mutual; +/** + * probject:cim-android-sdk + * @version 2.0.0 + * + * @author 3979434@qq.com + */ +package com.farsunset.cim.client.model; import java.io.Serializable; import java.util.HashMap; /** * 请求应答对象 - * @author 3979434@qq.com * */ public class ReplyBody implements Serializable { - - /** - * @author 3979434@qq.com - * 服务端返回消息对象 - */ + private static final long serialVersionUID = 1L; /** diff --git a/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/model/SentBody.java b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/model/SentBody.java new file mode 100644 index 0000000..38c444f --- /dev/null +++ b/cim_for_netty/cim-android-sdk/src/com/farsunset/cim/client/model/SentBody.java @@ -0,0 +1,84 @@ +/** + * probject:cim-android-sdk + * @version 2.0.0 + * + * @author 3979434@qq.com + */ +package com.farsunset.cim.client.model; + +import java.io.Serializable; +import java.util.HashMap; +/** + * java |android 客户端请求结构 + * + */ +public class SentBody implements Serializable { + + private static final long serialVersionUID = 1L; + + private String key; + + private HashMap data; + + private long timestamp; + + public SentBody() { + + data = new HashMap(); + timestamp = System.currentTimeMillis(); + } + + public String getKey() { + return key; + } + + public String get(String k) { + return data.get(k); + } + + public long getTimestamp() { + return timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } + + public void setKey(String key) { + this.key = key; + } + + public void put(String k, String v) { + data.put(k, v); + } + + public void remove(String k) { + data.remove(k); + } + + public HashMap getData() { + return data; + } + + @Override + public String toString() { + StringBuffer buffer = new StringBuffer(); + buffer.append(""); + buffer.append(""); + buffer.append("").append(key).append(""); + buffer.append("").append(timestamp).append(""); + buffer.append(""); + for (String key : data.keySet()) { + buffer.append("<" + key + ">").append(data.get(key)).append( + ""); + } + buffer.append(""); + buffer.append(""); + return buffer.toString(); + } + + public String toXmlString() { + + return toString(); + } +} diff --git a/cim_for_netty/cim-core/.classpath b/cim_for_netty/cim-core/.classpath deleted file mode 100644 index 75706f0..0000000 --- a/cim_for_netty/cim-core/.classpath +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/cim_for_netty/cim-core/lib/netty-3.6.5.Final.jar b/cim_for_netty/cim-core/lib/netty-3.6.5.Final.jar deleted file mode 100644 index 3d10dbb..0000000 Binary files a/cim_for_netty/cim-core/lib/netty-3.6.5.Final.jar and /dev/null differ diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMListenerManager.java b/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMListenerManager.java deleted file mode 100644 index 089ff74..0000000 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMListenerManager.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.farsunset.cim.client.android; -import java.util.ArrayList; -import java.util.Collections; - -import android.content.Context; - - -/** - * CIM 消息监听器管理 - * - * @author 3979434@qq.com - */ -public class CIMListenerManager { - - private static ArrayList cimListeners = new ArrayList(); - - - - public static void registerMessageListener(OnCIMMessageListener listener,Context mcontext) { - - if (!cimListeners.contains(listener)) { - cimListeners.add(listener); - // 按照接收顺序倒序 - Collections.sort(cimListeners, new CIMMessageReceiveComparator(mcontext)); - } - } - - - public static void removeMessageListener(OnCIMMessageListener listener) { - for (int i = 0; i < cimListeners.size(); i++) { - if (listener.getClass() == cimListeners.get(i).getClass()) { - cimListeners.remove(i); - } - } - } - - public static ArrayList getCIMListeners() { - return cimListeners; - } -} \ No newline at end of file diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMMessageReceiveComparator.java b/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMMessageReceiveComparator.java deleted file mode 100644 index 088ffae..0000000 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/CIMMessageReceiveComparator.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.farsunset.cim.client.android; - -import java.util.Comparator; - -import android.app.Activity; -import android.content.Context; -import android.content.pm.ActivityInfo; -import android.content.pm.PackageManager; - -import com.farsunset.cim.nio.constant.CIMConstant; - - -/** - * 消息接收activity的接收顺序排序,CIM_RECEIVE_ORDER倒序 - * @author 3979434 - * - */ -public class CIMMessageReceiveComparator implements Comparator{ - - Context mcontext; - public CIMMessageReceiveComparator(Context ctx) - { - mcontext = ctx; - } - - @Override - public int compare(OnCIMMessageListener arg1, OnCIMMessageListener arg2) { - - Integer order1 = CIMConstant.CIM_DEFAULT_MESSAGE_ORDER; - Integer order2 = CIMConstant.CIM_DEFAULT_MESSAGE_ORDER; - ActivityInfo info; - if (arg1 instanceof Activity ) { - - try { - info = mcontext.getPackageManager() .getActivityInfo(((Activity)(arg1)).getComponentName(), PackageManager.GET_META_DATA); - if(info.metaData!=null) - { - order1 = info.metaData.getInt("CIM_RECEIVE_ORDER"); - } - - } catch (Exception e) {} - } - - if (arg1 instanceof Activity ) { - try { - info = mcontext.getPackageManager() .getActivityInfo(((Activity)(arg2)).getComponentName(), PackageManager.GET_META_DATA); - if(info.metaData!=null) - { - order2 = info.metaData.getInt("CIM_RECEIVE_ORDER"); - } - - } catch (Exception e) {} - } - - return order2.compareTo(order1); - } - - -} diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/KeepAliveReceiver.java b/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/KeepAliveReceiver.java deleted file mode 100644 index d75efc1..0000000 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/client/android/KeepAliveReceiver.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.farsunset.cim.client.android; - - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.util.Log; -/** - * @author 3979434 - * - */ -public class KeepAliveReceiver extends BroadcastReceiver { - - - @Override - public void onReceive(Context context, Intent it) { - Log.d(KeepAliveReceiver.class.getSimpleName(), "onReceive()"); - - Intent intent = new Intent(context, CIMPushService.class); - intent.putExtra(CIMPushManager.SERVICE_ACTION, CIMPushManager.ACTION_CONNECTION_KEEPALIVE); - context.startService(intent); - } - -} diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/filter/ClientMessageEncoder.java b/cim_for_netty/cim-core/src/com/farsunset/cim/nio/filter/ClientMessageEncoder.java deleted file mode 100644 index 1bd8d9d..0000000 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/filter/ClientMessageEncoder.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.farsunset.cim.nio.filter; - - - -import org.jboss.netty.buffer.ChannelBuffer; -import org.jboss.netty.buffer.ChannelBuffers; -import org.jboss.netty.channel.Channel; -import org.jboss.netty.channel.ChannelHandlerContext; -import org.jboss.netty.handler.codec.oneone.OneToOneEncoder; - -import com.farsunset.cim.nio.constant.CIMConstant; - -/** - * 客户端消息发送前进行编码,可在此加密消息 - * @author 3979434@qq.com - * - */ -public class ClientMessageEncoder extends OneToOneEncoder { - - @Override - protected Object encode(ChannelHandlerContext arg0, Channel arg1,Object message) throws Exception { - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();//(2) - buf.writeBytes(message.toString().getBytes()); - buf.writeByte(CIMConstant.MESSAGE_SEPARATE); - return buf; - } - - - - -} diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/filter/ServerMessageDecoder.java b/cim_for_netty/cim-core/src/com/farsunset/cim/nio/filter/ServerMessageDecoder.java deleted file mode 100644 index 16affc2..0000000 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/filter/ServerMessageDecoder.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.farsunset.cim.nio.filter; - -import java.io.ByteArrayInputStream; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.jboss.netty.buffer.ChannelBuffer; -import org.jboss.netty.channel.Channel; -import org.jboss.netty.channel.ChannelHandlerContext; -import org.jboss.netty.handler.codec.frame.FrameDecoder; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import com.farsunset.cim.nio.constant.CIMConstant; -import com.farsunset.cim.nio.mutual.SentBody; -/** - * 服务端接收消息解码,可在此解密消息 - * @author 3979434@qq.com - * - */ -public class ServerMessageDecoder extends FrameDecoder { - - @Override - protected Object decode(ChannelHandlerContext arg0, Channel channel,ChannelBuffer buffer) throws Exception { - - - int length = buffer.readableBytes(); - - /** - * CIMConstant.MESSAGE_SEPARATE 为消息界限 - * 当一次收到多个消息时,以此分隔解析多个消息 - */ - if (buffer.readable()&&length > 0 && CIMConstant.MESSAGE_SEPARATE == buffer.getByte(length-1)) { - - byte[] data = new byte[length-1]; - buffer.readBytes(data); - String message = new String(new String(data,CIMConstant.ENCODE_UTF8)); - System.out.println("[ServerMessageDecoder]:"+message); - buffer.readByte(); - - SentBody body = new SentBody(); - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = factory.newDocumentBuilder(); - Document doc = builder.parse(new ByteArrayInputStream(message.toString().getBytes())); - body.setKey(doc.getElementsByTagName("key").item(0).getTextContent()); - NodeList dataNodeList = doc.getElementsByTagName("data"); - if(dataNodeList!=null && dataNodeList.getLength()>0) - { - NodeList items = dataNodeList.item(0).getChildNodes(); - for (int i = 0; i < items.getLength(); i++) { - Node node = items.item(i); - body.getData().put(node.getNodeName(), node.getTextContent()); - } - } - data = null; - message = null; - return body; - } - - /** - * CIMConstant.FLEX_DATA_SEPARATE 为FLEX客户端socket验证消息界限 - * - */ - if (buffer.readable()&& length > 0 && CIMConstant.FLEX_DATA_SEPARATE == buffer.getByte(length-1)) { - - byte[] data = new byte[length-1]; - buffer.readBytes(data); - String message = new String(new String(data,CIMConstant.ENCODE_UTF8)); - - System.out.println("[ServerMessageDecoder]:"+message); - - //将末尾的消息分隔符读取掉 - buffer.readByte(); - data = null; - - return message; - } - - return null; - } - -} diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/filter/ServerMessageEncoder.java b/cim_for_netty/cim-core/src/com/farsunset/cim/nio/filter/ServerMessageEncoder.java deleted file mode 100644 index 5e2531b..0000000 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/filter/ServerMessageEncoder.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.farsunset.cim.nio.filter; - - - -import org.jboss.netty.buffer.ChannelBuffer; -import org.jboss.netty.buffer.ChannelBuffers; -import org.jboss.netty.channel.Channel; -import org.jboss.netty.channel.ChannelHandlerContext; -import org.jboss.netty.handler.codec.oneone.OneToOneEncoder; - -import com.farsunset.cim.nio.constant.CIMConstant; - - -/** - * 服务端发送消息前编码,可在此加密消息 - * @author 3979434@qq.com - * - */ -public class ServerMessageEncoder extends OneToOneEncoder { - - - - - @Override - protected Object encode(ChannelHandlerContext arg0, Channel arg1, Object message) throws Exception { - ChannelBuffer buf = ChannelBuffers.dynamicBuffer();//(2) - buf.writeBytes(message.toString().getBytes(CIMConstant.ENCODE_UTF8)); - buf.writeByte(CIMConstant.MESSAGE_SEPARATE); - System.out.println("[ServerMessageEncoder]:"+message); - return buf; - } - - - -} diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/handler/HeartbeatHandler.java b/cim_for_netty/cim-core/src/com/farsunset/cim/nio/handler/HeartbeatHandler.java deleted file mode 100644 index 5a6f47b..0000000 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/handler/HeartbeatHandler.java +++ /dev/null @@ -1,32 +0,0 @@ - -package com.farsunset.cim.nio.handler; - -import org.apache.log4j.Logger; - -import com.farsunset.cim.nio.constant.CIMConstant; -import com.farsunset.cim.nio.mutual.ReplyBody; -import com.farsunset.cim.nio.mutual.SentBody; -import com.farsunset.cim.nio.session.CIMSession; - -/** - *客户端心跳实现 - * - * @author - */ -public class HeartbeatHandler implements CIMRequestHandler { - - protected final Logger logger = Logger.getLogger(HeartbeatHandler.class); - - public ReplyBody process(CIMSession session, SentBody message) { - - logger.warn("heartbeat... from "+session.getRemoteAddress().toString()); - ReplyBody reply = new ReplyBody(); - reply.setKey(CIMConstant.RequestKey.CLIENT_HEARTBEAT); - reply.setCode(CIMConstant.ReturnCode.CODE_200); - session.setHeartbeat(System.currentTimeMillis()); - return reply; - } - - - -} \ No newline at end of file diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/handler/MainIOHandler.java b/cim_for_netty/cim-core/src/com/farsunset/cim/nio/handler/MainIOHandler.java deleted file mode 100644 index 2900b08..0000000 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/handler/MainIOHandler.java +++ /dev/null @@ -1,158 +0,0 @@ - -package com.farsunset.cim.nio.handler; - -import java.net.InetSocketAddress; -import java.util.HashMap; -import java.util.concurrent.Executors; - -import org.apache.log4j.Logger; -import org.jboss.netty.bootstrap.ServerBootstrap; -import org.jboss.netty.channel.ChannelHandlerContext; -import org.jboss.netty.channel.ChannelPipeline; -import org.jboss.netty.channel.ChannelPipelineFactory; -import org.jboss.netty.channel.ChannelStateEvent; -import org.jboss.netty.channel.Channels; -import org.jboss.netty.channel.MessageEvent; -import org.jboss.netty.channel.SimpleChannelUpstreamHandler; -import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory; - -import com.farsunset.cim.nio.constant.CIMConstant; -import com.farsunset.cim.nio.filter.ServerMessageDecoder; -import com.farsunset.cim.nio.filter.ServerMessageEncoder; -import com.farsunset.cim.nio.mutual.ReplyBody; -import com.farsunset.cim.nio.mutual.SentBody; -import com.farsunset.cim.nio.session.CIMSession; - -/** - * - * 客户端请求的入口,所有请求都首先经过它分发处理 - * @author farsunset (3979434@qq.com) - */ -public class MainIOHandler extends SimpleChannelUpstreamHandler { - - protected final Logger logger = Logger.getLogger(MainIOHandler.class); - - private HashMap handlers = new HashMap(); - - - private int port; - - public void init() - { - ServerBootstrap bootstrap = new ServerBootstrap( - new NioServerSocketChannelFactory( - Executors.newCachedThreadPool(), - Executors.newCachedThreadPool())); - - bootstrap.setPipelineFactory(new ChannelPipelineFactory() - { - - @Override - public ChannelPipeline getPipeline() throws Exception - { - return Channels.pipeline( - new ServerMessageDecoder(), - new ServerMessageEncoder(), - MainIOHandler.this); - - } - - }); - - bootstrap.bind(new InetSocketAddress(port)); - logger.warn("netty 启动成功" + port); - - } - - public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent event) - { - logger.warn("sessionCreated()... from "+ctx.getChannel().getRemoteAddress().toString()); - } - - - - - public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) - throws Exception { - logger.debug("message: " + e.getMessage().toString()); - - - /** - * flex 客户端安全策略请求,需要返回特定报文 - */ - if(CIMConstant.FLEX_POLICY_REQUEST.equals(e.getMessage())) - { - ctx.getChannel().write(CIMConstant.FLEX_POLICY_RESPONSE); - return ; - } - - CIMSession cimSession =new CIMSession(ctx.getChannel()); - ReplyBody reply = new ReplyBody(); - SentBody body = (SentBody) e.getMessage(); - String key = body.getKey(); - - CIMRequestHandler handler = handlers.get(key); - if (handler == null) { - reply.setCode(CIMConstant.ReturnCode.CODE_405); - reply.setCode("KEY ["+key+"] 服务端未定义"); - } else { - reply = handler.process(cimSession, body); - } - - if(reply!=null) - { - reply.setKey(key); - cimSession.write(reply); - logger.debug("-----------------------process done. reply: " + reply.toString()); - } - - //设置心跳时间 - cimSession.setAttribute(CIMConstant.HEARTBEAT_KEY, System.currentTimeMillis()); - } - - public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent event) { - CIMSession cimSession =new CIMSession(ctx.getChannel()); - try{ - logger.warn("sessionClosed()... from "+cimSession.getRemoteAddress()); - CIMRequestHandler handler = handlers.get("sessionClosedHander"); - if(handler!=null && cimSession.containsAttribute(CIMConstant.SESSION_KEY)) - { - handler.process(cimSession, null); - } - } - catch(Exception e) - { - e.printStackTrace(); - } - } - - - /** - *//* - public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent event) { - CIMSession cimSession =new CIMSession(ctx.getChannel()); - try{ - logger.warn("sessionClosed()... from "+cimSession.getRemoteAddress()); - CIMRequestHandler handler = handlers.get("sessionClosedHander"); - if(handler!=null && cimSession.containsAttribute(CIMConstant.SESSION_KEY)) - { - handler.process(cimSession, null); - } - } - catch(Exception e) - { - e.printStackTrace(); - } - }*/ - - public void setHandlers(HashMap handlers) { - this.handlers = handlers; - } - - public void setPort(int port) { - this.port = port; - } - - - -} \ No newline at end of file diff --git a/cim_for_netty/cim-server-sdk/.classpath b/cim_for_netty/cim-server-sdk/.classpath new file mode 100644 index 0000000..057a55b --- /dev/null +++ b/cim_for_netty/cim-server-sdk/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/cim_for_netty/cim-core/.project b/cim_for_netty/cim-server-sdk/.project similarity index 92% rename from cim_for_netty/cim-core/.project rename to cim_for_netty/cim-server-sdk/.project index a449ea4..7ab8139 100644 --- a/cim_for_netty/cim-core/.project +++ b/cim_for_netty/cim-server-sdk/.project @@ -1,6 +1,6 @@ - cim-core + cim-server-sdk diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/launcher/CIMNioSocketAcceptor.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/launcher/CIMNioSocketAcceptor.java new file mode 100644 index 0000000..79b6637 --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/launcher/CIMNioSocketAcceptor.java @@ -0,0 +1,167 @@ +package com.farsunset.cim.launcher; +import io.netty.bootstrap.ServerBootstrap; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInitializer; +import io.netty.channel.ChannelPipeline; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.SocketChannel; +import io.netty.channel.socket.nio.NioServerSocketChannel; +import io.netty.handler.codec.serialization.ClassResolvers; +import io.netty.handler.timeout.IdleState; +import io.netty.handler.timeout.IdleStateEvent; +import io.netty.handler.timeout.IdleStateHandler; +import io.netty.util.AttributeKey; + +import java.util.HashMap; + +import org.apache.log4j.Logger; + +import com.farsunset.cim.server.constant.CIMConstant; +import com.farsunset.cim.server.filter.ServerMessageDecoder; +import com.farsunset.cim.server.filter.ServerMessageEncoder; +import com.farsunset.cim.server.handler.CIMRequestHandler; +import com.farsunset.cim.server.mutual.ReplyBody; +import com.farsunset.cim.server.mutual.SentBody; +import com.farsunset.cim.server.session.CIMSession; + +@io.netty.channel.ChannelHandler.Sharable +public class CIMNioSocketAcceptor extends SimpleChannelInboundHandler{ + + protected final Logger logger = Logger.getLogger(CIMNioSocketAcceptor.class.getSimpleName()); + public final static String KEY_CLIENT_CIMSESSION_CLOSED = "client_cimsession_closed"; + private HashMap handlers = new HashMap(); + + private int port; + + + + public void bind() + { + new Thread(new Runnable(){ + @Override + public void run() { + EventLoopGroup bossGroup = new NioEventLoopGroup(); + EventLoopGroup workerGroup = new NioEventLoopGroup(); + try{ + ServerBootstrap bootstrap = new ServerBootstrap(); + bootstrap.group(bossGroup, workerGroup); + bootstrap.channel(NioServerSocketChannel.class); + bootstrap.childHandler(new ChannelInitializer() { + @Override + public void initChannel(SocketChannel ch) throws Exception { + ChannelPipeline pipeline = ch.pipeline(); + + pipeline.addLast(new ServerMessageDecoder(ClassResolvers.cacheDisabled(null))); + pipeline.addLast(new ServerMessageEncoder()); + pipeline.addLast(new IdleStateHandler(CIMConstant.IDLE_TIME/2,0,CIMConstant.IDLE_TIME)); + pipeline.addLast(CIMNioSocketAcceptor.this); + } + }); + + bootstrap.bind(port).sync().channel().closeFuture().sync(); + }catch(Exception e) + { + e.printStackTrace(); + } + finally { + workerGroup.shutdownGracefully(); + bossGroup.shutdownGracefully(); + } + } + }).start(); + } + + + @Override + public void channelRegistered( ChannelHandlerContext ctx) throws Exception { + + logger.debug("channelRegistered()... from "+ctx.channel().remoteAddress()); + } + + + + /** + * 检测到连接空闲事件,发送心跳请求命令 + */ + @Override + public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { + if (evt instanceof IdleStateEvent && ((IdleStateEvent) evt).state().equals(IdleState.ALL_IDLE)) { + ctx.channel().attr(AttributeKey.valueOf(CIMConstant.HEARTBEAT_PINGED)).set(System.currentTimeMillis()); + ctx.channel().writeAndFlush(CIMConstant.CMD_HEARTBEAT_REQUEST); + } + + //如果心跳请求发出30秒内没收到响应,则关闭连接 + if (evt instanceof IdleStateEvent + && ((IdleStateEvent) evt).state().equals(IdleState.READER_IDLE) + && ctx.channel().attr(AttributeKey.valueOf(CIMConstant.HEARTBEAT_PINGED)).get()!=null) + { + long t = (Long) ctx.channel().attr(AttributeKey.valueOf(CIMConstant.HEARTBEAT_PINGED)).get(); + if(System.currentTimeMillis() - t >= CIMConstant.PING_TIME_OUT) + { + ctx.channel().close(); + } + } + super.userEventTriggered(ctx, evt); + } + + protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception { + + /** + * flex 客户端安全策略请求,需要返回特定报文 + */ + if(CIMConstant.FLEX_POLICY_REQUEST.equals(msg)) + { + ctx.writeAndFlush(CIMConstant.FLEX_POLICY_RESPONSE); + return ; + } + CIMSession cimSession =new CIMSession(ctx.channel()); + ReplyBody reply = new ReplyBody(); + SentBody body = (SentBody)msg; + String key = body.getKey(); + + CIMRequestHandler handler = handlers.get(key); + if (handler == null) { + reply.setCode(CIMConstant.ReturnCode.CODE_405); + reply.setCode("KEY ["+key+"] 服务端未定义"); + } else { + reply = handler.process(cimSession, body); + } + + if(reply!=null) + { + reply.setKey(key); + cimSession.write(reply); + } + + } + + @Override + public void channelInactive(ChannelHandlerContext ctx) throws Exception { + + CIMSession cimSession =new CIMSession(ctx.channel()); + try{ + logger.debug("channelInactive()... from "+cimSession.getRemoteAddress()); + CIMRequestHandler handler = handlers.get(KEY_CLIENT_CIMSESSION_CLOSED); + if(handler!=null && cimSession.hasTag(CIMConstant.SESSION_KEY)) + { + handler.process(cimSession, null); + } + } + catch(Exception e) + { + e.printStackTrace(); + } + } + + + public void setHandlers(HashMap handlers) { + this.handlers = handlers; + } + + public void setPort(int port) { + this.port = port; + } + +} \ No newline at end of file diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/constant/CIMConstant.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/constant/CIMConstant.java similarity index 75% rename from cim_for_netty/cim-core/src/com/farsunset/cim/nio/constant/CIMConstant.java rename to cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/constant/CIMConstant.java index 80e79d1..8d1b3ad 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/constant/CIMConstant.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/constant/CIMConstant.java @@ -1,5 +1,5 @@ -package com.farsunset.cim.nio.constant; +package com.farsunset.cim.server.constant; import java.nio.charset.Charset; @@ -27,6 +27,11 @@ public interface CIMConstant { } + //连接空闲时间 + public static final int IDLE_TIME = 60;//秒 + + public static final int PING_TIME_OUT = 30;//心跳响应 超时为30秒 + public static final Charset ENCODE_UTF8 = Charset.forName("UTF-8"); @@ -41,7 +46,16 @@ public interface CIMConstant { public static final String HEARTBEAT_KEY ="heartbeat"; + /** + * 服务端心跳请求命令 + */ + public static final String CMD_HEARTBEAT_REQUEST="cmd_server_hb_request"; + /** + * 客户端心跳响应命令 + */ + public static final String CMD_HEARTBEAT_RESPONSE ="cmd_client_hb_response"; + public static final String HEARTBEAT_PINGED ="HEARTBEAT_PINGED"; /** * FLEX 客户端socket请求发的安全策略请求,需要特殊处理,返回安全验证报文 @@ -54,8 +68,8 @@ public interface CIMConstant { /** - * 对应ichat 中 spring-cim.xml > bean:mainIoHandler >handlers - * 为 服务端处理对应的handlers,应该继承与com.farsunset.cim.nio.handle.AbstractHandler + * 对应cim-server 中 spring-cim.xml > bean:mainIoHandler >handlers + * 为 服务端处理对应的handlers,应该继承与com.farsunset.cim.nio.handle.CIMRequestHandler * @author xiajun * */ diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/filter/ServerMessageDecoder.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/filter/ServerMessageDecoder.java new file mode 100644 index 0000000..a30b176 --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/filter/ServerMessageDecoder.java @@ -0,0 +1,99 @@ +package com.farsunset.cim.server.filter; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.serialization.ClassResolver; +import io.netty.handler.codec.serialization.ObjectDecoder; +import java.io.ByteArrayInputStream; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import com.farsunset.cim.server.constant.CIMConstant; +import com.farsunset.cim.server.mutual.SentBody; +/** + * 服务端接收消息解码,可在此解密消息 + * @author 3979434@qq.com + * + */ +public class ServerMessageDecoder extends ObjectDecoder { + protected final Logger logger = Logger.getLogger(ServerMessageDecoder.class.getSimpleName()); + public ServerMessageDecoder(ClassResolver classResolver) { + super(classResolver); + } + + @Override + public Object decode(ChannelHandlerContext arg0, ByteBuf buffer) throws Exception { + + + int length = buffer.readableBytes(); + + /** + * CIMConstant.MESSAGE_SEPARATE 为消息界限 + * 当一次收到多个消息时,以此分隔解析多个消息 + */ + if (buffer.isReadable()&&length > 0 && CIMConstant.MESSAGE_SEPARATE == buffer.getByte(length-1)) { + + byte[] data = new byte[length-1]; + buffer.readBytes(data); + String message = new String(new String(data,CIMConstant.ENCODE_UTF8)); + logger.debug(message); + buffer.readByte(); + + SentBody body = parserMessageToSentBody(message); + data = null; + message = null; + return body; + } + + /** + * CIMConstant.FLEX_DATA_SEPARATE 为FLEX客户端socket验证消息界限 + * + */ + if (buffer.isReadable()&& length > 0 && CIMConstant.FLEX_DATA_SEPARATE == buffer.getByte(length-1)) { + + byte[] data = new byte[length-1]; + buffer.readBytes(data); + String message = new String(new String(data,CIMConstant.ENCODE_UTF8)); + System.out.println("[ServerMessageDecoder]:"+message); + + //将末尾的消息分隔符读取掉 + buffer.readByte(); + data = null; + return message; + } + + return null; + } + + private SentBody parserMessageToSentBody(String message) throws Exception + { + SentBody body = new SentBody(); + if(message.equals(CIMConstant.CMD_HEARTBEAT_RESPONSE))//如果是心跳响应,则让HeartbeatHandler去处理 + { + body.setKey(CIMConstant.RequestKey.CLIENT_HEARTBEAT); + return body; + } + + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + Document doc = builder.parse(new ByteArrayInputStream(message.toString().getBytes(CIMConstant.ENCODE_UTF8))); + body.setKey(doc.getElementsByTagName("key").item(0).getTextContent()); + NodeList dataNodeList = doc.getElementsByTagName("data"); + if(dataNodeList!=null && dataNodeList.getLength()>0) + { + NodeList items = dataNodeList.item(0).getChildNodes(); + for (int i = 0; i < items.getLength(); i++) { + Node node = items.item(i); + body.getData().put(node.getNodeName(), node.getTextContent()); + } + } + + return body; + } + +} diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/filter/ServerMessageEncoder.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/filter/ServerMessageEncoder.java new file mode 100644 index 0000000..2f70f26 --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/filter/ServerMessageEncoder.java @@ -0,0 +1,33 @@ +package com.farsunset.cim.server.filter; + + + +import org.apache.log4j.Logger; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; + + +import com.farsunset.cim.server.constant.CIMConstant; + +/** + * 服务端发送消息前编码,可在此加密消息 + * @author 3979434@qq.com + * + */ +public class ServerMessageEncoder extends MessageToByteEncoder { + protected final Logger logger = Logger.getLogger(ServerMessageEncoder.class.getSimpleName()); + + @Override + protected void encode(ChannelHandlerContext ctx, Object message, ByteBuf out) throws Exception { + out.writeBytes(message.toString().getBytes(CIMConstant.ENCODE_UTF8)); + out.writeByte(CIMConstant.MESSAGE_SEPARATE); + logger.debug(message); + } + + + + + +} diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/handler/CIMRequestHandler.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/handler/CIMRequestHandler.java similarity index 53% rename from cim_for_netty/cim-core/src/com/farsunset/cim/nio/handler/CIMRequestHandler.java rename to cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/handler/CIMRequestHandler.java index 07b0de7..99e07a8 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/handler/CIMRequestHandler.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/handler/CIMRequestHandler.java @@ -1,13 +1,13 @@ -package com.farsunset.cim.nio.handler; +package com.farsunset.cim.server.handler; /** * 请求处理接口,所有的请求实现必须实现此接口 * @author 3979434@qq.com */ -import com.farsunset.cim.nio.mutual.ReplyBody; -import com.farsunset.cim.nio.mutual.SentBody; -import com.farsunset.cim.nio.session.CIMSession; +import com.farsunset.cim.server.mutual.ReplyBody; +import com.farsunset.cim.server.mutual.SentBody; +import com.farsunset.cim.server.session.CIMSession; public interface CIMRequestHandler { diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/handler/HeartbeatHandler.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/handler/HeartbeatHandler.java new file mode 100644 index 0000000..405c328 --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/handler/HeartbeatHandler.java @@ -0,0 +1,26 @@ + +package com.farsunset.cim.server.handler; + +import com.farsunset.cim.server.constant.CIMConstant; +import com.farsunset.cim.server.mutual.ReplyBody; +import com.farsunset.cim.server.mutual.SentBody; +import com.farsunset.cim.server.session.CIMSession; + +/** + *客户端心跳实现 + * + * @author + */ +public class HeartbeatHandler implements CIMRequestHandler { + + + public ReplyBody process(CIMSession session, SentBody message) { + + //收到心跳响应,清除发送心跳请求标记 + session.removeTag(CIMConstant.HEARTBEAT_PINGED); + return null; + } + + + +} \ No newline at end of file diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/mutual/Message.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/mutual/Message.java similarity index 96% rename from cim_for_netty/cim-core/src/com/farsunset/cim/nio/mutual/Message.java rename to cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/mutual/Message.java index 49e64cb..876a7e3 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/mutual/Message.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/mutual/Message.java @@ -1,4 +1,4 @@ -package com.farsunset.cim.nio.mutual; +package com.farsunset.cim.server.mutual; import java.io.Serializable; /** @@ -152,7 +152,7 @@ public class Message implements Serializable { buffer.append("").append(this.getSender()==null?"":this.getSender()).append(""); buffer.append("").append(this.getReceiver()==null?"":this.getReceiver()).append(""); buffer.append("").append(this.getFormat()==null?"":this.getFormat()).append(""); - buffer.append("").append(timestamp).append(""); + buffer.append("").append(String.valueOf(timestamp)).append(""); buffer.append(""); return buffer.toString(); } diff --git a/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/mutual/ReplyBody.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/mutual/ReplyBody.java new file mode 100644 index 0000000..4a4816b --- /dev/null +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/mutual/ReplyBody.java @@ -0,0 +1,122 @@ +package com.farsunset.cim.server.mutual; + +import java.io.Serializable; +import java.util.HashMap; +/** + * 请求应答对象 + * @author 3979434@qq.com + * + */ +public class ReplyBody implements Serializable { + + /** + * @author 3979434@qq.com + * 服务端返回消息对象 + */ + private static final long serialVersionUID = 1L; + + /** + * 请求key + */ + private String key; + + + /** + * 返回码 + */ + private String code; + + /** + * 返回说明 + */ + private String message; + + /** + * 返回数据集合 + */ + private HashMap data; + + + private long timestamp; + + public ReplyBody() + { + data = new HashMap(); + timestamp = System.currentTimeMillis(); + } + public long getTimestamp() { + return timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } + + + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public void put(String k, String v) { + data.put(k, v); + } + + public String get(String k) { + return data.get(k); + } + + public void remove(String k) { + data.remove(k); + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public HashMap getData() { + return data; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + + public String toString() + { + StringBuffer buffer = new StringBuffer(); + buffer.append(""); + buffer.append(""); + buffer.append("").append(this.getKey()).append(""); + buffer.append("").append(String.valueOf(timestamp)).append(""); + buffer.append("").append(code).append(""); + buffer.append(""); + for(String key:this.getData().keySet()) + { + buffer.append("<"+key+">").append(this.get(key)).append(""); + } + buffer.append(""); + buffer.append(""); + return buffer.toString(); + } + + + public String toXmlString() + { + + return toString(); + } +} diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/mutual/SentBody.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/mutual/SentBody.java similarity index 91% rename from cim_for_netty/cim-core/src/com/farsunset/cim/nio/mutual/SentBody.java rename to cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/mutual/SentBody.java index 405e196..9b197da 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/mutual/SentBody.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/mutual/SentBody.java @@ -1,4 +1,4 @@ -package com.farsunset.cim.nio.mutual; +package com.farsunset.cim.server.mutual; import java.io.Serializable; import java.util.HashMap; @@ -64,7 +64,7 @@ public class SentBody implements Serializable { buffer.append(""); buffer.append(""); buffer.append("").append(key).append(""); - buffer.append("").append(timestamp).append(""); + buffer.append("").append(String.valueOf(timestamp)).append(""); buffer.append(""); for (String key : data.keySet()) { buffer.append("<" + key + ">").append(data.get(key)).append( diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/session/CIMSession.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/session/CIMSession.java similarity index 67% rename from cim_for_netty/cim-core/src/com/farsunset/cim/nio/session/CIMSession.java rename to cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/session/CIMSession.java index a8818c8..c3f6155 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/session/CIMSession.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/session/CIMSession.java @@ -1,15 +1,14 @@ -package com.farsunset.cim.nio.session; +package com.farsunset.cim.server.session; + +import io.netty.channel.Channel; +import io.netty.util.AttributeKey; import java.io.Serializable; import java.net.InetAddress; import java.net.SocketAddress; import java.net.UnknownHostException; -import java.util.HashMap; -import java.util.Map; -import org.jboss.netty.channel.Channel; - -import com.farsunset.cim.nio.constant.CIMConstant; +import com.farsunset.cim.server.constant.CIMConstant; /** * IoSession包装类,集群时 将此对象存入表中 @@ -29,26 +28,20 @@ public class CIMSession implements Serializable{ private Channel session; private String gid;//session全局ID - private int nid;//session在本台服务器上的ID + private String nid;//session在本台服务器上的ID private String deviceId;//客户端设备ID private String host;//session绑定的服务器IP private String account;//session绑定的账号 private String channel;//终端设备类型 private String deviceModel;//终端设备型号 - + private String appVersion;//客户端应用版本 private Long bindTime;//登录时间 private Long heartbeat;//心跳时间 public CIMSession(Channel session) { this.session = session; - this.nid = session.getId(); - if(session.getAttachment()==null) - { - HashMap params= new HashMap(); - session.setAttachment(params); - } - + this.nid = session.id().asLongText(); } @@ -61,14 +54,24 @@ public class CIMSession implements Serializable{ public void setAccount(String account) { if(session!=null) { - ((Map)session.getAttachment()).put(CIMConstant.SESSION_KEY, account); + setTag(CIMConstant.SESSION_KEY, account); } this.account = account; } - + + public void setTag(String key,Object value) + { + if(value!=null) + session.attr(AttributeKey.valueOf(key)).set(value.toString()); + } + public String getTag(String key) + { + Object tag = session.attr(AttributeKey.valueOf(key)).get(); + return tag!=null?tag.toString():null; + } public String getGid() { @@ -79,11 +82,11 @@ public class CIMSession implements Serializable{ this.gid = gid; } - public int getNid() { + public String getNid() { return nid; } - public void setNid(int nid) { + public void setNid(String nid) { this.nid = nid; } @@ -135,9 +138,9 @@ public class CIMSession implements Serializable{ public void setHeartbeat(Long heartbeat) { this.heartbeat = heartbeat; - if(session!=null && session.getAttachment()!=null) + if(session!=null ) { - ((Map)session.getAttachment()).put(CIMConstant.HEARTBEAT_KEY, heartbeat); + setTag(CIMConstant.HEARTBEAT_KEY, heartbeat.toString()); } } @@ -146,45 +149,52 @@ public class CIMSession implements Serializable{ } + - public void setAttribute(String key, Object value) { - if(session!=null) - ((Map)session.getAttachment()).put(key, value); + + public String getAppVersion() { + return appVersion; } - public boolean containsAttribute(String key) { + + + public void setAppVersion(String appVersion) { + this.appVersion = appVersion; + } + + + + + public boolean hasTag(String key) { if(session!=null) - return ((Map)session.getAttachment()).containsKey(key); + return session.hasAttr(AttributeKey.valueOf(key)); return false; } - public Object getAttribute(String key) { - return ((Map)session.getAttachment()).get(key); - } - public void removeAttribute(String key) { - ((Map)session.getAttachment()).remove(key); + public void removeTag(String key) { + session.attr(AttributeKey.valueOf(key)).remove(); } public SocketAddress getRemoteAddress() { if(session!=null) - return session.getRemoteAddress(); + return session.remoteAddress(); return null; } public boolean write(Object msg) { - if(session!=null && session.isConnected()) + if(session!=null && session.isActive()) { - return session.write(msg).awaitUninterruptibly(5000); + return session.writeAndFlush(msg).awaitUninterruptibly(5000); } return false; } public boolean isConnected() { if(session!=null) - return session.isConnected(); + return session.isActive(); return false; } @@ -220,7 +230,7 @@ public class CIMSession implements Serializable{ { return false; } - if (t.session.getId() == session.getId()&& t.host.equals(host)) { + if (t.session.id().asLongText().equals(session.id().asLongText())&& t.host.equals(host)) { return true; } return false; diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/session/DefaultSessionManager.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/session/DefaultSessionManager.java similarity index 78% rename from cim_for_netty/cim-core/src/com/farsunset/cim/nio/session/DefaultSessionManager.java rename to cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/session/DefaultSessionManager.java index 213d81c..8a38c63 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/session/DefaultSessionManager.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/session/DefaultSessionManager.java @@ -1,11 +1,11 @@ -package com.farsunset.cim.nio.session; +package com.farsunset.cim.server.session; import java.util.Collection; import java.util.HashMap; import java.util.concurrent.atomic.AtomicInteger; -import com.farsunset.cim.nio.constant.CIMConstant; +import com.farsunset.cim.server.constant.CIMConstant; /** * 自带默认 session管理实现, 各位可以自行实现 AbstractSessionManager接口来实现自己的 session管理 @@ -28,7 +28,7 @@ public class DefaultSessionManager implements SessionManager{ public void addSession(String account,CIMSession session) { if(session!=null) { - session.setAttribute(CIMConstant.SESSION_KEY, account); + session.setTag(CIMConstant.SESSION_KEY, account); sessions.put(account, session); connectionsCounter.incrementAndGet(); } @@ -52,7 +52,7 @@ public class DefaultSessionManager implements SessionManager{ public void removeSession(CIMSession session) { - sessions.remove(session.getAttribute(CIMConstant.SESSION_KEY)); + sessions.remove(session.getTag(CIMConstant.SESSION_KEY)); } @@ -65,13 +65,13 @@ public class DefaultSessionManager implements SessionManager{ public boolean containsCIMSession(CIMSession ios) { - return sessions.containsKey(ios.getAttribute(CIMConstant.SESSION_KEY)) || sessions.containsValue(ios); + return sessions.containsKey(ios.getTag(CIMConstant.SESSION_KEY)) || sessions.containsValue(ios); } public String getAccount(CIMSession ios) { - if(ios.getAttribute(CIMConstant.SESSION_KEY)==null) + if(ios.getTag(CIMConstant.SESSION_KEY)==null) { for(String key:sessions.keySet()) { @@ -82,7 +82,7 @@ public class DefaultSessionManager implements SessionManager{ } }else { - return ios.getAttribute(CIMConstant.SESSION_KEY).toString(); + return ios.getTag(CIMConstant.SESSION_KEY).toString(); } return null; diff --git a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/session/SessionManager.java b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/session/SessionManager.java similarity index 95% rename from cim_for_netty/cim-core/src/com/farsunset/cim/nio/session/SessionManager.java rename to cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/session/SessionManager.java index 8c01dcf..1f6edb4 100644 --- a/cim_for_netty/cim-core/src/com/farsunset/cim/nio/session/SessionManager.java +++ b/cim_for_netty/cim-server-sdk/src/com/farsunset/cim/server/session/SessionManager.java @@ -1,5 +1,5 @@ -package com.farsunset.cim.nio.session; +package com.farsunset.cim.server.session; import java.util.Collection; diff --git a/cim_for_netty/ichat-server/.classpath b/cim_for_netty/cim-server/.classpath similarity index 94% rename from cim_for_netty/ichat-server/.classpath rename to cim_for_netty/cim-server/.classpath index e9ab666..8bf2c44 100644 --- a/cim_for_netty/ichat-server/.classpath +++ b/cim_for_netty/cim-server/.classpath @@ -6,6 +6,7 @@ + @@ -19,7 +20,6 @@ - @@ -30,7 +30,7 @@ - + diff --git a/cim_for_netty/ichat-server/.mymetadata b/cim_for_netty/cim-server/.mymetadata similarity index 72% rename from cim_for_netty/ichat-server/.mymetadata rename to cim_for_netty/cim-server/.mymetadata index 194d12c..576f422 100644 --- a/cim_for_netty/ichat-server/.mymetadata +++ b/cim_for_netty/cim-server/.mymetadata @@ -1,11 +1,11 @@ + archive="cim-server.war"> diff --git a/cim_for_netty/ichat-server/.project b/cim_for_netty/cim-server/.project similarity index 98% rename from cim_for_netty/ichat-server/.project rename to cim_for_netty/cim-server/.project index 593a507..96180f8 100644 --- a/cim_for_netty/ichat-server/.project +++ b/cim_for_netty/cim-server/.project @@ -1,6 +1,6 @@ - ichat-server + cim-server diff --git a/cim_for_netty/ichat-server/.settings/org.eclipse.core.resources.prefs b/cim_for_netty/cim-server/.settings/org.eclipse.core.resources.prefs similarity index 100% rename from cim_for_netty/ichat-server/.settings/org.eclipse.core.resources.prefs rename to cim_for_netty/cim-server/.settings/org.eclipse.core.resources.prefs diff --git a/cim_for_netty/ichat-server/WebRoot/META-INF/MANIFEST.MF b/cim_for_netty/cim-server/WebRoot/META-INF/MANIFEST.MF similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/META-INF/MANIFEST.MF rename to cim_for_netty/cim-server/WebRoot/META-INF/MANIFEST.MF diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/log4j.properties b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/log4j.properties similarity index 94% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/log4j.properties rename to cim_for_netty/cim-server/WebRoot/WEB-INF/classes/log4j.properties index b0801a7..b0572a1 100644 --- a/cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/log4j.properties +++ b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/log4j.properties @@ -1,4 +1,4 @@ -log4j.rootLogger=warn,console, file +log4j.rootLogger=debug,console, file #----------console---------------- log4j.appender.console=org.apache.log4j.ConsoleAppender diff --git a/cim_for_netty/ichat-server/src/main/resource/spring-cim.xml b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-cim.xml similarity index 64% rename from cim_for_netty/ichat-server/src/main/resource/spring-cim.xml rename to cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-cim.xml index f0aa66d..7e428ed 100644 --- a/cim_for_netty/ichat-server/src/main/resource/spring-cim.xml +++ b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-cim.xml @@ -14,24 +14,24 @@ > - + - + - + - + - - + + - + @@ -39,5 +39,5 @@ - + \ No newline at end of file diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/spring-config.xml b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-config.xml similarity index 87% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/spring-config.xml rename to cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-config.xml index b24013a..de92bdb 100644 --- a/cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/spring-config.xml +++ b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-config.xml @@ -12,5 +12,5 @@ http://www.springframework.org/schema/aop/spring-aop-2.5.xsd " > - + \ No newline at end of file diff --git a/cim_for_netty/ichat-server/src/main/resource/spring-push.xml b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-push.xml similarity index 80% rename from cim_for_netty/ichat-server/src/main/resource/spring-push.xml rename to cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-push.xml index 6b21240..b7959fa 100644 --- a/cim_for_netty/ichat-server/src/main/resource/spring-push.xml +++ b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/spring-push.xml @@ -13,11 +13,11 @@ " > - + - + \ No newline at end of file diff --git a/cim_for_netty/ichat-server/src/main/resource/struts.xml b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/struts.xml similarity index 79% rename from cim_for_netty/ichat-server/src/main/resource/struts.xml rename to cim_for_netty/cim-server/WebRoot/WEB-INF/classes/struts.xml index 7dd0e3d..f8f7936 100644 --- a/cim_for_netty/ichat-server/src/main/resource/struts.xml +++ b/cim_for_netty/cim-server/WebRoot/WEB-INF/classes/struts.xml @@ -10,12 +10,12 @@ - + /console/session/manage.jsp - + \ No newline at end of file diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.aop-3.0.2.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.aop-3.0.2.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.aop-3.0.2.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.aop-3.0.2.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.asm-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.asm-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.asm-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.asm-3.0.2.RELEASE.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.beans-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.beans-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.beans-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.beans-3.0.2.RELEASE.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.context-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.context-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.context-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.context-3.0.2.RELEASE.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.core-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.core-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.core-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.core-3.0.2.RELEASE.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.expression-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.expression-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.expression-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.expression-3.0.2.RELEASE.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.jdbc-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.jdbc-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.jdbc-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.jdbc-3.0.2.RELEASE.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.orm-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.orm-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.orm-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.orm-3.0.2.RELEASE.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.transaction-3.0.2.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.transaction-3.0.2.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.transaction-3.0.2.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.transaction-3.0.2.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.web-3.0.2.RELEASE.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.web-3.0.2.RELEASE.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/Spring.web-3.0.2.RELEASE.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/Spring.web-3.0.2.RELEASE.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/antlr-2.7.6.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/antlr-2.7.6.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/antlr-2.7.6.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/antlr-2.7.6.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/asm.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/asm.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/asm.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/asm.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/aspectjweaver.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/aspectjweaver.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/aspectjweaver.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/aspectjweaver.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/commons-fileupload-1.2.1.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-fileupload-1.2.1.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/commons-fileupload-1.2.1.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-fileupload-1.2.1.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/commons-io-2.4.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-io-2.4.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/commons-io-2.4.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-io-2.4.jar diff --git a/cim_for_netty/cim-core/lib/commons-lang3-3.1.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-lang3-3.1.jar similarity index 100% rename from cim_for_netty/cim-core/lib/commons-lang3-3.1.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-lang3-3.1.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/commons-logging-1.0.4.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-logging-1.0.4.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/commons-logging-1.0.4.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/commons-logging-1.0.4.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/freemarker-2.3.15.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/freemarker-2.3.15.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/freemarker-2.3.15.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/freemarker-2.3.15.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/gson-2.1.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/gson-2.1.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/gson-2.1.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/gson-2.1.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/httpclient-4.3.4.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/httpclient-4.3.4.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/httpclient-4.3.4.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/httpclient-4.3.4.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/httpcore-4.3.2.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/httpcore-4.3.2.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/httpcore-4.3.2.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/httpcore-4.3.2.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/jstl-1.2.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/jstl-1.2.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/jstl-1.2.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/jstl-1.2.jar diff --git a/cim_for_netty/cim-core/lib/log4j.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/log4j.jar similarity index 100% rename from cim_for_netty/cim-core/lib/log4j.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/log4j.jar diff --git a/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-all-5.0.0.Alpha2.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-all-5.0.0.Alpha2.jar new file mode 100644 index 0000000..adcaa31 Binary files /dev/null and b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/netty-all-5.0.0.Alpha2.jar differ diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/ognl-2.7.3.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/ognl-2.7.3.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/ognl-2.7.3.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/ognl-2.7.3.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/slf4j-api-1.7.5.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/slf4j-api-1.7.5.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/slf4j-api-1.7.5.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/slf4j-api-1.7.5.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/slf4j-nop-1.7.5.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/slf4j-nop-1.7.5.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/slf4j-nop-1.7.5.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/slf4j-nop-1.7.5.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/spring-context-support.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/spring-context-support.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/spring-context-support.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/spring-context-support.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/xstream-1.3.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/xstream-1.3.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/xstream-1.3.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/xstream-1.3.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/xwork-core-2.1.6.jar b/cim_for_netty/cim-server/WebRoot/WEB-INF/lib/xwork-core-2.1.6.jar similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/lib/xwork-core-2.1.6.jar rename to cim_for_netty/cim-server/WebRoot/WEB-INF/lib/xwork-core-2.1.6.jar diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/web.xml b/cim_for_netty/cim-server/WebRoot/WEB-INF/web.xml similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/web.xml rename to cim_for_netty/cim-server/WebRoot/WEB-INF/web.xml diff --git a/cim_for_netty/ichat-server/WebRoot/console/header.jsp b/cim_for_netty/cim-server/WebRoot/console/header.jsp similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/console/header.jsp rename to cim_for_netty/cim-server/WebRoot/console/header.jsp diff --git a/cim_for_netty/ichat-server/WebRoot/console/index.jsp b/cim_for_netty/cim-server/WebRoot/console/index.jsp similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/console/index.jsp rename to cim_for_netty/cim-server/WebRoot/console/index.jsp diff --git a/cim_for_netty/ichat-server/WebRoot/console/nav.jsp b/cim_for_netty/cim-server/WebRoot/console/nav.jsp similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/console/nav.jsp rename to cim_for_netty/cim-server/WebRoot/console/nav.jsp diff --git a/cim_for_netty/ichat-server/WebRoot/console/session/manage.jsp b/cim_for_netty/cim-server/WebRoot/console/session/manage.jsp similarity index 95% rename from cim_for_netty/ichat-server/WebRoot/console/session/manage.jsp rename to cim_for_netty/cim-server/WebRoot/console/session/manage.jsp index 4d8ba5a..80632c3 100644 --- a/cim_for_netty/ichat-server/WebRoot/console/session/manage.jsp +++ b/cim_for_netty/cim-server/WebRoot/console/session/manage.jsp @@ -1,6 +1,6 @@ <%@ page language="java" pageEncoding="utf-8"%> <%@ page import="java.util.Collection"%> -<%@ page import="com.farsunset.cim.nio.session.CIMSession"%> +<%@ page import="com.farsunset.cim.server.session.CIMSession"%> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" @@ -56,7 +56,7 @@ function onImageError(obj) { - obj.src="<%=basePath%>/webclient/images/icon_head_default.png"; + obj.src="<%=basePath%>/resource/img/icon.png"; } function openWebclient(){ @@ -92,6 +92,7 @@ 头像 账号 终端 + 应用版本 设备型号 在线时长 位置 @@ -117,6 +118,9 @@ <%=ios.getChannel()%> + + <%=ios.getAppVersion()==null?"":ios.getAppVersion()%> + <%=ios.getDeviceModel()==null?"":ios.getDeviceModel()%> @@ -124,7 +128,7 @@ <%=(System.currentTimeMillis()-ios.getBindTime())/1000 %>秒 - <%=ios.getAttribute("location")==null?"":ios.getAttribute("location") %> + <%=ios.getTag("location")==null?"":ios.getTag("location") %>
diff --git a/cim_for_netty/ichat-server/WebRoot/console/webclient/CIMBridge.swf b/cim_for_netty/cim-server/WebRoot/console/webclient/CIMBridge.swf similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/console/webclient/CIMBridge.swf rename to cim_for_netty/cim-server/WebRoot/console/webclient/CIMBridge.swf diff --git a/cim_for_netty/ichat-server/WebRoot/console/webclient/LoginDialog.jsp b/cim_for_netty/cim-server/WebRoot/console/webclient/LoginDialog.jsp similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/console/webclient/LoginDialog.jsp rename to cim_for_netty/cim-server/WebRoot/console/webclient/LoginDialog.jsp diff --git a/cim_for_netty/ichat-server/WebRoot/console/webclient/MessageDialog.jsp b/cim_for_netty/cim-server/WebRoot/console/webclient/MessageDialog.jsp similarity index 79% rename from cim_for_netty/ichat-server/WebRoot/console/webclient/MessageDialog.jsp rename to cim_for_netty/cim-server/WebRoot/console/webclient/MessageDialog.jsp index 7119991..c19bade 100644 --- a/cim_for_netty/ichat-server/WebRoot/console/webclient/MessageDialog.jsp +++ b/cim_for_netty/cim-server/WebRoot/console/webclient/MessageDialog.jsp @@ -7,7 +7,9 @@
- +
+ 请调用接口,或者在后台页面,推送一条消息到客户端 +
diff --git a/cim_for_netty/ichat-server/WebRoot/console/webclient/cim.js b/cim_for_netty/cim-server/WebRoot/console/webclient/cim.js similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/console/webclient/cim.js rename to cim_for_netty/cim-server/WebRoot/console/webclient/cim.js diff --git a/cim_for_netty/ichat-server/WebRoot/console/webclient/dingdong.mp3 b/cim_for_netty/cim-server/WebRoot/console/webclient/dingdong.mp3 similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/console/webclient/dingdong.mp3 rename to cim_for_netty/cim-server/WebRoot/console/webclient/dingdong.mp3 diff --git a/cim_for_netty/ichat-server/WebRoot/console/webclient/main.jsp b/cim_for_netty/cim-server/WebRoot/console/webclient/main.jsp similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/console/webclient/main.jsp rename to cim_for_netty/cim-server/WebRoot/console/webclient/main.jsp diff --git a/cim_for_netty/ichat-server/WebRoot/index.jsp b/cim_for_netty/cim-server/WebRoot/index.jsp similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/index.jsp rename to cim_for_netty/cim-server/WebRoot/index.jsp diff --git a/cim_for_netty/ichat-server/WebRoot/resource/bootstrap/css/bootstrap-theme.min.css b/cim_for_netty/cim-server/WebRoot/resource/bootstrap/css/bootstrap-theme.min.css similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/bootstrap/css/bootstrap-theme.min.css rename to cim_for_netty/cim-server/WebRoot/resource/bootstrap/css/bootstrap-theme.min.css diff --git a/cim_for_netty/ichat-server/WebRoot/resource/bootstrap/css/bootstrap.min.css b/cim_for_netty/cim-server/WebRoot/resource/bootstrap/css/bootstrap.min.css similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/bootstrap/css/bootstrap.min.css rename to cim_for_netty/cim-server/WebRoot/resource/bootstrap/css/bootstrap.min.css diff --git a/cim_for_netty/ichat-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.eot b/cim_for_netty/cim-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.eot rename to cim_for_netty/cim-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.eot diff --git a/cim_for_netty/ichat-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.svg b/cim_for_netty/cim-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.svg rename to cim_for_netty/cim-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.svg diff --git a/cim_for_netty/ichat-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.ttf b/cim_for_netty/cim-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.ttf rename to cim_for_netty/cim-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.ttf diff --git a/cim_for_netty/ichat-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.woff b/cim_for_netty/cim-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.woff rename to cim_for_netty/cim-server/WebRoot/resource/bootstrap/fonts/glyphicons-halflings-regular.woff diff --git a/cim_for_netty/ichat-server/WebRoot/resource/bootstrap/js/bootstrap.min.js b/cim_for_netty/cim-server/WebRoot/resource/bootstrap/js/bootstrap.min.js similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/bootstrap/js/bootstrap.min.js rename to cim_for_netty/cim-server/WebRoot/resource/bootstrap/js/bootstrap.min.js diff --git a/cim_for_netty/ichat-server/WebRoot/resource/css/base-ui.css b/cim_for_netty/cim-server/WebRoot/resource/css/base-ui.css similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/css/base-ui.css rename to cim_for_netty/cim-server/WebRoot/resource/css/base-ui.css diff --git a/cim_for_netty/ichat-server/WebRoot/resource/css/dialog.css b/cim_for_netty/cim-server/WebRoot/resource/css/dialog.css similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/css/dialog.css rename to cim_for_netty/cim-server/WebRoot/resource/css/dialog.css diff --git a/cim_for_netty/ichat-server/WebRoot/resource/css/login.css b/cim_for_netty/cim-server/WebRoot/resource/css/login.css similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/css/login.css rename to cim_for_netty/cim-server/WebRoot/resource/css/login.css diff --git a/cim_for_netty/ichat-server/WebRoot/resource/css/main-layout.css b/cim_for_netty/cim-server/WebRoot/resource/css/main-layout.css similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/css/main-layout.css rename to cim_for_netty/cim-server/WebRoot/resource/css/main-layout.css diff --git a/cim_for_netty/ichat-server/WebRoot/resource/css/table.css b/cim_for_netty/cim-server/WebRoot/resource/css/table.css similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/css/table.css rename to cim_for_netty/cim-server/WebRoot/resource/css/table.css diff --git a/cim_for_netty/ichat-server/WebRoot/resource/css/webbase.css b/cim_for_netty/cim-server/WebRoot/resource/css/webbase.css similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/css/webbase.css rename to cim_for_netty/cim-server/WebRoot/resource/css/webbase.css diff --git a/cim_for_netty/ichat-server/WebRoot/resource/img/blue_line.jpg b/cim_for_netty/cim-server/WebRoot/resource/img/blue_line.jpg similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/img/blue_line.jpg rename to cim_for_netty/cim-server/WebRoot/resource/img/blue_line.jpg diff --git a/cim_for_netty/ichat-server/WebRoot/resource/img/circle_banner.jpg b/cim_for_netty/cim-server/WebRoot/resource/img/circle_banner.jpg similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/img/circle_banner.jpg rename to cim_for_netty/cim-server/WebRoot/resource/img/circle_banner.jpg diff --git a/cim_for_netty/ichat-server/WebRoot/resource/img/disk-spr.png b/cim_for_netty/cim-server/WebRoot/resource/img/disk-spr.png similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/img/disk-spr.png rename to cim_for_netty/cim-server/WebRoot/resource/img/disk-spr.png diff --git a/cim_for_netty/ichat-server/WebRoot/resource/img/icon.png b/cim_for_netty/cim-server/WebRoot/resource/img/icon.png similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/img/icon.png rename to cim_for_netty/cim-server/WebRoot/resource/img/icon.png diff --git a/cim_for_netty/ichat-server/WebRoot/resource/img/icon_error.png b/cim_for_netty/cim-server/WebRoot/resource/img/icon_error.png similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/img/icon_error.png rename to cim_for_netty/cim-server/WebRoot/resource/img/icon_error.png diff --git a/cim_for_netty/ichat-server/WebRoot/resource/img/icon_hint.png b/cim_for_netty/cim-server/WebRoot/resource/img/icon_hint.png similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/img/icon_hint.png rename to cim_for_netty/cim-server/WebRoot/resource/img/icon_hint.png diff --git a/cim_for_netty/ichat-server/WebRoot/resource/img/icon_loading_small.gif b/cim_for_netty/cim-server/WebRoot/resource/img/icon_loading_small.gif similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/img/icon_loading_small.gif rename to cim_for_netty/cim-server/WebRoot/resource/img/icon_loading_small.gif diff --git a/cim_for_netty/ichat-server/WebRoot/resource/img/icon_success.png b/cim_for_netty/cim-server/WebRoot/resource/img/icon_success.png similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/img/icon_success.png rename to cim_for_netty/cim-server/WebRoot/resource/img/icon_success.png diff --git a/cim_for_netty/ichat-server/WebRoot/resource/img/scan_download.png b/cim_for_netty/cim-server/WebRoot/resource/img/scan_download.png similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/img/scan_download.png rename to cim_for_netty/cim-server/WebRoot/resource/img/scan_download.png diff --git a/cim_for_netty/ichat-server/WebRoot/resource/img/top-bg.png b/cim_for_netty/cim-server/WebRoot/resource/img/top-bg.png similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/img/top-bg.png rename to cim_for_netty/cim-server/WebRoot/resource/img/top-bg.png diff --git a/cim_for_netty/ichat-server/WebRoot/resource/img/usericon_bg.png b/cim_for_netty/cim-server/WebRoot/resource/img/usericon_bg.png similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/img/usericon_bg.png rename to cim_for_netty/cim-server/WebRoot/resource/img/usericon_bg.png diff --git a/cim_for_netty/ichat-server/WebRoot/resource/js/framework.js b/cim_for_netty/cim-server/WebRoot/resource/js/framework.js similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/js/framework.js rename to cim_for_netty/cim-server/WebRoot/resource/js/framework.js diff --git a/cim_for_netty/ichat-server/WebRoot/resource/js/jquery-1.8.3.min.js b/cim_for_netty/cim-server/WebRoot/resource/js/jquery-1.8.3.min.js similarity index 100% rename from cim_for_netty/ichat-server/WebRoot/resource/js/jquery-1.8.3.min.js rename to cim_for_netty/cim-server/WebRoot/resource/js/jquery-1.8.3.min.js diff --git a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/admin/action/SessionAction.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/admin/action/SessionAction.java similarity index 76% rename from cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/admin/action/SessionAction.java rename to cim_for_netty/cim-server/src/main/java/com/farsunset/cim/admin/action/SessionAction.java index ea354e6..88e3fa8 100644 --- a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/admin/action/SessionAction.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/admin/action/SessionAction.java @@ -1,14 +1,14 @@ -package com.farsunset.ichat.admin.action; +package com.farsunset.cim.admin.action; import java.io.IOException; import org.apache.struts2.ServletActionContext; -import com.farsunset.cim.nio.mutual.Message; -import com.farsunset.cim.nio.session.DefaultSessionManager; -import com.farsunset.ichat.cim.push.SystemMessagePusher; -import com.farsunset.ichat.common.util.ContextHolder; +import com.farsunset.cim.push.SystemMessagePusher; +import com.farsunset.cim.server.mutual.Message; +import com.farsunset.cim.server.session.DefaultSessionManager; +import com.farsunset.cim.util.ContextHolder; import com.opensymphony.xwork2.ActionSupport; public class SessionAction extends ActionSupport { diff --git a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/api/action/MessageAction.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/api/action/MessageAction.java similarity index 89% rename from cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/api/action/MessageAction.java rename to cim_for_netty/cim-server/src/main/java/com/farsunset/cim/api/action/MessageAction.java index 76f7af1..fbd1daa 100644 --- a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/api/action/MessageAction.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/api/action/MessageAction.java @@ -1,122 +1,122 @@ -package com.farsunset.ichat.api.action; - -import java.util.HashMap; - -import org.apache.commons.lang3.StringUtils; -import org.apache.struts2.ServletActionContext; -import org.springframework.web.bind.ServletRequestBindingException; - -import com.farsunset.cim.nio.mutual.Message; -import com.farsunset.ichat.cim.push.DefaultMessagePusher; -import com.farsunset.ichat.cim.push.SystemMessagePusher; -import com.farsunset.ichat.common.util.Constants; -import com.farsunset.ichat.common.util.ContextHolder; -import com.google.gson.Gson; -import com.opensymphony.xwork2.ActionSupport; -import com.opensymphony.xwork2.ModelDriven; - -/** - * - * @author farsunset (3979434@qq.com) - */ -public class MessageAction extends ActionSupport implements ModelDriven{ - - /** - * - */ - private static final long serialVersionUID = 1L; - Message message = new Message(); - - /** - * 关于http参数获取, struts2 的模型驱动 比如 http 参数 sender=xiaomao&receiver=xiaogou - * struts自动会将参数的值 存入getModel()返回的对象的对应属性中,即xiaomao会存入message.sender属性,xiaogou会存入message.receiver属性 - * 省去了request.getParameter("sender")方式获取参数,,如果参数名在getModel()返回的对象中不存在,则需要用request.getParameter()获取 - * 其他相关*Action.java中 同理,这里做统一说明! - */ - public String send() throws Exception { - - HashMap datamap = new HashMap(); - HashMap data = new HashMap(); - ServletActionContext.getResponse().setContentType("text/json;charset=UTF-8"); - datamap.put("code", 200); - - try{ - - checkParams(); - - if(Constants.MessageType.TYPE_2.equals(message.getType())) - { - //向客户端 发送消息 - ContextHolder.getBean(SystemMessagePusher.class).pushMessageToUser(message); - }else - { - //向客户端 发送消息 - ((DefaultMessagePusher)ContextHolder.getBean("messagePusher")).pushMessageToUser(message); - } - - data.put("id", message.getMid()); - data.put("createTime", String.valueOf(message.getTimestamp())); - datamap.put("data", data); - }catch(Exception e){ - - datamap.put("code", 500); - e.printStackTrace(); - } - - ServletActionContext.getResponse().getWriter().print(new Gson().toJson(datamap)); - return null; - } - - - - - /** - * 文件由客户端发往阿里云 OSS 存储 - * @param messageServiceImpl - */ - /* private void fileHandler(Message mo, HttpServletRequest request) throws IOException - { - if(request instanceof MultiPartRequestWrapper){ - MultiPartRequestWrapper pr = (MultiPartRequestWrapper) request; - if(pr.getFiles("file")!=null) - { - File file = pr.getFiles("file")[0]; - - String fileType = request.getParameter("fileType"); - String dir = dirMap.get(fileType); - if(StringUtils.isEmpty(dir)) - { - throw new IllegalArgumentException("fileType:" +fileType+" 未定义" ); - - } - String path = request.getSession().getServletContext().getRealPath(dir); - String uuid=UUID.randomUUID().toString().replaceAll("-", ""); - File des = new File(path+"/"+uuid); - FileUtil.copyFile(file, des); - mo.setFile(dir+"/"+uuid); - mo.setFileType(fileType); - } - } - - }*/ - - - private void checkParams() throws ServletRequestBindingException - { - - if(StringUtils.isEmpty(message.getReceiver())) - { - throw new IllegalArgumentException("receiver 不能为空!"); - - } - } - - @Override - public Message getModel() { - // TODO Auto-generated method stub - return message; - } - - - +package com.farsunset.cim.api.action; + +import java.util.HashMap; + +import org.apache.commons.lang3.StringUtils; +import org.apache.struts2.ServletActionContext; +import org.springframework.web.bind.ServletRequestBindingException; + +import com.farsunset.cim.push.DefaultMessagePusher; +import com.farsunset.cim.push.SystemMessagePusher; +import com.farsunset.cim.server.mutual.Message; +import com.farsunset.cim.util.Constants; +import com.farsunset.cim.util.ContextHolder; +import com.google.gson.Gson; +import com.opensymphony.xwork2.ActionSupport; +import com.opensymphony.xwork2.ModelDriven; + +/** + * + * @author farsunset (3979434@qq.com) + */ +public class MessageAction extends ActionSupport implements ModelDriven{ + + /** + * + */ + private static final long serialVersionUID = 1L; + Message message = new Message(); + + /** + * 关于http参数获取, struts2 的模型驱动 比如 http 参数 sender=xiaomao&receiver=xiaogou + * struts自动会将参数的值 存入getModel()返回的对象的对应属性中,即xiaomao会存入message.sender属性,xiaogou会存入message.receiver属性 + * 省去了request.getParameter("sender")方式获取参数,,如果参数名在getModel()返回的对象中不存在,则需要用request.getParameter()获取 + * 其他相关*Action.java中 同理,这里做统一说明! + */ + public String send() throws Exception { + + HashMap datamap = new HashMap(); + HashMap data = new HashMap(); + ServletActionContext.getResponse().setContentType("text/json;charset=UTF-8"); + datamap.put("code", 200); + + try{ + + checkParams(); + + if(Constants.MessageType.TYPE_2.equals(message.getType())) + { + //向客户端 发送消息 + ContextHolder.getBean(SystemMessagePusher.class).pushMessageToUser(message); + }else + { + //向客户端 发送消息 + ((DefaultMessagePusher)ContextHolder.getBean("messagePusher")).pushMessageToUser(message); + } + + data.put("id", message.getMid()); + data.put("createTime", String.valueOf(message.getTimestamp())); + datamap.put("data", data); + }catch(Exception e){ + + datamap.put("code", 500); + e.printStackTrace(); + } + + ServletActionContext.getResponse().getWriter().print(new Gson().toJson(datamap)); + return null; + } + + + + + /** + * 文件由客户端发往阿里云 OSS 存储 + * @param messageServiceImpl + */ + /* private void fileHandler(Message mo, HttpServletRequest request) throws IOException + { + if(request instanceof MultiPartRequestWrapper){ + MultiPartRequestWrapper pr = (MultiPartRequestWrapper) request; + if(pr.getFiles("file")!=null) + { + File file = pr.getFiles("file")[0]; + + String fileType = request.getParameter("fileType"); + String dir = dirMap.get(fileType); + if(StringUtils.isEmpty(dir)) + { + throw new IllegalArgumentException("fileType:" +fileType+" 未定义" ); + + } + String path = request.getSession().getServletContext().getRealPath(dir); + String uuid=UUID.randomUUID().toString().replaceAll("-", ""); + File des = new File(path+"/"+uuid); + FileUtil.copyFile(file, des); + mo.setFile(dir+"/"+uuid); + mo.setFileType(fileType); + } + } + + }*/ + + + private void checkParams() throws ServletRequestBindingException + { + + if(StringUtils.isEmpty(message.getReceiver())) + { + throw new IllegalArgumentException("receiver 不能为空!"); + + } + } + + @Override + public Message getModel() { + // TODO Auto-generated method stub + return message; + } + + + } \ No newline at end of file diff --git a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/handler/BindHandler.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/BindHandler.java similarity index 75% rename from cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/handler/BindHandler.java rename to cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/BindHandler.java index c314142..2bbcf8b 100644 --- a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/handler/BindHandler.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/BindHandler.java @@ -1,90 +1,90 @@ -package com.farsunset.ichat.cim.handler; - -import java.net.InetAddress; -import java.util.UUID; - -import org.apache.log4j.Logger; - -import com.farsunset.cim.nio.constant.CIMConstant; -import com.farsunset.cim.nio.handler.CIMRequestHandler; -import com.farsunset.cim.nio.mutual.Message; -import com.farsunset.cim.nio.mutual.ReplyBody; -import com.farsunset.cim.nio.mutual.SentBody; -import com.farsunset.cim.nio.session.CIMSession; -import com.farsunset.cim.nio.session.DefaultSessionManager; -import com.farsunset.ichat.common.util.ContextHolder; - - -/** - * 账号绑定实现 - * - * @author - */ -public class BindHandler implements CIMRequestHandler { - - protected final Logger logger = Logger.getLogger(BindHandler.class); - public ReplyBody process(CIMSession newSession, SentBody message) { - - ReplyBody reply = new ReplyBody(); - DefaultSessionManager sessionManager= ((DefaultSessionManager) ContextHolder.getBean("defaultSessionManager")); - try { - - String account = message.get("account"); - - newSession.setAccount(account); - newSession.setDeviceId(message.get("deviceId")); - newSession.setGid(UUID.randomUUID().toString()); - newSession.setHost(InetAddress.getLocalHost().getHostAddress()); - newSession.setChannel( message.get("channel")); - newSession.setDeviceModel(message.get("device")); - //第一次设置心跳时间为登录时间 - newSession.setBindTime(System.currentTimeMillis()); - newSession.setHeartbeat(System.currentTimeMillis()); - /** - * 由于客户端断线服务端可能会无法获知的情况,客户端重连时,需要关闭旧的连接 - */ - CIMSession oldSession = sessionManager.getSession(account); - //如果是账号已经在另一台终端登录。则让另一个终端下线 - if(oldSession!=null&&!oldSession.equals(newSession)) - { - - - oldSession.removeAttribute(CIMConstant.SESSION_KEY); - Message msg = new Message(); - msg.setType(CIMConstant.MessageType.TYPE_999);//强行下线消息类型 - msg.setReceiver(account); - - if(!oldSession.isLocalhost()) - { - - /* - 判断当前session是否连接于本台服务器,如不是发往目标服务器处理 - MessageDispatcher.execute(msg, oldSession.getHost()); - */ - }else - { - oldSession.write(msg); - oldSession.close(true); - oldSession = null; - } - oldSession = null; - - - } - if(oldSession==null) - { - sessionManager.addSession(account, newSession); - - } - - reply.setCode(CIMConstant.ReturnCode.CODE_200); - - } catch (Exception e) { - reply.setCode(CIMConstant.ReturnCode.CODE_500); - e.printStackTrace(); - } - logger.debug("bind :account:" +message.get("account")+"-----------------------------" +reply.getCode()); - return reply; - } - +package com.farsunset.cim.handler; + +import java.net.InetAddress; +import java.util.UUID; + +import org.apache.log4j.Logger; + +import com.farsunset.cim.server.constant.CIMConstant; +import com.farsunset.cim.server.handler.CIMRequestHandler; +import com.farsunset.cim.server.mutual.Message; +import com.farsunset.cim.server.mutual.ReplyBody; +import com.farsunset.cim.server.mutual.SentBody; +import com.farsunset.cim.server.session.CIMSession; +import com.farsunset.cim.server.session.DefaultSessionManager; +import com.farsunset.cim.util.ContextHolder; + + +/** + * 账号绑定实现 + * + * @author + */ +public class BindHandler implements CIMRequestHandler { + + protected final Logger logger = Logger.getLogger(BindHandler.class); + public ReplyBody process(CIMSession newSession, SentBody message) { + + ReplyBody reply = new ReplyBody(); + DefaultSessionManager sessionManager= ((DefaultSessionManager) ContextHolder.getBean("defaultSessionManager")); + try { + + String account = message.get("account"); + + newSession.setAccount(account); + newSession.setDeviceId(message.get("deviceId")); + newSession.setGid(UUID.randomUUID().toString()); + newSession.setHost(InetAddress.getLocalHost().getHostAddress()); + newSession.setChannel( message.get("channel")); + newSession.setDeviceModel(message.get("device")); + newSession.setAppVersion(message.get("appVersion")); + //第一次设置心跳时间为登录时间 + newSession.setBindTime(System.currentTimeMillis()); + newSession.setHeartbeat(System.currentTimeMillis()); + /** + * 由于客户端断线服务端可能会无法获知的情况,客户端重连时,需要关闭旧的连接 + */ + CIMSession oldSession = sessionManager.getSession(account); + //如果是账号已经在另一台终端登录。则让另一个终端下线 + if(oldSession!=null&&!oldSession.equals(newSession)) + { + + + oldSession.removeTag(CIMConstant.SESSION_KEY); + Message msg = new Message(); + msg.setType(CIMConstant.MessageType.TYPE_999);//强行下线消息类型 + msg.setReceiver(account); + + if(!oldSession.isLocalhost()) + { + + /* + 判断当前session是否连接于本台服务器,如不是发往目标服务器处理 + MessageDispatcher.execute(msg, oldSession.getHost()); + */ + }else + { + oldSession.write(msg); + oldSession.close(true); + oldSession = null; + } + oldSession = null; + + + } + if(oldSession==null) + { + sessionManager.addSession(account, newSession); + + } + + reply.setCode(CIMConstant.ReturnCode.CODE_200); + + } catch (Exception e) { + reply.setCode(CIMConstant.ReturnCode.CODE_500); + e.printStackTrace(); + } + return reply; + } + } \ No newline at end of file diff --git a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/LogoutHandler.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/LogoutHandler.java new file mode 100644 index 0000000..41f08bf --- /dev/null +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/LogoutHandler.java @@ -0,0 +1,35 @@ + +package com.farsunset.cim.handler; + +import com.farsunset.cim.server.constant.CIMConstant; +import com.farsunset.cim.server.handler.CIMRequestHandler; +import com.farsunset.cim.server.mutual.ReplyBody; +import com.farsunset.cim.server.mutual.SentBody; +import com.farsunset.cim.server.session.CIMSession; +import com.farsunset.cim.server.session.DefaultSessionManager; +import com.farsunset.cim.util.ContextHolder; + + +/** + * 退出连接实现 + * + * @author 3979434@qq.com + */ +public class LogoutHandler implements CIMRequestHandler { + + public ReplyBody process(CIMSession ios, SentBody message) { + + + DefaultSessionManager sessionManager = ((DefaultSessionManager) ContextHolder.getBean("defaultSessionManager")); + + String account =ios.getTag(CIMConstant.SESSION_KEY).toString(); + ios.removeTag(CIMConstant.SESSION_KEY); + ios.close(true); + + sessionManager.removeSession(account); + + return null; + } + + +} \ No newline at end of file diff --git a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/handler/PushOfflineMessageHandler.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/PushOfflineMessageHandler.java similarity index 72% rename from cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/handler/PushOfflineMessageHandler.java rename to cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/PushOfflineMessageHandler.java index 2f1fb7c..41a1411 100644 --- a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/handler/PushOfflineMessageHandler.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/PushOfflineMessageHandler.java @@ -4,19 +4,19 @@ * * @author 3979434@qq.com */ -package com.farsunset.ichat.cim.handler; +package com.farsunset.cim.handler; import java.util.ArrayList; import java.util.List; import org.apache.log4j.Logger; -import com.farsunset.cim.nio.constant.CIMConstant; -import com.farsunset.cim.nio.handler.CIMRequestHandler; -import com.farsunset.cim.nio.mutual.Message; -import com.farsunset.cim.nio.mutual.ReplyBody; -import com.farsunset.cim.nio.mutual.SentBody; -import com.farsunset.cim.nio.session.CIMSession; +import com.farsunset.cim.server.constant.CIMConstant; +import com.farsunset.cim.server.handler.CIMRequestHandler; +import com.farsunset.cim.server.mutual.Message; +import com.farsunset.cim.server.mutual.ReplyBody; +import com.farsunset.cim.server.mutual.SentBody; +import com.farsunset.cim.server.session.CIMSession; /** * 推送离线消息 */ diff --git a/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/SessionClosedHandler.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/SessionClosedHandler.java new file mode 100644 index 0000000..8ae304d --- /dev/null +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/handler/SessionClosedHandler.java @@ -0,0 +1,40 @@ + +package com.farsunset.cim.handler; + +import org.apache.log4j.Logger; + +import com.farsunset.cim.server.constant.CIMConstant; +import com.farsunset.cim.server.handler.CIMRequestHandler; +import com.farsunset.cim.server.mutual.ReplyBody; +import com.farsunset.cim.server.mutual.SentBody; +import com.farsunset.cim.server.session.CIMSession; +import com.farsunset.cim.server.session.DefaultSessionManager; +import com.farsunset.cim.util.ContextHolder; + +/** + * 断开连接,清除session + * + * @author + */ +public class SessionClosedHandler implements CIMRequestHandler { + + protected final Logger logger = Logger.getLogger(SessionClosedHandler.class); + + public ReplyBody process(CIMSession ios, SentBody message) { + + DefaultSessionManager sessionManager = ((DefaultSessionManager) ContextHolder.getBean("defaultSessionManager")); + + if(ios.getTag(CIMConstant.SESSION_KEY)==null) + { + return null; + } + + String account = ios.getTag(CIMConstant.SESSION_KEY).toString(); + sessionManager.removeSession(account); + + return null; + } + + + +} \ No newline at end of file diff --git a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/push/CIMMessagePusher.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/CIMMessagePusher.java similarity index 73% rename from cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/push/CIMMessagePusher.java rename to cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/CIMMessagePusher.java index 187bb0a..fe9e39a 100644 --- a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/push/CIMMessagePusher.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/CIMMessagePusher.java @@ -1,7 +1,7 @@ -package com.farsunset.ichat.cim.push; +package com.farsunset.cim.push; -import com.farsunset.cim.nio.mutual.Message; +import com.farsunset.cim.server.mutual.Message; /** * 消息发送实接口 diff --git a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/push/DefaultMessagePusher.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/DefaultMessagePusher.java similarity index 94% rename from cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/push/DefaultMessagePusher.java rename to cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/DefaultMessagePusher.java index 6ac7e31..41680b6 100644 --- a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/push/DefaultMessagePusher.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/DefaultMessagePusher.java @@ -1,12 +1,12 @@ -package com.farsunset.ichat.cim.push; +package com.farsunset.cim.push; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import com.farsunset.cim.nio.mutual.Message; -import com.farsunset.cim.nio.session.CIMSession; -import com.farsunset.cim.nio.session.DefaultSessionManager; +import com.farsunset.cim.server.mutual.Message; +import com.farsunset.cim.server.session.CIMSession; +import com.farsunset.cim.server.session.DefaultSessionManager; /** * 消息发送实现类 diff --git a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/push/SystemMessagePusher.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/SystemMessagePusher.java similarity index 80% rename from cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/push/SystemMessagePusher.java rename to cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/SystemMessagePusher.java index 60ab59d..e4c461d 100644 --- a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/push/SystemMessagePusher.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/push/SystemMessagePusher.java @@ -1,7 +1,7 @@ -package com.farsunset.ichat.cim.push; +package com.farsunset.cim.push; -import com.farsunset.cim.nio.mutual.Message; +import com.farsunset.cim.server.mutual.Message; diff --git a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/session/ClusterSessionManager.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/session/ClusterSessionManager.java similarity index 92% rename from cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/session/ClusterSessionManager.java rename to cim_for_netty/cim-server/src/main/java/com/farsunset/cim/session/ClusterSessionManager.java index 80c1712..274006b 100644 --- a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/cim/session/ClusterSessionManager.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/session/ClusterSessionManager.java @@ -1,10 +1,10 @@ -package com.farsunset.ichat.cim.session; +package com.farsunset.cim.session; import java.util.Collection; -import com.farsunset.cim.nio.session.CIMSession; -import com.farsunset.cim.nio.session.SessionManager; +import com.farsunset.cim.server.session.CIMSession; +import com.farsunset.cim.server.session.SessionManager; /** * 集群 session管理实现示例, 各位可以自行实现 AbstractSessionManager接口来实现自己的 session管理 diff --git a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/common/util/Constants.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/Constants.java similarity index 97% rename from cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/common/util/Constants.java rename to cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/Constants.java index 9bba21b..6546848 100644 --- a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/common/util/Constants.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/Constants.java @@ -1,4 +1,4 @@ -package com.farsunset.ichat.common.util; +package com.farsunset.cim.util; public interface Constants { diff --git a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/common/util/ContextHolder.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/ContextHolder.java similarity index 94% rename from cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/common/util/ContextHolder.java rename to cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/ContextHolder.java index f3b73cb..ecfd01b 100644 --- a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/common/util/ContextHolder.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/ContextHolder.java @@ -1,4 +1,4 @@ -package com.farsunset.ichat.common.util; +package com.farsunset.cim.util; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; diff --git a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/common/util/MessageDispatcher.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/MessageDispatcher.java similarity index 93% rename from cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/common/util/MessageDispatcher.java rename to cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/MessageDispatcher.java index 3c820ff..9a9c380 100644 --- a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/common/util/MessageDispatcher.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/MessageDispatcher.java @@ -1,5 +1,5 @@ -package com.farsunset.ichat.common.util; +package com.farsunset.cim.util; import java.util.ArrayList; import java.util.List; import java.util.concurrent.BlockingQueue; @@ -17,13 +17,13 @@ import org.apache.http.impl.client.HttpClients; import org.apache.http.message.BasicNameValuePair; import org.apache.http.util.EntityUtils; -import com.farsunset.cim.nio.mutual.Message; +import com.farsunset.cim.server.mutual.Message; public class MessageDispatcher { private static BlockingQueue queue = new LinkedBlockingQueue(); private static ThreadPoolExecutor executor = new ThreadPoolExecutor(3, 5, 20, TimeUnit.SECONDS,queue);; - final static String sendUrl = "http://%1$s:8080/ichat-servier/cgi/message_send.api"; + final static String sendUrl = "http://%1$s:8080/cim-servier/cgi/message_send.api"; public static void execute(final Message msg,final String ip) { diff --git a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/common/util/StringUtil.java b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/StringUtil.java similarity index 95% rename from cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/common/util/StringUtil.java rename to cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/StringUtil.java index 68e38f8..82fb185 100644 --- a/cim_for_netty/ichat-server/src/main/java/com/farsunset/ichat/common/util/StringUtil.java +++ b/cim_for_netty/cim-server/src/main/java/com/farsunset/cim/util/StringUtil.java @@ -1,4 +1,4 @@ -package com.farsunset.ichat.common.util; +package com.farsunset.cim.util; import java.text.SimpleDateFormat; import java.util.Date; diff --git a/cim_for_netty/ichat-server/src/main/resource/log4j.properties b/cim_for_netty/cim-server/src/main/resource/log4j.properties similarity index 94% rename from cim_for_netty/ichat-server/src/main/resource/log4j.properties rename to cim_for_netty/cim-server/src/main/resource/log4j.properties index b0801a7..b0572a1 100644 --- a/cim_for_netty/ichat-server/src/main/resource/log4j.properties +++ b/cim_for_netty/cim-server/src/main/resource/log4j.properties @@ -1,4 +1,4 @@ -log4j.rootLogger=warn,console, file +log4j.rootLogger=debug,console, file #----------console---------------- log4j.appender.console=org.apache.log4j.ConsoleAppender diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/spring-cim.xml b/cim_for_netty/cim-server/src/main/resource/spring-cim.xml similarity index 64% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/spring-cim.xml rename to cim_for_netty/cim-server/src/main/resource/spring-cim.xml index f0aa66d..7e428ed 100644 --- a/cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/spring-cim.xml +++ b/cim_for_netty/cim-server/src/main/resource/spring-cim.xml @@ -14,24 +14,24 @@ > - + - + - + - + - - + + - + @@ -39,5 +39,5 @@ - + \ No newline at end of file diff --git a/cim_for_netty/ichat-server/src/main/resource/spring-config.xml b/cim_for_netty/cim-server/src/main/resource/spring-config.xml similarity index 87% rename from cim_for_netty/ichat-server/src/main/resource/spring-config.xml rename to cim_for_netty/cim-server/src/main/resource/spring-config.xml index b24013a..de92bdb 100644 --- a/cim_for_netty/ichat-server/src/main/resource/spring-config.xml +++ b/cim_for_netty/cim-server/src/main/resource/spring-config.xml @@ -12,5 +12,5 @@ http://www.springframework.org/schema/aop/spring-aop-2.5.xsd " > - + \ No newline at end of file diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/spring-push.xml b/cim_for_netty/cim-server/src/main/resource/spring-push.xml similarity index 80% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/spring-push.xml rename to cim_for_netty/cim-server/src/main/resource/spring-push.xml index 6b21240..b7959fa 100644 --- a/cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/spring-push.xml +++ b/cim_for_netty/cim-server/src/main/resource/spring-push.xml @@ -13,11 +13,11 @@ " > - + - + \ No newline at end of file diff --git a/cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/struts.xml b/cim_for_netty/cim-server/src/main/resource/struts.xml similarity index 79% rename from cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/struts.xml rename to cim_for_netty/cim-server/src/main/resource/struts.xml index 7dd0e3d..f8f7936 100644 --- a/cim_for_netty/ichat-server/WebRoot/WEB-INF/classes/struts.xml +++ b/cim_for_netty/cim-server/src/main/resource/struts.xml @@ -10,12 +10,12 @@ - + /console/session/manage.jsp - + \ No newline at end of file diff --git a/cim_for_netty/mchat-simple/.classpath b/cim_for_netty/client-mchat-android/.classpath similarity index 100% rename from cim_for_netty/mchat-simple/.classpath rename to cim_for_netty/client-mchat-android/.classpath diff --git a/cim_for_netty/mchat-simple/.project b/cim_for_netty/client-mchat-android/.project similarity index 95% rename from cim_for_netty/mchat-simple/.project rename to cim_for_netty/client-mchat-android/.project index 13800fd..71b77c4 100644 --- a/cim_for_netty/mchat-simple/.project +++ b/cim_for_netty/client-mchat-android/.project @@ -1,6 +1,6 @@ - mchat-simple + client-mchat-android diff --git a/cim_for_netty/mchat-simple/.settings/org.eclipse.core.resources.prefs b/cim_for_netty/client-mchat-android/.settings/org.eclipse.core.resources.prefs similarity index 100% rename from cim_for_netty/mchat-simple/.settings/org.eclipse.core.resources.prefs rename to cim_for_netty/client-mchat-android/.settings/org.eclipse.core.resources.prefs diff --git a/cim_for_netty/client-mchat-android/.settings/org.eclipse.jdt.core.prefs b/cim_for_netty/client-mchat-android/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..b080d2d --- /dev/null +++ b/cim_for_netty/client-mchat-android/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/cim_for_netty/mchat-simple/AndroidManifest.xml b/cim_for_netty/client-mchat-android/AndroidManifest.xml similarity index 86% rename from cim_for_netty/mchat-simple/AndroidManifest.xml rename to cim_for_netty/client-mchat-android/AndroidManifest.xml index 84e521d..cd25be2 100644 --- a/cim_for_netty/mchat-simple/AndroidManifest.xml +++ b/cim_for_netty/client-mchat-android/AndroidManifest.xml @@ -53,12 +53,9 @@ - - - - + - + @@ -68,7 +65,12 @@ - + + + + + + diff --git a/cim_for_netty/mchat-simple/libs/android-support-v4.jar b/cim_for_netty/client-mchat-android/libs/android-support-v4.jar similarity index 100% rename from cim_for_netty/mchat-simple/libs/android-support-v4.jar rename to cim_for_netty/client-mchat-android/libs/android-support-v4.jar diff --git a/cim_for_netty/client-mchat-android/libs/cim-android-sdk-2.0.jar b/cim_for_netty/client-mchat-android/libs/cim-android-sdk-2.0.jar new file mode 100644 index 0000000..9afecc0 Binary files /dev/null and b/cim_for_netty/client-mchat-android/libs/cim-android-sdk-2.0.jar differ diff --git a/cim_for_netty/mchat-simple/libs/fastjson-1.1.34.android.jar b/cim_for_netty/client-mchat-android/libs/fastjson-1.1.34.android.jar similarity index 100% rename from cim_for_netty/mchat-simple/libs/fastjson-1.1.34.android.jar rename to cim_for_netty/client-mchat-android/libs/fastjson-1.1.34.android.jar diff --git a/cim_for_netty/mchat-simple/libs/httpmime-4.1.1.jar b/cim_for_netty/client-mchat-android/libs/httpmime-4.1.1.jar similarity index 100% rename from cim_for_netty/mchat-simple/libs/httpmime-4.1.1.jar rename to cim_for_netty/client-mchat-android/libs/httpmime-4.1.1.jar diff --git a/cim_for_netty/client-mchat-android/libs/netty-buffer-5.0.0.Alpha2.jar b/cim_for_netty/client-mchat-android/libs/netty-buffer-5.0.0.Alpha2.jar new file mode 100644 index 0000000..039947c Binary files /dev/null and b/cim_for_netty/client-mchat-android/libs/netty-buffer-5.0.0.Alpha2.jar differ diff --git a/cim_for_netty/client-mchat-android/libs/netty-codec-5.0.0.Alpha2.jar b/cim_for_netty/client-mchat-android/libs/netty-codec-5.0.0.Alpha2.jar new file mode 100644 index 0000000..f51892d Binary files /dev/null and b/cim_for_netty/client-mchat-android/libs/netty-codec-5.0.0.Alpha2.jar differ diff --git a/cim_for_netty/client-mchat-android/libs/netty-common-5.0.0.Alpha2.jar b/cim_for_netty/client-mchat-android/libs/netty-common-5.0.0.Alpha2.jar new file mode 100644 index 0000000..894e7bb Binary files /dev/null and b/cim_for_netty/client-mchat-android/libs/netty-common-5.0.0.Alpha2.jar differ diff --git a/cim_for_netty/client-mchat-android/libs/netty-resolver-5.0.0.Alpha2.jar b/cim_for_netty/client-mchat-android/libs/netty-resolver-5.0.0.Alpha2.jar new file mode 100644 index 0000000..113143f Binary files /dev/null and b/cim_for_netty/client-mchat-android/libs/netty-resolver-5.0.0.Alpha2.jar differ diff --git a/cim_for_netty/client-mchat-android/libs/netty-transport-5.0.0.Alpha2.jar b/cim_for_netty/client-mchat-android/libs/netty-transport-5.0.0.Alpha2.jar new file mode 100644 index 0000000..299b3cc Binary files /dev/null and b/cim_for_netty/client-mchat-android/libs/netty-transport-5.0.0.Alpha2.jar differ diff --git a/cim_for_netty/mchat-simple/libs/slf4j-api-1.7.5.jar b/cim_for_netty/client-mchat-android/libs/slf4j-api-1.7.5.jar similarity index 100% rename from cim_for_netty/mchat-simple/libs/slf4j-api-1.7.5.jar rename to cim_for_netty/client-mchat-android/libs/slf4j-api-1.7.5.jar diff --git a/cim_for_netty/mchat-simple/libs/slf4j-nop-1.7.5.jar b/cim_for_netty/client-mchat-android/libs/slf4j-nop-1.7.5.jar similarity index 100% rename from cim_for_netty/mchat-simple/libs/slf4j-nop-1.7.5.jar rename to cim_for_netty/client-mchat-android/libs/slf4j-nop-1.7.5.jar diff --git a/cim_for_netty/mchat-simple/lint.xml b/cim_for_netty/client-mchat-android/lint.xml similarity index 100% rename from cim_for_netty/mchat-simple/lint.xml rename to cim_for_netty/client-mchat-android/lint.xml diff --git a/cim_for_netty/mchat-simple/proguard.cfg b/cim_for_netty/client-mchat-android/proguard.cfg similarity index 100% rename from cim_for_netty/mchat-simple/proguard.cfg rename to cim_for_netty/client-mchat-android/proguard.cfg diff --git a/cim_for_netty/mchat-simple/project.properties b/cim_for_netty/client-mchat-android/project.properties similarity index 100% rename from cim_for_netty/mchat-simple/project.properties rename to cim_for_netty/client-mchat-android/project.properties diff --git a/cim_for_netty/mchat-simple/res/anim/activity_back.xml b/cim_for_netty/client-mchat-android/res/anim/activity_back.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/activity_back.xml rename to cim_for_netty/client-mchat-android/res/anim/activity_back.xml diff --git a/cim_for_netty/mchat-simple/res/anim/activity_finish.xml b/cim_for_netty/client-mchat-android/res/anim/activity_finish.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/activity_finish.xml rename to cim_for_netty/client-mchat-android/res/anim/activity_finish.xml diff --git a/cim_for_netty/mchat-simple/res/anim/activity_new.xml b/cim_for_netty/client-mchat-android/res/anim/activity_new.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/activity_new.xml rename to cim_for_netty/client-mchat-android/res/anim/activity_new.xml diff --git a/cim_for_netty/mchat-simple/res/anim/activity_out.xml b/cim_for_netty/client-mchat-android/res/anim/activity_out.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/activity_out.xml rename to cim_for_netty/client-mchat-android/res/anim/activity_out.xml diff --git a/cim_for_netty/mchat-simple/res/anim/appear.xml b/cim_for_netty/client-mchat-android/res/anim/appear.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/appear.xml rename to cim_for_netty/client-mchat-android/res/anim/appear.xml diff --git a/cim_for_netty/mchat-simple/res/anim/disappear.xml b/cim_for_netty/client-mchat-android/res/anim/disappear.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/disappear.xml rename to cim_for_netty/client-mchat-android/res/anim/disappear.xml diff --git a/cim_for_netty/mchat-simple/res/anim/disappear_del.xml b/cim_for_netty/client-mchat-android/res/anim/disappear_del.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/disappear_del.xml rename to cim_for_netty/client-mchat-android/res/anim/disappear_del.xml diff --git a/cim_for_netty/mchat-simple/res/anim/extension_appear_from_bottom_to_top.xml b/cim_for_netty/client-mchat-android/res/anim/extension_appear_from_bottom_to_top.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/extension_appear_from_bottom_to_top.xml rename to cim_for_netty/client-mchat-android/res/anim/extension_appear_from_bottom_to_top.xml diff --git a/cim_for_netty/mchat-simple/res/anim/extension_disappear_from_top_to_bottom.xml b/cim_for_netty/client-mchat-android/res/anim/extension_disappear_from_top_to_bottom.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/extension_disappear_from_top_to_bottom.xml rename to cim_for_netty/client-mchat-android/res/anim/extension_disappear_from_top_to_bottom.xml diff --git a/cim_for_netty/mchat-simple/res/anim/rotate.xml b/cim_for_netty/client-mchat-android/res/anim/rotate.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/rotate.xml rename to cim_for_netty/client-mchat-android/res/anim/rotate.xml diff --git a/cim_for_netty/mchat-simple/res/anim/slide_in_from_bottom.xml b/cim_for_netty/client-mchat-android/res/anim/slide_in_from_bottom.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/slide_in_from_bottom.xml rename to cim_for_netty/client-mchat-android/res/anim/slide_in_from_bottom.xml diff --git a/cim_for_netty/mchat-simple/res/anim/slide_in_from_left.xml b/cim_for_netty/client-mchat-android/res/anim/slide_in_from_left.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/slide_in_from_left.xml rename to cim_for_netty/client-mchat-android/res/anim/slide_in_from_left.xml diff --git a/cim_for_netty/mchat-simple/res/anim/slide_out_to_bottom.xml b/cim_for_netty/client-mchat-android/res/anim/slide_out_to_bottom.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/slide_out_to_bottom.xml rename to cim_for_netty/client-mchat-android/res/anim/slide_out_to_bottom.xml diff --git a/cim_for_netty/mchat-simple/res/anim/slide_out_to_right.xml b/cim_for_netty/client-mchat-android/res/anim/slide_out_to_right.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/anim/slide_out_to_right.xml rename to cim_for_netty/client-mchat-android/res/anim/slide_out_to_right.xml diff --git a/cim_for_netty/mchat-simple/res/color/login_text_button_selector.xml b/cim_for_netty/client-mchat-android/res/color/login_text_button_selector.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/color/login_text_button_selector.xml rename to cim_for_netty/client-mchat-android/res/color/login_text_button_selector.xml diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/action_sheet_base_9.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/action_sheet_base_9.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/action_sheet_base_9.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/action_sheet_base_9.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/add_contacts_create_troop.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_create_troop.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/add_contacts_create_troop.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_create_troop.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/add_contacts_look_for_similarity.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_similarity.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/add_contacts_look_for_similarity.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_similarity.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/add_contacts_look_for_troop.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_troop.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/add_contacts_look_for_troop.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/add_contacts_look_for_troop.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/aio_friend_bg_nor.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_friend_bg_nor.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/aio_friend_bg_nor.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_friend_bg_nor.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/aio_friend_bg_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_friend_bg_pressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/aio_friend_bg_pressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_friend_bg_pressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/aio_user_bg_nor.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_user_bg_nor.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/aio_user_bg_nor.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_user_bg_nor.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/aio_user_bg_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_user_bg_pressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/aio_user_bg_pressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/aio_user_bg_pressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/card_avatar.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/card_avatar.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/card_avatar.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/card_avatar.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/chat_tool_camera.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_camera.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/chat_tool_camera.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_camera.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/chat_tool_location.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_location.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/chat_tool_location.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_location.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/chat_tool_photo.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_photo.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/chat_tool_photo.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_photo.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/chat_tool_send_file.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_send_file.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/chat_tool_send_file.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/chat_tool_send_file.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_0.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_0.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_0.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_0.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_1.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_1.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_1.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_1.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_10.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_10.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_10.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_10.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_11.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_11.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_11.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_11.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_2.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_2.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_2.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_2.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_3.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_3.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_3.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_3.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_4.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_4.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_4.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_4.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_5.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_5.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_5.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_5.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_6.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_6.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_6.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_6.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_7.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_7.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_7.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_7.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_8.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_8.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_8.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_8.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/common_loading_9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/common_loading_9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/ic_date_time.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/ic_date_time.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/ic_date_time.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/ic_date_time.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/ic_read.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/ic_read.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/ic_read.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/ic_read.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/icon_addfriend.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_addfriend.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/icon_addfriend.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_addfriend.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/icon_face_click.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_face_click.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/icon_face_click.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_face_click.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/icon_face_nor.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_face_nor.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/icon_face_nor.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_face_nor.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/icon_joinfroup.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_joinfroup.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/icon_joinfroup.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_joinfroup.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/icon_more.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_more.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/icon_more.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_more.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/icon_recent_sysmsg.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_recent_sysmsg.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/icon_recent_sysmsg.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/icon_recent_sysmsg.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/input_box_bg.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/input_box_bg.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/input_box_bg.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/input_box_bg.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/list_head_border_whitebg.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/list_head_border_whitebg.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/list_head_border_whitebg.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/list_head_border_whitebg.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/login_default_avatar.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/login_default_avatar.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/login_default_avatar.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/login_default_avatar.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/mchat_navbar_tab_m_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_normal.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/mchat_navbar_tab_m_normal.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_normal.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/mchat_navbar_tab_m_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_pressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/mchat_navbar_tab_m_pressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/mchat_navbar_tab_m_pressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/profile_photowall_avatar_frame_nor.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_avatar_frame_nor.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/profile_photowall_avatar_frame_nor.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_avatar_frame_nor.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/profile_photowall_bg_female.jpg b/cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_female.jpg similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/profile_photowall_bg_female.jpg rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_female.jpg diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/profile_photowall_bg_male.jpg b/cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_male.jpg similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/profile_photowall_bg_male.jpg rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/profile_photowall_bg_male.jpg diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_aio_input_bar_bg.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_input_bar_bg.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_aio_input_bar_bg.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_input_bar_bg.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_aio_more_nor.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_more_nor.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_aio_more_nor.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_more_nor.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_aio_more_pressed.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_more_pressed.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_aio_more_pressed.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_more_pressed.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_aio_send_button_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_normal.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_aio_send_button_normal.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_normal.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_aio_send_button_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_pressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_aio_send_button_pressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_aio_send_button_pressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_bottom_bar_background.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_bottom_bar_background.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_bottom_bar_background.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_bottom_bar_background.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_blue_bg_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_blue_bg_pressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_blue_bg_pressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_blue_bg_pressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_blue_unpressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_blue_unpressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_blue_unpressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_blue_unpressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_green_disable.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_disable.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_green_disable.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_disable.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_green_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_normal.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_green_normal.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_normal.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_green_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_pressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_green_pressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_green_pressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_red_disabled.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_disabled.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_red_disabled.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_disabled.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_red_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_pressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_red_pressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_pressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_red_unpressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_unpressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_red_unpressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_red_unpressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_white_disabled.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_disabled.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_white_disabled.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_disabled.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_white_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_pressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_white_pressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_pressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_white_unpressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_unpressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_common_btn_white_unpressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_common_btn_white_unpressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_contact_add_btn_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_normal.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_contact_add_btn_normal.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_normal.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_contact_add_btn_press.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_press.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_contact_add_btn_press.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_contact_add_btn_press.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_bar_bg.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_bar_bg.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_bar_bg.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_bar_bg.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_back_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_back_normal.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_back_normal.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_back_normal.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_back_press.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_back_press.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_back_press.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_back_press.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_disable.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_disable.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_disable.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_disable.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_indicative_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_normal.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_indicative_normal.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_normal.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_indicative_press.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_press.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_indicative_press.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_indicative_press.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_normal.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_normal.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_normal.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_press.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_press.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_btn_press.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_btn_press.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_icon_group.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_icon_group.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_icon_group.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_icon_group.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_icon_single.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_icon_single.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_icon_single.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_icon_single.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_tab_left_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_normal.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_tab_left_normal.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_normal.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_tab_left_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_pressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_tab_left_pressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_left_pressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_tab_right_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_normal.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_tab_right_normal.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_normal.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_tab_right_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_pressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_header_tab_right_pressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_header_tab_right_pressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_contact_normal.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_normal.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_contact_normal.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_normal.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_contact_selected.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_selected.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_contact_selected.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_contact_selected.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_conversation_normal.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_normal.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_conversation_normal.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_normal.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_conversation_selected.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_selected.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_conversation_selected.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_conversation_selected.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_plugin_normal.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_normal.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_plugin_normal.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_normal.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_plugin_selected.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_selected.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_plugin_selected.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_plugin_selected.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_setup_normal.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_normal.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_setup_normal.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_normal.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_setup_selected.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_selected.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_icon_setup_selected.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_icon_setup_selected.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_newmessage.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_newmessage.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_newmessage2.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage2.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tab_newmessage2.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tab_newmessage2.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tabbar_tab_select.9.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tabbar_tab_select.9.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tabbar_tab_select_left.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_left.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tabbar_tab_select_left.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_left.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tabbar_tab_select_right.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_right.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/skin_tabbar_tab_select_right.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/skin_tabbar_tab_select_right.png diff --git a/cim_for_netty/mchat-simple/res/drawable-320dpi/tab_new.png b/cim_for_netty/client-mchat-android/res/drawable-320dpi/tab_new.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-320dpi/tab_new.png rename to cim_for_netty/client-mchat-android/res/drawable-320dpi/tab_new.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/aicon_error.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/aicon_error.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/aicon_error.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/aicon_error.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/app_main_bg.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/app_main_bg.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/app_main_bg.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/app_main_bg.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/arrow.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/arrow.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/arrow.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/arrow.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/blue_button_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/blue_button_normal.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/blue_button_normal.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/blue_button_normal.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/blue_button_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/blue_button_pressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/blue_button_pressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/blue_button_pressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/bodylisttop.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/bodylisttop.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/bodylisttop.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/bodylisttop.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/bottom.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/bottom.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/bottom.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/bottom.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/btn_check_off.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/btn_check_off.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/btn_check_off.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/btn_check_off.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/btn_check_on.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/btn_check_on.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/btn_check_on.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/btn_check_on.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/chat_time_block.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/chat_time_block.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/chat_time_block.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/chat_time_block.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/close_del.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/close_del.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/close_del.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/close_del.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/close_pressed.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/close_pressed.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/close_pressed.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/close_pressed.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/colorful_line.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/colorful_line.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/colorful_line.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/colorful_line.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/conversation_loading_icon.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/conversation_loading_icon.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/conversation_loading_icon.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/conversation_loading_icon.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/conversation_net_error_icon.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/conversation_net_error_icon.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/conversation_net_error_icon.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/conversation_net_error_icon.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/cutline.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/cutline.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/cutline.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/cutline.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/edittext_bg.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/edittext_bg.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/edittext_bg.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/edittext_bg.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f000.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f000.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f000.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f000.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f001.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f001.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f001.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f001.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f002.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f002.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f002.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f002.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f003.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f003.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f003.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f003.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f004.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f004.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f004.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f004.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f005.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f005.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f005.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f005.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f006.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f006.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f006.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f006.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f007.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f007.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f007.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f007.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f008.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f008.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f008.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f008.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f009.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f009.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f009.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f009.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f010.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f010.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f010.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f010.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f011.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f011.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f011.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f011.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f012.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f012.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f012.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f012.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f013.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f013.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f013.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f013.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f014.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f014.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f014.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f014.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f015.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f015.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f015.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f015.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f016.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f016.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f016.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f016.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f017.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f017.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f017.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f017.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f018.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f018.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f018.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f018.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f019.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f019.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f019.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f019.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f020.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f020.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f020.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f020.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f021.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f021.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f021.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f021.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f022.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f022.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f022.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f022.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f023.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f023.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f023.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f023.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f024.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f024.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f024.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f024.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f025.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f025.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f025.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f025.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f026.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f026.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f026.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f026.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f027.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f027.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f027.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f027.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f028.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f028.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f028.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f028.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f029.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f029.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f029.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f029.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f030.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f030.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f030.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f030.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f031.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f031.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f031.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f031.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f032.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f032.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f032.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f032.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f033.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f033.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f033.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f033.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f034.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f034.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f034.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f034.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f035.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f035.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f035.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f035.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f036.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f036.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f036.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f036.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f037.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f037.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f037.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f037.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f038.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f038.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f038.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f038.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f039.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f039.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f039.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f039.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f040.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f040.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f040.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f040.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f041.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f041.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f041.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f041.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f042.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f042.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f042.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f042.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f043.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f043.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f043.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f043.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f044.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f044.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f044.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f044.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f045.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f045.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f045.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f045.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f046.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f046.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f046.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f046.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f047.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f047.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f047.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f047.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f048.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f048.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f048.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f048.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f049.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f049.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f049.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f049.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f050.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f050.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f050.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f050.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f051.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f051.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f051.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f051.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f052.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f052.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f052.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f052.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f053.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f053.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f053.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f053.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f054.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f054.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f054.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f054.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f055.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f055.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f055.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f055.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f056.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f056.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f056.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f056.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f057.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f057.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f057.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f057.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f058.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f058.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f058.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f058.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f059.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f059.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f059.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f059.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f060.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f060.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f060.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f060.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f061.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f061.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f061.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f061.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f062.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f062.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f062.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f062.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f063.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f063.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f063.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f063.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f064.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f064.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f064.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f064.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f065.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f065.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f065.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f065.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f066.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f066.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f066.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f066.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f067.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f067.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f067.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f067.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f068.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f068.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f068.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f068.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f069.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f069.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f069.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f069.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f070.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f070.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f070.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f070.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f071.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f071.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f071.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f071.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f072.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f072.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f072.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f072.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f073.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f073.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f073.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f073.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f074.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f074.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f074.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f074.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f075.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f075.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f075.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f075.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f076.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f076.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f076.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f076.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f077.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f077.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f077.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f077.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f078.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f078.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f078.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f078.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f079.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f079.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f079.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f079.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f080.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f080.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f080.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f080.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f081.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f081.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f081.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f081.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f082.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f082.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f082.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f082.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f083.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f083.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f083.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f083.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f084.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f084.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f084.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f084.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f085.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f085.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f085.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f085.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f086.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f086.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f086.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f086.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f087.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f087.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f087.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f087.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f088.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f088.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f088.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f088.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f089.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f089.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f089.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f089.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f090.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f090.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f090.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f090.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f091.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f091.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f091.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f091.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f092.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f092.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f092.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f092.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f093.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f093.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f093.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f093.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f094.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f094.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f094.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f094.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f095.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f095.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f095.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f095.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f096.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f096.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f096.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f096.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f097.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f097.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f097.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f097.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f098.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f098.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f098.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f098.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f099.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f099.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f099.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f099.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f100.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f100.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f100.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f100.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f101.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f101.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f101.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f101.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f102.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f102.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f102.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f102.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f103.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f103.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f103.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f103.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f104.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f104.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f104.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f104.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f105.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f105.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f105.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f105.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f106.gif b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f106.gif similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f106.gif rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f106.gif diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_000.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_000.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_000.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_000.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_001.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_001.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_001.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_001.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_002.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_002.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_002.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_002.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_003.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_003.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_003.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_003.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_004.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_004.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_004.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_004.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_005.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_005.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_005.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_005.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_006.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_006.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_006.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_006.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_007.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_007.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_007.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_007.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_008.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_008.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_008.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_008.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_009.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_009.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_009.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_009.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_010.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_010.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_010.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_010.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_011.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_011.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_011.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_011.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_012.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_012.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_012.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_012.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_013.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_013.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_013.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_013.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_014.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_014.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_014.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_014.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_015.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_015.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_015.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_015.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_016.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_016.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_016.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_016.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_017.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_017.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_017.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_017.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_018.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_018.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_018.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_018.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_019.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_019.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_019.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_019.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_020.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_020.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_020.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_020.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_021.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_021.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_021.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_021.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_022.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_022.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_022.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_022.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_023.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_023.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_023.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_023.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_024.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_024.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_024.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_024.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_025.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_025.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_025.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_025.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_026.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_026.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_026.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_026.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_027.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_027.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_027.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_027.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_028.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_028.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_028.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_028.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_029.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_029.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_029.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_029.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_030.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_030.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_030.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_030.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_031.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_031.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_031.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_031.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_032.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_032.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_032.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_032.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_033.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_033.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_033.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_033.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_034.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_034.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_034.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_034.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_035.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_035.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_035.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_035.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_036.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_036.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_036.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_036.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_037.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_037.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_037.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_037.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_038.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_038.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_038.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_038.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_039.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_039.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_039.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_039.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_040.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_040.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_040.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_040.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_041.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_041.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_041.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_041.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_042.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_042.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_042.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_042.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_043.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_043.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_043.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_043.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_044.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_044.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_044.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_044.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_045.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_045.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_045.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_045.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_046.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_046.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_046.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_046.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_047.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_047.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_047.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_047.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_048.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_048.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_048.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_048.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_049.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_049.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_049.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_049.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_050.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_050.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_050.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_050.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_051.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_051.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_051.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_051.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_052.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_052.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_052.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_052.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_053.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_053.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_053.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_053.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_054.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_054.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_054.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_054.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_055.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_055.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_055.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_055.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_056.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_056.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_056.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_056.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_057.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_057.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_057.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_057.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_058.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_058.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_058.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_058.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_059.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_059.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_059.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_059.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_060.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_060.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_060.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_060.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_061.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_061.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_061.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_061.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_062.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_062.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_062.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_062.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_063.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_063.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_063.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_063.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_064.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_064.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_064.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_064.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_065.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_065.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_065.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_065.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_066.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_066.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_066.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_066.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_067.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_067.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_067.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_067.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_068.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_068.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_068.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_068.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_069.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_069.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_069.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_069.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_070.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_070.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_070.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_070.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_071.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_071.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_071.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_071.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_072.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_072.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_072.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_072.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_073.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_073.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_073.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_073.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_074.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_074.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_074.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_074.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_075.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_075.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_075.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_075.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_076.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_076.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_076.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_076.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_077.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_077.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_077.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_077.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_078.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_078.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_078.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_078.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_079.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_079.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_079.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_079.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_080.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_080.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_080.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_080.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_081.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_081.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_081.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_081.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_082.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_082.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_082.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_082.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_083.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_083.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_083.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_083.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_084.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_084.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_084.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_084.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_085.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_085.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_085.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_085.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_086.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_086.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_086.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_086.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_087.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_087.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_087.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_087.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_088.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_088.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_088.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_088.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_089.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_089.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_089.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_089.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_090.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_090.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_090.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_090.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_091.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_091.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_091.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_091.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_092.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_092.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_092.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_092.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_093.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_093.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_093.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_093.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_094.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_094.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_094.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_094.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_095.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_095.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_095.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_095.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_096.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_096.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_096.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_096.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_097.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_097.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_097.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_097.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_098.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_098.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_098.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_098.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_099.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_099.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_099.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_099.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_100.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_100.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_100.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_100.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_101.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_101.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_101.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_101.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_102.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_102.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_102.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_102.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_103.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_103.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_103.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_103.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_104.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_104.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_104.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_104.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_105.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_105.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_105.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_105.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_106.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_106.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/f_static_106.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/f_static_106.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/grouphead_normal.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/grouphead_normal.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/grouphead_normal.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/grouphead_normal.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/h033.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/h033.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/h033.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/h033.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/icon.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/icon.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/icon.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/icon_away.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_away.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/icon_away.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_away.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/icon_error.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_error.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/icon_error.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_error.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/icon_invisiable.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_invisiable.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/icon_invisiable.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_invisiable.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/icon_logo.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_logo.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/icon_logo.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_logo.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/icon_normal.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_normal.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/icon_normal.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_normal.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/icon_notify.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_notify.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/icon_notify.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_notify.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/icon_offline.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_offline.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/icon_offline.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_offline.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/icon_online.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_online.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/icon_online.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_online.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/icon_share.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_share.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/icon_share.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_share.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/icon_success.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_success.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/icon_success.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/icon_success.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/image_empty.jpg b/cim_for_netty/client-mchat-android/res/drawable-hdpi/image_empty.jpg similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/image_empty.jpg rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/image_empty.jpg diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/input.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/input.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/input.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/input.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/input_over.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/input_over.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/input_over.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/input_over.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/list_blockbg.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/list_blockbg.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/list_blockbg.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/list_blockbg.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/list_divider_line.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/list_divider_line.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/list_divider_line.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/list_divider_line.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/listitem_hover.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/listitem_hover.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/listitem_hover.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/listitem_hover.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_1.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_1.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_1.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_1.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_10.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_10.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_10.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_10.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_11.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_11.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_11.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_11.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_12.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_12.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_12.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_12.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_13.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_13.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_13.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_13.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_14.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_14.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_14.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_14.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_15.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_15.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_15.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_15.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_16.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_16.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_16.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_16.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_17.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_17.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_17.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_17.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_18.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_18.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_18.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_18.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_19.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_19.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_19.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_19.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_2.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_2.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_2.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_2.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_20.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_20.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_20.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_20.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_21.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_21.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_21.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_21.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_22.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_22.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_22.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_22.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_23.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_23.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_23.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_23.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_24.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_24.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_24.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_24.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_3.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_3.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_3.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_3.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_4.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_4.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_4.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_4.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_5.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_5.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_5.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_5.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_6.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_6.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_6.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_6.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_7.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_7.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_7.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_7.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_8.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_8.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_8.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_8.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_bg.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_bg.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_bg.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_bg.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/loading_coffee.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_coffee.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/loading_coffee.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/loading_coffee.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/login_bg.jpg b/cim_for_netty/client-mchat-android/res/drawable-hdpi/login_bg.jpg similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/login_bg.jpg rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/login_bg.jpg diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/login_input.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/login_input.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/login_input.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/login_input.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/message_hint.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/message_hint.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/message_hint.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/message_hint.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/msg_tips_bg_normal.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/msg_tips_bg_normal.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/msg_tips_bg_normal.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/msg_tips_bg_normal.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/msg_tips_bg_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/msg_tips_bg_pressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/msg_tips_bg_pressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/msg_tips_bg_pressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/narrow.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/narrow.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/narrow.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/narrow.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/narrow_select.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/narrow_select.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/narrow_select.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/narrow_select.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/scrollbar.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/scrollbar.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/scrollbar.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/scrollbar.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_bottom.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_bottom.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_bottom.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_bottom.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_bottom_pre.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_bottom_pre.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_bottom_pre.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_bottom_pre.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_middle.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_middle.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_middle.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_middle.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_middle_pre.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_middle_pre.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_middle_pre.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_middle_pre.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_single.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_single.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_single.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_single.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_single_pre.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_single_pre.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_single_pre.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_single_pre.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_top.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_top.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_top.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_top.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_top_pre.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_top_pre.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/set_list_top_pre.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/set_list_top_pre.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/show.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/show.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/show.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/show.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/skin_icon_arrow_right_normal.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_normal.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/skin_icon_arrow_right_normal.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_normal.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/skin_icon_arrow_right_pressed.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_pressed.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/skin_icon_arrow_right_pressed.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_icon_arrow_right_pressed.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/skin_msgbox_bg_nor.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_nor.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/skin_msgbox_bg_nor.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_nor.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/skin_msgbox_bg_pressed.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_pressed.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/skin_msgbox_bg_pressed.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_pressed.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/skin_msgbox_bg_top.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_top.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/skin_msgbox_bg_top.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/skin_msgbox_bg_top.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/splash_bg.jpg b/cim_for_netty/client-mchat-android/res/drawable-hdpi/splash_bg.jpg similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/splash_bg.jpg rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/splash_bg.jpg diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/success.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/success.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/success.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/success.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/tab2_normal.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab2_normal.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/tab2_normal.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/tab2_normal.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/tab2_over.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab2_over.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/tab2_over.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/tab2_over.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/tab3_normal.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab3_normal.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/tab3_normal.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/tab3_normal.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/tab3_over.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/tab3_over.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/tab3_over.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/tab3_over.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/table_arrow.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/table_arrow.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/table_arrow.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/table_arrow.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/toast_bg.9.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/toast_bg.9.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/toast_bg.9.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/toast_bg.9.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/topface_back.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/topface_back.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/topface_back.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/topface_back.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/troop_default_head_1.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_1.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/troop_default_head_1.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_1.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/troop_default_head_2.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_2.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/troop_default_head_2.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_2.png diff --git a/cim_for_netty/mchat-simple/res/drawable-hdpi/troop_default_head_3.png b/cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_3.png similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable-hdpi/troop_default_head_3.png rename to cim_for_netty/client-mchat-android/res/drawable-hdpi/troop_default_head_3.png diff --git a/cim_for_netty/mchat-simple/res/drawable/common_button_blue.xml b/cim_for_netty/client-mchat-android/res/drawable/common_button_blue.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable/common_button_blue.xml rename to cim_for_netty/client-mchat-android/res/drawable/common_button_blue.xml diff --git a/cim_for_netty/mchat-simple/res/drawable/common_msgbox_bg.xml b/cim_for_netty/client-mchat-android/res/drawable/common_msgbox_bg.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable/common_msgbox_bg.xml rename to cim_for_netty/client-mchat-android/res/drawable/common_msgbox_bg.xml diff --git a/cim_for_netty/mchat-simple/res/drawable/top_back_left_selector.xml b/cim_for_netty/client-mchat-android/res/drawable/top_back_left_selector.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/drawable/top_back_left_selector.xml rename to cim_for_netty/client-mchat-android/res/drawable/top_back_left_selector.xml diff --git a/cim_for_netty/mchat-simple/res/layout/activity_login.xml b/cim_for_netty/client-mchat-android/res/layout/activity_login.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/layout/activity_login.xml rename to cim_for_netty/client-mchat-android/res/layout/activity_login.xml diff --git a/cim_for_netty/mchat-simple/res/layout/activity_splansh.xml b/cim_for_netty/client-mchat-android/res/layout/activity_splansh.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/layout/activity_splansh.xml rename to cim_for_netty/client-mchat-android/res/layout/activity_splansh.xml diff --git a/cim_for_netty/mchat-simple/res/layout/activity_system_chat.xml b/cim_for_netty/client-mchat-android/res/layout/activity_system_chat.xml similarity index 65% rename from cim_for_netty/mchat-simple/res/layout/activity_system_chat.xml rename to cim_for_netty/client-mchat-android/res/layout/activity_system_chat.xml index ca20047..607b378 100644 --- a/cim_for_netty/mchat-simple/res/layout/activity_system_chat.xml +++ b/cim_for_netty/client-mchat-android/res/layout/activity_system_chat.xml @@ -1,5 +1,5 @@ - - + - \ No newline at end of file + \ No newline at end of file diff --git a/cim_for_netty/mchat-simple/res/layout/item_chat_sysmsg.xml b/cim_for_netty/client-mchat-android/res/layout/item_chat_sysmsg.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/layout/item_chat_sysmsg.xml rename to cim_for_netty/client-mchat-android/res/layout/item_chat_sysmsg.xml diff --git a/cim_for_netty/mchat-simple/res/layout/layout_global_top_header.xml b/cim_for_netty/client-mchat-android/res/layout/layout_global_top_header.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/layout/layout_global_top_header.xml rename to cim_for_netty/client-mchat-android/res/layout/layout_global_top_header.xml diff --git a/cim_for_netty/mchat-simple/res/raw/classic.mp3 b/cim_for_netty/client-mchat-android/res/raw/classic.mp3 similarity index 100% rename from cim_for_netty/mchat-simple/res/raw/classic.mp3 rename to cim_for_netty/client-mchat-android/res/raw/classic.mp3 diff --git a/cim_for_netty/mchat-simple/res/values/arrays.xml b/cim_for_netty/client-mchat-android/res/values/arrays.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/values/arrays.xml rename to cim_for_netty/client-mchat-android/res/values/arrays.xml diff --git a/cim_for_netty/mchat-simple/res/values/attrs.xml b/cim_for_netty/client-mchat-android/res/values/attrs.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/values/attrs.xml rename to cim_for_netty/client-mchat-android/res/values/attrs.xml diff --git a/cim_for_netty/mchat-simple/res/values/color.xml b/cim_for_netty/client-mchat-android/res/values/color.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/values/color.xml rename to cim_for_netty/client-mchat-android/res/values/color.xml diff --git a/cim_for_netty/mchat-simple/res/values/dimens.xml b/cim_for_netty/client-mchat-android/res/values/dimens.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/values/dimens.xml rename to cim_for_netty/client-mchat-android/res/values/dimens.xml diff --git a/cim_for_netty/mchat-simple/res/values/strings.xml b/cim_for_netty/client-mchat-android/res/values/strings.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/values/strings.xml rename to cim_for_netty/client-mchat-android/res/values/strings.xml diff --git a/cim_for_netty/mchat-simple/res/values/styles.xml b/cim_for_netty/client-mchat-android/res/values/styles.xml similarity index 100% rename from cim_for_netty/mchat-simple/res/values/styles.xml rename to cim_for_netty/client-mchat-android/res/values/styles.xml diff --git a/cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java similarity index 85% rename from cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java rename to cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java index 9fffdd0..ac1fc61 100644 --- a/cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java +++ b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/adapter/MessageTimeDescComparator.java @@ -2,7 +2,7 @@ package com.farsunset.ichat.example.adapter; import java.util.Comparator; -import com.farsunset.cim.nio.mutual.Message; +import com.farsunset.cim.client.model.Message; public class MessageTimeDescComparator implements Comparator{ diff --git a/cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java similarity index 97% rename from cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java rename to cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java index 97aa182..2dd2872 100644 --- a/cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java +++ b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/adapter/SystemMsgListViewAdapter.java @@ -11,7 +11,7 @@ import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; -import com.farsunset.cim.nio.mutual.Message; +import com.farsunset.cim.client.model.Message; import com.farsunset.ichat.example.R; import com.farsunset.ichat.example.ui.SystemMessageActivity; diff --git a/cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/app/CIMMonitorActivity.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/CIMMonitorActivity.java similarity index 87% rename from cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/app/CIMMonitorActivity.java rename to cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/CIMMonitorActivity.java index f3e4140..8eee807 100644 --- a/cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/app/CIMMonitorActivity.java +++ b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/CIMMonitorActivity.java @@ -8,12 +8,12 @@ import android.net.NetworkInfo; import android.os.Bundle; import android.widget.Toast; +import com.farsunset.cim.client.android.CIMEventListener; import com.farsunset.cim.client.android.CIMListenerManager; -import com.farsunset.cim.client.android.OnCIMMessageListener; -import com.farsunset.cim.nio.mutual.Message; -import com.farsunset.cim.nio.mutual.ReplyBody; +import com.farsunset.cim.client.model.Message; +import com.farsunset.cim.client.model.ReplyBody; -public abstract class CIMMonitorActivity extends Activity implements OnCIMMessageListener{ +public abstract class CIMMonitorActivity extends Activity implements CIMEventListener{ private ProgressDialog progressDialog; @@ -74,13 +74,13 @@ public abstract class CIMMonitorActivity extends Activity implements OnCIMMess * 与服务端断开连接时回调,不要再里面做连接服务端的操作 */ @Override - public void onConnectionClosed(){}; + public void onCIMConnectionClosed(){}; /** * 与服务端断开连接时成功时回调 */ @Override - public void onConnectionSucceed() {} + public void onCIMConnectionSucceed() {} @Override public void onConnectionStatus(boolean isConnected){} diff --git a/cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/app/Constant.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/Constant.java similarity index 78% rename from cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/app/Constant.java rename to cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/Constant.java index a2f508f..4d372be 100644 --- a/cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/app/Constant.java +++ b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/app/Constant.java @@ -11,10 +11,12 @@ package com.farsunset.ichat.example.app; */ public interface Constant { + //服务端IP地址 + public static final String CIM_SERVER_HOST = "192.168.2.3"; + //服务端web地址 - public static final String SERVER_URL = "http://10.0.0.127:8080/ichat-server"; - //服务端IP地址 - public static final String CIM_SERVER_HOST = "10.0.0.127"; + public static final String SERVER_URL = "http://"+CIM_SERVER_HOST+":8080/cim-server"; + //注意,这里的端口不是tomcat的端口,CIM端口在服务端spring-cim.xml中配置的,没改动就使用默认的23456 public static final int CIM_SERVER_PORT = 23456; diff --git a/cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/network/HttpAPIRequester.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIRequester.java similarity index 100% rename from cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/network/HttpAPIRequester.java rename to cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIRequester.java diff --git a/cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/network/HttpAPIResponser.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIResponser.java similarity index 100% rename from cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/network/HttpAPIResponser.java rename to cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/network/HttpAPIResponser.java diff --git a/cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/network/Page.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/network/Page.java similarity index 100% rename from cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/network/Page.java rename to cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/network/Page.java diff --git a/cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/receiver/CustomCIMMessageReceiver.java b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/receiver/CustomCIMMessageReceiver.java similarity index 84% rename from cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/receiver/CustomCIMMessageReceiver.java rename to cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/receiver/CustomCIMMessageReceiver.java index 61dbd33..7827bc2 100644 --- a/cim_for_netty/mchat-simple/src/com/farsunset/ichat/example/receiver/CustomCIMMessageReceiver.java +++ b/cim_for_netty/client-mchat-android/src/com/farsunset/ichat/example/receiver/CustomCIMMessageReceiver.java @@ -8,10 +8,11 @@ import android.content.Context; import android.content.Intent; import android.net.NetworkInfo; import android.util.Log; -import com.farsunset.cim.client.android.CIMEnventListenerReceiver; + +import com.farsunset.cim.client.android.CIMEventBroadcastReceiver; import com.farsunset.cim.client.android.CIMListenerManager; -import com.farsunset.cim.nio.mutual.Message; -import com.farsunset.cim.nio.mutual.ReplyBody; +import com.farsunset.cim.client.model.Message; +import com.farsunset.cim.client.model.ReplyBody; import com.farsunset.ichat.example.R; import com.farsunset.ichat.example.ui.SystemMessageActivity; @@ -20,7 +21,7 @@ import com.farsunset.ichat.example.ui.SystemMessageActivity; * @author 3979434 * */ -public final class CustomCIMMessageReceiver extends CIMEnventListenerReceiver { +public final class CustomCIMMessageReceiver extends CIMEventBroadcastReceiver { private NotificationManager notificationManager; @@ -28,7 +29,7 @@ public final class CustomCIMMessageReceiver extends CIMEnventListenerReceiver { //当收到消息时,会执行onMessageReceived,这里是消息第一入口 @Override - public void onMessageReceived(com.farsunset.cim.nio.mutual.Message message) { + public void onMessageReceived(com.farsunset.cim.client.model.Message message) { for (int index = 0 ;index sendMessage(Message msg,File file) throws Exception{ - Map map = new HashMap(); - map.put("content", msg.getContent()); - map.put("title", msg.getTitle()); - map.put("sender", msg.getSender()); - map.put("receiver", msg.getReceiver()); - map.put("type", msg.getType()); - map.put("fileType", msg.getFileType()); - String json = httpPost(API_URL+"message_send.api",map,file); - - return new Gson().fromJson(json, new TypeToken>(){}.getType()); - }*/ - - public static String httpPost(String url,Map map,File file) throws ClientProtocolException, IOException - { - HttpPost httpPost = new HttpPost(url); - - MultipartEntity mpEntity = new MultipartEntity(); //文件传输 - if(file!=null){ - ContentBody cbFile = new FileBody(file); - mpEntity.addPart("file", cbFile); - } - for(String key:map.keySet()) - { - if(map.get(key)!=null) - { - StringBody stringBody = new StringBody(map.get(key), Charset.forName("UTF-8")); - mpEntity.addPart(key,stringBody); - } - } - - // 设置参数实体 - httpPost.setEntity(mpEntity); - System.out.println("request params:--->>" + map.toString()); - // 获取HttpClient对象 - HttpClient httpClient = new DefaultHttpClient(); - //连接超时 - httpClient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 30000); - //请求超时 - httpClient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 30000); - - HttpResponse httpResp = httpClient.execute(httpPost); - String json = EntityUtils.toString(httpResp.getEntity(), "UTF-8"); - System.out.println(json); - return json; - } - - - - public static String httpPost(String url,Map map) throws ClientProtocolException, IOException - { - return httpPost(url,map,null); - } - - -} diff --git a/cim_for_netty/netty版本需要JDK1.7.txt b/cim_for_netty/netty版本需要JDK1.7.txt new file mode 100644 index 0000000..e69de29