导航菜单

页面标题

页面副标题

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

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

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


package com.jianzhen.wsk.ui.groupsend;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.Toast;
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.R;
import com.jianzhen.wsk.bean.CollectSendAllFriendData;
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.dialog.BaseDialog;
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 ImgTextSendActivity extends MessageSendActivity implements View.OnClickListener, NodeExecutor.StatusCallback {
    private ExecutorWindow mExecutorWindow;
    GroupSendData partSendData;
    private GroupSendData savaSendData;
    private int sendAllFriendIndex = 0;
    private int selectAllIndex = -1;
    private int savaSendGroupOrTagNum = 0;
    private final Handler handlerPost = new Handler(Looper.getMainLooper());
    private String myWxName = "";
    private boolean isAgainSend = false;
    public List<GroupListData> partGroupAgainList = new ArrayList();
    public List<GroupListData> savaGroupAgainList = new ArrayList();
    private int partGroupSendNum = 0;
    private List<SendTagListData.FriendTagList> tagSendAgainList = new ArrayList();

    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<?>) ImgTextSendActivity.class);
        intent.putExtra("funcId", str);
        activity.startActivity(intent);
    }

    @Override
    protected void initView() {
        findViewById(R.id.send_ok).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ImgTextSendActivity.this.lambda$initView$1(view);
            }
        });
        this.partGroupAgainList = getPartGroupHis();
        this.savaGroupAgainList = getSavaGroupHis();
        this.tagSendAgainList = getTagSendHis();
        this.sendAllFriendIndex = SharedPreferencesUtil.getInt(this, "sendAllFriendIndex", 0);
    }

    public void lambda$initView$1(View view) {
        ArrayList arrayList = new ArrayList();
        arrayList.addAll(this.imgList);
        arrayList.removeIf(new Predicate() {
            @Override
            public final boolean test(Object obj) {
                boolean equals;
                equals = ((String) obj).equals("-1");
                return equals;
            }
        });
        Iterator it = arrayList.iterator();
        int i = 0;
        while (it.hasNext()) {
            if (!((String) it.next()).isEmpty()) {
                i++;
            }
        }
        if ((this.isSelectObject == 100 || this.isSelectObject == 101 || this.isSelectObject == 102) && i >= 2) {
            new AlertDialog.Builder(this).setTitle("温馨提示").setMessage("群发给好友时,根据平台规则,每次最多可附带1张图片。请重新修改图片!").setPositiveButton("知道了", (DialogInterface.OnClickListener) null).create().show();
            return;
        }
        if (getEdText().isEmpty() && !isSendImg()) {
            showCenterToast("请输入发送的内容,或选择图片!");
            return;
        }
        if (this.sendObjectTv.getText().toString().equals("请选择") || this.isSelectObject == 0) {
            showCenterToast("请选择群发对象!");
            return;
        }
        if (this.isSelectObject == 200 || this.isSelectObject == 201) {
            if (this.groupPartSendData == null || this.groupPartSendData.getGroup_list() == null || this.groupPartSendData.getGroup_list().isEmpty()) {
                showCenterToast("请先选择群!");
                return;
            }
        } else if (this.isSelectObject == 202 && (this.groupSendData == null || this.groupSendData.getGroup_list() == null || this.groupSendData.getGroup_list().isEmpty())) {
            showCenterToast("请先选择群!");
            return;
        }
        if (this.isSelectObject == 200) {
            List<TagAndGroupBean> partGroupListData = DataSaveUtils.getPartGroupListData(this);
            if (partGroupListData == null) {
                new GetAllGroupDataDialog(this).show();
                return;
            } else if (partGroupListData.size() <= 0) {
                new GetAllGroupDataDialog(this).show();
                return;
            }
        }
        getFuncLimit(this.funcId);
    }

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

    public void lambda$SendWxStart$2() {
        if (this.isSelectObject == 100 || this.isSelectObject == 102) {
            int i = SharedPreferencesUtil.getInt(this, "sendAllFriendIndex", 0);
            this.sendAllFriendIndex = i;
            if (i > 0) {
                setAgainDialog();
                return;
            } else {
                start();
                return;
            }
        }
        if (this.isSelectObject == 101) {
            List<SendTagListData.FriendTagList> list = this.tagSendAgainList;
            if (list != null && !list.isEmpty()) {
                setAgainDialog();
                return;
            } else {
                start();
                return;
            }
        }
        if (this.isSelectObject == 200 || this.isSelectObject == 201) {
            List<GroupListData> list2 = this.partGroupAgainList;
            if (list2 != null && !list2.isEmpty()) {
                setAgainDialog();
                return;
            } else {
                start();
                return;
            }
        }
        if (this.isSelectObject == 202) {
            List<GroupListData> list3 = this.savaGroupAgainList;
            if (list3 != null && !list3.isEmpty()) {
                setAgainDialog();
            } else {
                start();
            }
        }
    }

    private void sendAllFriendOrNotSendFriend() {
        int i;
        try {
            Utils.openWx(this);
            ExecutorWindow loadWx = ScriptLoadUtil.loadWx(AuxiliaryService.getAccessibility(), this.funcId, "send_all_or_notsend_friend");
            this.mExecutorWindow = loadWx;
            loadWx.showFloatWindow();
            String edText = getEdText();
            CollectSendAllFriendData collectSendAllFriendData = new CollectSendAllFriendData();
            List<CollectSendAllFriendData.SendAllFriendList> sendAllFriendData = setSendAllFriendData(isSendImg(), !edText.isEmpty(), edText, this.sendTime);
            if (this.isAgainSend && (i = this.sendAllFriendIndex) > 0) {
                collectSendAllFriendData.setSendAllFriendList(sendAllFriendData.subList(i, sendAllFriendData.size()));
            } else {
                collectSendAllFriendData.setSendAllFriendList(sendAllFriendData);
            }
            this.mExecutorWindow.setArgs(collectSendAllFriendData);
            this.mExecutorWindow.setProgress();
            this.mExecutorWindow.setIFilter(new NodeExecutor.IFilter() {
                public final List onFilter(NodeExecutor nodeExecutor, INode iNode, List list, Object obj) {
                    List lambda$sendAllFriendOrNotSendFriend$3;
                    lambda$sendAllFriendOrNotSendFriend$3 = ImgTextSendActivity.this.lambda$sendAllFriendOrNotSendFriend$3(nodeExecutor, iNode, list, obj);
                    return lambda$sendAllFriendOrNotSendFriend$3;
                }
            });
            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 i2, NodeExecutor nodeExecutor) {
                    boolean lambda$sendAllFriendOrNotSendFriend$4;
                    lambda$sendAllFriendOrNotSendFriend$4 = ImgTextSendActivity.this.lambda$sendAllFriendOrNotSendFriend$4(iAccessibility, iNode, objArr, i2, nodeExecutor);
                    return lambda$sendAllFriendOrNotSendFriend$4;
                }
            });
        } catch (Exception unused) {
            Toast.makeText((Context) this, (CharSequence) "请先启动辅助服务", 0).show();
        }
    }

    public List lambda$sendAllFriendOrNotSendFriend$3(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$sendAllFriendOrNotSendFriend$4(IAccessibility iAccessibility, INode iNode, Object[] objArr, int i, NodeExecutor nodeExecutor) {
        if (!"while_node".equals(iNode.getNodeType()) || !"all".equals(((WhileNode) iNode).getTag())) {
            return true;
        }
        this.selectAllIndex = i;
        return true;
    }

    private List<CollectSendAllFriendData.SendAllFriendList> setSendAllFriendData(boolean z, boolean z2, String str, String str2) {
        ArrayList arrayList = new ArrayList();
        ArrayList arrayList2 = new ArrayList();
        ArrayList arrayList3 = new ArrayList();
        arrayList2.add(0);
        int i = 0;
        while (i < 9500) {
            i += 500;
            arrayList2.add(Integer.valueOf(i));
        }
        int i2 = 499;
        arrayList3.add(499);
        while (i2 < 9999) {
            i2 += 500;
            arrayList3.add(Integer.valueOf(i2));
        }
        for (int i3 = 0; i3 < arrayList2.size(); i3++) {
            arrayList.add(new CollectSendAllFriendData.SendAllFriendList(z, z2, 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;
        }
        Utils.openWx(this);
        SendTagListData sendTagListData = new SendTagListData(this.sendTagListData1.getTag_list());
        List<SendTagListData.FriendTagList> list = this.tagSendAgainList;
        if (list != null && !list.isEmpty() && this.isAgainSend) {
            sendTagListData.setTag_list(new ArrayList(this.tagSendAgainList));
        }
        String edText = getEdText();
        for (SendTagListData.FriendTagList friendTagList : sendTagListData.getTag_list()) {
            friendTagList.setSend_text(edText);
            if (isSendImg()) {
                friendTagList.setSend_img_list(this.imgListDataList);
            }
            friendTagList.setHavaSendImg(isSendImg());
            friendTagList.setHavaSendText(!edText.isEmpty());
        }
        sendTagListData.setFirstSendText(this.firstSendTextIv.isSelected());
        if (!this.isVipOrFree && sendTagListData.getTag_list().size() > Constant.sendMessageNum) {
            sendTagListData.setTag_list(sendTagListData.getTag_list().subList(0, Constant.sendMessageNum));
        }
        try {
            ExecutorWindow loadWx = ScriptLoadUtil.loadWx(AuxiliaryService.getAccessibility(), this.funcId, "send_tag_friend");
            this.mExecutorWindow = loadWx;
            loadWx.setArgs(sendTagListData);
            ArrayList arrayList = new ArrayList();
            this.tagSendAgainList = arrayList;
            arrayList.addAll(sendTagListData.getTag_list());
            setTagSendHis(this.tagSendAgainList);
            this.savaSendGroupOrTagNum = sendTagListData.getTag_list().size();
            this.mExecutorWindow.showFloatWindow();
            this.mExecutorWindow.setProgress();
            this.mExecutorWindow.setCallback(new SendCallback(this, this.mExecutorWindow));
            this.mExecutorWindow.addStatusCallback(this);
        } catch (Exception unused) {
            showCenterToast("请先启动辅助服务!");
        }
    }

    private void sendSaveGroup() {
        String edText = getEdText();
        if (this.groupSendData == null || this.groupSendData.getGroup_list() == null || this.groupSendData.getGroup_list().size() <= 0) {
            showCenterToast("未选择群!");
            return;
        }
        Utils.openWx(this);
        this.savaSendData = new GroupSendData(this.groupSendData.getGroup_list());
        List<GroupListData> list = this.savaGroupAgainList;
        if (list != null && !list.isEmpty() && this.isAgainSend) {
            this.savaSendData.setGroup_list(new ArrayList(this.savaGroupAgainList));
        }
        for (GroupListData groupListData : this.savaSendData.getGroup_list()) {
            groupListData.setSend_text(edText);
            groupListData.setSend_img_list(this.imgListDataList);
            groupListData.setHavaSendImg(isSendImg());
            groupListData.setHavaSendText(!edText.isEmpty());
            groupListData.setSend_time(this.sendTime);
        }
        if (!this.isVipOrFree && this.savaSendData.getGroup_list().size() > Constant.sendMessageNum) {
            GroupSendData groupSendData = this.savaSendData;
            groupSendData.setGroup_list(groupSendData.getGroup_list().subList(0, Constant.sendMessageNum));
        }
        try {
            IAccessibility accessibility = AuxiliaryService.getAccessibility();
            if (this.isPageSearchPay) {
                this.mExecutorWindow = ScriptLoadUtil.loadWx(accessibility, this.funcId, "page_send_to_save_group");
                this.savaSendData.setSend_text(edText);
                this.savaSendData.setTime(this.sendTime);
                this.savaSendData.setSend_img_list(this.imgListDataList);
                this.savaSendData.setFirstSendImg(!this.firstSendTextIv.isSelected());
                this.savaSendData.setHavaSendImg(isSendImg());
                this.savaSendData.setHavaSendText(!edText.isEmpty());
                final ArrayList arrayList = new ArrayList();
                Iterator<GroupListData> it = this.savaSendData.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$sendSaveGroup$5;
                        lambda$sendSaveGroup$5 = ImgTextSendActivity.this.lambda$sendSaveGroup$5(arrayList, nodeExecutor, iNode, list2, obj);
                        return lambda$sendSaveGroup$5;
                    }
                });
            } else {
                this.mExecutorWindow = ScriptLoadUtil.loadWx(accessibility, this.funcId, "search_send_to_save_group");
                this.savaSendData.setFirstSendText(this.firstSendTextIv.isSelected());
            }
            this.mExecutorWindow.setArgs(this.savaSendData);
            ArrayList arrayList2 = new ArrayList();
            this.savaGroupAgainList = arrayList2;
            arrayList2.addAll(this.savaSendData.getGroup_list());
            setSavaGroupHis(this.savaGroupAgainList);
            this.savaSendGroupOrTagNum = this.savaSendData.getGroup_list().size();
            this.mExecutorWindow.addStatusCallback(this);
            this.mExecutorWindow.showFloatWindow();
            this.mExecutorWindow.setProgress();
            this.mExecutorWindow.setISelect(new NodeExecutor.ISelectMap() {
                public final void onNodeSelect(SelectNode selectNode, List list2, Object obj, NodeExecutor nodeExecutor) {
                    ImgTextSendActivity.this.lambda$sendSaveGroup$9(selectNode, list2, obj, nodeExecutor);
                }
            });
            this.mExecutorWindow.setCallback(new SendCallback(this, this.mExecutorWindow));
        } catch (Exception unused) {
            showCenterToast("请先启动辅助服务!");
        }
    }

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

    public void lambda$sendSaveGroup$9(SelectNode selectNode, List list, Object obj, NodeExecutor nodeExecutor) {
        final List list2 = (List) list.stream().filter(new Predicate() {
            @Override
            public final boolean test(Object obj2) {
                return ImgTextSendActivity.lambda$sendSaveGroup$6((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 (!list2.isEmpty()) {
                this.savaGroupAgainList.removeIf(new Predicate() {
                    @Override
                    public final boolean test(Object obj2) {
                        boolean equals;
                        equals = ((GroupListData) obj2).getSend_group().equals(list2.get(0));
                        return equals;
                    }
                });
                setSavaGroupHis(this.savaGroupAgainList);
            }
            this.partGroupSendNum++;
            this.mExecutorWindow.setProgress("正在操作第" + this.partGroupSendNum + "个群,共" + this.savaSendGroupOrTagNum + "个群");
        }
    }

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

    private void sendPartGroup() {
        String edText = getEdText();
        if (this.groupPartSendData == null || this.groupPartSendData.getGroup_list() == null || this.groupPartSendData.getGroup_list().size() <= 0) {
            showCenterToast("未选择群!");
            return;
        }
        Utils.openWx(this);
        this.partSendData = new GroupSendData(this.groupPartSendData.getGroup_list());
        List<GroupListData> list = this.partGroupAgainList;
        if (list != null && !list.isEmpty() && this.isAgainSend) {
            this.partSendData.setGroup_list(new ArrayList(this.partGroupAgainList));
        }
        for (GroupListData groupListData : this.partSendData.getGroup_list()) {
            groupListData.setSend_text(edText);
            groupListData.setSend_img_list(this.imgListDataList);
            groupListData.setHavaSendImg(isSendImg());
            groupListData.setHavaSendText(!edText.isEmpty());
            groupListData.setSend_time(this.sendTime);
        }
        for (int i = 0; i < this.partSendData.getGroup_list().size(); i++) {
            int lastIndexOf = this.partSendData.getGroup_list().get(i).getSend_group().lastIndexOf(8230);
            if (lastIndexOf != -1) {
                this.partSendData.getGroup_list().get(i).setSend_group(this.partSendData.getGroup_list().get(i).getSend_group().substring(0, lastIndexOf));
            }
        }
        try {
            IAccessibility accessibility = AuxiliaryService.getAccessibility();
            if (this.isPageSearchPay) {
                this.mExecutorWindow = ScriptLoadUtil.loadWx(accessibility, this.funcId, "page_send_part_group");
                this.partSendData.setSend_text(edText);
                this.partSendData.setTime(this.sendTime);
                this.partSendData.setSend_img_list(this.imgListDataList);
                this.partSendData.setFirstSendImg(!this.firstSendTextIv.isSelected());
                this.partSendData.setHavaSendImg(isSendImg());
                this.partSendData.setHavaSendText(!edText.isEmpty());
                final ArrayList arrayList = new ArrayList();
                Iterator<GroupListData> it = this.partSendData.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$sendPartGroup$10;
                        lambda$sendPartGroup$10 = ImgTextSendActivity.this.lambda$sendPartGroup$10(arrayList, nodeExecutor, iNode, list2, obj);
                        return lambda$sendPartGroup$10;
                    }
                });
            } else {
                this.mExecutorWindow = ScriptLoadUtil.loadWx(accessibility, "10001", "search_send_part_group");
                this.partSendData.setFirstSendText(this.firstSendTextIv.isSelected());
            }
            this.mExecutorWindow.addStatusCallback(this);
            this.mExecutorWindow.showFloatWindow();
            this.mExecutorWindow.setProgress();
            this.mExecutorWindow.setArgs(this.partSendData);
            ArrayList arrayList2 = new ArrayList();
            this.partGroupAgainList = arrayList2;
            arrayList2.addAll(this.partSendData.getGroup_list());
            setPartGroupHis(this.partGroupAgainList);
            this.savaSendGroupOrTagNum = this.partSendData.getGroup_list().size();
            this.mExecutorWindow.setISelect(new NodeExecutor.ISelectMap() {
                public final void onNodeSelect(SelectNode selectNode, List list2, Object obj, NodeExecutor nodeExecutor) {
                    ImgTextSendActivity.this.lambda$sendPartGroup$15(selectNode, list2, obj, nodeExecutor);
                }
            });
            this.mExecutorWindow.setCallback(new SendCallback(this, this.mExecutorWindow));
        } catch (Exception unused) {
            showCenterToast("请先启动辅助服务!");
        }
    }

    public List lambda$sendPartGroup$10(List list, NodeExecutor nodeExecutor, INode iNode, List list2, Object obj) {
        ArrayList arrayList = new ArrayList(list2);
        if (!this.partSendData.getGroup_list().isEmpty()) {
            Iterator it = list2.iterator();
            while (it.hasNext()) {
                AccessibilityNodeInfo accessibilityNodeInfo = (AccessibilityNodeInfo) it.next();
                if (accessibilityNodeInfo != null && accessibilityNodeInfo.getText() != null) {
                    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);
                    }
                }
            }
        }
        return arrayList;
    }

    public void lambda$sendPartGroup$15(SelectNode selectNode, List list, Object obj, NodeExecutor nodeExecutor) {
        final List list2 = (List) list.stream().filter(new Predicate() {
            @Override
            public final boolean test(Object obj2) {
                return ImgTextSendActivity.lambda$sendPartGroup$11((NodeExecutor.NodeParam) obj2);
            }
        }).map(new Function() {
            @Override
            public final Object apply(Object obj2) {
                String str;
                str = ((NodeExecutor.NodeParam) obj2).text;
                return str;
            }
        }).filter(new Predicate() {
            @Override
            public final boolean test(Object obj2) {
                return ImgTextSendActivity.lambda$sendPartGroup$13((String) obj2);
            }
        }).collect(Collectors.toList());
        if (selectNode.getPageName().equals("我的页面获取我的昵称")) {
            if (this.myWxName.isEmpty() && !list2.isEmpty()) {
                this.myWxName = (String) list2.get(0);
            }
            this.partSendData.setWx_name(this.myWxName);
            if (this.isVipOrFree || this.partSendData.getGroup_list().size() <= Constant.sendMessageNum) {
                return;
            }
            GroupSendData groupSendData = this.partSendData;
            groupSendData.setGroup_list(groupSendData.getGroup_list().subList(0, Constant.sendMessageNum));
            return;
        }
        if (selectNode.getPageName().equals("部分群聊-获取输入群聊")) {
            if (!list2.isEmpty()) {
                this.partGroupAgainList.removeIf(new Predicate() {
                    @Override
                    public final boolean test(Object obj2) {
                        boolean equals;
                        equals = ((GroupListData) obj2).getSend_group().equals(list2.get(0));
                        return equals;
                    }
                });
                setPartGroupHis(this.partGroupAgainList);
            }
            this.partGroupSendNum++;
            this.mExecutorWindow.setProgress("正在操作第" + this.partGroupSendNum + "个群,共" + this.savaSendGroupOrTagNum + "个群");
        }
    }

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

    static boolean lambda$sendPartGroup$13(String str) {
        return ("微信团队".equals(str) || "文件传输助手".equals(str) || "未设置标签的朋友".equals(str)) ? false : true;
    }

    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 (ImgTextSendActivity.this.isSelectObject == 100) {
                    ImgTextSendActivity.this.sendAllFriendIndex++;
                    ?? r0 = ImgTextSendActivity.this;
                    SharedPreferencesUtil.putInt(r0, "sendAllFriendIndex", ((ImgTextSendActivity) r0).sendAllFriendIndex);
                }
                if (ImgTextSendActivity.this.selectAllIndex != -1 && ImgTextSendActivity.this.selectAllIndex < 490) {
                    this.mExecutorWindow.setFinishMessage("群发完成!", true);
                    ImgTextSendActivity.this.sendAllFriendIndex = 0;
                    SharedPreferencesUtil.putInt(ImgTextSendActivity.this, "sendAllFriendIndex", 0);
                }
                ImgTextSendActivity imgTextSendActivity = ImgTextSendActivity.this;
                imgTextSendActivity.partGroupSendNum = imgTextSendActivity.partGroupSendNum + ImgTextSendActivity.this.selectAllIndex + 1;
                this.mExecutorWindow.setProgress("正在操作第" + ImgTextSendActivity.this.partGroupSendNum + "个好友");
                return super.onNodeFound(pageNode, viewNode, nodeExecutor);
            }
            if (pageNode.getPageName() != null && pageNode.getPageName().equals("发送到加入的群聊-翻页点击群")) {
                final String text = viewNode.getText();
                if (viewNode.getText() != null && !text.isEmpty()) {
                    ImgTextSendActivity.this.partGroupAgainList.removeIf(new Predicate() {
                        @Override
                        public final boolean test(Object obj) {
                            boolean equals;
                            equals = ((GroupListData) obj).getSend_group().equals(text);
                            return equals;
                        }
                    });
                    ImgTextSendActivity imgTextSendActivity2 = ImgTextSendActivity.this;
                    imgTextSendActivity2.setPartGroupHis(imgTextSendActivity2.partGroupAgainList);
                }
                ImgTextSendActivity.this.partGroupSendNum++;
                this.mExecutorWindow.setProgress("正在操作第" + ImgTextSendActivity.this.partGroupSendNum + "个群,共" + ImgTextSendActivity.this.savaSendGroupOrTagNum + "个群");
            } else if (pageNode.getPageName() != null && pageNode.getPageName().equals("通讯录群聊-翻页点击群")) {
                final String text2 = viewNode.getText();
                if (viewNode.getText() != null && !text2.isEmpty()) {
                    ImgTextSendActivity.this.savaGroupAgainList.removeIf(new Predicate() {
                        @Override
                        public final boolean test(Object obj) {
                            boolean equals;
                            equals = ((GroupListData) obj).getSend_group().equals(text2);
                            return equals;
                        }
                    });
                    ImgTextSendActivity imgTextSendActivity3 = ImgTextSendActivity.this;
                    imgTextSendActivity3.setSavaGroupHis(imgTextSendActivity3.savaGroupAgainList);
                }
                ImgTextSendActivity.this.partGroupSendNum++;
                this.mExecutorWindow.setProgress("正在操作第" + ImgTextSendActivity.this.partGroupSendNum + "个群,共" + ImgTextSendActivity.this.savaSendGroupOrTagNum + "个群");
            } else if (pageNode.getPageName() != null && pageNode.getPageName().equals("从标签导入-选择标签")) {
                final String text3 = viewNode.getText();
                if (viewNode.getText() != null && !text3.isEmpty()) {
                    ImgTextSendActivity.this.tagSendAgainList.removeIf(new Predicate() {
                        @Override
                        public final boolean test(Object obj) {
                            boolean equals;
                            equals = ((SendTagListData.FriendTagList) obj).getTag_name().equals(text3);
                            return equals;
                        }
                    });
                    ImgTextSendActivity imgTextSendActivity4 = ImgTextSendActivity.this;
                    imgTextSendActivity4.setTagSendHis(imgTextSendActivity4.tagSendAgainList);
                }
                ImgTextSendActivity.this.partGroupSendNum++;
                ExecutorWindow executorWindow = this.mExecutorWindow;
                StringBuilder sb = new StringBuilder("正在操作第");
                ImgTextSendActivity imgTextSendActivity5 = ImgTextSendActivity.this;
                executorWindow.setProgress(sb.append(imgTextSendActivity5.showNum(imgTextSendActivity5.partGroupSendNum)).append("个标签好友,共").append(ImgTextSendActivity.this.savaSendGroupOrTagNum).append("个标签").toString());
            }
            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.setMessage("标签群发失败!\n可能是操作太频繁,建议24小时后重试!(您也可以手动点击发送)", true);
            }
            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("当前群群发中断,请退回到群聊列表页面,继续开始群发!");
            }
            return super.onPageNotFound(iAccessibility, iNode, str, nodeExecutor);
        }
    }

    private boolean isSendTextAndImg() {
        return !getEdText().isEmpty() && isSendImg();
    }

    public int showNum(int i) {
        if (!isSendTextAndImg()) {
            return i;
        }
        int i2 = i % 2;
        int i3 = i / 2;
        return i2 == 0 ? i3 : i3 + 1;
    }

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

    public void onFinish(NodeExecutor nodeExecutor, boolean z) {
        this.savaSendGroupOrTagNum = 0;
        if (!this.isVipOrFree) {
            this.mExecutorWindow.setMessageShow("群发任务已成功完成,你的免费体验已结束,继续使用请返回应用,开通会员!");
        } else 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已群发" + showNum(this.partGroupSendNum) + "个标签好友");
        } else {
            this.mExecutorWindow.setMessageShow("群发完成!\n\n已群发" + showNum(this.partGroupSendNum) + "个好友");
        }
        saveHistoryData();
        addFuncLimitCount(this.funcId);
    }

    protected void onResume() {
        super.onResume();
        ExecutorWindow executorWindow = this.mExecutorWindow;
        if (executorWindow != null) {
            executorWindow.hideFloatWindow();
            this.mExecutorWindow.stop();
        }
        if (this.isSelectObject == 100 || this.isSelectObject == 101 || this.isSelectObject == 102) {
            this.imgTextSendTip.setVisibility(0);
        } else {
            this.imgTextSendTip.setVisibility(8);
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ExecutorWindow executorWindow = this.mExecutorWindow;
        if (executorWindow != null) {
            executorWindow.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) {
                ImgTextSendActivity.this.lambda$setAgainDialog$16(baseDialog, view);
            }
        });
        baseDialog.setLeftButton("重新开始", -1, new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ImgTextSendActivity.this.lambda$setAgainDialog$17(baseDialog, view);
            }
        });
        baseDialog.show();
    }

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

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

    private void start() {
        if (this.isSelectObject == 202) {
            sendSaveGroup();
            return;
        }
        if (this.isSelectObject == 200 || this.isSelectObject == 201) {
            sendPartGroup();
            return;
        }
        if (this.isSelectObject == 101) {
            sendSelectTagFriend();
        } else if (this.isSelectObject == 100 || this.isSelectObject == 102) {
            sendAllFriendOrNotSendFriend();
        }
    }

    public void setPartGroupHis(List<GroupListData> list) {
        DataSaveUtils.setPartGroupHistoryListData(this, JSON.toJSONString(list));
    }

    private List<GroupListData> getPartGroupHis() {
        ArrayList arrayList = new ArrayList();
        List<GroupListData> partGroupHistoryListData = DataSaveUtils.getPartGroupHistoryListData(this);
        return (partGroupHistoryListData == null || partGroupHistoryListData.isEmpty()) ? arrayList : DataSaveUtils.getPartGroupHistoryListData(this);
    }

    public void setSavaGroupHis(List<GroupListData> list) {
        DataSaveUtils.setSavaGroupHistoryListData(this, JSON.toJSONString(list));
    }

    private List<GroupListData> getSavaGroupHis() {
        ArrayList arrayList = new ArrayList();
        List<GroupListData> savaGroupHistoryListData = DataSaveUtils.getSavaGroupHistoryListData(this);
        return (savaGroupHistoryListData == null || savaGroupHistoryListData.isEmpty()) ? arrayList : DataSaveUtils.getSavaGroupHistoryListData(this);
    }

    public void setTagSendHis(List<SendTagListData.FriendTagList> list) {
        DataSaveUtils.setSendTagHistoryListData(this, JSON.toJSONString(list));
    }

    private List<SendTagListData.FriendTagList> getTagSendHis() {
        ArrayList arrayList = new ArrayList();
        List<SendTagListData.FriendTagList> sendTagHistoryListData = DataSaveUtils.getSendTagHistoryListData(this);
        return (sendTagHistoryListData == null || sendTagHistoryListData.isEmpty()) ? arrayList : DataSaveUtils.getSendTagHistoryListData(this);
    }
}