package com.tencent.mm.plugin.appbrand.networking;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ai.b;
import com.tencent.mm.bt.a;
import com.tencent.mm.ci.g;
import com.tencent.mm.protocal.protobuf.btd;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.al;
import com.tencent.mm.sdk.platformtools.bp;
import com.tencent.mm.vending.g.c;
import com.tencent.mm.vending.h.h;
import java.util.Map;

public final class f implements a {
    protected static final boolean gNV = bp.dpL();
    protected static final h ipK = new h(new al("MicroMsg.WxaCgiServiceWC").oAl.getLooper(), "MicroMsg.WxaCgiServiceWC");
    protected static final Map<String, Integer> ipL;

    public final /* synthetic */ c a(String str, a aVar, Class cls) {
        AppMethodBeat.i(132320);
        com.tencent.mm.ci.f b = b(str, aVar, cls);
        AppMethodBeat.o(132320);
        return b;
    }

    static {
        AppMethodBeat.i(132321);
        1 1 = new 1();
        ipL = 1;
        1.put("/cgi-bin/mmbiz-bin/wxaapp/verifyplugin", Integer.valueOf(1714));
        ipL.put("/cgi-bin/mmbiz-bin/wxabusiness/reportwxaappexpose", Integer.valueOf(1345));
        ipL.put("/cgi-bin/mmbiz-bin/wxaapp_getauthinfo", Integer.valueOf(1115));
        ipL.put("/cgi-bin/mmbiz-bin/wxabusiness/getremotedebugticket", Integer.valueOf(1862));
        ipL.put("/cgi-bin/mmbiz-bin/wxaapp/autofill/deleteinfo", Integer.valueOf(1194));
        ipL.put("/cgi-bin/mmbiz-bin/wxaapp/autofill/getinfo", Integer.valueOf(1191));
        ipL.put("/cgi-bin/mmbiz-bin/wxaapp/autofill/saveinfo", Integer.valueOf(1180));
        ipL.put("/cgi-bin/mmbiz-bin/wxaapp/autofill/authinfo", Integer.valueOf(1183));
        ipL.put("/cgi-bin/mmbiz-bin/js-authorize", Integer.valueOf(1157));
        ipL.put("/cgi-bin/mmbiz-bin/js-authorize-confirm", Integer.valueOf(1158));
        AppMethodBeat.o(132321);
    }

    private <Resp extends btd> com.tencent.mm.ci.f<Resp> b(String str, a aVar, Class<Resp> cls) {
        AppMethodBeat.i(132319);
        b.a aVar2 = new b.a();
        aVar2.fsI = ((Integer) ipL.get(str)).intValue();
        aVar2.uri = str;
        aVar2.fsJ = aVar;
        try {
            aVar2.fsK = (a) cls.newInstance();
        } catch (IllegalAccessException | InstantiationException e) {
            ab.e("MicroMsg.WxaCgiServiceWC", "new Response failed %s", new Object[]{cls.getName()});
            if (gNV) {
                RuntimeException runtimeException = new RuntimeException(e);
                AppMethodBeat.o(132319);
                throw runtimeException;
            }
        }
        com.tencent.mm.ci.f g = g.dOW().d(ipK).g(new 2(this, aVar2));
        AppMethodBeat.o(132319);
        return g;
    }
}
