package com.tencent.mm.plugin.messenger.foundation;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ci.c;
import com.tencent.mm.kernel.g;
import com.tencent.mm.modelmulti.j;
import com.tencent.mm.modelmulti.o;
import com.tencent.mm.modelmulti.p;
import com.tencent.mm.plugin.messenger.foundation.a.h;
import com.tencent.mm.plugin.messenger.foundation.a.r;
import com.tencent.mm.plugin.messenger.foundation.a.r.a;
import com.tencent.mm.plugin.messenger.foundation.a.t;
import com.tencent.mm.plugin.messenger.foundation.a.u;
import com.tencent.mm.protocal.protobuf.tb;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.al;
import java.io.IOException;
import java.util.LinkedList;

public final class f implements com.tencent.mm.plugin.zero.a.f {
    private t oqx;

    public final void ca(Object obj) {
        AppMethodBeat.i(1061);
        c bOt = u.bOt();
        if (bOt != null) {
            this.oqx = (t) bOt.get();
        }
        if (this.oqx == null) {
            this.oqx = new a((byte) 0);
        }
        if (obj instanceof j) {
            ((com.tencent.mm.plugin.messenger.foundation.a.j) g.K(com.tencent.mm.plugin.messenger.foundation.a.j.class)).bOr().QW(((j) obj).TAG);
            ((h) g.K(h.class)).Pl();
            AppMethodBeat.o(1061);
            return;
        }
        if (obj instanceof String) {
            if (obj.equals("NetSceneInit")) {
                ((com.tencent.mm.plugin.messenger.foundation.a.j) g.K(com.tencent.mm.plugin.messenger.foundation.a.j.class)).bOr().QW((String) obj);
                ((h) g.K(h.class)).Pl();
                AppMethodBeat.o(1061);
                return;
            }
        } else if (obj instanceof o.c) {
            ((com.tencent.mm.plugin.messenger.foundation.a.j) g.K(com.tencent.mm.plugin.messenger.foundation.a.j.class)).bOr().QW(obj.toString());
            ((h) g.K(h.class)).Pl();
        }
        AppMethodBeat.o(1061);
    }

    public final void a(tb tbVar, byte[] bArr, boolean z) {
        AppMethodBeat.i(1062);
        r yv = a.yv(tbVar.wat);
        if (yv != null) {
            try {
                yv.a(tbVar, bArr, z, this.oqx);
                AppMethodBeat.o(1062);
                return;
            } catch (IOException e) {
                ab.e("MicroMsg.SyncDoCmdExtensions", "docmd: parse protobuf error, " + e.getMessage());
                RuntimeException runtimeException = new RuntimeException("docmd: parse protobuf error");
                AppMethodBeat.o(1062);
                throw runtimeException;
            }
        }
        ab.w("MicroMsg.SyncDoCmdExtensions", "SyncDoCmdExtension for cmd id [%s] is null.", new Object[]{Integer.valueOf(tbVar.wat)});
        AppMethodBeat.o(1062);
    }

    public final void cc(Object obj) {
        AppMethodBeat.i(1063);
        if (obj instanceof j) {
            LinkedList linkedList;
            this.oqx.bOs();
            ((com.tencent.mm.plugin.messenger.foundation.a.j) g.K(com.tencent.mm.plugin.messenger.foundation.a.j.class)).bOr().QX(((j) obj).TAG);
            al RS = g.RS();
            String str = ((j) obj).TAG;
            p pVar = ((j) obj).fIx;
            j jVar = (j) obj;
            if (jVar.fIF == null || jVar.fIF.vyH.vTR == null) {
                linkedList = null;
            } else {
                linkedList = jVar.fIF.vyH.vTR.jBw;
            }
            RS.aa(new b(str, pVar, linkedList));
            ((h) g.K(h.class)).Pm();
            AppMethodBeat.o(1063);
        } else if ((obj instanceof String) && obj.equals("NetSceneInit")) {
            this.oqx.bOs();
            ((com.tencent.mm.plugin.messenger.foundation.a.j) g.K(com.tencent.mm.plugin.messenger.foundation.a.j.class)).bOr().QX((String) obj);
            ((h) g.K(h.class)).Pm();
            AppMethodBeat.o(1063);
        } else {
            if (obj instanceof o.c) {
                this.oqx.bOs();
                ((com.tencent.mm.plugin.messenger.foundation.a.j) g.K(com.tencent.mm.plugin.messenger.foundation.a.j.class)).bOr().QX(obj.toString());
                ((h) g.K(h.class)).Pm();
            }
            AppMethodBeat.o(1063);
        }
    }

    public final void cd(Object obj) {
        AppMethodBeat.i(1064);
        if (obj instanceof j) {
            ((com.tencent.mm.plugin.messenger.foundation.a.j) g.K(com.tencent.mm.plugin.messenger.foundation.a.j.class)).bOr().QX(((j) obj).TAG);
        }
        AppMethodBeat.o(1064);
    }
}
