Explorar el Código

更新日志系统;

owen hace 6 años
padre
commit
52c79d35e0

+ 36 - 36
app/src/main/java/com/wiipu/marketingrobot/AutoReplyService.java

@@ -95,9 +95,9 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
     public static windowAction mWindowAction;
 
     @Override
-    public void showEnabeAddFriendReply(enableAddFriendResponse enableAddFriendResponse) {
+    public void showEnableAddFriendReply(enableAddFriendResponse enableAddFriendResponse) {
         enableFriendsCounts = enableAddFriendResponse.getMsg();
-        LogUtil.e(TAG, "showEnabeAddFriendReply: 允许人数为 " + enableFriendsCounts);
+        LogUtils.e(TAG + " showEnableAddFriendReply: 允许人数为 " + enableFriendsCounts);
     }
 
     @Override
@@ -116,7 +116,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
     @Override
     protected void onServiceConnected() {
         super.onServiceConnected();
-        LogUtil.d(TAG, "onServiceConnected");
+        LogUtils.d(TAG + " onServiceConnected");
         mGetMoney = new getMoneyFunction(this);
         mHandleChat = new handleChatFunction(this);
         mAddFriendFunction = new addFriendFunction(this);
@@ -160,24 +160,24 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
         int eventType = event.getEventType();
         switch (eventType) {
             case AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED:// 通知栏事件,仅有在锁屏状态下, 或者亮屏后台状态下才会发送通知
-                LogUtil.d("maptrix", "get notification event");
+                LogUtils.d("maptrix : get notification event");
                 if (pref.getString(savedRobotNum, null) != null) {
                     mEnableAddFriendPresenter.getEnableAddFriend(pref.getString(savedRobotNum, null));
                 }
                 List<CharSequence> texts = event.getText();
                 if (!texts.isEmpty()) {
                     for (CharSequence text : texts) {
-                        LogUtil.d("maptrix", "onAccessibilityEvent: texts size is " + texts.size());
+                        LogUtils.d("maptrix : onAccessibilityEvent: texts size is " + texts.size());
                         String content = text.toString();
-                        LogUtil.d("maptrix", "onAccessibilityEvent: content is " + content);
+                        LogUtils.d("maptrix : onAccessibilityEvent: content is " + content);
                         if (!TextUtils.isEmpty(content)) {
                             if (!isScreenOn()) {
                                 lightOnScreen();
-                                LogUtil.d("maptrix", "the screen is black");
+                                LogUtils.d("maptrix : the screen is black");
                                 sendNotifacationReply(event);
 
                             } else {
-                                LogUtil.d("maptrix", "the screen is on");
+                                LogUtils.d("maptrix : the screen is on");
                                 sendNotifacationReply(event);
                             }
                         }
@@ -185,8 +185,8 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
                 }
                 break;
             case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED:
-                LogUtil.d("maptrix", "window_stat_changed,event name:" + event.getClassName());
-                LogUtil.d(TAG, "onAccessibilityEvent: " + mActionType);
+                LogUtils.d("maptrix : window_stat_changed,event name:" + event.getClassName());
+                LogUtils.d(TAG + " onAccessibilityEvent: " + mActionType);
                 if (event.getClassName().equals("com.tencent.mm.ui.base.p")) {
 /*                    if (isSendingPermissionRequest) {
                         AutoReplyService.isInSeeRoomInfoUICanNotGoBack = false;
@@ -206,7 +206,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
                     }
                 }
                 if (!hasAction) {
-                    LogUtil.d(TAG, "hasAction = false");
+                    LogUtils.d(TAG + " hasAction = false");
                     break;
                 }
                 //  mActionType = actionType.isGroupInvited;
@@ -216,7 +216,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
                 break;
 
             case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED:
-                LogUtil.d("maptrix", "window content changed " + event.getClassName() + inMineView + msgView); //window content内容变化时候调用
+                LogUtils.d("maptrix : window content changed " + event.getClassName() + inMineView + msgView); //window content内容变化时候调用
                 if (inMineView && msgView) {
                     inMineView = false;
                     msgView = false;
@@ -283,7 +283,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
          * 当在动作进行中来消息了,就把消息的发送人和内容存起来,在动作结束后统一回到聊天页面,判断事件
          * 此处自行判断小红点然后处理事件
          */
-        LogUtil.d(TAG, "doTheUndoWork: ");
+        LogUtils.d(TAG + " doTheUndoWork: ");
         //遍历聊天列表,找没做的任务,右上角有数字的
         //coversationWithAppBrandListView(cwp)-->LinearLayout(b4m)-->...
         // 每一条名称部分的ID为b4o,名称下的消息缩略内容为b4q,头像右上角的带数字小红点为textview,Id为mm
@@ -292,12 +292,12 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
         AccessibilityNodeInfo root = getRootInActiveWindow();
         AccessibilityNodeInfo msgLists = AccessibilityHelper.findNodeInfosById(root, "com.tencent.mm:id/cwp");
         if (msgLists == null) {
-            LogUtil.e(TAG, "doTheUndoWork: msg list size is null ");
+            LogUtils.e(TAG + " doTheUndoWork: msg list size is null ");
             return;
         }
 
         List<AccessibilityNodeInfo> msg = msgLists.findAccessibilityNodeInfosByViewId("com.tencent.mm:id/b4m");
-        LogUtil.e(TAG, "doTheUndoWork: " + msg.size());
+        LogUtils.e(TAG + " doTheUndoWork: " + msg.size());
         if (msg.size() == 0) {
             return;
         }
@@ -305,20 +305,20 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
             AccessibilityNodeInfo perMsg = msg.get(i);
             AccessibilityNodeInfo redPoint = AccessibilityHelper.findNodeInfosById(perMsg, "com.tencent.mm:id/mm");
             if (redPoint == null) {
-                LogUtil.e(TAG, "doTheUndoWork: the" + perMsg.getContentDescription() + " mm is null");
+                LogUtils.e(TAG + " doTheUndoWork: the" + perMsg.getContentDescription() + " mm is null");
                 continue;
             }
             int theMsgCount = Integer.parseInt(redPoint.getText().toString());
-            LogUtil.e(TAG, "doTheUndoWork: " + theMsgCount);
+            LogUtils.e(TAG + " doTheUndoWork: " + theMsgCount);
             if (theMsgCount > 0) {
                 AccessibilityNodeInfo underTextNode = AccessibilityHelper.findNodeInfosById(perMsg, "com.tencent.mm:id/b4q");
                 AccessibilityNodeInfo theMsgName = AccessibilityHelper.findNodeInfosById(perMsg, "com.tencent.mm:id/b4o");
                 if (underTextNode == null) {
-                    LogUtil.e(TAG, "doTheUndoWork: underTextNode is null");
+                    LogUtils.e(TAG + " doTheUndoWork: underTextNode is null");
                     continue;
                 }
                 if (theMsgName == null) {
-                    LogUtil.e(TAG, "doTheUndoWork: the msgname is null");
+                    LogUtils.e(TAG + " doTheUndoWork: the msgname is null");
                     continue;
                 }
                 if (theMsgName.getText().toString().equals("腾讯新闻") || theMsgName.getText().toString().equals("服务通知")) {
@@ -347,7 +347,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
 
         AccessibilityNodeInfo underTab = AccessibilityHelper.findNodeInfosById(root, "com.tencent.mm:id/bn");
         if (underTab == null) {
-            LogUtil.e(TAG, "doTheUndoWork: under tab is null");
+            LogUtils.e(TAG + " doTheUndoWork: under tab is null");
             performGlobalAction(GLOBAL_ACTION_HOME);
             return;
 
@@ -355,7 +355,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
 
         AccessibilityNodeInfo mineNode = underTab.getChild(0).getChild(3);
         if (mineNode == null) {
-            LogUtil.e(TAG, "doTheUndoWork: mine node is null");
+            LogUtils.e(TAG + " doTheUndoWork: mine node is null");
             performGlobalAction(GLOBAL_ACTION_HOME);
             return;
         }
@@ -367,7 +367,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
         mActionType = actionType.isNone;
         hasAction = false;
         msgList.clear();
-        LogUtil.e(TAG, "doTheUndoWork: " + inMineView);
+        LogUtils.e(TAG + " doTheUndoWork: " + inMineView);
 
 
         //performGlobalAction(GLOBAL_ACTION_HOME);
@@ -383,19 +383,19 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
         AccessibilityNodeInfo root = getRootInActiveWindow();
         AccessibilityNodeInfo underTabNode = AccessibilityHelper.findNodeInfosById(root, "com.tencent.mm:id/bn");
         if (underTabNode == null) {
-            LogUtil.e(TAG, "doTheUndoWork: underTab is null");
+            LogUtils.e(TAG + " doTheUndoWork: underTab is null");
             return false;
         }
 
         AccessibilityNodeInfo contractTabNode = underTabNode.getChild(0).getChild(1);
         if (contractTabNode == null) {
-            LogUtil.e(TAG, "doTheUndoWork: contractNode is null");
+            LogUtils.e(TAG + " doTheUndoWork: contractNode is null");
             return false;
         }
 
         AccessibilityNodeInfo unAddFriendCountNode = AccessibilityHelper.findNodeInfosById(contractTabNode, "com.tencent.mm:id/d3s");
         if (unAddFriendCountNode == null) {
-            LogUtil.e(TAG, "addUnaddFriend: unAddCountNode is null");
+            LogUtils.e(TAG + " addUnaddFriend: unAddCountNode is null");
             return false;
         }
         CharSequence count = unAddFriendCountNode.getText();
@@ -419,13 +419,13 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
         //通讯录界面,整体是个list(m_),第一个子节点是朋友推荐list,包含未加好友那一行的布局id为brc
         AccessibilityNodeInfo listNode = AccessibilityHelper.findNodeInfosById(root, "com.tencent.mm:id/m_");
         if (listNode == null) {
-            LogUtil.e(TAG, "addUnaddFriend: tab view list node is null");
+            LogUtils.e(TAG + " addUnaddFriend: tab view list node is null");
             return;
         }
 
         AccessibilityNodeInfo unAddFriendNode = AccessibilityHelper.findNodeInfosById(listNode, "com.tencent.mm:id/brc");
         if (unAddFriendNode == null) {
-            LogUtil.e(TAG, "addUnaddFriend: unaddFriend node is null");
+            LogUtils.e(TAG + " addUnaddFriend: unaddFriend node is null");
             return;
         }
 
@@ -458,7 +458,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
             int size = root.getChildCount();
             for (int i = 0; i < size; i++) {
                 AccessibilityNodeInfo child = root.getChild(i);
-                LogUtil.d(TAG, "findallchild: " + child.getContentDescription() + " " + child.getClassName() + " " + child.getViewIdResourceName() + " " + child.getText());
+                LogUtils.d(TAG + " findallchild: " + child.getContentDescription() + " " + child.getClassName() + " " + child.getViewIdResourceName() + " " + child.getText());
                 findallchild(child);
             }
 
@@ -478,7 +478,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
             hasAction = true;
             if (isInAction) {
                 //暂时无法获取到消息标题用作判断,将所有收到的消息都存下来,遍历列表时候能找到就找到找不到无所谓
-                LogUtil.e(Constants.TAG_PREFIX + TAG, "sendNotifacationReply: in action");
+                LogUtils.e(Constants.TAG_PREFIX + TAG + "sendNotifacationReply: in action");
                 msgList.add(msgSenderName.length() + msgSenderName + mActionType);
                 return;
             }
@@ -496,8 +496,8 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
                 scontent = "请求添加你为朋友";
             }
 
-            LogUtil.i("maptrix", "sender name =" + msgSenderName);
-            LogUtil.i("maptrix", "sender content =" + scontent);
+            LogUtils.i("maptrix : sender name =" + msgSenderName);
+            LogUtils.i("maptrix : sender content =" + scontent);
 
             judgeMsgText(scontent);
 
@@ -507,7 +507,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
             PendingIntent pendingIntent = notification.contentIntent;
             try {
                 pendingIntent.send(); //执行点击
-                LogUtil.e(TAG, "sendNotifacationReply: dowwwwwwnnnnnn");
+                LogUtils.e(TAG + " sendNotifacationReply: dowwwwwwnnnnnn");
             } catch (PendingIntent.CanceledException e) {
                 e.printStackTrace();
             }
@@ -539,7 +539,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
      * 判断消息是否包含特定的字符串
      */
     private void judgeMsgText(String content) {
-        LogUtil.e(TAG, "judgeMsgText: " + content);
+        LogUtils.e(TAG + " judgeMsgText: " + content);
         if (content.contains("[微信红包]")) {
             mActionType = actionType.isHongBao;
         } else if (content.contains("[转账]")) {
@@ -576,7 +576,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
         ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
         ComponentName cn = am.getRunningTasks(1).get(0).topActivity;
         String currentPackageName = cn.getPackageName();
-        LogUtil.d("maptrix", "isAppForeground: " + currentPackageName);
+        LogUtils.d("maptrix : isAppForeground: " + currentPackageName);
         if (!TextUtils.isEmpty(currentPackageName) && currentPackageName.equals(packageName)) {
             return true;
         }
@@ -620,7 +620,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
      */
 
     private boolean isScreenOn() {
-        LogUtil.e(TAG, "isScreenOn: ");
+        LogUtils.e(TAG + " isScreenOn: ");
         PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
 
         return powerManager.isScreenOn();
@@ -651,7 +651,7 @@ public class AutoReplyService extends AccessibilityService implements enableAddF
     }
 
     private void wakeAndUnlock() {
-        LogUtil.e(TAG, "wakeAndUnlock: ");
+        LogUtils.e(TAG + " wakeAndUnlock: ");
         //获取电源管理器对象
         PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
 

+ 0 - 21
app/src/main/java/com/wiipu/marketingrobot/LogUtil.java

@@ -1,21 +0,0 @@
-package com.wiipu.marketingrobot;
-
-import android.util.Log;
-
-public class LogUtil {
-    public static void e(String suffixTag,String message){
-        Log.e(Constants.TAG_PREFIX+suffixTag,message);
-    }
-
-    public static void d(String suffixTag,String message){
-        Log.d(Constants.TAG_PREFIX+suffixTag,message);
-    }
-
-    public static void i(String suffixTag,String message){
-        Log.i(Constants.TAG_PREFIX+suffixTag,message);
-    }
-
-    public static void v(String suffixTag,String message){
-        Log.v(Constants.TAG_PREFIX+suffixTag,message);
-    }
-}

+ 1 - 3
app/src/main/java/com/wiipu/marketingrobot/application/App.java

@@ -10,6 +10,7 @@ import com.wiipu.netlib.utils.ContextUtils;
  * Description:
  */
 public class App extends Application{
+
     private static Context sContext;
 
     public static Application INSTANCE = null;
@@ -21,8 +22,5 @@ public class App extends Application{
         ContextUtils.init(this);
         sContext = getApplicationContext();
 
-       // refWatcher = LeakCanary.install(this);
-
-
     }
 }

+ 2 - 2
app/src/main/java/com/wiipu/marketingrobot/contract/enableAddFriendContract.java

@@ -9,12 +9,12 @@ import com.wiipu.netlib.base.BaseView;
  */
 public interface enableAddFriendContract {
     interface View extends BaseView {
-        void showEnabeAddFriendReply(enableAddFriendResponse enableAddFriendResponse);
+        void showEnableAddFriendReply(enableAddFriendResponse enableAddFriendResponse);
 
         void showEnableError(String msg);
     }
 
     interface Presenter{
-        void getEnableAddFriend(String rabotNum);
+        void getEnableAddFriend(String robotNum);
     }
 }

+ 1 - 1
app/src/main/java/com/wiipu/marketingrobot/contract/moneyContract.java

@@ -16,7 +16,7 @@ public interface moneyContract {
     }
 
     interface Presenter{
-        void loadMoneyReply(String no, String money, String rabotNum);
+        void loadMoneyReply(String no, String money, String robotNum);
 
         void addGroupReply(String user_no, String robot_no, String group_name);
     }

+ 2 - 2
app/src/main/java/com/wiipu/marketingrobot/contract/replyContract.java

@@ -17,9 +17,9 @@ public interface replyContract {
     }
 
     interface Presenter {
-        void loadReply(String content, String mmNum, String rabotNum);
+        void loadReply(String content, String mmNum, String robotNum);
 
-        void upLoadFriends(String mmName, String mmNum, String rabotName, String rabotNum);
+        void upLoadFriends(String mmName, String mmNum, String robotName, String robotNum);
 
 
     }

+ 14 - 13
app/src/main/java/com/wiipu/marketingrobot/function/addAutoReplyFunction.java

@@ -24,6 +24,7 @@ import com.wiipu.marketingrobot.response.replyResponse;
 import com.wiipu.marketingrobot.response.uploadFriendResponse;
 import com.wiipu.marketingrobot.widget.AccessibilityHelper;
 import com.wiipu.netlib.rxbus.RxBus;
+import com.wiipu.netlib.utils.LogUtils;
 
 import java.util.List;
 
@@ -80,9 +81,9 @@ public class addAutoReplyFunction implements replyContract.View , enableAddFrien
     }
 
     @Override
-    public void showEnabeAddFriendReply(enableAddFriendResponse enableAddFriendResponse) {
+    public void showEnableAddFriendReply(enableAddFriendResponse enableAddFriendResponse) {
         AutoReplyService.enableFriendsCounts = enableAddFriendResponse.getMsg();
-        Log.d(TAG,"addAutoReplyService showEnableAddFriendReply,now the enableFriendCounts is :"+AutoReplyService.enableFriendsCounts);
+        LogUtils.d(TAG + " addAutoReplyService showEnableAddFriendReply,now the enableFriendCounts is :"+AutoReplyService.enableFriendsCounts);
     }
 
     @Override
@@ -119,38 +120,38 @@ public class addAutoReplyFunction implements replyContract.View , enableAddFrien
 
     public void addAutoReply(AccessibilityEvent event) {
         AutoReplyService.isInAction = true;
-        Log.e(TAG, "addAutoReply: 1");
+        LogUtils.e(TAG + " addAutoReply: 1");
 
         if (pref.getString(savedRobotName, null) == null || pref.getString(savedRobotNum, null) == null) {
-            Log.d(TAG, "addAutoReply: get the robot info");
+            LogUtils.d(TAG + " addAutoReply: get the robot info");
             getTheRobotInfo(event);
             return;
         }
-        Log.d(TAG, "addAutoReply: 2");
+        LogUtils.d(TAG + " addAutoReply: 2");
         if (event.getClassName().equals("com.tencent.mm.ui.LauncherUI")) {
             if (!hasGetmmId) {
                 openMemberList();
                 return;
             }
 
-            Log.d(TAG, "addAutoReply: 2.5");
+            LogUtils.d(TAG + " addAutoReply: 2.5");
             mReplyPresenter.upLoadFriends(mmName, mmNum, pref.getString(savedRobotName, null), pref.getString(savedRobotNum, null));
             mEnableAddFriendPresenter.getEnableAddFriend(pref.getString(savedRobotNum, null));
 
 
         }
-        Log.e(TAG, "addAutoReply: 3");
+        LogUtils.d(TAG + " addAutoReply: 3");
 
         if (event.getClassName().equals("com.tencent.mm.ui.SingleChatInfoUI")) {//点开3个点后的页面
             AccessibilityNodeInfo root = mService.getRootInActiveWindow();
             AccessibilityNodeInfo ci7List = AccessibilityHelper.findNodeInfosById(root, chatRoomNewCi7List);
             if (ci7List == null) {
-                Log.e(TAG, "addFriend: ci7 is null");
+                LogUtils.e(TAG + " addFriend: ci7 is null");
                 return;
             }
 
             if (!hasGetmmId) {
-                Log.d(TAG, "openMoney :not  get mm id");
+                LogUtils.d(TAG + " openMoney :not  get mm id");
                 //ci7List.getChild(0).performAction(AccessibilityNodeInfo.ACTION_CLICK);
                 AccessibilityHelper.performClick(ci7List.getChild(0));
             } else {
@@ -209,7 +210,7 @@ public class addAutoReplyFunction implements replyContract.View , enableAddFrien
     private void getTheRobotInfo(AccessibilityEvent event) {
         String senderName = AutoReplyService.msgSenderName;
         if (senderName == null) {
-            Log.e(TAG, "getTheRobotInfo: wtf!!!!");
+            LogUtils.e(TAG + " getTheRobotInfo: wtf!!!!");
             return;
         }
 
@@ -221,7 +222,7 @@ public class addAutoReplyFunction implements replyContract.View , enableAddFrien
 
             AccessibilityNodeInfo root = mService.getRootInActiveWindow();
             List<AccessibilityNodeInfo> memList = root.findAccessibilityNodeInfosByViewId(chatListMem);
-            Log.d(TAG, "getTheRobotInfo: the memlist size is" + memList.size());
+            LogUtils.d(TAG + " getTheRobotInfo: the memlist size is" + memList.size());
             for(int i=0;i<memList.size();i++) {
                 AccessibilityNodeInfo node = memList.get(i);
                 if (node != null && !node.getContentDescription().toString().contains(AutoReplyService.msgSenderName)) {
@@ -252,7 +253,7 @@ public class addAutoReplyFunction implements replyContract.View , enableAddFrien
                 AccessibilityHelper.performClick(addTocContract);
                 return;
             } else {
-                Log.e(TAG, "getTheRobotInfo: name id is null");
+                LogUtils.e(TAG + " getTheRobotInfo: name id is null");
             }
 
             mService.performGlobalAction(GLOBAL_ACTION_BACK);
@@ -332,7 +333,7 @@ public class addAutoReplyFunction implements replyContract.View , enableAddFrien
                 for (AccessibilityNodeInfo n : list) {
                    // n.performAction(AccessibilityNodeInfo.ACTION_CLICK);
                     AccessibilityHelper.performClick(n);
-                    Log.d(TAG, "send: 1");
+                    LogUtils.d(TAG + " send: 1");
                 }
 
             } else {

+ 18 - 19
app/src/main/java/com/wiipu/marketingrobot/function/addFriendFunction.java

@@ -9,12 +9,10 @@ import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.os.SystemClock;
 import android.support.annotation.Nullable;
-import android.util.Log;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityNodeInfo;
 
 import com.wiipu.marketingrobot.AutoReplyService;
-import com.wiipu.marketingrobot.LogUtil;
 import com.wiipu.marketingrobot.contract.enableAddFriendContract;
 import com.wiipu.marketingrobot.contract.replyContract;
 import com.wiipu.marketingrobot.presenter.enableAddFriendPresenter;
@@ -24,6 +22,7 @@ import com.wiipu.marketingrobot.response.replyResponse;
 import com.wiipu.marketingrobot.response.uploadFriendResponse;
 import com.wiipu.marketingrobot.widget.AccessibilityHelper;
 import com.wiipu.netlib.rxbus.RxBus;
+import com.wiipu.netlib.utils.LogUtils;
 
 import java.util.List;
 
@@ -60,7 +59,7 @@ public class addFriendFunction implements replyContract.View , enableAddFriendCo
 
     @Override
     public void showUploadFriendReply(uploadFriendResponse uploadFriendResponse) {
-        Log.e(TAG, "showUploadFriendReply: up load success");
+        LogUtils.d(TAG + " showUploadFriendReply: up load success");
         finalAction(uploadFriendResponse.getMsg());
 
     }
@@ -82,9 +81,9 @@ public class addFriendFunction implements replyContract.View , enableAddFriendCo
 
 
     @Override
-    public void showEnabeAddFriendReply(enableAddFriendResponse enableAddFriendResponse) {
+    public void showEnableAddFriendReply(enableAddFriendResponse enableAddFriendResponse) {
         AutoReplyService.enableFriendsCounts = enableAddFriendResponse.getMsg();
-        Log.d(TAG,"showEnableAddFriendReply,now the enableFriendCounts is :"+AutoReplyService.enableFriendsCounts);
+        LogUtils.d(TAG + " showEnableAddFriendReply,now the enableFriendCounts is :"+AutoReplyService.enableFriendsCounts);
     }
 
     @Override
@@ -173,7 +172,7 @@ public class addFriendFunction implements replyContract.View , enableAddFriendCo
                     AccessibilityHelper.performClick(addTocContract);
                     return;
                 } else {
-                    Log.e(TAG, "getTheRobotInfo: name id is null");
+                    LogUtils.e(TAG + " getTheRobotInfo: name id is null");
                 }
 
                 needGetSelfInfo = false;
@@ -182,12 +181,12 @@ public class addFriendFunction implements replyContract.View , enableAddFriendCo
             }
 
            if(mmId==null){
-               Log.e(TAG, "addFriend: mm id is null" );
+               LogUtils.e(TAG + " addFriend: mm id is null" );
                return;
            }
             String id = mmId.getText().toString();
             id = id.substring(id.indexOf(":")+2, id.length()).trim();
-            Log.d(TAG, "addFriend: the mmid is " + id);
+            LogUtils.d(TAG + " addFriend: the mmid is " + id);
             mmNum = id;
             hasGetmmId = true;
 
@@ -198,28 +197,28 @@ public class addFriendFunction implements replyContract.View , enableAddFriendCo
         }
 
         if (event.getClassName().equals("com.tencent.mm.ui.chatting.ChattingUI")) {//聊天页面
-            Log.d(TAG, "addFriend: in the chatt ui");
+            LogUtils.d(TAG + " addFriend: in the chatt ui");
             AccessibilityNodeInfo root = mService.getRootInActiveWindow();
             AccessibilityNodeInfo more = AccessibilityHelper.findNodeInfosById(root, threePointInLanucher);//右上角三个点
             AccessibilityNodeInfo name = AccessibilityHelper.findNodeInfosById(root, chatNameInLeftUp);//名称
             if (more == null || name == null) {
-                Log.e(TAG, "addFriend: more or name is null");
+                LogUtils.e(TAG + " addFriend: more or name is null");
                 return;
             }
             mmName = name.getText().toString();
-            Log.e(TAG, "addFriend: 1");
+            LogUtils.e(TAG + " addFriend: 1");
             if (!hasGetmmId) {
                 //增加一个延迟,防止点击不到右上角的三个点。
                 SystemClock.sleep(1000);
                 AccessibilityHelper.performClick(more);
                 return;
             }
-            Log.e(TAG, "addFriend: 2" );
+            LogUtils.e(TAG + " addFriend: 2" );
             if (pref.getString(savedRobotName, null) == null || pref.getString(savedRobotNum, null) == null) {
                 getTheRobotInfo(event);
                 return;
             }
-            Log.e(TAG, "addFriend: 3");
+            LogUtils.e(TAG + " addFriend: 3");
             mReplyPresenter.upLoadFriends(mmName, mmNum, pref.getString(savedRobotName, null), pref.getString(savedRobotNum, null));
             mEnableAddFriendPresenter.getEnableAddFriend(pref.getString(savedRobotNum, null));
 
@@ -229,7 +228,7 @@ public class addFriendFunction implements replyContract.View , enableAddFriendCo
             AccessibilityNodeInfo root = mService.getRootInActiveWindow();
             AccessibilityNodeInfo ci7List = AccessibilityHelper.findNodeInfosById(root, chatRoomNewCi7List);
             if (ci7List == null) {
-                Log.e(TAG, "addFriend: ci7 is null");
+                LogUtils.e(TAG + " addFriend: ci7 is null");
                 return;
             }
 
@@ -251,10 +250,10 @@ public class addFriendFunction implements replyContract.View , enableAddFriendCo
      */
 
     private void getTheRobotInfo(AccessibilityEvent event) {
-        Log.d(TAG, "getTheRobotInfo: ");
+        LogUtils.d(TAG + " getTheRobotInfo: ");
         String senderName = AutoReplyService.msgSenderName;
         if (senderName == null) {
-            Log.e(TAG, "getTheRobotInfo: wtf!!!!");
+            LogUtils.e(TAG + " getTheRobotInfo: wtf!!!!");
             return;
         }
 
@@ -308,7 +307,7 @@ public class addFriendFunction implements replyContract.View , enableAddFriendCo
         for (int i = 0; i < count; i++) {
             AccessibilityNodeInfo nodeInfo = rootNode.getChild(i);
             if (nodeInfo == null) {
-                LogUtil.d("maptrix", "nodeinfo = null");
+                LogUtils.d("maptrix : nodeinfo = null");
                 continue;
             }
 
@@ -316,7 +315,7 @@ public class addFriendFunction implements replyContract.View , enableAddFriendCo
             //  LogUtil.e("maptrix", "ds=" + nodeInfo.getContentDescription());
 
             if ("android.widget.EditText".equals(nodeInfo.getClassName())) {
-                LogUtil.i("maptrix", "find edit text");
+                LogUtils.i("m : find edit text");
 
                 Bundle arguments = new Bundle();
                 arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT,
@@ -358,7 +357,7 @@ public class addFriendFunction implements replyContract.View , enableAddFriendCo
                 for (AccessibilityNodeInfo n : list) {
                     //n.performAction(AccessibilityNodeInfo.ACTION_CLICK);
                     AccessibilityHelper.performClick(n);
-                    Log.d(TAG, "send: 1");
+                    LogUtils.d(TAG + " send: 1");
                 }
 
             } else {

+ 55 - 57
app/src/main/java/com/wiipu/marketingrobot/function/addGroupFunction.java

@@ -15,7 +15,6 @@ import android.view.accessibility.AccessibilityNodeInfo;
 
 
 import com.wiipu.marketingrobot.AutoReplyService;
-import com.wiipu.marketingrobot.LogUtil;
 import com.wiipu.marketingrobot.contract.moneyContract;
 import com.wiipu.marketingrobot.presenter.moneyPresenter;
 import com.wiipu.marketingrobot.response.AddGroupReplyResponse;
@@ -107,7 +106,7 @@ public class addGroupFunction implements moneyContract.View {
 
         AutoReplyService.isInAction = true;
         if (pref.getString(savedRobotName, null) == null || pref.getString(savedRobotNum, null) == null) {
-            LogUtil.d(TAG, "addAutoReply: get the robot info");
+            LogUtils.d(TAG + " addAutoReply: get the robot info");
             getTheRobotInfo(event);
             return;
         }
@@ -126,7 +125,7 @@ public class addGroupFunction implements moneyContract.View {
 
             List<AccessibilityNodeInfo> nodesList = root.findAccessibilityNodeInfosByText("邀请你加入群聊");
             if (nodesList.size() == 0) {
-                LogUtil.e(TAG, "addGroup: nodes list size is 0");
+                LogUtils.e(TAG + " addGroup: nodes list size is 0");
             } else {
                 AccessibilityNodeInfo node = nodesList.get(nodesList.size() - 1);
                 if (node != null) {
@@ -135,7 +134,7 @@ public class addGroupFunction implements moneyContract.View {
                         if (fill("群聊人员数不足,请重新拉群")) {
                             send();
                         } else {
-                            LogUtil.e(TAG, "addGroup: cant find edittext");
+                            LogUtils.e(TAG + " addGroup: cant find edittext");
                         }
                         isGroupNumLegal = true;
                         hasGetMMid = false;
@@ -161,7 +160,7 @@ public class addGroupFunction implements moneyContract.View {
                 }
             }
 
-            LogUtil.e(TAG, "addGroup: 2");
+            LogUtils.e(TAG + " addGroup: 2");
             if (finishAllJob) {
                 mService.performGlobalAction(GLOBAL_ACTION_BACK);//两个连着的global操作是不行的,只能分开页面判断
                 finishAllJob = false;
@@ -171,10 +170,10 @@ public class addGroupFunction implements moneyContract.View {
                 return;
             }
 
-            LogUtil.e(TAG, "addGroup: 3");
+            LogUtils.e(TAG + " addGroup: 3");
 //            SystemClock.sleep(3000);
             if (isGroupChatUi()) {
-                LogUtil.e(TAG, "addGroup: is group ui");
+                LogUtils.e(TAG + " addGroup: is group ui");
                 openMemberList();
             }
 
@@ -197,13 +196,13 @@ public class addGroupFunction implements moneyContract.View {
             findallchild(root);
             isNumLegal(root);
             if (!isGroupNumLegal) {
-                LogUtil.e(TAG, "addGroup: 人数不合法");
+                LogUtils.e(TAG + " addGroup: 人数不合法");
                 mService.performGlobalAction(GLOBAL_ACTION_BACK);
                 return;
             } else {
-                LogUtil.e(TAG, "addGroup: num is legal");
+                LogUtils.e(TAG + " addGroup: num is legal");
             }
-            LogUtil.e(TAG, "addGroup: 1");
+            LogUtils.e(TAG + " addGroup: 1");
 
             if (needToReplyInvite) {//第一次检查符合人数后,回消息页面进行回复
                 mMoneyPresenter.addGroupReply(mmNum, pref.getString(savedRobotNum, null),
@@ -214,16 +213,16 @@ public class addGroupFunction implements moneyContract.View {
                 return;
             }
 
-            LogUtil.d(TAG, "addGroup: 2");
+            LogUtils.d(TAG + " addGroup: 2");
 
             findchild(root);
             AccessibilityNodeInfo node = findChild;
             if (node == null) {
-                LogUtil.d(TAG, "addGroup: node null");
+                LogUtils.d(TAG + " addGroup: node null");
                 return;
             }
 
-            LogUtil.e(TAG, "addGroup: click 加入");
+            LogUtils.e(TAG + " addGroup: click 加入");
 
             AccessibilityHelper.performClick(node);
 
@@ -253,10 +252,10 @@ public class addGroupFunction implements moneyContract.View {
                 return;
             }
 
-            LogUtil.e(TAG, "addGroup: 0");
+            LogUtils.e(TAG + " addGroup: 0");
             //用于修正在点击添加到联系人后,会先调用群友信息界面再调用验证界面的情况
             if (isFriendSend) {
-                LogUtil.d(TAG,"handleChatFunction: friend send");
+                LogUtils.d(TAG + " handleChatFunction: friend send");
                 addGroupChatFriendFlag = false;
                 isFriendSend = false;
                 mService.performGlobalAction(GLOBAL_ACTION_BACK);
@@ -265,10 +264,10 @@ public class addGroupFunction implements moneyContract.View {
                 return;
             }
 
-            LogUtil.e(TAG, "addGroup: 1");
+            LogUtils.e(TAG + " addGroup: 1");
             if (!isGroupChatFriend()) {
                 addGroupFriend();
-                LogUtil.e(TAG, "addGroup: 添加好友,结果未知");
+                LogUtils.e(TAG + " addGroup: 添加好友,结果未知");
                 // mService.performGlobalAction(GLOBAL_ACTION_BACK);
                 AutoReplyService.isInSeeRoomInfoUICanNotGoBack = false;
 
@@ -288,7 +287,7 @@ public class addGroupFunction implements moneyContract.View {
 
                     return;
                 }*/
-                LogUtil.d(TAG, "ContactInfoUI global back");
+                LogUtils.d(TAG + " ContactInfoUI global back");
 
                 mService.performGlobalAction(GLOBAL_ACTION_BACK);
             }
@@ -296,7 +295,7 @@ public class addGroupFunction implements moneyContract.View {
 
         if (event.getClassName().equals("com.tencent.mm.plugin.profile.ui.SayHiWithSnsPermissionUI")) {//点击“添加到通讯录”后的验证页面
             addGroupFriendPermission();
-            LogUtil.e(TAG, "addGroup: back");
+            LogUtils.e(TAG + " addGroup: back");
             AutoReplyService.isInSeeRoomInfoUICanNotGoBack = false;
             // AccessibilityNodeInfo nodeInfo = AccessibilityHelper.findNodeInfosById(mService.getRootInActiveWindow(), "com.tencent.mm:id/k4");
             //  AccessibilityHelper.performClick(nodeInfo);
@@ -308,12 +307,12 @@ public class addGroupFunction implements moneyContract.View {
             AccessibilityNodeInfo root = mService.getRootInActiveWindow();
             AccessibilityNodeInfo ci7List = AccessibilityHelper.findNodeInfosById(root, chatRoomNewCi7List);
             if (ci7List == null) {
-                LogUtil.e(TAG, "addFriend: ci7 is null");
+                LogUtils.e(TAG + " addFriend: ci7 is null");
                 return;
             }
 
             if (!hasGetMMid) {
-                LogUtil.d(TAG, "openMoney :not  get mm id");
+                LogUtils.d(TAG + " openMoney :not  get mm id");
                 AccessibilityHelper.performClick(ci7List.getChild(0));
 
             } else {
@@ -350,7 +349,7 @@ public class addGroupFunction implements moneyContract.View {
         AccessibilityNodeInfo root = mService.getRootInActiveWindow();
         List<AccessibilityNodeInfo> listNodes = root.findAccessibilityNodeInfosByText("邀请你加入群聊");
         if (listNodes.size() == 0) {
-            LogUtil.e(TAG, "reInTheGroupView: 找不到加入群聊");
+            LogUtils.e(TAG + " reInTheGroupView: 找不到加入群聊");
             return;
         }
 
@@ -375,7 +374,7 @@ public class addGroupFunction implements moneyContract.View {
         }
 
         if (target != null) {
-            LogUtil.d(TAG, "addGrouFunction openChatMemberList() target!=null");
+            LogUtils.d(TAG + " addGrouFunction openChatMemberList() target!=null");
             SystemClock.sleep(2000);
             AccessibilityHelper.performClick(target);
         } else {
@@ -421,7 +420,7 @@ public class addGroupFunction implements moneyContract.View {
         AccessibilityNodeInfo root = mService.getRootInActiveWindow();
         AccessibilityNodeInfo titleNode = AccessibilityHelper.findNodeInfosById(root, chatNameInLeftUp);
         if (titleNode == null) {
-            LogUtil.e(TAG, "getTheGroupName: title is null ");
+            LogUtils.e(TAG + " getTheGroupName: title is null ");
             return null;
         }
         String title = titleNode.getText().toString();
@@ -445,7 +444,7 @@ public class addGroupFunction implements moneyContract.View {
         AccessibilityNodeInfo target = AccessibilityHelper.findNodeInfosById(root, addFriendSendBtn);//右上角“发送”按钮ID
         if (target != null) {
             AccessibilityHelper.performClick(target);
-            LogUtil.d("handleChatFunction", "addGroupFriendPermission: 点击发送");
+            LogUtils.d("handleChatFunction : addGroupFriendPermission: 点击发送");
             AutoReplyService.isSendingPermissionRequest = true;
         }
 
@@ -461,7 +460,7 @@ public class addGroupFunction implements moneyContract.View {
         AccessibilityNodeInfo root = mService.getRootInActiveWindow();
         AccessibilityNodeInfo target = null;
         if (root == null) {
-            LogUtil.d(TAG, "isGroupChatFriend,root==null,return true");
+            LogUtils.d(TAG + " isGroupChatFriend,root==null,return true");
             return true;
         }
         target = AccessibilityHelper.findNodeInfosByText(root, "添加到通讯录");//这里必须以名字查询
@@ -478,7 +477,7 @@ public class addGroupFunction implements moneyContract.View {
      */
 
     private void addGroupFriend() {
-        LogUtil.d("handleChatFunction", "addGroupFriend: add group friend");
+        LogUtils.d("handleChatFunction : addGroupFriend: add group friend");
         SystemClock.sleep(2000);
         AccessibilityNodeInfo target = AccessibilityHelper.findNodeInfosByText(mService.getRootInActiveWindow(), "添加到通讯录");
         AccessibilityHelper.performClick(target);
@@ -522,7 +521,7 @@ public class addGroupFunction implements moneyContract.View {
      */
     private void addBigGroupFriends() {
         if (addFriendError) {
-            LogUtil.d(TAG, "addFriendError");
+            LogUtils.d(TAG + " addFriendError");
             mService.performGlobalAction(GLOBAL_ACTION_BACK);
             addcount = 0;
             addFriendError = false;
@@ -531,13 +530,13 @@ public class addGroupFunction implements moneyContract.View {
         AccessibilityNodeInfo root = mService.getRootInActiveWindow();
         AccessibilityNodeInfo gridView = AccessibilityHelper.findNodeInfosById(root, bigGroupGridView);//全部成员gridview
         if (gridView == null) {
-            LogUtil.d(TAG, "addBigGroupFriends: grid view null ");
+            LogUtils.d(TAG + " addBigGroupFriends: grid view null ");
             findallchild(root);
             return;
         }
 
         if (isFirstReadGridview) {
-            LogUtil.d(TAG, "isFirstReadGridView");
+            LogUtils.d(TAG + " isFirstReadGridView");
             gridView.performAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
             SystemClock.sleep(500);
             isFirstReadGridview = false;
@@ -560,17 +559,17 @@ public class addGroupFunction implements moneyContract.View {
         }
         addcount++;
         if (addcount > AutoReplyService.enableFriendsCounts) {
-            LogUtil.d(TAG, "addCount is over enableFriendsCounts.enable friend count is:" + AutoReplyService.enableFriendsCounts);
+            LogUtils.d(TAG + " addCount is over enableFriendsCounts.enable friend count is:" + AutoReplyService.enableFriendsCounts);
             mService.performGlobalAction(GLOBAL_ACTION_BACK);//大于预定人员数直接后退
             addcount = 0;
             return;
         }
 //        LogUtil.e(TAG, "addBigGroupFriends: index is" + bigchatRoomMemberIndex + " " + bigchatRoomMemberName.size() + " " + getroomSize());
-        LogUtil.e(TAG, "addBigGroupFriends: index is" + bigchatRoomMemberIndex + " " + bigchatRoomMemberName.size());
+        LogUtils.e(TAG + " addBigGroupFriends: index is" + bigchatRoomMemberIndex + " " + bigchatRoomMemberName.size());
 
         if (bigchatRoomMemberName.size() == getroomSize()) {
             nullNameCount = 0;
-            LogUtil.e(TAG, "addBigGroupFriends: back to chat room");
+            LogUtils.e(TAG + " addBigGroupFriends: back to chat room");
             mService.performGlobalAction(GLOBAL_ACTION_BACK);
             return;
         }
@@ -585,18 +584,18 @@ public class addGroupFunction implements moneyContract.View {
 
             if (name != null && name.getText() != null) {
                 bigchatRoomMemberName.add(name.getText().toString());
-                LogUtil.d("clickkkkk", "addBigGroupFriends: click " + name.getText());
+                LogUtils.d("clickkkkk : addBigGroupFriends: click " + name.getText());
             }
             else{
                 nullNameCount++;
-                LogUtil.d(TAG,"null name count is :"+nullNameCount);
+                LogUtils.d(TAG + " null name count is :"+nullNameCount);
             }
             AccessibilityHelper.performClick(child);
             bigchatRoomMemberIndex++;
         } else {
             //找下一个该点的
             gridView.performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
-            LogUtil.d("clickkkkk", "addBigGroupFriends: scrollllllllllllllll");
+            LogUtils.d("clickkkkk : addBigGroupFriends: scrollllllllllllllll");
             SystemClock.sleep(1000);
             size = gridView.getChildCount();
             for (int i = 0; i < size; i++) {
@@ -605,12 +604,11 @@ public class addGroupFunction implements moneyContract.View {
 
 
                 if (name != null && name.getText() != null && !bigchatRoomMemberName.contains(name.getText().toString())) {
-                    LogUtil.d("addGroupFunction,index:" + i + " node name:", name.getText().toString());
+                    LogUtils.d("addGroupFunction,index:" + i + " node name: " + name.getText().toString());
 //                    forceClick(node);
                     AccessibilityHelper.performClick(node);
 
-                    LogUtil.d("" +
-                            "clickkkkk", "addBigGroupFriends: click " + i + " " + name.getText());
+                    LogUtils.d( "clickkkkk : addBigGroupFriends: click " + i + " " + name.getText());
                     bigchatRoomMemberIndex = i + 1;
                     break;
                 }
@@ -636,12 +634,12 @@ public class addGroupFunction implements moneyContract.View {
         // findallchild(root);
         AccessibilityNodeInfo title = AccessibilityHelper.findNodeInfosById(root, bigGroupGriViewMemCount);
         if (title == null || title.getText() == null) {
-            LogUtil.e(TAG, "getroomSize: null");
+            LogUtils.e(TAG + " getroomSize: null");
             return 0;
         }
         String tit = title.getText().toString();
         tit = tit.substring(tit.indexOf("(") + 1, tit.length() - 1);
-        LogUtil.d(TAG, "getroomSize: title is" + tit);
+        LogUtils.d(TAG + " getroomSize: title is" + tit);
 
         return Integer.parseInt(tit)-nullNameCount;
     }
@@ -657,14 +655,14 @@ public class addGroupFunction implements moneyContract.View {
         List<AccessibilityNodeInfo> ci7List = root.findAccessibilityNodeInfosByViewId(chatRoomNewCi7List);    //所有的用户头像名称,嵌套在该LinearLayout里
 
         if (ci7List.size() == 0 || rootlist == null) {
-            LogUtil.d(TAG, "searchChatRoomMembersInfo: nulll");
+            LogUtils.d(TAG + " searchChatRoomMembersInfo: nulll");
             return;
         }
 
         //大群情况
         if (AccessibilityHelper.findNodeInfosByText(rootlist, "消息免打扰") == null && !finishOpenList) {//大群情况初始页面看不到”消息免打扰“
             rootlist.performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
-            LogUtil.e(TAG, "searchChatRoomMembersInfo: scrolllled");
+            LogUtils.e(TAG + " searchChatRoomMembersInfo: scrolllled");
             SystemClock.sleep(500);
             if (AccessibilityHelper.findNodeInfosByText(root, "查看全部群成员") != null) {
                 AccessibilityNodeInfo nodeInfo = AccessibilityHelper.findNodeInfosByText(root, "查看全部群成员");
@@ -674,7 +672,7 @@ public class addGroupFunction implements moneyContract.View {
             }
 
         } else {
-            LogUtil.e(TAG, "searchChatRoomMembersInfo: find 免打扰");
+            LogUtils.e(TAG + " searchChatRoomMembersInfo: find 免打扰");
             rootlist.performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);//增加下滑保证一定能找到
             SystemClock.sleep(1000);
 
@@ -684,7 +682,7 @@ public class addGroupFunction implements moneyContract.View {
         root = mService.getRootInActiveWindow();
         AccessibilityNodeInfo node1 = AccessibilityHelper.findNodeInfosByText(root, "消息免打扰");
         if (node1 != null) {
-            LogUtil.d(TAG, "searchChatRoomMembersInfo: node1 not null");
+            LogUtils.d(TAG + " searchChatRoomMembersInfo: node1 not null");
             root = node1.getParent().getParent();//“消息免打扰”嵌套在两个linearlayout里面,此时root和开关view同根
         }
 
@@ -734,7 +732,7 @@ public class addGroupFunction implements moneyContract.View {
     private void getTheRobotInfo(AccessibilityEvent event) {
         String senderName = AutoReplyService.msgSenderName;
         if (senderName == null) {
-            LogUtil.e(TAG, "getTheRobotInfo: wtf!!!!");
+            LogUtils.e(TAG + " getTheRobotInfo: wtf!!!!");
             return;
         }
 
@@ -746,7 +744,7 @@ public class addGroupFunction implements moneyContract.View {
 
             AccessibilityNodeInfo root = mService.getRootInActiveWindow();
             List<AccessibilityNodeInfo> memList = root.findAccessibilityNodeInfosByViewId(chatListMem);
-            LogUtil.d(TAG, "getTheRobotInfo: the memlist size is" + memList.size());
+            LogUtils.d(TAG + " getTheRobotInfo: the memlist size is" + memList.size());
             for (int i = 0; i < memList.size(); i++) {
                 AccessibilityNodeInfo node = memList.get(i);
                 if (node != null && !node.getContentDescription().toString().contains(AutoReplyService.msgSenderName)) {
@@ -777,7 +775,7 @@ public class addGroupFunction implements moneyContract.View {
                 AccessibilityHelper.performClick(addTocContract);
                 return;
             } else {
-                LogUtil.e(TAG, "getTheRobotInfo: name id is null");
+                LogUtils.e(TAG + " getTheRobotInfo: name id is null");
             }
 
             mService.performGlobalAction(GLOBAL_ACTION_BACK);
@@ -793,7 +791,7 @@ public class addGroupFunction implements moneyContract.View {
         AccessibilityNodeInfo target = null;
         target = AccessibilityHelper.findNodeInfosById(nodeInfo, threePointInLanucher);
         if (target != null) {
-            LogUtil.e(TAG, "openMemberList: three pointertarget is not null");
+            LogUtils.e(TAG + " openMemberList: three pointertarget is not null");
             //target.performAction(AccessibilityNodeInfo.ACTION_CLICK);
             AccessibilityHelper.forceClick(target);
         } else {
@@ -833,13 +831,13 @@ public class addGroupFunction implements moneyContract.View {
                 if (child != null && child.getText() != null) {
                     String text = child.getText().toString();
                     if (text.matches("[0-9]+人")) {
-                        LogUtil.e(TAG, "isNumLegal: matches");
+                        LogUtils.e(TAG + " isNumLegal: matches");
                         String people = text.substring(0, text.length() - 1);
                         int num = Integer.parseInt(people);
-                        LogUtil.e(TAG, "isNumLegal: num is" + num);
+                        LogUtils.e(TAG + " isNumLegal: num is" + num);
                         if (num < 100) {
                             isGroupNumLegal = false;
-                            LogUtil.e(TAG, "isNumLegal: 不合法");
+                            LogUtils.e(TAG + " isNumLegal: 不合法");
                             return;
                         }
                     }
@@ -860,7 +858,7 @@ public class addGroupFunction implements moneyContract.View {
                 AccessibilityNodeInfo child = root.getChild(i);
                 // LogUtil.d(TAG, "findallchild: " + child.getContentDescription() + " " + child.getClassName() + " " + child.getViewIdResourceName() + " " + child.getText());
                 if (child.getText() != null && child.getText().toString().equals("加入群聊")) {
-                    LogUtil.d(TAG, "findchild: find child!!!!!");
+                    LogUtils.d(TAG + " findchild: find child!!!!!");
                     findChild = child;
                     return;
                 }
@@ -876,7 +874,7 @@ public class addGroupFunction implements moneyContract.View {
     private void forceClick(AccessibilityNodeInfo nodeInfo) {
         Rect rect = new Rect();
         nodeInfo.getBoundsInScreen(rect);
-        LogUtil.d(TAG, "forceClick: " + rect.left + " " + rect.top + " " + rect.right + " " + rect.bottom);
+        LogUtils.d(TAG + " forceClick: " + rect.left + " " + rect.top + " " + rect.right + " " + rect.bottom);
         int x = (rect.left + rect.right) / 2;
         int y = (rect.top + rect.bottom) / 2;
         String cmd = "input tap " + String.valueOf(x) + " " + String.valueOf(y);
@@ -918,7 +916,7 @@ public class addGroupFunction implements moneyContract.View {
         for (int i = 0; i < count; i++) {
             AccessibilityNodeInfo nodeInfo = rootNode.getChild(i);
             if (nodeInfo == null) {
-                LogUtil.d("maptrix", "nodeinfo = null");
+                LogUtils.d("maptrix : nodeinfo = null");
                 continue;
             }
 
@@ -926,7 +924,7 @@ public class addGroupFunction implements moneyContract.View {
             //  android.util.LogUtil.e("maptrix", "ds=" + nodeInfo.getContentDescription());
 
             if ("android.widget.EditText".equals(nodeInfo.getClassName())) {
-                LogUtil.i("maptrix", "find edit text");
+                LogUtils.i("maptrix : find edit text");
 
                 Bundle arguments = new Bundle();
                 arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT,
@@ -968,7 +966,7 @@ public class addGroupFunction implements moneyContract.View {
                 for (AccessibilityNodeInfo n : list) {
                     //n.performAction(AccessibilityNodeInfo.ACTION_CLICK);
                     AccessibilityHelper.performClick(n);
-                    LogUtil.d(TAG, "send: 1");
+                    LogUtils.d(TAG + " send: 1");
                 }
 
             } else {

+ 16 - 17
app/src/main/java/com/wiipu/marketingrobot/function/handleChatFunction.java

@@ -16,7 +16,6 @@ import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityNodeInfo;
 
 import com.wiipu.marketingrobot.AutoReplyService;
-import com.wiipu.marketingrobot.LogUtil;
 import com.wiipu.marketingrobot.contract.replyContract;
 import com.wiipu.marketingrobot.presenter.replyPresenter;
 import com.wiipu.marketingrobot.response.replyResponse;
@@ -48,7 +47,7 @@ public class handleChatFunction implements replyContract.View {
     private boolean isFirstReadGroupMem = true;//第一次进小群标志位
     private boolean finishAllJob = false;//用于回退时陷入死循环的flag
     private boolean isInGroupChatAction = false;//用于区分小群聊和单聊
-    private List<AccessibilityNodeInfo> nodeList = new ArrayList<>();//对于小群人员,所有的人员node放一起
+    private List<AccessibilityNodeInfo> nodeList = new ArrayList<>();//对于小群人员,所有的人员node放一起
     private replyPresenter mReplyPresenter;
     private String groupName = null;
     private String reply;
@@ -60,7 +59,7 @@ public class handleChatFunction implements replyContract.View {
     private static final String TAG = "handleChatFunction";
     private OutputStream os;
     private SharedPreferences pref;
-    private static final String threePointInLanucher = "com.tencent.mm:id/jr";
+    private static final String threePointInLauncher = "com.tencent.mm:id/jr";
     private static final String chatRoomNewCi7List = "com.tencent.mm:id/d4l";//新的ci7list
     private static final String chatListMem = "com.tencent.mm:id/nj";//聊天列表头像的id
     private static final String chatNameInLeftUp = "com.tencent.mm:id/jw";//聊天界面左上角的微信名
@@ -88,7 +87,7 @@ public class handleChatFunction implements replyContract.View {
          */
         if (replyResponse.getCode().equals("104")
                 && replyResponse.getMsg().equals("\u67e5\u8be2\u9519\u8bef\uff0c\u8be5\u7528\u6237\u4e0d\u5b58\u5728")) {
-            Log.d(TAG, "showReply: " + senderName + " " + mmNum + " " + pref.getString(savedRobotName, null) + " " + pref.getString(savedRobotNum, null));
+            LogUtils.d(TAG + " showReply: " + senderName + " " + mmNum + " " + pref.getString(savedRobotName, null) + " " + pref.getString(savedRobotNum, null));
             mReplyPresenter.upLoadFriends(senderName, mmNum, pref.getString(savedRobotName, null), pref.getString(savedRobotNum, null));
             return;
         }
@@ -154,7 +153,7 @@ public class handleChatFunction implements replyContract.View {
     public void handleChat(AccessibilityEvent event, String content) {
         senderContent = content;
         AutoReplyService.isInAction = true;
-        Log.e(TAG, "handleChat: " + pref.getString(savedRobotName, null) + pref.getString(savedRobotNum, null));
+        LogUtils.d(TAG + " handleChat: " + pref.getString(savedRobotName, null) + pref.getString(savedRobotNum, null));
         if (pref.getString(savedRobotName, null) == null || pref.getString(savedRobotNum, null) == null) {
             getTheRobotInfo(event);
             return;
@@ -177,12 +176,12 @@ public class handleChatFunction implements replyContract.View {
                 return;
             }
 
-            Log.e(TAG, "handleChat: 1" + mmNum);
+            LogUtils.e(TAG + " handleChat: 1" + mmNum);
             if (mmNum == null) {
                 getTheMMnum(event);
                 return;
             }
-            Log.e(TAG, "handleChat: 2");
+            LogUtils.e(TAG + " handleChat: 2");
 
             mReplyPresenter.loadReply(content, mmNum, pref.getString(savedRobotNum, null));
 
@@ -192,7 +191,7 @@ public class handleChatFunction implements replyContract.View {
             AccessibilityNodeInfo root = mService.getRootInActiveWindow();
             AccessibilityNodeInfo ci7List = AccessibilityHelper.findNodeInfosById(root, chatRoomNewCi7List);
             if (ci7List == null) {
-                Log.e(TAG, "addFriend: ci7 is null");
+                LogUtils.e(TAG + " addFriend: ci7 is null");
                 return;
             }
 
@@ -231,7 +230,7 @@ public class handleChatFunction implements replyContract.View {
             AccessibilityNodeInfo mmId = AccessibilityHelper.findNodeInfosByText(root, "微信号");
             String id = mmId.getText().toString();
             id = id.substring(id.indexOf(":") + 2, id.length()).trim();
-            Log.d(TAG, "addFriend: the mmid is " + id);
+            LogUtils.d(TAG + " addFriend: the mmid is " + id);
             mmNum = id;
             hasGetmmId = true;
             mService.performGlobalAction(GLOBAL_ACTION_BACK);
@@ -277,7 +276,7 @@ public class handleChatFunction implements replyContract.View {
         AccessibilityNodeInfo root = mService.getRootInActiveWindow();
         AccessibilityNodeInfo chatListNode = AccessibilityHelper.findNodeInfosById(root, "com.tencent.mm:id/akn");
         if (chatListNode == null) {
-            Log.e(TAG, "getRealContent: chat list node is null");
+            LogUtils.e(TAG + " getRealContent: chat list node is null");
             return null;
         }
 
@@ -286,12 +285,12 @@ public class handleChatFunction implements replyContract.View {
 
         AccessibilityNodeInfo textNode = AccessibilityHelper.findNodeInfosById(lastChild, "com.tencent.mm:id/nl");
         if (textNode == null) {
-            Log.e(TAG, "getRealContent: text node is null");
+            LogUtils.e(TAG + " getRealContent: text node is null");
             return null;
         }
         findallchild(chatListNode);
 
-        Log.e(TAG, "getRealContent: content is" + textNode.getContentDescription());
+        LogUtils.e(TAG + " getRealContent: content is" + textNode.getContentDescription());
 
         if (textNode.getText() != null) {
             return textNode.getText().toString();
@@ -336,7 +335,7 @@ public class handleChatFunction implements replyContract.View {
     private void getTheRobotInfo(AccessibilityEvent event) {
         String senderName = AutoReplyService.msgSenderName;
         if (senderName == null) {
-            Log.e(TAG, "getTheRobotInfo: wtf!!!!");
+            LogUtils.e(TAG + " getTheRobotInfo: wtf!!!!");
             return;
         }
 
@@ -390,7 +389,7 @@ public class handleChatFunction implements replyContract.View {
 
     private void getTheMMnum(AccessibilityEvent event) {
         AccessibilityNodeInfo root = mService.getRootInActiveWindow();
-        AccessibilityNodeInfo target = AccessibilityHelper.findNodeInfosById(root, threePointInLanucher);
+        AccessibilityNodeInfo target = AccessibilityHelper.findNodeInfosById(root, threePointInLauncher);
         if (target != null) {
             Log.e(TAG, "openMemberList: not nulllll");
             //target.performAction(AccessibilityNodeInfo.ACTION_CLICK);
@@ -477,7 +476,7 @@ public class handleChatFunction implements replyContract.View {
      */
     private void openMemberList() {
         AccessibilityNodeInfo nodeInfo = mService.getRootInActiveWindow();
-        AccessibilityNodeInfo target = AccessibilityHelper.findNodeInfosById(nodeInfo, threePointInLanucher);
+        AccessibilityNodeInfo target = AccessibilityHelper.findNodeInfosById(nodeInfo, threePointInLauncher);
 
         if (target != null) {
             Log.e(TAG, "openMemberList: not nulllll");
@@ -523,7 +522,7 @@ public class handleChatFunction implements replyContract.View {
         for (int i = 0; i < count; i++) {
             AccessibilityNodeInfo nodeInfo = rootNode.getChild(i);
             if (nodeInfo == null) {
-                LogUtil.d("maptrix", "nodeinfo = null");
+                LogUtils.d("maptrix : nodeinfo = null");
                 continue;
             }
 
@@ -531,7 +530,7 @@ public class handleChatFunction implements replyContract.View {
             //  LogUtil.e("maptrix", "ds=" + nodeInfo.getContentDescription());
 
             if ("android.widget.EditText".equals(nodeInfo.getClassName())) {
-                LogUtil.i("maptrix", "find edit text");
+                LogUtils.i("maptrix : find edit text");
 
                 Bundle arguments = new Bundle();
                 arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT,

+ 3 - 3
app/src/main/java/com/wiipu/marketingrobot/presenter/enableAddFriendPresenter.java

@@ -21,16 +21,16 @@ public class enableAddFriendPresenter extends BasePresenter<enableAddFriendContr
     }
 
     @Override
-    public void getEnableAddFriend(String rabotNum) {
+    public void getEnableAddFriend(String robotNum) {
         String method = "user_status";
         Subscription subscription = HttpClient.getInstance()
                 .create(replyService.class)
-                .getEnableAddFriendResponse(method, rabotNum)
+                .getEnableAddFriendResponse(method, robotNum)
                 .compose(RxTransformer.<enableAddFriendResponse>apply())
                 .subscribe(new Action1<enableAddFriendResponse>() {
                     @Override
                     public void call(enableAddFriendResponse enableAddFriendResponse) {
-                        mView.showEnabeAddFriendReply(enableAddFriendResponse);
+                        mView.showEnableAddFriendReply(enableAddFriendResponse);
                     }
                 }, new Action1<Throwable>() {
                     @Override

+ 2 - 2
app/src/main/java/com/wiipu/marketingrobot/presenter/moneyPresenter.java

@@ -21,11 +21,11 @@ public class moneyPresenter extends BasePresenter<moneyContract.View> implements
     }
 
     @Override
-    public void loadMoneyReply(String no, String money,String rabotNum) {
+    public void loadMoneyReply(String no, String money,String robotNum) {
         String act = "user_recharge";
         Subscription subscription = HttpClient.getInstance()
                 .create(replyService.class)
-                .getMoneyResponse(act, no, rabotNum,money)
+                .getMoneyResponse(act, no, robotNum,money)
                 .compose(RxTransformer.<moneyResponse>apply())
                 .subscribe(new Action1<moneyResponse>() {
                     @Override

+ 6 - 6
app/src/main/java/com/wiipu/marketingrobot/presenter/replyPresenter.java

@@ -25,7 +25,7 @@ public class replyPresenter extends BasePresenter<replyContract.View> implements
     }
 
     @Override
-    public void loadReply(String content, String mmNum, String rabotNum) {
+    public void loadReply(String content, String mmNum, String robotNum) {
 
         String method = "user_question";
         // long timestamp  = System.currentTimeMillis();
@@ -33,7 +33,7 @@ public class replyPresenter extends BasePresenter<replyContract.View> implements
         Subscription subscription = HttpClient.getInstance()
                 .create(replyService.class)
                 // .getResponse(method, "2", "test2")
-                .getResponse(method, content, mmNum, rabotNum)
+                .getResponse(method, content, mmNum, robotNum)
                 .compose(RxTransformer.<replyResponse>apply())
                 .subscribe(new Action1<replyResponse>() {
                     @Override
@@ -53,24 +53,24 @@ public class replyPresenter extends BasePresenter<replyContract.View> implements
     }
 
     @Override
-    public void upLoadFriends(String mmName, String mmNum,String rabotName,String rabotNum) {
+    public void upLoadFriends(String mmName, String mmNum, String robotName, String robotNum) {
         Log.d("presenter", "upLoadFriends: ");
         String method = "user_add";
         Subscription subscription = HttpClient.getInstance()
                 .create(replyService.class)
-                .getUploadFriendResponse(method, rabotName, rabotNum, mmName, mmNum)
+                .getUploadFriendResponse(method, robotName, robotNum, mmName, mmNum)
                 .compose(RxTransformer.<uploadFriendResponse>apply())
                 .subscribe(new Action1<uploadFriendResponse>() {
                     @Override
                     public void call(uploadFriendResponse uploadFriendResponse) {
-                        LogUtils.d("successs");
+                        LogUtils.d("success");
                         mView.showUploadFriendReply(uploadFriendResponse);
 
                     }
                 }, new Action1<Throwable>() {
                     @Override
                     public void call(Throwable throwable) {
-                        LogUtils.e("faillll");
+                        LogUtils.e(throwable.getMessage());
                         mView.showError(throwable.getMessage());
                     }
                 });

+ 1 - 1
app/src/main/java/com/wiipu/marketingrobot/service/replyService.java

@@ -61,7 +61,7 @@ public interface replyService {
 
     /**
      *
-     *拉群后上传结果
+     * 拉群后上传结果
      * */
     @POST("api.php")
     @FormUrlEncoded

+ 2 - 36
netlib/src/main/java/com/wiipu/netlib/net/HttpClient.java

@@ -9,26 +9,16 @@ import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
 import retrofit2.converter.gson.GsonConverterFactory;
 
 /**
- * Description: retrofit 初始化,mock data
+ * Description: retrofit 初始化
  */
 
 public class HttpClient {
 
-    /*
-     * 网页版测试环境
-     */
-    public static final String BASE_NET_URL = "http://minxin.xazhima.com/";
-
-    /*
-     * 网页版线上环境
-     */
-//    public static final String BASE_NET_URL = "http://www.rcmxw.com/";
 
     /*
      * 测试环境
      */
-   // public static final String BASE_URL = "http://alar.goobucks.com/api/v1.0/";
-    public static final String BASE_URL ="http://47.96.24.215/stock_rabot_admin/api/v1.0/";
+    public static final String BASE_URL ="http://47.96.24.215/market_rabot/api/v1.0/";
 
     /*
      * 线上环境
@@ -36,13 +26,9 @@ public class HttpClient {
 //    public static final String BASE_URL = "http://www.xayuanju.com/api/v1.0/";
 
 
-
-
     private static volatile HttpClient mHttpClientInstance;
 
     private Retrofit retrofit;
-    private Retrofit mockRetrofit;
-    private Retrofit verifyRetrofit; //自带验证的客户端
 
     private HttpClient(){}
 
@@ -55,13 +41,6 @@ public class HttpClient {
                     OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder()
                             .addInterceptor(new LoggingInterceptor());
 
-                    /*
-                     * 带安全签名的网络请求封装
-                     */
-                    OkHttpClient.Builder verifyBuilder = new OkHttpClient.Builder()
-                            .addInterceptor(new LoggingInterceptor())
-                            .addInterceptor(new VerifyInterceptor());
-
                     Gson gson = new GsonBuilder()
                             .setLenient()
                             .create();
@@ -73,8 +52,6 @@ public class HttpClient {
                             .addConverterFactory(GsonConverterFactory.create(gson))
                             .build();
 
-
-
                 }
             }
         }
@@ -89,16 +66,5 @@ public class HttpClient {
         return retrofit.create(service);
     }
 
-    public <T> T createMock(final Class<T> service){
-        return mockRetrofit.create(service);
-    }
-
-
-    /*
-    * 自带验证的接口客户端
-    */
-    public <T> T createVerify(final Class<T> service){
-        return verifyRetrofit.create(service);
-    }
 
 }

+ 3 - 3
netlib/src/main/java/com/wiipu/netlib/net/LoggingInterceptor.java

@@ -27,7 +27,7 @@ public class LoggingInterceptor implements Interceptor{
         Request request = chain.request();
 
         long t1 = System.nanoTime();
-        Log.i(TAG, String.format("Sending request %s ",
+        LogUtils.i(TAG + String.format("Sending request %s ",
                 request.url() + " ; request body  %s " + request.body()));
         if (request.body() instanceof FormBody) {
             StringBuilder stringBuilder = new StringBuilder();
@@ -37,13 +37,13 @@ public class LoggingInterceptor implements Interceptor{
                     stringBuilder.append(formBody.encodedName(i) + "=" + formBody.encodedValue(i)+", ");
                 }
                 stringBuilder.delete(stringBuilder.length() - 1, stringBuilder.length());
-                LogUtils.i("RequestParams: " + stringBuilder.toString());
+                LogUtils.i("请求参数 : " + stringBuilder.toString());
             }
 
         }
 
         Response response = chain.proceed(request);
-        Log.i(TAG, "intercept: "+response.code());
+        Log.i(TAG, "intercept: " + response.code());
 
         //if(BuildConfig.DEBUG){
             //print response;