package com.tencent.mm.plugin.record.b;

import com.tencent.mm.plugin.record.a.j;

class q$a implements Runnable {
    final /* synthetic */ q pJT;
    private j pJu;

    public q$a(q qVar, j jVar) {
        this.pJT = qVar;
        this.pJu = jVar;
    }

    /* JADX WARNING: Removed duplicated region for block: B:29:0x00d0  */
    /* JADX WARNING: Removed duplicated region for block: B:53:0x0283  */
    /* JADX WARNING: Removed duplicated region for block: B:32:0x00f4  */
    public final void run() {
        /*
        r12 = this;
        r0 = 135724; // 0x2122c float:1.9019E-40 double:6.70566E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r0);
        r1 = 0;
        r0 = 0;
        r2 = "MicroMsg.RecordMsgSendService";
        r3 = "dojob ChatDataCopyRunnable, info id:%s";
        r4 = 1;
        r4 = new java.lang.Object[r4];
        r5 = 0;
        r6 = r12.pJu;
        r6 = r6.field_msgId;
        r6 = java.lang.Long.valueOf(r6);
        r4[r5] = r6;
        com.tencent.mm.sdk.platformtools.ab.i(r2, r3, r4);
        r2 = r12.pJu;
        if (r2 == 0) goto L_0x02e1;
    L_0x0023:
        r2 = r12.pJu;
        r2 = r2.field_dataProto;
        if (r2 == 0) goto L_0x02e1;
    L_0x0029:
        r2 = r12.pJu;
        r2 = r2.field_dataProto;
        r2 = r2.wiv;
        if (r2 == 0) goto L_0x02e1;
    L_0x0031:
        r2 = r12.pJu;
        r2 = r2.field_dataProto;
        r2 = r2.wiv;
        r4 = r2.iterator();
        r2 = r0;
    L_0x003c:
        r0 = r4.hasNext();
        if (r0 == 0) goto L_0x02e2;
    L_0x0042:
        r0 = r4.next();
        r0 = (com.tencent.mm.protocal.protobuf.aar) r0;
        r3 = r0.wfZ;
        r3 = com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r3);
        if (r3 == 0) goto L_0x0058;
    L_0x0050:
        r3 = r0.wgx;
        r3 = com.tencent.mm.vfs.e.ct(r3);
        if (r3 == 0) goto L_0x0366;
    L_0x0058:
        r5 = r0.wgx;
        r3 = r12.pJu;
        r6 = r3.field_msgId;
        r6 = com.tencent.mm.plugin.record.b.n.c(r0, r6);
        r8 = com.tencent.mm.vfs.e.y(r5, r6);
        r10 = 0;
        r3 = (r8 > r10 ? 1 : (r8 == r10 ? 0 : -1));
        if (r3 <= 0) goto L_0x027a;
    L_0x006c:
        r3 = 1;
    L_0x006d:
        r7 = "MicroMsg.RecordMsgSendService";
        r8 = "summerrecord CdnDataUrl[%s] copy[%s] to [%s] result[%B]";
        r9 = 4;
        r9 = new java.lang.Object[r9];
        r10 = 0;
        r11 = r0.wfZ;
        r9[r10] = r11;
        r10 = 1;
        r9[r10] = r5;
        r5 = 2;
        r9[r5] = r6;
        r5 = 3;
        r10 = java.lang.Boolean.valueOf(r3);
        r9[r5] = r10;
        com.tencent.mm.sdk.platformtools.ab.d(r7, r8, r9);
        if (r3 == 0) goto L_0x0363;
    L_0x008d:
        r3 = r0.wgq;
        r3 = com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r3);
        if (r3 == 0) goto L_0x00a6;
    L_0x0095:
        r1 = "MicroMsg.RecordMsgSendService";
        r3 = "summerrecord not find full md5, try to calculate";
        com.tencent.mm.sdk.platformtools.ab.i(r1, r3);
        r1 = com.tencent.mm.vfs.e.atg(r6);
        r0.akS(r1);
        r1 = 1;
    L_0x00a6:
        r3 = r0.wgs;
        r3 = com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r3);
        if (r3 == 0) goto L_0x0363;
    L_0x00ae:
        r1 = "MicroMsg.RecordMsgSendService";
        r3 = "summerrecord not find head 256 md5, try to calculate";
        com.tencent.mm.sdk.platformtools.ab.i(r1, r3);
        r1 = 0;
        r3 = 256; // 0x100 float:3.59E-43 double:1.265E-321;
        r1 = com.tencent.mm.vfs.e.e(r6, r1, r3);
        if (r1 != 0) goto L_0x027d;
    L_0x00c0:
        r1 = 0;
    L_0x00c1:
        r0.akT(r1);
        r1 = 1;
        r3 = r1;
    L_0x00c6:
        r8 = com.tencent.mm.vfs.e.asZ(r6);
        r10 = 0;
        r1 = (r8 > r10 ? 1 : (r8 == r10 ? 0 : -1));
        if (r1 == 0) goto L_0x00d7;
    L_0x00d0:
        r6 = com.tencent.mm.vfs.e.asZ(r6);
        r0.mf(r6);
    L_0x00d7:
        r1 = r0.mnd;
        r5 = r12.pJu;
        r6 = r5.field_msgId;
        r5 = 0;
        r5 = com.tencent.mm.plugin.record.b.n.h(r1, r6, r5);
        r1 = com.tencent.mm.plugin.record.a.a.class;
        r1 = com.tencent.mm.kernel.g.M(r1);
        r1 = (com.tencent.mm.plugin.record.a.a) r1;
        r1 = r1.getRecordMsgCDNStorage();
        r1 = r1.VH(r5);
        if (r1 != 0) goto L_0x0283;
    L_0x00f4:
        r6 = new com.tencent.mm.plugin.record.a.i;
        r6.<init>();
        r1 = r0.wgb;
        r6.field_cdnKey = r1;
        r1 = r0.wfZ;
        r6.field_cdnUrl = r1;
        r1 = r0.mnd;
        r6.field_dataId = r1;
        r6.field_mediaId = r5;
        r8 = r0.wgu;
        r1 = (int) r8;
        r6.field_totalLen = r1;
        r1 = r6.field_mediaId;
        r1 = r1.hashCode();
        r6.field_localId = r1;
        r1 = r12.pJu;
        r8 = r1.field_msgId;
        r1 = com.tencent.mm.plugin.record.b.n.c(r0, r8);
        r6.field_path = r1;
        r1 = 2;
        r6.field_type = r1;
        r1 = r0.dataType;
        r1 = com.tencent.mm.plugin.record.b.n.BH(r1);
        r6.field_fileType = r1;
        r1 = r12.pJu;
        r1 = r1.field_localId;
        r6.field_recordLocalId = r1;
        r1 = r12.pJu;
        r1 = r1.field_toUser;
        r6.field_toUser = r1;
        r1 = 0;
        r6.field_isThumb = r1;
        r1 = com.tencent.mm.plugin.record.a.a.class;
        r1 = com.tencent.mm.kernel.g.M(r1);
        r1 = (com.tencent.mm.plugin.record.a.a) r1;
        r1 = r1.getRecordMsgCDNStorage();
        r1 = r1.b(r6);
        r2 = 1;
        r7 = "MicroMsg.RecordMsgSendService";
        r8 = "summerrecord insert localId[%d] result[%B] fileType[%d], mediaId[%s]";
        r9 = 4;
        r9 = new java.lang.Object[r9];
        r10 = 0;
        r11 = r6.field_localId;
        r11 = java.lang.Integer.valueOf(r11);
        r9[r10] = r11;
        r10 = 1;
        r1 = java.lang.Boolean.valueOf(r1);
        r9[r10] = r1;
        r1 = 2;
        r6 = r6.field_fileType;
        r6 = java.lang.Integer.valueOf(r6);
        r9[r1] = r6;
        r1 = 3;
        r9[r1] = r5;
        com.tencent.mm.sdk.platformtools.ab.i(r7, r8, r9);
    L_0x0171:
        r1 = r0.fgE;
        r1 = com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r1);
        if (r1 == 0) goto L_0x0181;
    L_0x0179:
        r1 = r0.wgz;
        r1 = com.tencent.mm.vfs.e.ct(r1);
        if (r1 == 0) goto L_0x035f;
    L_0x0181:
        r5 = r0.wgz;
        r1 = r12.pJu;
        r6 = r1.field_msgId;
        r6 = com.tencent.mm.plugin.record.b.n.f(r0, r6);
        r8 = com.tencent.mm.vfs.e.y(r5, r6);
        r10 = 0;
        r1 = (r8 > r10 ? 1 : (r8 == r10 ? 0 : -1));
        if (r1 <= 0) goto L_0x02af;
    L_0x0195:
        r1 = 1;
    L_0x0196:
        r7 = "MicroMsg.RecordMsgSendService";
        r8 = "copy thumb[%s] to [%s] result[%B]";
        r9 = 3;
        r9 = new java.lang.Object[r9];
        r10 = 0;
        r9[r10] = r5;
        r5 = 1;
        r9[r5] = r6;
        r5 = 2;
        r10 = java.lang.Boolean.valueOf(r1);
        r9[r5] = r10;
        com.tencent.mm.sdk.platformtools.ab.d(r7, r8, r9);
        r8 = com.tencent.mm.vfs.e.asZ(r6);
        r0.mg(r8);
        if (r1 == 0) goto L_0x01ea;
    L_0x01b8:
        r1 = r0.wgB;
        r1 = com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r1);
        if (r1 == 0) goto L_0x01d1;
    L_0x01c0:
        r1 = "MicroMsg.RecordMsgSendService";
        r3 = "not find ThumbMd5 md5, try to calculate";
        com.tencent.mm.sdk.platformtools.ab.i(r1, r3);
        r1 = com.tencent.mm.a.g.cz(r6);
        r0.akX(r1);
        r3 = 1;
    L_0x01d1:
        r1 = r0.wgD;
        r1 = com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r1);
        if (r1 == 0) goto L_0x01ea;
    L_0x01d9:
        r1 = "MicroMsg.RecordMsgSendService";
        r3 = "not find Thumb Head 256 Md5, try to calculate";
        com.tencent.mm.sdk.platformtools.ab.i(r1, r3);
        r1 = com.tencent.mm.a.g.cA(r6);
        r0.akY(r1);
        r3 = 1;
    L_0x01ea:
        r1 = r0.mnd;
        r5 = com.tencent.mm.plugin.record.b.n.LA(r1);
        r1 = r12.pJu;
        r6 = r1.field_msgId;
        r1 = 0;
        r6 = com.tencent.mm.plugin.record.b.n.h(r5, r6, r1);
        r1 = com.tencent.mm.plugin.record.a.a.class;
        r1 = com.tencent.mm.kernel.g.M(r1);
        r1 = (com.tencent.mm.plugin.record.a.a) r1;
        r1 = r1.getRecordMsgCDNStorage();
        r1 = r1.VH(r6);
        if (r1 != 0) goto L_0x02b2;
    L_0x020b:
        r1 = new com.tencent.mm.plugin.record.a.i;
        r1.<init>();
        r2 = r0.wfV;
        r1.field_cdnKey = r2;
        r2 = r0.fgE;
        r1.field_cdnUrl = r2;
        r1.field_dataId = r5;
        r1.field_mediaId = r6;
        r6 = r0.wgF;
        r2 = (int) r6;
        r1.field_totalLen = r2;
        r2 = r1.field_mediaId;
        r2 = r2.hashCode();
        r1.field_localId = r2;
        r2 = r12.pJu;
        r6 = r2.field_msgId;
        r0 = com.tencent.mm.plugin.record.b.n.f(r0, r6);
        r1.field_path = r0;
        r0 = 2;
        r1.field_type = r0;
        r0 = com.tencent.mm.i.a.MediaType_FULLSIZEIMAGE;
        r1.field_fileType = r0;
        r0 = r12.pJu;
        r0 = r0.field_localId;
        r1.field_recordLocalId = r0;
        r0 = r12.pJu;
        r0 = r0.field_toUser;
        r1.field_toUser = r0;
        r0 = 1;
        r1.field_isThumb = r0;
        r0 = com.tencent.mm.plugin.record.a.a.class;
        r0 = com.tencent.mm.kernel.g.M(r0);
        r0 = (com.tencent.mm.plugin.record.a.a) r0;
        r0 = r0.getRecordMsgCDNStorage();
        r2 = r0.b(r1);
        r0 = 1;
        r5 = "MicroMsg.RecordMsgSendService";
        r6 = "insert localId[%d] result[%B]";
        r7 = 2;
        r7 = new java.lang.Object[r7];
        r8 = 0;
        r1 = r1.field_localId;
        r1 = java.lang.Integer.valueOf(r1);
        r7[r8] = r1;
        r1 = 1;
        r2 = java.lang.Boolean.valueOf(r2);
        r7[r1] = r2;
        com.tencent.mm.sdk.platformtools.ab.i(r5, r6, r7);
        r2 = r0;
        r1 = r3;
        goto L_0x003c;
    L_0x027a:
        r3 = 0;
        goto L_0x006d;
    L_0x027d:
        r1 = com.tencent.mm.a.g.x(r1);
        goto L_0x00c1;
    L_0x0283:
        r5 = r1.field_status;
        r6 = 2;
        if (r5 == r6) goto L_0x0171;
    L_0x0288:
        r5 = r1.field_status;
        r6 = 3;
        if (r5 == r6) goto L_0x0171;
    L_0x028d:
        r5 = r1.field_status;
        r6 = 4;
        if (r5 == r6) goto L_0x0171;
    L_0x0292:
        r5 = r1.field_status;
        r6 = -1;
        if (r5 == r6) goto L_0x0171;
    L_0x0297:
        r2 = "MicroMsg.RecordMsgSendService";
        r5 = "hasInsertCdn, cdnInfo status:%s";
        r6 = 1;
        r6 = new java.lang.Object[r6];
        r7 = 0;
        r1 = r1.field_status;
        r1 = java.lang.Integer.valueOf(r1);
        r6[r7] = r1;
        com.tencent.mm.sdk.platformtools.ab.i(r2, r5, r6);
        r2 = 1;
        goto L_0x0171;
    L_0x02af:
        r1 = 0;
        goto L_0x0196;
    L_0x02b2:
        r0 = r1.field_status;
        r5 = 2;
        if (r0 == r5) goto L_0x035f;
    L_0x02b7:
        r0 = r1.field_status;
        r5 = 3;
        if (r0 == r5) goto L_0x035f;
    L_0x02bc:
        r0 = r1.field_status;
        r5 = 4;
        if (r0 == r5) goto L_0x035f;
    L_0x02c1:
        r0 = r1.field_status;
        r5 = -1;
        if (r0 == r5) goto L_0x035f;
    L_0x02c6:
        r0 = "MicroMsg.RecordMsgSendService";
        r2 = "hasInsertCdn, thumb cdnInfo status:%s";
        r5 = 1;
        r5 = new java.lang.Object[r5];
        r6 = 0;
        r1 = r1.field_status;
        r1 = java.lang.Integer.valueOf(r1);
        r5[r6] = r1;
        com.tencent.mm.sdk.platformtools.ab.i(r0, r2, r5);
        r2 = 1;
        r0 = r2;
        r1 = r3;
    L_0x02de:
        r2 = r0;
        goto L_0x003c;
    L_0x02e1:
        r2 = r0;
    L_0x02e2:
        if (r1 == 0) goto L_0x032b;
    L_0x02e4:
        r0 = "MicroMsg.RecordMsgSendService";
        r1 = "update record info, something changed, localid %d msgid %d, type %d";
        r3 = 3;
        r3 = new java.lang.Object[r3];
        r4 = 0;
        r5 = r12.pJu;
        r5 = r5.field_localId;
        r5 = java.lang.Integer.valueOf(r5);
        r3[r4] = r5;
        r4 = 1;
        r5 = r12.pJu;
        r6 = r5.field_msgId;
        r5 = java.lang.Long.valueOf(r6);
        r3[r4] = r5;
        r4 = 2;
        r5 = r12.pJu;
        r5 = r5.field_type;
        r5 = java.lang.Integer.valueOf(r5);
        r3[r4] = r5;
        com.tencent.mm.sdk.platformtools.ab.i(r0, r1, r3);
        r0 = com.tencent.mm.plugin.record.a.a.class;
        r0 = com.tencent.mm.kernel.g.M(r0);
        r0 = (com.tencent.mm.plugin.record.a.a) r0;
        r0 = r0.getRecordMsgStorage();
        r1 = r12.pJu;
        r3 = 1;
        r3 = new java.lang.String[r3];
        r4 = 0;
        r5 = "localId";
        r3[r4] = r5;
        r0.c(r1, r3);
    L_0x032b:
        if (r2 != 0) goto L_0x0349;
    L_0x032d:
        r0 = "MicroMsg.RecordMsgSendService";
        r1 = "doSendContinue without cdn task";
        com.tencent.mm.sdk.platformtools.ab.i(r0, r1);
        r0 = r12.pJT;
        r1 = r12.pJu;
        r2 = 0;
        r0.a(r1, r2);
        r0 = r12.pJT;
        r1 = 0;
        r0.pJx = r1;
        r0 = r12.pJT;
        r1 = 0;
        r0.a(r1);
    L_0x0349:
        r0 = com.tencent.mm.plugin.record.a.a.class;
        r0 = com.tencent.mm.kernel.g.M(r0);
        r0 = (com.tencent.mm.plugin.record.a.a) r0;
        r0 = r0.getRecordMsgCDNService();
        r0.run();
        r0 = 135724; // 0x2122c float:1.9019E-40 double:6.70566E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r0);
        return;
    L_0x035f:
        r0 = r2;
        r1 = r3;
        goto L_0x02de;
    L_0x0363:
        r3 = r1;
        goto L_0x00c6;
    L_0x0366:
        r3 = r1;
        goto L_0x0171;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.record.b.q$a.run():void");
    }
}
