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

import com.tencent.mm.plugin.appbrand.jsapi.c;
import com.tencent.mm.plugin.appbrand.l.d.a;
import java.util.ArrayList;
import java.util.Map;
import org.json.JSONObject;

class d$1 implements Runnable {
    final /* synthetic */ String hvm;
    final /* synthetic */ c hxc;
    final /* synthetic */ JSONObject ioC;
    final /* synthetic */ a ioD;
    final /* synthetic */ int ioE;
    final /* synthetic */ Map ioF;
    final /* synthetic */ ArrayList ioG;
    final /* synthetic */ String ioH;
    final /* synthetic */ d ioI;

    d$1(d dVar, c cVar, JSONObject jSONObject, a aVar, String str, int i, Map map, ArrayList arrayList, String str2) {
        this.ioI = dVar;
        this.hxc = cVar;
        this.ioC = jSONObject;
        this.ioD = aVar;
        this.hvm = str;
        this.ioE = i;
        this.ioF = map;
        this.ioG = arrayList;
        this.ioH = str2;
    }

    /* JADX WARNING: Missing block: B:33:0x00ef, code skipped:
            com.tencent.mm.sdk.platformtools.ab.i("MicroMsg.AppBrandNetworkRequest", "request taskId %s, method %s ,url %s timeout %s", new java.lang.Object[]{r11.hvm, r5, r1, java.lang.Integer.valueOf(r11.ioE)});
            r0 = new com.tencent.mm.plugin.appbrand.l.e(r1, r2, r11.ioE, r11.ioD, r5);
            r0.ioM = r11.ioF;
            r0.ioN = r11.ioG;
            r0.ioR = r11.ioH;
            r0.ioP = r11.ioC.optString("responseType", "text");
            r1 = r11.ioI.ioA;
     */
    /* JADX WARNING: Missing block: B:34:0x0133, code skipped:
            monitor-enter(r1);
     */
    /* JADX WARNING: Missing block: B:36:?, code skipped:
            r11.ioI.ioA.add(r0);
     */
    /* JADX WARNING: Missing block: B:37:0x013b, code skipped:
            monitor-exit(r1);
     */
    /* JADX WARNING: Missing block: B:38:0x013c, code skipped:
            r0.hvr = r11.hvm;
            com.tencent.mm.plugin.appbrand.l.d.a(r11.ioI, r0);
     */
    /* JADX WARNING: Missing block: B:46:0x0152, code skipped:
            com.tencent.matrix.trace.core.AppMethodBeat.o(108148);
     */
    public final void run() {
        /*
        r11 = this;
        r10 = 2;
        r9 = 1;
        r7 = 0;
        r8 = 108148; // 0x1a674 float:1.51548E-40 double:5.3432E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r8);
        r0 = r11.hxc;
        r1 = r0.aBx();
        r2 = r11.ioC;
        r0 = r11.hxc;
        r3 = com.tencent.mm.plugin.appbrand.s.q.a.class;
        r0 = r0.aa(r3);
        r0 = (com.tencent.mm.plugin.appbrand.s.q.a) r0;
        r0 = com.tencent.mm.plugin.appbrand.s.q.a(r1, r2, r0);
        r1 = com.tencent.mm.plugin.appbrand.s.q$b.FAIL_SIZE_EXCEED_LIMIT;
        if (r0 != r1) goto L_0x002f;
    L_0x0023:
        r0 = r11.ioD;
        r1 = "convert native buffer parameter fail. native buffer exceed size limit.";
        r0.BA(r1);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
    L_0x002e:
        return;
    L_0x002f:
        r0 = r11.ioC;
        r1 = "url";
        r0 = r0.optString(r1);
        r1 = com.tencent.mm.plugin.appbrand.l.j.CS(r0);
        r0 = r11.ioC;
        r2 = "data";
        r0 = r0.opt(r2);
        r2 = r11.ioC;
        r3 = "method";
        r5 = r2.optString(r3);
        r2 = com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r5);
        if (r2 == 0) goto L_0x0057;
    L_0x0054:
        r5 = "GET";
    L_0x0057:
        r2 = android.text.TextUtils.isEmpty(r1);
        if (r2 == 0) goto L_0x0069;
    L_0x005d:
        r0 = r11.ioD;
        r1 = "url is null";
        r0.BA(r1);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
        goto L_0x002e;
    L_0x0069:
        r2 = android.webkit.URLUtil.isHttpsUrl(r1);
        if (r2 != 0) goto L_0x0081;
    L_0x006f:
        r2 = android.webkit.URLUtil.isHttpUrl(r1);
        if (r2 != 0) goto L_0x0081;
    L_0x0075:
        r0 = r11.ioD;
        r1 = "request protocol must be http or https";
        r0.BA(r1);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
        goto L_0x002e;
    L_0x0081:
        r2 = new byte[r7];
        if (r0 == 0) goto L_0x009c;
    L_0x0085:
        r3 = com.tencent.mm.plugin.appbrand.l.d.CK(r5);
        if (r3 == 0) goto L_0x009c;
    L_0x008b:
        r3 = r0 instanceof java.lang.String;
        if (r3 == 0) goto L_0x00e3;
    L_0x008f:
        r0 = (java.lang.String) r0;
        r2 = "UTF-8";
        r2 = java.nio.charset.Charset.forName(r2);
        r2 = r0.getBytes(r2);
    L_0x009c:
        r0 = r11.ioI;
        r3 = r0.ioA;
        monitor-enter(r3);
        r0 = r11.ioI;	 Catch:{ all -> 0x014a }
        r0 = r0.ioA;	 Catch:{ all -> 0x014a }
        r0 = r0.size();	 Catch:{ all -> 0x014a }
        r4 = r11.ioI;	 Catch:{ all -> 0x014a }
        r4 = r4.ioB;	 Catch:{ all -> 0x014a }
        if (r0 < r4) goto L_0x00ee;
    L_0x00af:
        r0 = r11.ioD;	 Catch:{ all -> 0x014a }
        r1 = "max connected";
        r0.BA(r1);	 Catch:{ all -> 0x014a }
        r0 = "MicroMsg.AppBrandNetworkRequest";
        r1 = "max connected mRequestTaskList.size():%d,mMaxRequestConcurrent:%d";
        r2 = 2;
        r2 = new java.lang.Object[r2];	 Catch:{ all -> 0x014a }
        r4 = 0;
        r5 = r11.ioI;	 Catch:{ all -> 0x014a }
        r5 = r5.ioA;	 Catch:{ all -> 0x014a }
        r5 = r5.size();	 Catch:{ all -> 0x014a }
        r5 = java.lang.Integer.valueOf(r5);	 Catch:{ all -> 0x014a }
        r2[r4] = r5;	 Catch:{ all -> 0x014a }
        r4 = 1;
        r5 = r11.ioI;	 Catch:{ all -> 0x014a }
        r5 = r5.ioB;	 Catch:{ all -> 0x014a }
        r5 = java.lang.Integer.valueOf(r5);	 Catch:{ all -> 0x014a }
        r2[r4] = r5;	 Catch:{ all -> 0x014a }
        com.tencent.mm.sdk.platformtools.ab.i(r0, r1, r2);	 Catch:{ all -> 0x014a }
        monitor-exit(r3);	 Catch:{ all -> 0x014a }
        com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
        goto L_0x002e;
    L_0x00e3:
        r3 = r0 instanceof java.nio.ByteBuffer;
        if (r3 == 0) goto L_0x009c;
    L_0x00e7:
        r0 = (java.nio.ByteBuffer) r0;
        r2 = com.tencent.mm.plugin.appbrand.r.d.q(r0);
        goto L_0x009c;
    L_0x00ee:
        monitor-exit(r3);	 Catch:{ all -> 0x014a }
        r0 = "MicroMsg.AppBrandNetworkRequest";
        r3 = "request taskId %s, method %s ,url %s timeout %s";
        r4 = 4;
        r4 = new java.lang.Object[r4];
        r6 = r11.hvm;
        r4[r7] = r6;
        r4[r9] = r5;
        r4[r10] = r1;
        r6 = 3;
        r7 = r11.ioE;
        r7 = java.lang.Integer.valueOf(r7);
        r4[r6] = r7;
        com.tencent.mm.sdk.platformtools.ab.i(r0, r3, r4);
        r0 = new com.tencent.mm.plugin.appbrand.l.e;
        r3 = r11.ioE;
        r4 = r11.ioD;
        r0.<init>(r1, r2, r3, r4, r5);
        r1 = r11.ioF;
        r0.ioM = r1;
        r1 = r11.ioG;
        r0.ioN = r1;
        r1 = r11.ioH;
        r0.ioR = r1;
        r1 = r11.ioC;
        r2 = "responseType";
        r3 = "text";
        r1 = r1.optString(r2, r3);
        r0.ioP = r1;
        r1 = r11.ioI;
        r1 = r1.ioA;
        monitor-enter(r1);
        r2 = r11.ioI;	 Catch:{ all -> 0x0150 }
        r2 = r2.ioA;	 Catch:{ all -> 0x0150 }
        r2.add(r0);	 Catch:{ all -> 0x0150 }
        monitor-exit(r1);	 Catch:{ all -> 0x0150 }
        r1 = r11.hvm;
        r0.hvr = r1;
        r1 = r11.ioI;
        com.tencent.mm.plugin.appbrand.l.d.a(r1, r0);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
        goto L_0x002e;
    L_0x014a:
        r0 = move-exception;
        monitor-exit(r3);	 Catch:{ all -> 0x014a }
        com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
        throw r0;
    L_0x0150:
        r0 = move-exception;
        monitor-exit(r1);	 Catch:{ all -> 0x0150 }
        com.tencent.matrix.trace.core.AppMethodBeat.o(r8);
        throw r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.appbrand.l.d$1.run():void");
    }
}
