导航菜单

页面标题

页面副标题

微商客 v2.1.2 - CollectSendActivity.java 源代码

正在查看: 微商客 v2.1.2 应用的 CollectSendActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.jianzhen.wsk.ui.groupsend;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.view.accessibility.AccessibilityNodeInfo;
import com.alibaba.fastjson.JSON;
import com.auxiliary.library.core.NodeExecutor;
import com.auxiliary.library.node.SelectNode;
import com.auxiliary.library.node.ViewNode;
import com.auxiliary.library.node.WhileNode;
import com.auxiliary.library.node.base.INode;
import com.auxiliary.library.node.base.PageNode;
import com.auxiliary.library.service.AuxiliaryService;
import com.auxiliary.library.service.IAccessibility;
import com.auxiliary.library.widget.ExecutorWindow;
import com.jianzhen.wsk.BaseActivity;
import com.jianzhen.wsk.R;
import com.jianzhen.wsk.bean.CollectSendAllFriendData;
import com.jianzhen.wsk.bean.FriendData;
import com.jianzhen.wsk.bean.GroupListData;
import com.jianzhen.wsk.bean.GroupSendData;
import com.jianzhen.wsk.bean.NameList;
import com.jianzhen.wsk.bean.SendTagListData;
import com.jianzhen.wsk.bean.TagAndGroupBean;
import com.jianzhen.wsk.bean.TransmitWithGroupBean;
import com.jianzhen.wsk.bean.TransmitWithTagBean;
import com.jianzhen.wsk.dialog.BaseDialog;
import com.jianzhen.wsk.dialog.BusinessCardDialog;
import com.jianzhen.wsk.dialog.GetAllGroupDataDialog;
import com.jianzhen.wsk.net.api.Constant;
import com.jianzhen.wsk.utils.DataSaveUtils;
import com.jianzhen.wsk.utils.ScriptLoadUtil;
import com.jianzhen.wsk.utils.SharedPreferencesUtil;
import com.jianzhen.wsk.utils.Utils;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;

public class CollectSendActivity extends MessageSendActivity implements View.OnClickListener, NodeExecutor.StatusCallback {
    private GroupSendData argsData;
    private List<String> groupList;
    private GroupSendData singleSendData;
    private int tagFriendAgainNum;
    private int sendGroupNum = 0;
    private boolean tsModel = false;
    private final Handler handlerPost = new Handler(Looper.getMainLooper());
    private int selectAllIndex = -1;
    private String myWxName = "";
    private List<String> getGroupTemporaryData = new ArrayList();
    private int addNum = 0;
    private boolean isAgainSend = false;
    public List<GroupListData> groupAgainList = new ArrayList();
    private List<NameList> sendAllFriendAgainData = new ArrayList();
    private List<NameList> sendSelectFriendAgainData = new ArrayList();
    private int partGroupSendNum = 0;

    public void onFail(NodeExecutor nodeExecutor, Throwable th) {
    }

    public void onPause(NodeExecutor nodeExecutor) {
    }

    public void onResume(NodeExecutor nodeExecutor) {
    }

    public static void startActivity(Activity activity, String str) {
        Intent intent = new Intent(activity, (Class<?>) CollectSendActivity.class);
        intent.putExtra("funcId", str);
        activity.startActivity(intent);
    }

    @Override
    protected void initView() {
        this.tsModel = SharedPreferencesUtil.getBoolean(this, "TS_DEVICE_MODEL", false);
        findViewById(R.id.send_ok).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (CollectSendActivity.this.isSelectObject == 200) {
                    List<TagAndGroupBean> partGroupListData = DataSaveUtils.getPartGroupListData(CollectSendActivity.this);
                    if (partGroupListData == null) {
                        new GetAllGroupDataDialog(CollectSendActivity.this).show();
                        return;
                    } else if (partGroupListData.size() <= 0) {
                        new GetAllGroupDataDialog(CollectSendActivity.this).show();
                        return;
                    }
                }
                if (CollectSendActivity.this.sendObjectTv.getText().toString().equals("请选择")) {
                    BaseActivity.showCenterToast("请选择群发对象!");
                    return;
                }
                if (CollectSendActivity.this.isSelectObject == 200 || CollectSendActivity.this.isSelectObject == 201) {
                    if (CollectSendActivity.this.groupPartSendData == null || CollectSendActivity.this.groupPartSendData.getGroup_list() == null || CollectSendActivity.this.groupPartSendData.getGroup_list().isEmpty()) {
                        BaseActivity.showCenterToast("请先选择群!");
                        return;
                    }
                } else if (CollectSendActivity.this.isSelectObject == 202 && (CollectSendActivity.this.groupSendData == null || CollectSendActivity.this.groupSendData.getGroup_list() == null || CollectSendActivity.this.groupSendData.getGroup_list().isEmpty())) {
                    BaseActivity.showCenterToast("请先选择群!");
                    return;
                }
                if (CollectSendActivity.this.funcId.equals("10005") && CollectSendActivity.this.businessCardStr.isEmpty()) {
                    new BusinessCardDialog(CollectSendActivity.this) {
                        @Override
                        protected void okData(String str) {
                            super.okData(str);
                            CollectSendActivity.this.titleTv.setText(str);
                            CollectSendActivity.this.businessCardStr = str;
                            CollectSendActivity.this.getFuncLimit(CollectSendActivity.this.funcId);
                        }
                    }.show();
                } else {
                    CollectSendActivity collectSendActivity = CollectSendActivity.this;
                    collectSendActivity.getFuncLimit(collectSendActivity.funcId);
                }
            }
        });
        this.groupAgainList = getSearchGroupHis();
        this.sendAllFriendAgainData = getFriendHis("all");
        this.sendSelectFriendAgainData = getFriendHis("select");
    }

    @Override
    public void lambda$setNotYearVipTip$7() {
        super.lambda$setNotYearVipTip$7();
        if (isSendImg()) {
            saveImg();
        }
        this.handlerPost.post(new Runnable() {
            @Override
            public final void run() {
                CollectSendActivity.this.lambda$SendWxStart$0();
            }
        });
    }

    public void lambda$SendWxStart$0() {
        if (this.isSelectObject == 100 || this.isSelectObject == 102) {
            List<NameList> list = this.sendAllFriendAgainData;
            if (list != null && !list.isEmpty()) {
                setAgainDialog();
                return;
            } else {
                start();
                return;
            }
        }
        if (this.isSelectObject == 101) {
            List<NameList> list2 = this.sendSelectFriendAgainData;
            if (list2 != null && !list2.isEmpty()) {
                setAgainDialog();
                return;
            } else {
                start();
                return;
            }
        }
        if (this.isSelectObject == 200 || this.isSelectObject == 201 || this.isSelectObject == 202) {
            List<GroupListData> list3 = this.groupAgainList;
            if (list3 != null && !list3.isEmpty()) {
                setAgainDialog();
            } else {
                start();
            }
        }
    }

    private void sendAllFriendOrNotSendFriend2() {
        try {
            this.mExecutorWindow = ScriptLoadUtil.loadWx(AuxiliaryService.getAccessibility(), this.funcId, sendAllFileAddress());
            this.mExecutorWindow.showFloatWindow();
            this.mExecutorWindow.setProgress();
            String edText = getEdText();
            CollectSendAllFriendData collectSendAllFriendData = new CollectSendAllFriendData();
            collectSendAllFriendData.setSendAllFriendList(setSendAllFriendData(edText, this.sendTime));
            collectSendAllFriendData.setWxName(this.businessCardStr);
            this.mExecutorWindow.setArgs(collectSendAllFriendData);
            if (this.isAgainSend) {
                Iterator<NameList> it = this.sendAllFriendAgainData.iterator();
                while (it.hasNext()) {
                    this.notSendData.add(new NameList(it.next().nameText));
                }
            }
            this.mExecutorWindow.setIFilter(new NodeExecutor.IFilter() {
                public final List onFilter(NodeExecutor nodeExecutor, INode iNode, List list, Object obj) {
                    List lambda$sendAllFriendOrNotSendFriend2$1;
                    lambda$sendAllFriendOrNotSendFriend2$1 = CollectSendActivity.this.lambda$sendAllFriendOrNotSendFriend2$1(nodeExecutor, iNode, list, obj);
                    return lambda$sendAllFriendOrNotSendFriend2$1;
                }
            });
            this.mExecutorWindow.setCallback(new SendCallback(this, this.mExecutorWindow));
            this.mExecutorWindow.addStatusCallback(this);
            this.mExecutorWindow.setIProgress(new NodeExecutor.IProgress() {
                public final boolean onProgress(IAccessibility iAccessibility, INode iNode, Object[] objArr, int i, NodeExecutor nodeExecutor) {
                    boolean lambda$sendAllFriendOrNotSendFriend2$2;
                    lambda$sendAllFriendOrNotSendFriend2$2 = CollectSendActivity.this.lambda$sendAllFriendOrNotSendFriend2$2(iAccessibility, iNode, objArr, i, nodeExecutor);
                    return lambda$sendAllFriendOrNotSendFriend2$2;
                }
            });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public List lambda$sendAllFriendOrNotSendFriend2$1(NodeExecutor nodeExecutor, INode iNode, List list, Object obj) {
        ArrayList arrayList = new ArrayList(list);
        if (this.notSendData != null && !this.notSendData.isEmpty()) {
            for (NameList nameList : this.notSendData) {
                Iterator it = list.iterator();
                while (true) {
                    if (!it.hasNext()) {
                        break;
                    }
                    AccessibilityNodeInfo accessibilityNodeInfo = (AccessibilityNodeInfo) it.next();
                    if (accessibilityNodeInfo != null && accessibilityNodeInfo.getText() != null && nameList.nameText.equals(accessibilityNodeInfo.getText().toString())) {
                        arrayList.remove(accessibilityNodeInfo);
                        break;
                    }
                }
            }
        }
        return arrayList;
    }

    public boolean lambda$sendAllFriendOrNotSendFriend2$2(IAccessibility iAccessibility, INode iNode, Object[] objArr, int i, NodeExecutor nodeExecutor) {
        this.selectAllIndex = i;
        return true;
    }

    private List<CollectSendAllFriendData.SendAllFriendList> setSendAllFriendData(String str, String str2) {
        ArrayList arrayList = new ArrayList();
        ArrayList arrayList2 = new ArrayList();
        ArrayList arrayList3 = new ArrayList();
        arrayList2.add(0);
        int i = 0;
        while (i < 19991) {
            i += 9;
            arrayList2.add(Integer.valueOf(i));
        }
        int i2 = 9;
        arrayList3.add(9);
        while (i2 < 19999) {
            i2 += 9;
            arrayList3.add(Integer.valueOf(i2));
        }
        if (!this.isVipOrFree) {
            arrayList.add(new CollectSendAllFriendData.SendAllFriendList(false, false, str, 0, 2, this.sendTime));
        } else {
            for (int i3 = 0; i3 < arrayList2.size(); i3++) {
                arrayList.add(new CollectSendAllFriendData.SendAllFriendList(false, false, str, ((Integer) arrayList2.get(i3)).intValue(), ((Integer) arrayList3.get(i3)).intValue(), this.sendTime));
            }
        }
        return arrayList;
    }

    private void sendSelectTagFriend() {
        if (this.sendTagListData1 == null || this.sendTagListData1.getTag_list() == null || this.sendTagListData1.getTag_list().size() <= 0) {
            showCenterToast("未选择标签!");
            return;
        }
        if (!this.isVipOrFree && this.sendTagListData1.getTag_list().size() > Constant.sendMessageNum) {
            this.sendTagListData1.setTag_list(this.sendTagListData1.getTag_list().subList(0, Constant.sendMessageNum));
        }
        String edText = getEdText();
        TransmitWithTagBean transmitWithTagBean = new TransmitWithTagBean();
        ArrayList arrayList = new ArrayList();
        if (this.isAgainSend) {
            final ArrayList arrayList2 = new ArrayList();
            Iterator<NameList> it = this.sendSelectFriendAgainData.iterator();
            while (it.hasNext()) {
                arrayList2.add(it.next().nameText);
            }
            Iterator<SendTagListData.FriendTagList> it2 = this.sendTagListData1.getTag_list().iterator();
            while (it2.hasNext()) {
                it2.next().getFriend_list().removeIf(new Predicate() {
                    @Override
                    public final boolean test(Object obj) {
                        boolean contains;
                        contains = arrayList2.contains(((FriendData) obj).nameStr);
                        return contains;
                    }
                });
            }
        }
        for (SendTagListData.FriendTagList friendTagList : this.sendTagListData1.getTag_list()) {
            int i = 0;
            while (i < friendTagList.getFriend_list().size()) {
                int i2 = i + 9;
                List<FriendData> subList = friendTagList.getFriend_list().subList(i, Math.min(i2, friendTagList.getFriend_list().size()));
                TransmitWithTagBean.TransmitTagData transmitTagData = new TransmitWithTagBean.TransmitTagData();
                transmitTagData.setFriend_list(subList);
                transmitTagData.setTag_name(friendTagList.tag_name);
                transmitTagData.setSend_text(edText);
                transmitTagData.setSend_time(this.sendTime);
                if (this.funcId.equals("10007")) {
                    transmitTagData.setOfficial(true);
                }
                arrayList.add(transmitTagData);
                i = i2;
            }
        }
        transmitWithTagBean.setTransmitTagData(arrayList);
        this.tagFriendAgainNum = arrayList.size();
        try {
            this.mExecutorWindow = ScriptLoadUtil.loadWx(AuxiliaryService.getAccessibility(), this.funcId, sendSelectTagFileAddress());
            transmitWithTagBean.setWx_name(this.businessCardStr);
            this.mExecutorWindow.setArgs(transmitWithTagBean);
            this.mExecutorWindow.showFloatWindow();
            this.mExecutorWindow.setProgress();
            this.mExecutorWindow.addStatusCallback(this);
            this.mExecutorWindow.setCallback(new SendCallback(this, this.mExecutorWindow));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private TransmitWithGroupBean transmitWithGroupBean(GroupSendData groupSendData, String str) {
        TransmitWithGroupBean transmitWithGroupBean = new TransmitWithGroupBean();
        ArrayList arrayList = new ArrayList();
        int i = 0;
        while (i < groupSendData.getGroup_list().size()) {
            int i2 = i + 9;
            List<GroupListData> subList = groupSendData.getGroup_list().subList(i, Math.min(i2, groupSendData.getGroup_list().size()));
            GroupSendData groupSendData2 = new GroupSendData();
            groupSendData2.setGroup_list(subList);
            groupSendData2.setSend_text(str);
            groupSendData2.setSend_time(this.sendTime);
            if (this.funcId.equals("10007")) {
                groupSendData2.setOfficial(true);
            }
            arrayList.add(groupSendData2);
            i = i2;
        }
        transmitWithGroupBean.setWx_name(this.businessCardStr);
        transmitWithGroupBean.setGroupSendData(arrayList);
        return transmitWithGroupBean;
    }

    private void sendToGroup() {
        String edText = getEdText();
        this.argsData = new GroupSendData();
        GroupSendData groupSendData = new GroupSendData();
        if (this.isSelectObject == 200 || this.isSelectObject == 201) {
            groupSendData = cleanDataEllipsis(this.groupPartSendData);
        } else if (this.isSelectObject == 202) {
            groupSendData = this.groupSendData;
        }
        if (groupSendData == null || groupSendData.getGroup_list() == null || groupSendData.getGroup_list().size() <= 0) {
            showCenterToast("未选择群!");
            return;
        }
        for (GroupListData groupListData : groupSendData.getGroup_list()) {
            groupListData.setSend_group(groupListData.send_group.trim());
        }
        this.argsData = new GroupSendData(groupSendData.getGroup_list());
        List<GroupListData> list = this.groupAgainList;
        if (list != null && !list.isEmpty() && this.isAgainSend) {
            this.argsData.setGroup_list(new ArrayList(this.groupAgainList));
        }
        try {
            this.mExecutorWindow = ScriptLoadUtil.loadWx(AuxiliaryService.getAccessibility(), this.funcId, sendGroupFileAddress());
            this.mExecutorWindow.addStatusCallback(this);
            this.mExecutorWindow.showFloatWindow();
            this.mExecutorWindow.setProgress();
            this.mExecutorWindow.setIProgress(new NodeExecutor.IProgress() {
                public final boolean onProgress(IAccessibility iAccessibility, INode iNode, Object[] objArr, int i, NodeExecutor nodeExecutor) {
                    return CollectSendActivity.lambda$sendToGroup$4(iAccessibility, iNode, objArr, i, nodeExecutor);
                }
            });
            this.groupList = new ArrayList();
            Iterator<GroupListData> it = this.argsData.getGroup_list().iterator();
            while (it.hasNext()) {
                this.groupList.add(it.next().send_group);
            }
            this.mExecutorWindow.setIFilter(new NodeExecutor.IFilter() {
                public final List onFilter(NodeExecutor nodeExecutor, INode iNode, List list2, Object obj) {
                    List lambda$sendToGroup$5;
                    lambda$sendToGroup$5 = CollectSendActivity.this.lambda$sendToGroup$5(nodeExecutor, iNode, list2, obj);
                    return lambda$sendToGroup$5;
                }
            });
            if (!this.isVipOrFree && this.argsData.getGroup_list().size() > Constant.sendMessageNum) {
                GroupSendData groupSendData2 = this.argsData;
                groupSendData2.setGroup_list(groupSendData2.getGroup_list().subList(0, Constant.sendMessageNum));
            }
            this.mExecutorWindow.setArgs(transmitWithGroupBean(this.argsData, edText));
            ArrayList arrayList = new ArrayList();
            this.groupAgainList = arrayList;
            arrayList.addAll(this.argsData.getGroup_list());
            setSearchGroupHis(this.groupAgainList);
            this.sendGroupNum = this.argsData.getGroup_list().size();
            this.mExecutorWindow.setCallback(new SendCallback(this, this.mExecutorWindow));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    static boolean lambda$sendToGroup$4(IAccessibility iAccessibility, INode iNode, Object[] objArr, int i, NodeExecutor nodeExecutor) {
        return ("while_node".equals(iNode.getNodeType()) && "selectGroup".equals(((WhileNode) iNode).getTag()) && i == 9) ? false : true;
    }

    public List lambda$sendToGroup$5(NodeExecutor nodeExecutor, INode iNode, List list, Object obj) {
        ArrayList arrayList = new ArrayList(list);
        if (!this.argsData.getGroup_list().isEmpty()) {
            Iterator it = list.iterator();
            while (it.hasNext()) {
                AccessibilityNodeInfo accessibilityNodeInfo = (AccessibilityNodeInfo) it.next();
                if (accessibilityNodeInfo != null && accessibilityNodeInfo.getText() != null && !this.groupList.contains(accessibilityNodeInfo.getText().toString())) {
                    arrayList.remove(accessibilityNodeInfo);
                }
            }
        }
        return arrayList;
    }

    private GroupSendData cleanDataEllipsis(GroupSendData groupSendData) {
        for (int i = 0; i < groupSendData.getGroup_list().size(); i++) {
            int lastIndexOf = groupSendData.getGroup_list().get(i).getSend_group().lastIndexOf(8230);
            if (lastIndexOf != -1) {
                groupSendData.getGroup_list().get(i).setSend_group(groupSendData.getGroup_list().get(i).getSend_group().substring(0, lastIndexOf));
            }
        }
        return groupSendData;
    }

    private void collectSendToSingle() {
        String edText = getEdText();
        this.argsData = new GroupSendData();
        if (this.isSelectObject == 200 || this.isSelectObject == 201) {
            this.argsData = cleanDataEllipsis(this.groupPartSendData);
        } else if (this.isSelectObject == 202) {
            this.argsData = this.groupSendData;
        }
        GroupSendData groupSendData = this.argsData;
        if (groupSendData == null || groupSendData.getGroup_list() == null || this.argsData.getGroup_list().size() <= 0) {
            showCenterToast("未选择群!");
            return;
        }
        for (GroupListData groupListData : this.argsData.getGroup_list()) {
            groupListData.setSend_group(groupListData.send_group.trim());
        }
        this.singleSendData = new GroupSendData(this.argsData.getGroup_list());
        List<GroupListData> list = this.groupAgainList;
        if (list != null && !list.isEmpty() && this.isAgainSend) {
            this.singleSendData.setGroup_list(new ArrayList(this.groupAgainList));
        }
        try {
            IAccessibility accessibility = AuxiliaryService.getAccessibility();
            if (this.isSelectObject == 202) {
                this.mExecutorWindow = ScriptLoadUtil.loadWx(accessibility, this.funcId, "single_send_to_save_group");
            } else {
                this.mExecutorWindow = ScriptLoadUtil.loadWx(accessibility, this.funcId, "single_send_to_join_group");
            }
            if (!this.isVipOrFree && this.singleSendData.getGroup_list().size() > Constant.sendMessageNum) {
                GroupSendData groupSendData2 = this.singleSendData;
                groupSendData2.setGroup_list(groupSendData2.getGroup_list().subList(0, Constant.sendMessageNum));
            }
            this.singleSendData.setSend_text(edText);
            this.singleSendData.setSend_time(this.sendTime);
            final ArrayList arrayList = new ArrayList();
            Iterator<GroupListData> it = this.singleSendData.getGroup_list().iterator();
            while (it.hasNext()) {
                arrayList.add(it.next().send_group);
            }
            this.mExecutorWindow.setIFilter(new NodeExecutor.IFilter() {
                public final List onFilter(NodeExecutor nodeExecutor, INode iNode, List list2, Object obj) {
                    List lambda$collectSendToSingle$6;
                    lambda$collectSendToSingle$6 = CollectSendActivity.this.lambda$collectSendToSingle$6(arrayList, nodeExecutor, iNode, list2, obj);
                    return lambda$collectSendToSingle$6;
                }
            });
            this.mExecutorWindow.setISelect(new NodeExecutor.ISelectMap() {
                public final void onNodeSelect(SelectNode selectNode, List list2, Object obj, NodeExecutor nodeExecutor) {
                    CollectSendActivity.this.lambda$collectSendToSingle$9(selectNode, list2, obj, nodeExecutor);
                }
            });
            this.mExecutorWindow.setArgs(this.singleSendData);
            ArrayList arrayList2 = new ArrayList();
            this.groupAgainList = arrayList2;
            arrayList2.addAll(this.singleSendData.getGroup_list());
            setSearchGroupHis(this.groupAgainList);
            this.sendGroupNum = this.singleSendData.getGroup_list().size();
            this.mExecutorWindow.showFloatWindow();
            this.mExecutorWindow.setProgress();
            this.mExecutorWindow.setCallback(new SendCallback(this, this.mExecutorWindow));
            this.mExecutorWindow.addStatusCallback(this);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public List lambda$collectSendToSingle$6(List list, NodeExecutor nodeExecutor, INode iNode, List list2, Object obj) {
        ArrayList arrayList = new ArrayList(list2);
        if (!this.singleSendData.getGroup_list().isEmpty()) {
            Iterator it = list2.iterator();
            while (it.hasNext()) {
                AccessibilityNodeInfo accessibilityNodeInfo = (AccessibilityNodeInfo) it.next();
                if (accessibilityNodeInfo != null && accessibilityNodeInfo.getText() != null) {
                    if (this.isSelectObject == 200 || this.isSelectObject == 201) {
                        int lastIndexOf = accessibilityNodeInfo.getText().toString().lastIndexOf(40);
                        int lastIndexOf2 = accessibilityNodeInfo.getText().toString().lastIndexOf(41);
                        if (lastIndexOf != -1 && !list.contains(Utils.removeCharacters(accessibilityNodeInfo.getText().toString(), lastIndexOf, lastIndexOf2))) {
                            arrayList.remove(accessibilityNodeInfo);
                        }
                    } else if (!list.contains(accessibilityNodeInfo.getText().toString())) {
                        arrayList.remove(accessibilityNodeInfo);
                    }
                }
            }
        }
        return arrayList;
    }

    static boolean lambda$collectSendToSingle$7(NodeExecutor.NodeParam nodeParam) {
        return nodeParam.text != null;
    }

    public void lambda$collectSendToSingle$9(SelectNode selectNode, List list, Object obj, NodeExecutor nodeExecutor) {
        List list2 = (List) list.stream().filter(new Predicate() {
            @Override
            public final boolean test(Object obj2) {
                return CollectSendActivity.lambda$collectSendToSingle$7((NodeExecutor.NodeParam) obj2);
            }
        }).map(new Function() {
            @Override
            public final Object apply(Object obj2) {
                String str;
                str = ((NodeExecutor.NodeParam) obj2).text;
                return str;
            }
        }).collect(Collectors.toList());
        if (selectNode.getPageName().equals("我的页面获取我的昵称")) {
            if (this.myWxName.isEmpty() && !list2.isEmpty()) {
                this.myWxName = (String) list2.get(0);
            }
            this.singleSendData.setWx_name(this.myWxName);
        }
    }

    public class SendCallback extends NodeExecutor.DefaultCallback {
        private final ExecutorWindow mExecutorWindow;

        public SendCallback(Context context, ExecutorWindow executorWindow) {
            super(context);
            this.mExecutorWindow = executorWindow;
        }

        public boolean onNodeFound(PageNode pageNode, ViewNode viewNode, NodeExecutor nodeExecutor) {
            if (pageNode.getPageName() != null && pageNode.getPageName().equals("通讯录翻页收藏群发—点击选择群")) {
                if (viewNode.getText() != null && !viewNode.getText().isEmpty()) {
                    CollectSendActivity.this.groupList.remove(viewNode.getText());
                    CollectSendActivity.this.getGroupTemporaryData.add(viewNode.getText());
                }
                CollectSendActivity.this.addNum++;
            } else if (pageNode.getPageName() != null && "转发群发—all-选择第一条长按".equals(pageNode.getPageName())) {
                if (CollectSendActivity.this.selectAllIndex != -1 && CollectSendActivity.this.selectAllIndex < 8) {
                    if (CollectSendActivity.this.sendAllFriendAgainData != null && !CollectSendActivity.this.sendAllFriendAgainData.isEmpty()) {
                        CollectSendActivity.this.sendAllFriendAgainData.clear();
                        CollectSendActivity collectSendActivity = CollectSendActivity.this;
                        collectSendActivity.setSendAllFriendHis(collectSendActivity.sendAllFriendAgainData, "all");
                    }
                    this.mExecutorWindow.setFinishMessage("所有好友群发完成!", true);
                }
            } else if (pageNode.getPageName() != null && "转发群发—发送到群聊-选择搜索的群".equals(pageNode.getPageName())) {
                if (viewNode.getText() != null && !viewNode.getText().isEmpty()) {
                    CollectSendActivity.this.getGroupTemporaryData.add(viewNode.getText());
                }
                CollectSendActivity.this.addNum++;
            } else if (pageNode.getPageName() != null && "收藏群发—逐个群群发-点击群".equals(pageNode.getPageName())) {
                final String text = viewNode.getText();
                if (viewNode.getText() != null && !text.isEmpty()) {
                    CollectSendActivity.this.groupAgainList.removeIf(new Predicate() {
                        @Override
                        public final boolean test(Object obj) {
                            boolean equals;
                            equals = ((GroupListData) obj).getSend_group().equals(text);
                            return equals;
                        }
                    });
                    CollectSendActivity collectSendActivity2 = CollectSendActivity.this;
                    collectSendActivity2.setSearchGroupHis(collectSendActivity2.groupAgainList);
                }
                CollectSendActivity.this.partGroupSendNum++;
                this.mExecutorWindow.setProgress("正在操作第" + CollectSendActivity.this.partGroupSendNum + "个群,共" + CollectSendActivity.this.sendGroupNum + "个群");
            } else if (pageNode.getPageName() != null && "转发—搜索发送到群聊-确定发送".equals(pageNode.getPageName())) {
                if (CollectSendActivity.this.getGroupTemporaryData != null && !CollectSendActivity.this.getGroupTemporaryData.isEmpty()) {
                    for (final String str : CollectSendActivity.this.getGroupTemporaryData) {
                        CollectSendActivity.this.groupAgainList.removeIf(new Predicate() {
                            @Override
                            public final boolean test(Object obj) {
                                boolean equals;
                                equals = ((GroupListData) obj).getSend_group().equals(str);
                                return equals;
                            }
                        });
                        CollectSendActivity collectSendActivity3 = CollectSendActivity.this;
                        collectSendActivity3.setSearchGroupHis(collectSendActivity3.groupAgainList);
                    }
                }
                CollectSendActivity.this.partGroupSendNum += CollectSendActivity.this.addNum;
                CollectSendActivity.this.getGroupTemporaryData = new ArrayList();
                CollectSendActivity.this.addNum = 0;
                this.mExecutorWindow.setProgress("已操作" + CollectSendActivity.this.partGroupSendNum + "个群,共" + CollectSendActivity.this.sendGroupNum + "个群");
            } else if (pageNode.getPageName() != null && "群发所有好友-选择人点击".equals(pageNode.getPageName())) {
                if (viewNode.getText() != null && !viewNode.getText().isEmpty()) {
                    CollectSendActivity.this.getGroupTemporaryData.add(viewNode.getText());
                }
                CollectSendActivity.this.addNum++;
            } else if (pageNode.getPageName() != null && "转发—选择好友-选择搜索的好友".equals(pageNode.getPageName())) {
                if (viewNode.getText() != null && !viewNode.getText().isEmpty()) {
                    CollectSendActivity.this.getGroupTemporaryData.add(viewNode.getText());
                }
                CollectSendActivity.this.addNum++;
            } else if (pageNode.getPageName() != null && "转发—发送到好友-确定发送".equals(pageNode.getPageName())) {
                if (CollectSendActivity.this.getGroupTemporaryData != null && !CollectSendActivity.this.getGroupTemporaryData.isEmpty()) {
                    for (String str2 : CollectSendActivity.this.getGroupTemporaryData) {
                        if (CollectSendActivity.this.isSelectObject == 100 || CollectSendActivity.this.isSelectObject == 102) {
                            CollectSendActivity.this.sendAllFriendAgainData.add(new NameList(str2));
                            CollectSendActivity collectSendActivity4 = CollectSendActivity.this;
                            collectSendActivity4.setSendAllFriendHis(collectSendActivity4.sendAllFriendAgainData, "all");
                        } else if (CollectSendActivity.this.isSelectObject == 101) {
                            CollectSendActivity.this.sendSelectFriendAgainData.add(new NameList(str2));
                            CollectSendActivity collectSendActivity5 = CollectSendActivity.this;
                            collectSendActivity5.setSendAllFriendHis(collectSendActivity5.sendSelectFriendAgainData, "select");
                        }
                    }
                }
                CollectSendActivity.this.partGroupSendNum += CollectSendActivity.this.addNum;
                CollectSendActivity.this.getGroupTemporaryData = new ArrayList();
                CollectSendActivity.this.addNum = 0;
                if (CollectSendActivity.this.isSelectObject == 101) {
                    CollectSendActivity.this.tagFriendAgainNum--;
                    if (CollectSendActivity.this.tagFriendAgainNum <= 0) {
                        CollectSendActivity.this.sendSelectFriendAgainData.clear();
                        CollectSendActivity collectSendActivity6 = CollectSendActivity.this;
                        collectSendActivity6.setSendAllFriendHis(collectSendActivity6.sendSelectFriendAgainData, "select");
                    }
                }
                this.mExecutorWindow.setProgress("已操作" + CollectSendActivity.this.partGroupSendNum + "个好友");
            }
            return super.onNodeFound(pageNode, viewNode, nodeExecutor);
        }

        public boolean onNodeNotFound(PageNode pageNode, ViewNode viewNode, NodeExecutor nodeExecutor) {
            if (pageNode.getPageName() != null && pageNode.getPageName().equals("聊天窗口页面")) {
                this.mExecutorWindow.setMessageShow("请先进入聊天页面,并确保发送的内容,在本轮任务中始终保持在最后一条");
            } else if (pageNode.getPageName() != null && pageNode.getPageName().equals("视频号页面")) {
                this.mExecutorWindow.setMessageShow("请先点击“发现”-“视频号”,进入想要分享的视频号页面");
            } else if (pageNode.getPageName() != null && pageNode.getPageName().equals("号搜索结果")) {
                this.mExecutorWindow.setMessageShow("无法找到该号,或者它不支持转发。请核对号是否输入正确");
            } else if (pageNode.getPageName() != null && pageNode.getPageName().equals("号搜索结果-点击更多信息")) {
                this.mExecutorWindow.setMessageShow("无法找到该号,或者它不支持转发。请核对号是否输入正确");
            } else if (pageNode.getPageName() != null && pageNode.getPageName().equals("收藏群发-多选")) {
                this.mExecutorWindow.setMessageShow("暂不支持群发收藏的语音");
            } else if (pageNode.getPageName() != null && pageNode.getPageName().equals("号搜索结果页面传递群数据")) {
                this.mExecutorWindow.setMessageShow("当前无法转发推荐!\n(不支持转发自己的)");
            }
            return super.onNodeNotFound(pageNode, viewNode, nodeExecutor);
        }

        public boolean onPageNotFound(IAccessibility iAccessibility, INode iNode, String str, NodeExecutor nodeExecutor) {
            PageNode pageNode = (PageNode) iNode;
            if (pageNode.getPageName() != null && pageNode.getPageName().equals("聊天窗口页面")) {
                this.mExecutorWindow.setMessageShow("请先进入聊天页面,并确保发送的内容,在本轮任务中始终保持在最后一条");
            } else if (pageNode.getPageName() != null && pageNode.getPageName().equals("视频号页面")) {
                this.mExecutorWindow.setMessageShow("请先点击“发现”-“视频号”,进入想要分享的视频号页面");
            } else if (pageNode.getPageName() != null && pageNode.getPageName().equals("号搜索结果")) {
                this.mExecutorWindow.setMessageShow("无法找到该号,或者它不支持转发。请核对号是否输入正确");
            } else if (pageNode.getPageName() != null && pageNode.getPageName().equals("号搜索结果-点击更多信息")) {
                this.mExecutorWindow.setMessageShow("无法找到该号,或者它不支持转发。请核对号是否输入正确");
            } else if (pageNode.getPageName() != null && pageNode.getPageName().equals("收藏群发-多选")) {
                this.mExecutorWindow.setMessageShow("暂不支持群发收藏的语音");
            }
            return super.onPageNotFound(iAccessibility, iNode, str, nodeExecutor);
        }
    }

    private String sendAllFileAddress() {
        String str = this.funcId;
        str.hashCode();
        switch (str) {
            case "10002":
                return "to_all_friend";
            case "10004":
            case "10006":
                return "url_applet_to_all_friend";
            case "10005":
                return "business_to_all_friend";
            case "10007":
                return "official_to_all_friend";
            case "10008":
                return "video_id_to_all_friend";
            default:
                return "";
        }
    }

    private String sendGroupFileAddress() {
        String str = this.funcId;
        str.hashCode();
        switch (str) {
            case "10002":
                if (this.lookForGroupWayWithCollect == 0) {
                    return "search_send_to_group";
                }
                return "page_send_to_sava_group";
            case "10004":
            case "10006":
            case "10007":
                return "official_url_applet_to_group";
            case "10005":
                return "business_to_group";
            case "10008":
                return "video_id_to_group";
            default:
                return "";
        }
    }

    private String sendSelectTagFileAddress() {
        String str = this.funcId;
        str.hashCode();
        switch (str) {
            case "10002":
                return "to_select_friend";
            case "10004":
            case "10006":
            case "10007":
                return "official_url_apple_to_select_friend";
            case "10005":
                return "business_to_select_friend";
            case "10008":
                return "video_id_to_select_friend";
            default:
                return "";
        }
    }

    public void onStart(NodeExecutor nodeExecutor) {
        this.partGroupSendNum = 0;
        this.addNum = 0;
        this.getGroupTemporaryData = new ArrayList();
        this.isAgainSend = false;
    }

    public void onFinish(NodeExecutor nodeExecutor, boolean z) {
        this.sendGroupNum = 0;
        addFuncLimitCount(this.funcId);
        if (!this.isVipOrFree) {
            this.mExecutorWindow.setMessageShow("群发任务已成功完成,你的免费体验已结束,继续使用请返回应用,开通会员!");
            return;
        }
        if (this.isSelectObject == 200 || this.isSelectObject == 201 || this.isSelectObject == 202) {
            this.mExecutorWindow.setMessageShow("群发完成!\n\n已群发" + this.partGroupSendNum + "个群");
        } else if (this.isSelectObject == 101) {
            this.mExecutorWindow.setMessageShow("群发完成!\n\n已群发" + this.partGroupSendNum + "个标签好友");
        } else {
            this.mExecutorWindow.setMessageShow("群发完成!\n\n已群发" + this.partGroupSendNum + "个好友");
        }
    }

    protected void onResume() {
        super.onResume();
        if (this.mExecutorWindow != null) {
            this.mExecutorWindow.hideFloatWindow();
            this.mExecutorWindow.stop();
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (this.mExecutorWindow != null) {
            this.mExecutorWindow.hideFloatWindow();
            this.mExecutorWindow.stop();
        }
    }

    private void setAgainDialog() {
        final BaseDialog baseDialog = new BaseDialog(this, 1);
        baseDialog.setTitleText("温馨提示");
        if (this.isSelectObject == 200) {
            baseDialog.setContentText("检测到您上次群发[全部群聊]未完成,是否继续开始?");
        } else if (this.isSelectObject == 201) {
            baseDialog.setContentText("检测到您上次群发[加入的所有群聊]未完成,是否继续开始?");
        } else if (this.isSelectObject == 202) {
            baseDialog.setContentText("检测到您上次群发[保存到通讯录的群聊]未完成,是否继续开始?");
        } else if (this.isSelectObject == 101) {
            baseDialog.setContentText("检测到您上次群发[发送给部分好友]未完成,是否继续开始?");
        } else if (this.isSelectObject == 100 || this.isSelectObject == 102) {
            baseDialog.setContentText("检测到您上次群发[所有好友]未完成,是否继续开始?");
        }
        baseDialog.setRightButton("继续开始", -1, new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                CollectSendActivity.this.lambda$setAgainDialog$10(baseDialog, view);
            }
        });
        baseDialog.setLeftButton("重新开始", -1, new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                CollectSendActivity.this.lambda$setAgainDialog$11(baseDialog, view);
            }
        });
        baseDialog.show();
    }

    public void lambda$setAgainDialog$10(BaseDialog baseDialog, View view) {
        this.isAgainSend = true;
        start();
        baseDialog.dismiss();
    }

    public void lambda$setAgainDialog$11(BaseDialog baseDialog, View view) {
        this.sendAllFriendAgainData.clear();
        this.sendSelectFriendAgainData.clear();
        this.isAgainSend = false;
        start();
        baseDialog.dismiss();
    }

    private void start() {
        Utils.openWx(this);
        if (this.isSelectObject == 100 || this.isSelectObject == 102) {
            sendAllFriendOrNotSendFriend2();
            return;
        }
        if (this.isSelectObject == 101) {
            sendSelectTagFriend();
            return;
        }
        if (this.isSelectObject == 200 || this.isSelectObject == 201 || this.isSelectObject == 202) {
            if (this.lookForGroupWayWithCollect == 0 || this.lookForGroupWayWithCollect == 2) {
                sendToGroup();
            } else {
                collectSendToSingle();
            }
        }
    }

    public void setSearchGroupHis(List<GroupListData> list) {
        DataSaveUtils.setForwardGroupHistoryListData(this, JSON.toJSONString(list), this.funcId);
    }

    private List<GroupListData> getSearchGroupHis() {
        ArrayList arrayList = new ArrayList();
        List<GroupListData> forwardGroupHistoryListData = DataSaveUtils.getForwardGroupHistoryListData(this, this.funcId);
        return (forwardGroupHistoryListData == null || forwardGroupHistoryListData.isEmpty()) ? arrayList : DataSaveUtils.getForwardGroupHistoryListData(this, this.funcId);
    }

    public void setSendAllFriendHis(List<NameList> list, String str) {
        DataSaveUtils.setForwardFriendListData(this, JSON.toJSONString(list), this.funcId + str);
    }

    private List<NameList> getFriendHis(String str) {
        ArrayList arrayList = new ArrayList();
        List<NameList> forwardFriendHistoryListData = DataSaveUtils.getForwardFriendHistoryListData(this, this.funcId + str);
        return (forwardFriendHistoryListData == null || forwardFriendHistoryListData.isEmpty()) ? arrayList : DataSaveUtils.getForwardFriendHistoryListData(this, this.funcId + str);
    }
}