TIM v2.3.1版本的 MD5 值为:d6957e3ee7ce901ccc491cefdea0da8c

以下内容为反编译后的 ArrangeHandler.java 源代码,内容仅作参考


package com.tencent.arrange.op;

import android.content.Context;
import android.os.Message;
import com.tencent.arrange.ui.ArrangeUtil;
import com.tencent.av.gaudio.AVNotifyCenter;
import com.tencent.av.service.QavWrapper;
import com.tencent.mobileqq.app.BusinessHandler;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.msf.core.NetConnInfoCenter;
import com.tencent.mobileqq.pb.ByteStringMicro;
import com.tencent.mobileqq.pb.InvalidProtocolBufferMicroException;
import com.tencent.mobileqq.qcall.QCallFacade;
import com.tencent.mobileqq.statistics.ReportController;
import com.tencent.mobileqq.statistics.StatisticCollector;
import com.tencent.mobileqq.structmsg.AbsStructMsg;
import com.tencent.mobileqq.structmsg.TestStructMsg;
import com.tencent.mobileqq.utils.ContactUtils;
import com.tencent.mobileqq.utils.HexUtil;
import com.tencent.mobileqq.utils.ShareMsgHelper;
import com.tencent.qphone.base.remote.FromServiceMsg;
import com.tencent.qphone.base.remote.ToServiceMsg;
import com.tencent.qphone.base.util.BaseApplication;
import com.tencent.qphone.base.util.QLog;
import cooperation.groupvideo.GroupVideoWrapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Timer;
import mqq.os.MqqHandler;
import tencent.im.oidb.cmd0x920.oidb_cmd0x920;
import tencent.im.oidb.oidb_sso;
import tencent.im.s2c.msgtype0x210.submsgtype0x7a.submsgtype0x7a;
public class ArrangeHandler extends BusinessHandler implements ArrangeResult {
    public static final int f81119a = 0;
    static final String f557a = "ArrangeHandler";
    public static final int f81120b = 1;
    public static final String f558b = "OidbSvc.0x920_0";
    public static final int f81121c = 2;
    public static final int d = 3;
    public static final int e = 4;
    public static final int f = 5;
    private ArrangeResult f559a;
    private MeetingInfo f560a;
    private MeetingInfo f561b;
    private int g;

    public ArrangeHandler(QQAppInterface qQAppInterface) {
        super(qQAppInterface);
        this.g = 0;
        this.f561b = new MeetingInfo();
    }

    @Override
    public void a(int i, int i2, String str) {
    }

    @Override
    public void b(int i, int i2, String str) {
    }

    @Override
    public void a(int i, List list) {
        if (i == 0 && ((MeetingInfo) list.get(0)).getEnable() != 0) {
            ((MeetingInfo) list.get(0)).setNotifContent(this.f561b.getNotifContent());
            this.f561b = (MeetingInfo) list.get(0);
            b(this.f561b);
        }
    }

    public void a(MeetingInfo meetingInfo, ArrangeResult arrangeResult) {
        oidb_cmd0x920.ReqBody reqBody = new oidb_cmd0x920.ReqBody();
        reqBody.uint32_subcmd.set(1);
        reqBody.setHasFlag(true);
        oidb_cmd0x920.MeetingInfo meetingInfo2 = new oidb_cmd0x920.MeetingInfo();
        meetingInfo2.uint64_discuss_uin.set(Long.parseLong(meetingInfo.getDiscuss_uin()));
        meetingInfo2.uint64_creator_uin.set(Long.parseLong(meetingInfo.getCreator_uin()));
        meetingInfo2.uint32_begin_time.set((int) (meetingInfo.getBegin_time() / 1000));
        meetingInfo2.uint32_end_time.set((int) (meetingInfo.getEnd_time() / 1000));
        meetingInfo2.uint32_type.set(meetingInfo.getType());
        Iterator it = meetingInfo.getParticipants().iterator();
        while (it.hasNext()) {
            try {
                meetingInfo2.rpt_uint64_participants.add(Long.valueOf(Long.parseLong((String) it.next())));
            } catch (Exception e2) {
            }
        }
        meetingInfo2.bytes_meeting_intro.set(ByteStringMicro.copyFrom(meetingInfo.getIntroduction().getBytes()));
        meetingInfo2.uint32_enable.set(1);
        reqBody.msg_create_meeting.rpt_msg_meeting_info1.add(meetingInfo2);
        reqBody.msg_create_meeting.setHasFlag(true);
        this.g = 1;
        this.f559a = arrangeResult;
        this.f560a = meetingInfo;
        a(reqBody);
    }

    public void b(MeetingInfo meetingInfo, ArrangeResult arrangeResult) {
        oidb_cmd0x920.ReqBody reqBody = new oidb_cmd0x920.ReqBody();
        reqBody.uint32_subcmd.set(2);
        reqBody.setHasFlag(true);
        oidb_cmd0x920.MeetingInfo meetingInfo2 = new oidb_cmd0x920.MeetingInfo();
        meetingInfo2.uint64_discuss_uin.set(Long.parseLong(meetingInfo.getDiscuss_uin()));
        meetingInfo2.uint64_meeting_seq.set(meetingInfo.getSeq());
        reqBody.msg_cancle_meeting.rpt_msg_meeting_info2.add(meetingInfo2);
        reqBody.msg_cancle_meeting.setHasFlag(true);
        this.g = 2;
        this.f559a = arrangeResult;
        this.f560a = meetingInfo;
        a(reqBody);
    }

    public void a(long j, long j2, ArrangeResult arrangeResult) {
        oidb_cmd0x920.ReqBody reqBody = new oidb_cmd0x920.ReqBody();
        reqBody.uint32_subcmd.set(5);
        reqBody.setHasFlag(true);
        oidb_cmd0x920.MeetingInfo meetingInfo = new oidb_cmd0x920.MeetingInfo();
        meetingInfo.uint64_discuss_uin.set(j);
        meetingInfo.uint64_meeting_seq.set(j2);
        reqBody.msg_get_specified_meeting.rpt_msg_meeting_info3.add(meetingInfo);
        reqBody.msg_get_specified_meeting.setHasFlag(true);
        this.g = 5;
        this.f559a = arrangeResult;
        a(reqBody);
    }

    public void a(oidb_cmd0x920.ReqBody reqBody) {
        oidb_sso.OIDBSSOPkg oIDBSSOPkg = new oidb_sso.OIDBSSOPkg();
        oIDBSSOPkg.uint32_command.set(2336);
        oIDBSSOPkg.uint32_service_type.set(0);
        oIDBSSOPkg.uint32_result.set(0);
        oIDBSSOPkg.bytes_bodybuffer.set(ByteStringMicro.copyFrom(reqBody.toByteArray()));
        ToServiceMsg a2 = mo1045a(f558b);
        a2.putWupBuffer(oIDBSSOPkg.toByteArray());
        b(a2);
    }

    private void b(ToServiceMsg toServiceMsg, FromServiceMsg fromServiceMsg, Object obj) {
        String str;
        int i;
        int i2;
        if (fromServiceMsg.getResultCode() == 1000) {
            oidb_sso.OIDBSSOPkg oIDBSSOPkg = null;
            try {
                oidb_sso.OIDBSSOPkg oIDBSSOPkg2 = new oidb_sso.OIDBSSOPkg();
                try {
                    oIDBSSOPkg = (oidb_sso.OIDBSSOPkg) oIDBSSOPkg2.mergeFrom((byte[]) obj);
                } catch (InvalidProtocolBufferMicroException e2) {
                    oIDBSSOPkg = oIDBSSOPkg2;
                }
            } catch (InvalidProtocolBufferMicroException e3) {
            }
            if (oIDBSSOPkg != null) {
                int i3 = oIDBSSOPkg.uint32_result.get();
                ArrayList arrayList = new ArrayList();
                if (i3 == 0 && oIDBSSOPkg.bytes_bodybuffer.has() && oIDBSSOPkg.bytes_bodybuffer.get() != null) {
                    byte[] byteArray = oIDBSSOPkg.bytes_bodybuffer.get().toByteArray();
                    HexUtil.a(f557a, byteArray);
                    try {
                        oidb_cmd0x920.RspBody rspBody = new oidb_cmd0x920.RspBody();
                        rspBody.mergeFrom(byteArray);
                        try {
                            if (this.g == 1) {
                                ReportController.b(this.f87244b, "dc01331", "", "", "0X800556A", "0X800556A", 0, 0, "", "", "", "");
                                oidb_cmd0x920.MeetingInfo meetingInfo = (oidb_cmd0x920.MeetingInfo) rspBody.msg_create_meeting.rpt_msg_meeting_info1.get().get(0);
                                i2 = meetingInfo.uint32_err_code.get();
                                String str2 = new String(meetingInfo.bytes_error_info.get().toByteArray());
                                try {
                                    this.f560a.setSeq(meetingInfo.uint64_meeting_seq.get());
                                    a(this.f560a);
                                    str = str2;
                                    i = i2;
                                } catch (Exception e4) {
                                    str = str2;
                                    i = i2;
                                }
                            } else if (this.g == 2) {
                                oidb_cmd0x920.MeetingInfo meetingInfo2 = (oidb_cmd0x920.MeetingInfo) rspBody.msg_cancle_meeting.rpt_msg_meeting_info2.get().get(0);
                                i2 = meetingInfo2.uint32_err_code.get();
                                String str3 = new String(meetingInfo2.bytes_error_info.get().toByteArray());
                                try {
                                    this.f560a.setEnable(0);
                                    a(this.f560a);
                                    str = str3;
                                    i = i2;
                                } catch (Exception e5) {
                                    str = str3;
                                    i = i2;
                                }
                            } else if (this.g == 3 || this.g == 4 || this.g == 5) {
                                for (oidb_cmd0x920.MeetingInfo meetingInfo3 : rspBody.rpt_msg_meeting_info.get()) {
                                    MeetingInfo meetingInfo4 = new MeetingInfo();
                                    meetingInfo4.setDiscuss_uin(Long.toString(meetingInfo3.uint64_discuss_uin.get()));
                                    meetingInfo4.setCreator_uin(Long.toString(meetingInfo3.uint64_creator_uin.get()));
                                    meetingInfo4.setBegin_time(meetingInfo3.uint32_begin_time.get() * 1000);
                                    meetingInfo4.setEnd_time(meetingInfo3.uint32_end_time.get() * 1000);
                                    ArrayList arrayList2 = new ArrayList();
                                    for (Long l : meetingInfo3.rpt_uint64_participants.get()) {
                                        arrayList2.add(l.toString());
                                    }
                                    meetingInfo4.setParticipants(arrayList2);
                                    meetingInfo4.setIntroduction(new String(meetingInfo3.bytes_meeting_intro.get().toByteArray()));
                                    meetingInfo4.setSeq(meetingInfo3.uint64_meeting_seq.get());
                                    meetingInfo4.setEnable(meetingInfo3.uint32_enable.get());
                                    meetingInfo4.setType(meetingInfo3.uint32_type.get());
                                    arrayList.add(meetingInfo4);
                                }
                            }
                        } catch (Exception e6) {
                            str = "";
                            i = i2;
                        }
                    } catch (Exception e7) {
                        str = "";
                        i = 0;
                    }
                    if (this.f559a == null) {
                        switch (this.g) {
                            case 1:
                                this.f559a.a(i3, i, str);
                                return;
                            case 2:
                                this.f559a.b(i3, i, str);
                                return;
                            case 3:
                            case 4:
                            case 5:
                                this.f559a.a(i3, arrayList);
                                return;
                            default:
                                return;
                        }
                    }
                    return;
                } else if (i3 == 1203) {
                }
                str = "";
                i = 0;
                if (this.f559a == null) {
                }
            }
        }
    }

    public void a(MeetingInfo meetingInfo) {
        String str;
        String discuss_uin = meetingInfo.getDiscuss_uin();
        meetingInfo.getCreator_uin();
        String introduction = meetingInfo.getIntroduction();
        Long valueOf = Long.valueOf(meetingInfo.getSeq());
        String l = Long.toString(meetingInfo.getEnable());
        String formatTime = meetingInfo.getFormatTime();
        String i = ContactUtils.i(this.f87244b, meetingInfo.getCreator_uin());
        String str2 = "时间:" + formatTime + "\n主题:" + introduction;
        if (this.g == 1) {
            str = "预约";
        } else {
            str = "取消";
        }
        String str3 = str + "了QQ电话";
        AbsStructMsg a2 = TestStructMsg.a((((((((("<msg serviceID=\"49\" templateID=\"1\" action=\"plugin\" i_actionData=\"mqqapi://conference/viewconfdetail?maintype=discuss&amp;uin=" + discuss_uin + "&amp;seq=" + valueOf + "&amp;enable=" + l + "&amp;type=" + meetingInfo.getType() + "&amp;version=1&amp;src_type=internal\" ") + "a_actionData=\"mqqapi://conference/viewconfdetail?maintype=discuss&amp;uin=" + discuss_uin + "&amp;seq=" + valueOf + "&amp;enable=" + l + "&amp;type=" + meetingInfo.getType() + "&amp;version=1&amp;src_type=internal\" ") + "actionData=\"AppCmd://ViewConfScheduleDetail/?maintype=discuss&amp;uin=" + discuss_uin + "&amp;seq=" + valueOf + "&amp;enable=" + l + "&amp;type=" + meetingInfo.getType() + "\"  ") + "flag=\"3\" brief=\"" + i + str3 + "\">") + "<item layout=\"2\">") + "<picture cover=\"http://fwd.3g.qq.com:8080/forward.jsp?bid=1101\"/>") + "<title>QQ电话" + str + "</title>") + "<summary>" + str2 + "</summary>") + "</item></msg>");
        if (a2 != null) {
            a2.mCompatibleText = str3 + ":" + (introduction.length() > 10 ? introduction.substring(0, 10) + "…" : introduction) + "\r\n时间:" + formatTime;
            ShareMsgHelper.a(this.f87244b, discuss_uin, 3000, a2, null);
        }
    }

    @Override
    public boolean mo1045a(String str) {
        if (this.f17453b == null) {
            this.f17453b = new HashSet();
            this.f17453b.add(f558b);
        }
        return !this.f17453b.contains(str);
    }

    @Override
    public void mo4303a(ToServiceMsg toServiceMsg, FromServiceMsg fromServiceMsg, Object obj) {
        if (QLog.isColorLevel()) {
            QLog.d(f557a, 2, "onReceive");
        }
        String serviceCmd = fromServiceMsg.getServiceCmd();
        if (mo1045a(serviceCmd)) {
            if (QLog.isColorLevel()) {
                QLog.d(f557a, 2, "cmdfilter error = " + serviceCmd);
            }
        } else if (f558b.equalsIgnoreCase(serviceCmd)) {
            b(toServiceMsg, fromServiceMsg, obj);
        }
    }

    @Override
    public Class mo1966a() {
        return ArrangeObserver.class;
    }

    public void a(submsgtype0x7a.MsgBody msgBody) {
        if (NetConnInfoCenter.getServerTime() > msgBody.uint64_at_time.get() + 60) {
            ((QCallFacade) this.f87244b.getManager(37)).a(String.valueOf(msgBody.uint64_discuss_uin.get()), String.valueOf(msgBody.uint64_from_uin.get()));
            return;
        }
        this.f561b.setSeq(msgBody.uint64_seq.get());
        this.f561b.setNotifContent(new String(msgBody.bytes_content.get().toByteArray()));
        a(msgBody.uint64_discuss_uin.get(), this.f561b.getSeq(), this);
    }

    public void b(MeetingInfo meetingInfo) {
        if (meetingInfo.getNotifContent() == null || meetingInfo.getNotifContent().length() == 0) {
            meetingInfo.setNotifContent("预约的QQ电话开始了");
        }
        MqqHandler handler = this.f87244b.getHandler(AVNotifyCenter.class);
        if (handler != null) {
            Message obtainMessage = handler.obtainMessage(10012);
            obtainMessage.obj = meetingInfo;
            handler.sendMessage(obtainMessage);
        }
        c(meetingInfo);
        ArrangeUtil.a(this.f87244b, meetingInfo, 0);
        long m428b = this.f87244b.m4621a().m428b();
        int a2 = this.f87244b.m4621a().a();
        int b2 = m428b > 0 ? this.f87244b.m4621a().b(m428b) : 0;
        if (a2 == 1 && b2 == 2) {
            new GroupVideoWrapper(this.f87244b).a(new fhm(this, meetingInfo));
        } else {
            new QavWrapper(BaseApplication.getContext()).a(new fhn(this, meetingInfo));
        }
    }

    private void c(MeetingInfo meetingInfo) {
        new Timer().schedule(new fho(this, meetingInfo), meetingInfo.getShowTimeCount());
    }

    public void d(MeetingInfo meetingInfo) {
        long a2 = this.f87244b.m4621a().a(2, Long.parseLong(meetingInfo.getDiscuss_uin()));
        HashMap hashMap = new HashMap();
        hashMap.put("sessiontype", String.valueOf(2));
        hashMap.put("sessionid", meetingInfo.getDiscuss_uin());
        hashMap.put("arrangeseq", String.valueOf(meetingInfo.getSeq()));
        hashMap.put("roommemnum", String.valueOf(a2));
        StatisticCollector.a((Context) BaseApplication.getContext()).a(this.f87244b.getCurrentAccountUin(), "actConfRoomState", true, 0L, 0L, hashMap, (String) null, true);
    }
}