package com.tencent.mm.pluginsdk.i;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.compatible.util.e;
import com.tencent.mm.kernel.g;
import com.tencent.mm.modelvoice.q;
import com.tencent.mm.plugin.report.service.h;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.storage.aa;

public final class c {
    private static boolean[] vfY = new boolean[21];

    public static boolean diH() {
        AppMethodBeat.i(27473);
        g.RQ();
        if (g.RP().isSDCardAvailable()) {
            boolean ajm = ajm(e.eSn);
            g.RS().aa(new 1());
            AppMethodBeat.o(27473);
            return ajm;
        }
        AppMethodBeat.o(27473);
        return true;
    }

    /* JADX WARNING: Removed duplicated region for block: B:23:0x006b  */
    /* JADX WARNING: Removed duplicated region for block: B:35:0x00d2 A:{SYNTHETIC, Splitter:B:35:0x00d2} */
    /* JADX WARNING: Removed duplicated region for block: B:65:0x012e  */
    /* JADX WARNING: Removed duplicated region for block: B:38:0x00d7 A:{SYNTHETIC, Splitter:B:38:0x00d7} */
    /* JADX WARNING: Removed duplicated region for block: B:23:0x006b  */
    /* JADX WARNING: Removed duplicated region for block: B:48:0x00fd A:{SYNTHETIC, Splitter:B:48:0x00fd} */
    /* JADX WARNING: Removed duplicated region for block: B:51:0x0102 A:{SYNTHETIC, Splitter:B:51:0x0102} */
    /* JADX WARNING: Removed duplicated region for block: B:35:0x00d2 A:{SYNTHETIC, Splitter:B:35:0x00d2} */
    /* JADX WARNING: Removed duplicated region for block: B:38:0x00d7 A:{SYNTHETIC, Splitter:B:38:0x00d7} */
    /* JADX WARNING: Removed duplicated region for block: B:65:0x012e  */
    /* JADX WARNING: Removed duplicated region for block: B:23:0x006b  */
    /* JADX WARNING: Removed duplicated region for block: B:48:0x00fd A:{SYNTHETIC, Splitter:B:48:0x00fd} */
    /* JADX WARNING: Removed duplicated region for block: B:51:0x0102 A:{SYNTHETIC, Splitter:B:51:0x0102} */
    private static boolean ajm(java.lang.String r8) {
        /*
        r3 = 0;
        r7 = 27474; // 0x6b52 float:3.8499E-41 double:1.3574E-319;
        r0 = 1;
        r1 = 0;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r7);
        r2 = com.tencent.mm.vfs.e.ct(r8);
        if (r2 != 0) goto L_0x0012;
    L_0x000e:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r7);
    L_0x0011:
        return r0;
    L_0x0012:
        r2 = new java.lang.StringBuilder;
        r2.<init>();
        r2 = r2.append(r8);
        r4 = "test_writable";
        r2 = r2.append(r4);
        r5 = r2.toString();
        r2 = com.tencent.mm.vfs.e.ct(r5);	 Catch:{ IOException -> 0x00a8, all -> 0x00f8 }
        if (r2 == 0) goto L_0x002f;
    L_0x002c:
        com.tencent.mm.vfs.e.deleteFile(r5);	 Catch:{ IOException -> 0x00a8, all -> 0x00f8 }
    L_0x002f:
        com.tencent.mm.vfs.e.atc(r5);	 Catch:{ IOException -> 0x00a8, all -> 0x00f8 }
        r4 = new java.io.DataOutputStream;	 Catch:{ IOException -> 0x00a8, all -> 0x00f8 }
        r2 = 0;
        r2 = com.tencent.mm.vfs.e.L(r5, r2);	 Catch:{ IOException -> 0x00a8, all -> 0x00f8 }
        r4.<init>(r2);	 Catch:{ IOException -> 0x00a8, all -> 0x00f8 }
        r2 = 1;
        r4.writeInt(r2);	 Catch:{ IOException -> 0x0128, all -> 0x0123 }
        r4.flush();	 Catch:{ IOException -> 0x0128, all -> 0x0123 }
        r4.close();	 Catch:{ IOException -> 0x0128, all -> 0x0123 }
        r2 = new java.io.DataInputStream;	 Catch:{ IOException -> 0x0128, all -> 0x0123 }
        r6 = com.tencent.mm.vfs.e.openRead(r5);	 Catch:{ IOException -> 0x0128, all -> 0x0123 }
        r2.<init>(r6);	 Catch:{ IOException -> 0x0128, all -> 0x0123 }
        r3 = r2.readInt();	 Catch:{ IOException -> 0x012b }
        r2.close();	 Catch:{ IOException -> 0x012b }
        r5 = com.tencent.mm.vfs.e.deleteFile(r5);	 Catch:{ IOException -> 0x012b }
        if (r5 == 0) goto L_0x008c;
    L_0x005c:
        r5 = 1;
        r3 = com.tencent.mm.sdk.platformtools.bo.gW(r5, r3);	 Catch:{ IOException -> 0x012b }
        if (r3 == 0) goto L_0x008c;
    L_0x0063:
        r4.close();	 Catch:{ IOException -> 0x008e }
    L_0x0066:
        r2.close();	 Catch:{ IOException -> 0x009b }
    L_0x0069:
        if (r0 != 0) goto L_0x0088;
    L_0x006b:
        r1 = "MicroMsg.SdcardCheckUtil";
        r2 = new java.lang.StringBuilder;
        r3 = " dir: ";
        r2.<init>(r3);
        r2 = r2.append(r8);
        r3 = " Unusable; ";
        r2 = r2.append(r3);
        r2 = r2.toString();
        com.tencent.mm.sdk.platformtools.ab.w(r1, r2);
    L_0x0088:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r7);
        goto L_0x0011;
    L_0x008c:
        r0 = r1;
        goto L_0x0063;
    L_0x008e:
        r3 = move-exception;
        r4 = "MicroMsg.SdcardCheckUtil";
        r5 = "";
        r6 = new java.lang.Object[r1];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r4, r3, r5, r6);
        goto L_0x0066;
    L_0x009b:
        r2 = move-exception;
        r3 = "MicroMsg.SdcardCheckUtil";
        r4 = "";
        r1 = new java.lang.Object[r1];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r3, r2, r4, r1);
        goto L_0x0069;
    L_0x00a8:
        r0 = move-exception;
        r2 = r3;
        r4 = r3;
    L_0x00ab:
        r3 = "MicroMsg.SdcardCheckUtil";
        r5 = new java.lang.StringBuilder;	 Catch:{ all -> 0x0126 }
        r6 = " dir: ";
        r5.<init>(r6);	 Catch:{ all -> 0x0126 }
        r5 = r5.append(r8);	 Catch:{ all -> 0x0126 }
        r6 = " Unusable; ";
        r5 = r5.append(r6);	 Catch:{ all -> 0x0126 }
        r0 = r0.getMessage();	 Catch:{ all -> 0x0126 }
        r0 = r5.append(r0);	 Catch:{ all -> 0x0126 }
        r0 = r0.toString();	 Catch:{ all -> 0x0126 }
        com.tencent.mm.sdk.platformtools.ab.w(r3, r0);	 Catch:{ all -> 0x0126 }
        if (r4 == 0) goto L_0x00d5;
    L_0x00d2:
        r4.close();	 Catch:{ IOException -> 0x00dc }
    L_0x00d5:
        if (r2 == 0) goto L_0x012e;
    L_0x00d7:
        r2.close();	 Catch:{ IOException -> 0x00e9 }
        r0 = r1;
        goto L_0x0069;
    L_0x00dc:
        r0 = move-exception;
        r3 = "MicroMsg.SdcardCheckUtil";
        r4 = "";
        r5 = new java.lang.Object[r1];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r3, r0, r4, r5);
        goto L_0x00d5;
    L_0x00e9:
        r0 = move-exception;
        r2 = "MicroMsg.SdcardCheckUtil";
        r3 = "";
        r4 = new java.lang.Object[r1];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r2, r0, r3, r4);
        r0 = r1;
        goto L_0x0069;
    L_0x00f8:
        r0 = move-exception;
        r2 = r3;
        r4 = r3;
    L_0x00fb:
        if (r4 == 0) goto L_0x0100;
    L_0x00fd:
        r4.close();	 Catch:{ IOException -> 0x0109 }
    L_0x0100:
        if (r2 == 0) goto L_0x0105;
    L_0x0102:
        r2.close();	 Catch:{ IOException -> 0x0116 }
    L_0x0105:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r7);
        throw r0;
    L_0x0109:
        r3 = move-exception;
        r4 = "MicroMsg.SdcardCheckUtil";
        r5 = "";
        r6 = new java.lang.Object[r1];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r4, r3, r5, r6);
        goto L_0x0100;
    L_0x0116:
        r2 = move-exception;
        r3 = "MicroMsg.SdcardCheckUtil";
        r4 = "";
        r1 = new java.lang.Object[r1];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r3, r2, r4, r1);
        goto L_0x0105;
    L_0x0123:
        r0 = move-exception;
        r2 = r3;
        goto L_0x00fb;
    L_0x0126:
        r0 = move-exception;
        goto L_0x00fb;
    L_0x0128:
        r0 = move-exception;
        r2 = r3;
        goto L_0x00ab;
    L_0x012b:
        r0 = move-exception;
        goto L_0x00ab;
    L_0x012e:
        r0 = r1;
        goto L_0x0069;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.pluginsdk.i.c.ajm(java.lang.String):boolean");
    }

    static /* synthetic */ void access$000() {
        StringBuilder stringBuilder;
        AppMethodBeat.i(27475);
        long currentTimeMillis = System.currentTimeMillis();
        if (!(vfY[4] || ajm(e.euQ))) {
            h.pYm.k(951, 4, 1);
            vfY[4] = true;
        }
        if (!(vfY[5] || ajm(e.euT))) {
            h.pYm.k(951, 5, 1);
            vfY[5] = true;
        }
        if (!(vfY[6] || ajm(e.euR))) {
            h.pYm.k(951, 6, 1);
            vfY[6] = true;
        }
        if (!(vfY[7] || ajm(e.evi))) {
            h.pYm.k(951, 7, 1);
            vfY[7] = true;
        }
        if (!(vfY[8] || ajm(e.euX))) {
            h.pYm.k(951, 8, 1);
            vfY[8] = true;
        }
        if (!vfY[9]) {
            stringBuilder = new StringBuilder();
            g.RQ();
            if (!ajm(stringBuilder.append(g.RP().eJM).append("emoji/").toString())) {
                h.pYm.k(951, 9, 1);
                vfY[9] = true;
            }
        }
        if (!vfY[10]) {
            stringBuilder = new StringBuilder();
            g.RQ();
            if (!ajm(stringBuilder.append(g.RP().eJM).append("record/").toString())) {
                h.pYm.k(951, 10, 1);
                vfY[10] = true;
            }
        }
        if (!vfY[11]) {
            stringBuilder = new StringBuilder();
            g.RQ();
            if (!ajm(stringBuilder.append(g.RP().eJM).append("sns/").toString())) {
                h.pYm.k(951, 11, 1);
                vfY[11] = true;
            }
        }
        if (!(vfY[12] || ajm(aa.Ya()))) {
            h.pYm.k(951, 12, 1);
            vfY[12] = true;
        }
        if (!(vfY[13] || ajm(com.tencent.mm.plugin.i.c.XW()))) {
            h.pYm.k(951, 13, 1);
            vfY[13] = true;
        }
        if (!(vfY[14] || ajm(com.tencent.mm.plugin.i.c.XX()))) {
            h.pYm.k(951, 14, 1);
            vfY[14] = true;
        }
        if (!vfY[15]) {
            stringBuilder = new StringBuilder();
            g.RQ();
            if (!ajm(stringBuilder.append(g.RP().eJM).append("video/").toString())) {
                h.pYm.k(951, 15, 1);
                vfY[15] = true;
            }
        }
        if (!(vfY[16] || ajm(q.amg()))) {
            h.pYm.k(951, 16, 1);
            vfY[16] = true;
        }
        if (!(vfY[17] || ajm(q.XY()))) {
            h.pYm.k(951, 17, 1);
            vfY[17] = true;
        }
        if (!vfY[18]) {
            stringBuilder = new StringBuilder();
            g.RQ();
            if (!ajm(stringBuilder.append(g.RP().eJM).append("dbback/").toString())) {
                h.pYm.k(951, 18, 1);
                vfY[18] = true;
            }
        }
        if (!vfY[19]) {
            stringBuilder = new StringBuilder();
            g.RQ();
            if (!ajm(stringBuilder.append(g.RP().eJM).append("mailapp/").toString())) {
                h.pYm.k(951, 19, 1);
                vfY[19] = true;
            }
        }
        if (!vfY[20]) {
            stringBuilder = new StringBuilder();
            g.RQ();
            if (!ajm(stringBuilder.append(g.RP().eJM).append("openim/").toString())) {
                h.pYm.k(951, 20, 1);
                vfY[20] = true;
            }
        }
        ab.d("MicroMsg.SdcardCheckUtil", "check time:" + (System.currentTimeMillis() - currentTimeMillis));
        AppMethodBeat.o(27475);
    }
}
