package com.tencent.mm.plugin.appbrand.jsapi.audio;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.g.a.mb;
import com.tencent.mm.plugin.appbrand.g;
import com.tencent.mm.plugin.appbrand.jsapi.audio.j.a;
import com.tencent.mm.plugin.appbrand.media.record.AudioRecordVoIPInterruptListener;
import com.tencent.mm.plugin.appbrand.media.record.h;
import com.tencent.mm.plugin.appbrand.q;
import com.tencent.mm.plugin.appbrand.r.j;
import com.tencent.mm.plugin.appbrand.s.q$b;
import com.tencent.mm.sdk.b.c;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.ytcommon.BuildConfig;
import java.io.File;
import java.util.HashMap;
import org.json.JSONObject;

class j$b extends a {
    public int action;
    public String appId;
    private boolean cHT;
    private int duration = 0;
    public boolean error = false;
    private String filePath = BuildConfig.FLAVOR;
    private int fileSize = 0;
    private byte[] frameBuffer;
    AudioRecordVoIPInterruptListener hAN;
    private j hAO;
    public String hAP;
    private String hAQ = BuildConfig.FLAVOR;
    private String hAR;
    private int hAS;
    private final c<mb> hAT = new 1(this);
    public String hAa = BuildConfig.FLAVOR;
    public String hAz;
    g.c huj;
    public q hwf;
    public int hwi;
    public String processName = BuildConfig.FLAVOR;
    private String state = BuildConfig.FLAVOR;

    public j$b(j jVar, q qVar, int i) {
        AppMethodBeat.i(130747);
        this.hAO = jVar;
        this.hwf = qVar;
        this.hwi = i;
        j jVar2 = new j();
        if (qVar.asE().a(jVar2) == com.tencent.mm.plugin.appbrand.appstorage.j.gXA) {
            this.hAR = new File((String) jVar2.value, "frameBuffer").getAbsolutePath();
            AppMethodBeat.o(130747);
            return;
        }
        this.hAR = new File(qVar.getContext().getCacheDir(), "frameBuffer_" + qVar.getAppId()).getAbsolutePath();
        AppMethodBeat.o(130747);
    }

    /* JADX WARNING: Removed duplicated region for block: B:76:0x0279  */
    /* JADX WARNING: Removed duplicated region for block: B:34:0x0176  */
    public final void Dp() {
        /*
        r15 = this;
        r14 = 130748; // 0x1febc float:1.83217E-40 double:6.4598E-319;
        r13 = 2;
        r12 = -1;
        r1 = 0;
        r2 = 1;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r14);
        r0 = new org.json.JSONObject;	 Catch:{ JSONException -> 0x0037 }
        r3 = r15.hAP;	 Catch:{ JSONException -> 0x0037 }
        r0.<init>(r3);	 Catch:{ JSONException -> 0x0037 }
        r3 = "operationType";
        r3 = r0.optString(r3);
        r4 = android.text.TextUtils.isEmpty(r3);
        if (r4 == 0) goto L_0x0071;
    L_0x001e:
        r0 = "MicroMsg.Record.JsApiOperateRecorder";
        r1 = "operationType is null";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r1);
        r15.error = r2;
        r15.action = r12;
        r0 = "operationType is null";
        r15.hAa = r0;
        r15.wM();
        com.tencent.matrix.trace.core.AppMethodBeat.o(r14);
    L_0x0036:
        return;
    L_0x0037:
        r0 = move-exception;
        r3 = "MicroMsg.Record.JsApiOperateRecorder";
        r4 = "new json exists exception, data is invalid, dataStr:%s";
        r5 = new java.lang.Object[r2];
        r6 = r15.hAP;
        r5[r1] = r6;
        com.tencent.mm.sdk.platformtools.ab.e(r3, r4, r5);
        r15.error = r2;
        r15.action = r12;
        r1 = "parser data fail, data is invalid";
        r15.hAa = r1;
        r1 = "MicroMsg.Record.JsApiOperateRecorder";
        r2 = new java.lang.StringBuilder;
        r3 = "exception:%s";
        r2.<init>(r3);
        r0 = r0.getMessage();
        r0 = r2.append(r0);
        r0 = r0.toString();
        com.tencent.mm.sdk.platformtools.ab.e(r1, r0);
        r15.wM();
        com.tencent.matrix.trace.core.AppMethodBeat.o(r14);
        goto L_0x0036;
    L_0x0071:
        r4 = "MicroMsg.Record.JsApiOperateRecorder";
        r5 = "operationType;%s";
        r6 = new java.lang.Object[r2];
        r6[r1] = r3;
        com.tencent.mm.sdk.platformtools.ab.i(r4, r5, r6);
        r15.error = r1;
        r15.action = r12;
        r4 = "start";
        r4 = r3.equals(r4);
        if (r4 == 0) goto L_0x0293;
    L_0x008b:
        r3 = "duration";
        r4 = 60000; // 0xea60 float:8.4078E-41 double:2.9644E-319;
        r3 = r0.optInt(r3, r4);
        r4 = "sampleRate";
        r5 = 44100; // 0xac44 float:6.1797E-41 double:2.17883E-319;
        r4 = r0.optInt(r4, r5);
        r5 = "numberOfChannels";
        r5 = r0.optInt(r5, r13);
        r6 = "encodeBitRate";
        r7 = 128000; // 0x1f400 float:1.79366E-40 double:6.32404E-319;
        r6 = r0.optInt(r6, r7);
        r7 = "format";
        r7 = r0.optString(r7);
        r8 = "frameSize";
        r10 = 0;
        r8 = r0.optDouble(r8, r10);
        r10 = "audioSource";
        r0 = r0.optString(r10);
        r0 = r0.toUpperCase();
        r10 = com.tencent.mm.plugin.appbrand.media.record.b.ila;
        r0 = com.tencent.mm.plugin.appbrand.media.record.b.a(r0, r10);
        r10 = r15.appId;
        r11 = r15.hAT;
        com.tencent.mm.plugin.appbrand.media.record.c.b(r10, r11);
        r10 = new com.tencent.mm.plugin.appbrand.media.record.record_imp.RecordParam;
        r10.<init>();
        r10.duration = r3;
        r10.sampleRate = r4;
        r10.imk = r5;
        r10.iml = r6;
        r10.hAQ = r7;
        r3 = 8;
        r10.scene = r3;
        r10.imm = r8;
        r3 = new java.lang.StringBuilder;
        r3.<init>();
        r4 = java.lang.System.currentTimeMillis();
        r3 = r3.append(r4);
        r3 = r3.toString();
        r10.euD = r3;
        r3 = r15.processName;
        r10.processName = r3;
        r3 = r15.appId;
        r10.appId = r3;
        r10.imn = r0;
        r0 = r15.hAN;
        if (r0 != 0) goto L_0x0115;
    L_0x010e:
        r0 = new com.tencent.mm.plugin.appbrand.media.record.AudioRecordVoIPInterruptListener;
        r0.<init>();
        r15.hAN = r0;
    L_0x0115:
        r0 = r15.hAN;
        r10.imo = r0;
        r15.hAQ = r7;
        com.tencent.mm.plugin.appbrand.media.record.c.aIe();
        r3 = com.tencent.mm.plugin.appbrand.media.record.g.aIm();
        r0 = "MicroMsg.Record.AudioRecordMgr";
        r4 = "startRecord";
        com.tencent.mm.sdk.platformtools.ab.i(r0, r4);
        r0 = r3.ilo;
        if (r0 == 0) goto L_0x0195;
    L_0x012f:
        r0 = r10.appId;
        if (r0 == 0) goto L_0x0195;
    L_0x0133:
        r0 = r10.appId;
        r4 = r3.ilo;
        r4 = r4.appId;
        r0 = r0.equalsIgnoreCase(r4);
        if (r0 != 0) goto L_0x0195;
    L_0x013f:
        r0 = "MicroMsg.Record.AudioRecordMgr";
        r4 = "appId is diff, must stop record first";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r4);
        r3.EB();
    L_0x014b:
        r0 = r10.hAQ;
        r0 = android.text.TextUtils.isEmpty(r0);
        if (r0 != 0) goto L_0x0163;
    L_0x0153:
        r0 = r10.duration;
        if (r0 < 0) goto L_0x0163;
    L_0x0157:
        r0 = r10.iml;
        if (r0 <= 0) goto L_0x0163;
    L_0x015b:
        r0 = r10.sampleRate;
        if (r0 <= 0) goto L_0x0163;
    L_0x015f:
        r0 = r10.imk;
        if (r0 > 0) goto L_0x01b3;
    L_0x0163:
        r0 = r1;
    L_0x0164:
        if (r0 != 0) goto L_0x01b5;
    L_0x0166:
        r0 = "MicroMsg.Record.AudioRecordMgr";
        r3 = "startRecord fail, param is invalid";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r3);
        r0 = 15;
        com.tencent.mm.plugin.appbrand.media.record.j.pk(r0);
    L_0x0174:
        if (r1 == 0) goto L_0x0279;
    L_0x0176:
        r0 = "MicroMsg.Record.JsApiOperateRecorder";
        r1 = "star record ok";
        com.tencent.mm.sdk.platformtools.ab.i(r0, r1);
        r15.action = r12;
    L_0x0181:
        r0 = r15.error;
        if (r0 == 0) goto L_0x018d;
    L_0x0185:
        r0 = "MicroMsg.Record.JsApiOperateRecorder";
        r1 = r15.hAa;
        com.tencent.mm.sdk.platformtools.ab.e(r0, r1);
    L_0x018d:
        r15.wM();
        com.tencent.matrix.trace.core.AppMethodBeat.o(r14);
        goto L_0x0036;
    L_0x0195:
        r0 = r3.mIsRecording;
        if (r0 == 0) goto L_0x01a3;
    L_0x0199:
        r0 = "MicroMsg.Record.AudioRecordMgr";
        r3 = "startRecord fail, is recording";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r3);
        goto L_0x0174;
    L_0x01a3:
        r0 = r3.DA();
        if (r0 == 0) goto L_0x014b;
    L_0x01a9:
        r0 = "MicroMsg.Record.AudioRecordMgr";
        r3 = "startRecord fail, is pause";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r3);
        goto L_0x0174;
    L_0x01b3:
        r0 = r2;
        goto L_0x0164;
    L_0x01b5:
        r0 = r10.hAQ;
        r0 = com.tencent.mm.plugin.appbrand.media.record.h.Cz(r0);
        if (r0 != 0) goto L_0x01d2;
    L_0x01bd:
        r0 = "MicroMsg.Record.AudioRecordMgr";
        r3 = "startRecord fail, encode format %s is not support!";
        r4 = new java.lang.Object[r2];
        r5 = r10.hAQ;
        r4[r1] = r5;
        com.tencent.mm.sdk.platformtools.ab.e(r0, r3, r4);
        r0 = 16;
        com.tencent.mm.plugin.appbrand.media.record.j.pk(r0);
        goto L_0x0174;
    L_0x01d2:
        r0 = r10.euD;
        r0 = android.text.TextUtils.isEmpty(r0);
        if (r0 == 0) goto L_0x01ed;
    L_0x01da:
        r0 = new java.lang.StringBuilder;
        r0.<init>();
        r4 = java.lang.System.currentTimeMillis();
        r0 = r0.append(r4);
        r0 = r0.toString();
        r10.euD = r0;
    L_0x01ed:
        com.tencent.mm.plugin.appbrand.media.record.j.aIt();
        r0 = "MicroMsg.Record.RecordParamCompatibility";
        r4 = "recordParam duration:%d, numberOfChannels:%d, sampleRate:%d, encodeBitRate:%d";
        r5 = 4;
        r5 = new java.lang.Object[r5];
        r6 = r10.duration;
        r6 = java.lang.Integer.valueOf(r6);
        r5[r1] = r6;
        r1 = r10.imk;
        r1 = java.lang.Integer.valueOf(r1);
        r5[r2] = r1;
        r1 = r10.sampleRate;
        r1 = java.lang.Integer.valueOf(r1);
        r5[r13] = r1;
        r1 = 3;
        r6 = r10.iml;
        r6 = java.lang.Integer.valueOf(r6);
        r5[r1] = r6;
        com.tencent.mm.sdk.platformtools.ab.i(r0, r4, r5);
        r0 = r10.duration;
        if (r0 > 0) goto L_0x0256;
    L_0x0221:
        r0 = 60000; // 0xea60 float:8.4078E-41 double:2.9644E-319;
        r10.duration = r0;
    L_0x0226:
        r0 = r10.imk;
        if (r0 > 0) goto L_0x0230;
    L_0x022a:
        r0 = r10.imk;
        if (r0 <= r13) goto L_0x0230;
    L_0x022e:
        r10.imk = r13;
    L_0x0230:
        r0 = r10.sampleRate;
        r1 = 48000; // 0xbb80 float:6.7262E-41 double:2.3715E-319;
        if (r0 <= r1) goto L_0x0263;
    L_0x0237:
        r0 = 48000; // 0xbb80 float:6.7262E-41 double:2.3715E-319;
        r10.sampleRate = r0;
    L_0x023c:
        r0 = r10.iml;
        r1 = 320000; // 0x4e200 float:4.48416E-40 double:1.58101E-318;
        if (r0 <= r1) goto L_0x026e;
    L_0x0243:
        r0 = 320000; // 0x4e200 float:4.48416E-40 double:1.58101E-318;
        r10.iml = r0;
    L_0x0248:
        r0 = new com.tencent.mm.plugin.appbrand.media.record.g$7;
        r0.<init>(r3, r10);
        r1 = "app_brand_start_record";
        com.tencent.mm.sdk.g.d.post(r0, r1);
        r1 = r2;
        goto L_0x0174;
    L_0x0256:
        r0 = r10.duration;
        r1 = 600000; // 0x927c0 float:8.40779E-40 double:2.964394E-318;
        if (r0 < r1) goto L_0x0226;
    L_0x025d:
        r0 = 600000; // 0x927c0 float:8.40779E-40 double:2.964394E-318;
        r10.duration = r0;
        goto L_0x0226;
    L_0x0263:
        r0 = r10.sampleRate;
        r1 = 8000; // 0x1f40 float:1.121E-41 double:3.9525E-320;
        if (r0 >= r1) goto L_0x023c;
    L_0x0269:
        r0 = 8000; // 0x1f40 float:1.121E-41 double:3.9525E-320;
        r10.sampleRate = r0;
        goto L_0x023c;
    L_0x026e:
        r0 = r10.iml;
        r1 = 16000; // 0x3e80 float:2.2421E-41 double:7.905E-320;
        if (r0 >= r1) goto L_0x0248;
    L_0x0274:
        r0 = 16000; // 0x3e80 float:2.2421E-41 double:7.905E-320;
        r10.iml = r0;
        goto L_0x0248;
    L_0x0279:
        r0 = com.tencent.mm.plugin.appbrand.media.record.g.aIm();
        r0 = r0.mIsRecording;
        if (r0 == 0) goto L_0x028a;
    L_0x0281:
        r15.error = r2;
        r0 = "audio is recording, don't start record again";
        r15.hAa = r0;
        goto L_0x0181;
    L_0x028a:
        r15.error = r2;
        r0 = "start record fail";
        r15.hAa = r0;
        goto L_0x0181;
    L_0x0293:
        r0 = "resume";
        r0 = r3.equals(r0);
        if (r0 == 0) goto L_0x02f4;
    L_0x029c:
        r0 = com.tencent.mm.plugin.appbrand.media.record.g.aIm();
        r3 = r0.mIsRecording;
        if (r3 == 0) goto L_0x02bc;
    L_0x02a4:
        r0 = "MicroMsg.Record.AudioRecordMgr";
        r3 = "resumeRecord fail, is recording";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r3);
    L_0x02ad:
        if (r1 == 0) goto L_0x02da;
    L_0x02af:
        r15.action = r12;
        r0 = "MicroMsg.Record.JsApiOperateRecorder";
        r1 = "resume record ok";
        com.tencent.mm.sdk.platformtools.ab.i(r0, r1);
        goto L_0x0181;
    L_0x02bc:
        r3 = r0.ilo;
        if (r3 != 0) goto L_0x02ca;
    L_0x02c0:
        r0 = "MicroMsg.Record.AudioRecordMgr";
        r3 = "resumeRecord fail, mRecordParam is null";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r3);
        goto L_0x02ad;
    L_0x02ca:
        com.tencent.mm.plugin.appbrand.media.record.j.aIt();
        r1 = new com.tencent.mm.plugin.appbrand.media.record.g$8;
        r1.<init>(r0);
        r0 = "app_brand_resume_record";
        com.tencent.mm.sdk.g.d.post(r1, r0);
        r1 = r2;
        goto L_0x02ad;
    L_0x02da:
        r0 = com.tencent.mm.plugin.appbrand.media.record.g.aIm();
        r0 = r0.mIsRecording;
        if (r0 == 0) goto L_0x02eb;
    L_0x02e2:
        r15.error = r2;
        r0 = "audio is recording, don't resume record again";
        r15.hAa = r0;
        goto L_0x0181;
    L_0x02eb:
        r15.error = r2;
        r0 = "resume record fail";
        r15.hAa = r0;
        goto L_0x0181;
    L_0x02f4:
        r0 = "pause";
        r0 = r3.equals(r0);
        if (r0 == 0) goto L_0x0361;
    L_0x02fd:
        r0 = com.tencent.mm.plugin.appbrand.media.record.g.aIm();
        r3 = "MicroMsg.Record.AudioRecordMgr";
        r4 = "pauseRecord";
        com.tencent.mm.sdk.platformtools.ab.i(r3, r4);
        r3 = r0.ilm;
        if (r3 != 0) goto L_0x0327;
    L_0x030e:
        r0 = "MicroMsg.Record.AudioRecordMgr";
        r3 = "mRecord is null";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r3);
        r0 = r1;
    L_0x0318:
        if (r0 == 0) goto L_0x0345;
    L_0x031a:
        r15.action = r12;
        r0 = "MicroMsg.Record.JsApiOperateRecorder";
        r1 = "pause record ok";
        com.tencent.mm.sdk.platformtools.ab.i(r0, r1);
        goto L_0x0181;
    L_0x0327:
        r1 = r0.DA();
        if (r1 == 0) goto L_0x0338;
    L_0x032d:
        r0 = "MicroMsg.Record.AudioRecordMgr";
        r1 = "is paused, don't pause again";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r1);
        r0 = r2;
        goto L_0x0318;
    L_0x0338:
        r1 = new com.tencent.mm.plugin.appbrand.media.record.g$9;
        r1.<init>(r0);
        r0 = "app_brand_pause_record";
        com.tencent.mm.sdk.g.d.post(r1, r0);
        r0 = r2;
        goto L_0x0318;
    L_0x0345:
        r0 = com.tencent.mm.plugin.appbrand.media.record.g.aIm();
        r0 = r0.DA();
        if (r0 == 0) goto L_0x0358;
    L_0x034f:
        r15.error = r2;
        r0 = "audio is pause, don't pause record again";
        r15.hAa = r0;
        goto L_0x0181;
    L_0x0358:
        r15.error = r2;
        r0 = "pause record fail";
        r15.hAa = r0;
        goto L_0x0181;
    L_0x0361:
        r0 = "stop";
        r0 = r3.equals(r0);
        if (r0 == 0) goto L_0x039d;
    L_0x036a:
        r0 = com.tencent.mm.plugin.appbrand.media.record.g.aIm();
        r0 = r0.EB();
        if (r0 == 0) goto L_0x0381;
    L_0x0374:
        r15.action = r12;
        r0 = "MicroMsg.Record.JsApiOperateRecorder";
        r1 = "stop record ok";
        com.tencent.mm.sdk.platformtools.ab.i(r0, r1);
        goto L_0x0181;
    L_0x0381:
        r0 = com.tencent.mm.plugin.appbrand.media.record.g.aIm();
        r0 = r0.DB();
        if (r0 == 0) goto L_0x0394;
    L_0x038b:
        r15.error = r2;
        r0 = "audio is stop, don't stop record again";
        r15.hAa = r0;
        goto L_0x0181;
    L_0x0394:
        r15.error = r2;
        r0 = "stop record fail";
        r15.hAa = r0;
        goto L_0x0181;
    L_0x039d:
        r0 = "MicroMsg.Record.JsApiOperateRecorder";
        r1 = "operationType is invalid";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r1);
        r15.error = r2;
        r0 = "operationType is invalid";
        r15.hAa = r0;
        goto L_0x0181;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.appbrand.jsapi.audio.j$b.Dp():void");
    }

    public final void wM() {
        AppMethodBeat.i(130749);
        super.wM();
        if (this.hwf == null) {
            ab.e("MicroMsg.Record.JsApiOperateRecorder", "service is null, don't callback");
            AppMethodBeat.o(130749);
        } else if (this.action != -1) {
            a aVar = new a();
            switch (this.action) {
                case 0:
                case 1:
                    j.a(this.hAO, true);
                    if (!j.aCv().contains(this.appId)) {
                        g.a(this.appId, this.huj);
                        j.aCv().add(this.appId);
                        break;
                    }
                    break;
                case 2:
                case 3:
                case 4:
                    j.a(this.hAO, false);
                    if (this.action == 2 || this.action == 4) {
                        g.b(this.appId, this.huj);
                        j.aCv().remove(this.appId);
                        break;
                    }
            }
            if (this.action == 2) {
                HashMap hashMap = new HashMap();
                hashMap.put("state", this.state);
                ab.i("MicroMsg.Record.JsApiOperateRecorder", "filePath:%s, encodeFormat:%s", new Object[]{this.filePath, this.hAQ});
                j jVar = new j();
                if (this.hwf.asE().a(new File(this.filePath), h.Cy(this.hAQ), true, jVar) == com.tencent.mm.plugin.appbrand.appstorage.j.gXA) {
                    hashMap.put("tempFilePath", jVar.value);
                } else {
                    ab.e("MicroMsg.Record.JsApiOperateRecorder", "AppBrandLocalMediaObject obj is null");
                    hashMap.put("tempFilePath", BuildConfig.FLAVOR);
                }
                hashMap.put("duration", Integer.valueOf(this.duration));
                hashMap.put("fileSize", Integer.valueOf(this.fileSize));
                this.hAz = new JSONObject(hashMap).toString();
            }
            if (this.action == 5) {
                HashMap hashMap2 = new HashMap();
                hashMap2.put("state", this.state);
                hashMap2.put("isLastFrame", Boolean.valueOf(this.cHT));
                if (this.hAS > 819200) {
                    aCw();
                }
                if (this.frameBuffer != null) {
                    hashMap2.put("frameBuffer", com.tencent.mm.plugin.appbrand.s.q.al(this.frameBuffer));
                } else {
                    ab.e("MicroMsg.Record.JsApiOperateRecorder", "framBuffer is null, error");
                }
                q$b a = com.tencent.mm.plugin.appbrand.s.q.a(this.hwf.aBx(), hashMap2, (com.tencent.mm.plugin.appbrand.s.q.a) this.hwf.aa(com.tencent.mm.plugin.appbrand.s.q.a.class));
                if (a == q$b.OK) {
                    this.hAz = new JSONObject(hashMap2).toString();
                } else if (a == q$b.FAIL_SIZE_EXCEED_LIMIT) {
                    com.tencent.mm.plugin.appbrand.s.q.m(this.hwf, "onRecorderStateChange");
                    AppMethodBeat.o(130749);
                    return;
                }
            }
            ab.i("MicroMsg.Record.JsApiOperateRecorder", "operateRecorder onRecorderStateChange callback action:%d, jsonResult:%s", new Object[]{Integer.valueOf(this.action), this.hAz});
            aVar.i(this.hwf).AL(this.hAz).aCj();
            AppMethodBeat.o(130749);
        } else if (this.error) {
            ab.e("MicroMsg.Record.JsApiOperateRecorder", "operateRecorder fail:%s", new Object[]{this.hAa});
            this.hwf.M(this.hwi, this.hAO.j("fail:" + this.hAa, null));
            AppMethodBeat.o(130749);
        } else {
            ab.i("MicroMsg.Record.JsApiOperateRecorder", "operateRecorder ok");
            this.hwf.M(this.hwi, this.hAO.j("ok", null));
            AppMethodBeat.o(130749);
        }
    }

    /* JADX WARNING: Unknown top exception splitter block from list: {B:26:0x0090=Splitter:B:26:0x0090, B:40:0x00c8=Splitter:B:40:0x00c8} */
    /* JADX WARNING: Removed duplicated region for block: B:29:0x009e A:{SYNTHETIC, Splitter:B:29:0x009e} */
    /* JADX WARNING: Removed duplicated region for block: B:43:0x00d6 A:{SYNTHETIC, Splitter:B:43:0x00d6} */
    /* JADX WARNING: Removed duplicated region for block: B:55:0x0103 A:{SYNTHETIC, Splitter:B:55:0x0103} */
    /* JADX WARNING: Removed duplicated region for block: B:29:0x009e A:{SYNTHETIC, Splitter:B:29:0x009e} */
    /* JADX WARNING: Removed duplicated region for block: B:32:0x00a3  */
    /* JADX WARNING: Removed duplicated region for block: B:43:0x00d6 A:{SYNTHETIC, Splitter:B:43:0x00d6} */
    /* JADX WARNING: Removed duplicated region for block: B:46:0x00db  */
    /* JADX WARNING: Removed duplicated region for block: B:55:0x0103 A:{SYNTHETIC, Splitter:B:55:0x0103} */
    /* JADX WARNING: Removed duplicated region for block: B:58:0x0108  */
    private void aCw() {
        /*
        r10 = this;
        r2 = 0;
        r9 = 130750; // 0x1febe float:1.8322E-40 double:6.4599E-319;
        r8 = 0;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r9);
        r4 = java.lang.System.nanoTime();
        r3 = new java.io.File;	 Catch:{ FileNotFoundException -> 0x008d, IOException -> 0x00c5, all -> 0x00fe }
        r0 = r10.hAR;	 Catch:{ FileNotFoundException -> 0x008d, IOException -> 0x00c5, all -> 0x00fe }
        r3.<init>(r0);	 Catch:{ FileNotFoundException -> 0x008d, IOException -> 0x00c5, all -> 0x00fe }
        r0 = r3.exists();	 Catch:{ FileNotFoundException -> 0x0136, IOException -> 0x0131, all -> 0x012c }
        if (r0 == 0) goto L_0x0053;
    L_0x0019:
        r1 = new java.io.FileInputStream;	 Catch:{ FileNotFoundException -> 0x0136, IOException -> 0x0131, all -> 0x012c }
        r1.<init>(r3);	 Catch:{ FileNotFoundException -> 0x0136, IOException -> 0x0131, all -> 0x012c }
        r0 = r10.hAS;	 Catch:{ FileNotFoundException -> 0x013a, IOException -> 0x0134 }
        r0 = new byte[r0];	 Catch:{ FileNotFoundException -> 0x013a, IOException -> 0x0134 }
        r10.frameBuffer = r0;	 Catch:{ FileNotFoundException -> 0x013a, IOException -> 0x0134 }
        r0 = r10.frameBuffer;	 Catch:{ FileNotFoundException -> 0x013a, IOException -> 0x0134 }
        r1.read(r0);	 Catch:{ FileNotFoundException -> 0x013a, IOException -> 0x0134 }
        r1.close();	 Catch:{ FileNotFoundException -> 0x013a, IOException -> 0x0134 }
        r1.close();	 Catch:{ IOException -> 0x0076 }
    L_0x002f:
        r0 = r3.exists();
        if (r0 == 0) goto L_0x0083;
    L_0x0035:
        r3.delete();
    L_0x0038:
        r0 = java.lang.System.nanoTime();
        r2 = "MicroMsg.Record.JsApiOperateRecorder";
        r3 = "time:%d";
        r6 = 1;
        r6 = new java.lang.Object[r6];
        r0 = r0 - r4;
        r0 = java.lang.Long.valueOf(r0);
        r6[r8] = r0;
        com.tencent.mm.sdk.platformtools.ab.d(r2, r3, r6);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r9);
    L_0x0052:
        return;
    L_0x0053:
        r0 = "MicroMsg.Record.JsApiOperateRecorder";
        r1 = "frameBufferFile is not exist, return";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r1);	 Catch:{ FileNotFoundException -> 0x0136, IOException -> 0x0131, all -> 0x012c }
        r0 = r3.exists();
        if (r0 == 0) goto L_0x0069;
    L_0x0062:
        r3.delete();
        com.tencent.matrix.trace.core.AppMethodBeat.o(r9);
        goto L_0x0052;
    L_0x0069:
        r0 = "MicroMsg.Record.JsApiOperateRecorder";
        r1 = "frameBufferFile is not exist, delete error";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r1);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r9);
        goto L_0x0052;
    L_0x0076:
        r0 = move-exception;
        r1 = "MicroMsg.Record.JsApiOperateRecorder";
        r2 = "";
        r6 = new java.lang.Object[r8];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r1, r0, r2, r6);
        goto L_0x002f;
    L_0x0083:
        r0 = "MicroMsg.Record.JsApiOperateRecorder";
        r1 = "frameBufferFile is not exist, delete error";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r1);
        goto L_0x0038;
    L_0x008d:
        r0 = move-exception;
        r1 = r2;
        r3 = r2;
    L_0x0090:
        r2 = "MicroMsg.Record.JsApiOperateRecorder";
        r6 = "";
        r7 = 0;
        r7 = new java.lang.Object[r7];	 Catch:{ all -> 0x012f }
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r2, r0, r6, r7);	 Catch:{ all -> 0x012f }
        if (r1 == 0) goto L_0x00a1;
    L_0x009e:
        r1.close();	 Catch:{ IOException -> 0x00ad }
    L_0x00a1:
        if (r3 == 0) goto L_0x00ba;
    L_0x00a3:
        r0 = r3.exists();
        if (r0 == 0) goto L_0x00ba;
    L_0x00a9:
        r3.delete();
        goto L_0x0038;
    L_0x00ad:
        r0 = move-exception;
        r1 = "MicroMsg.Record.JsApiOperateRecorder";
        r2 = "";
        r6 = new java.lang.Object[r8];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r1, r0, r2, r6);
        goto L_0x00a1;
    L_0x00ba:
        r0 = "MicroMsg.Record.JsApiOperateRecorder";
        r1 = "frameBufferFile is not exist, delete error";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r1);
        goto L_0x0038;
    L_0x00c5:
        r0 = move-exception;
        r1 = r2;
        r3 = r2;
    L_0x00c8:
        r2 = "MicroMsg.Record.JsApiOperateRecorder";
        r6 = "";
        r7 = 0;
        r7 = new java.lang.Object[r7];	 Catch:{ all -> 0x012f }
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r2, r0, r6, r7);	 Catch:{ all -> 0x012f }
        if (r1 == 0) goto L_0x00d9;
    L_0x00d6:
        r1.close();	 Catch:{ IOException -> 0x00e6 }
    L_0x00d9:
        if (r3 == 0) goto L_0x00f3;
    L_0x00db:
        r0 = r3.exists();
        if (r0 == 0) goto L_0x00f3;
    L_0x00e1:
        r3.delete();
        goto L_0x0038;
    L_0x00e6:
        r0 = move-exception;
        r1 = "MicroMsg.Record.JsApiOperateRecorder";
        r2 = "";
        r6 = new java.lang.Object[r8];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r1, r0, r2, r6);
        goto L_0x00d9;
    L_0x00f3:
        r0 = "MicroMsg.Record.JsApiOperateRecorder";
        r1 = "frameBufferFile is not exist, delete error";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r1);
        goto L_0x0038;
    L_0x00fe:
        r0 = move-exception;
        r1 = r2;
        r3 = r2;
    L_0x0101:
        if (r1 == 0) goto L_0x0106;
    L_0x0103:
        r1.close();	 Catch:{ IOException -> 0x0115 }
    L_0x0106:
        if (r3 == 0) goto L_0x0122;
    L_0x0108:
        r1 = r3.exists();
        if (r1 == 0) goto L_0x0122;
    L_0x010e:
        r3.delete();
    L_0x0111:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r9);
        throw r0;
    L_0x0115:
        r1 = move-exception;
        r2 = "MicroMsg.Record.JsApiOperateRecorder";
        r4 = "";
        r5 = new java.lang.Object[r8];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r2, r1, r4, r5);
        goto L_0x0106;
    L_0x0122:
        r1 = "MicroMsg.Record.JsApiOperateRecorder";
        r2 = "frameBufferFile is not exist, delete error";
        com.tencent.mm.sdk.platformtools.ab.e(r1, r2);
        goto L_0x0111;
    L_0x012c:
        r0 = move-exception;
        r1 = r2;
        goto L_0x0101;
    L_0x012f:
        r0 = move-exception;
        goto L_0x0101;
    L_0x0131:
        r0 = move-exception;
        r1 = r2;
        goto L_0x00c8;
    L_0x0134:
        r0 = move-exception;
        goto L_0x00c8;
    L_0x0136:
        r0 = move-exception;
        r1 = r2;
        goto L_0x0090;
    L_0x013a:
        r0 = move-exception;
        goto L_0x0090;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.appbrand.jsapi.audio.j$b.aCw():void");
    }
}
