package com.tencent.mm.plugin.expt.roomexpt;

import android.database.Cursor;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.sdk.e.e;
import com.tencent.mm.sdk.e.j;
import com.tencent.mm.sdk.platformtools.ab;

public final class b extends j<e> {
    public static final String[] diI = new String[0];
    public static final String[] fnj = new String[]{j.a(e.ccO, "RoomMuteExpt"), "CREATE UNIQUE INDEX IF NOT EXISTS namedayIndex ON RoomMuteExpt( chatroom,daySec )"};
    e bSd;

    static {
        AppMethodBeat.i(73587);
        AppMethodBeat.o(73587);
    }

    public b(e eVar) {
        super(eVar, e.ccO, "RoomMuteExpt", diI);
        this.bSd = eVar;
    }

    /* JADX WARNING: Removed duplicated region for block: B:11:0x0032  */
    /* JADX WARNING: Removed duplicated region for block: B:23:0x0059  */
    /* JADX WARNING: Removed duplicated region for block: B:19:0x0051  */
    public final com.tencent.mm.plugin.expt.roomexpt.e eh(java.lang.String r11, java.lang.String r12) {
        /*
        r10 = this;
        r9 = 73582; // 0x11f6e float:1.0311E-40 double:3.63543E-319;
        r8 = 0;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r9);
        r0 = r10.bSd;	 Catch:{ Exception -> 0x0039, all -> 0x0055 }
        r1 = "RoomMuteExpt";
        r2 = 0;
        r3 = "chatroom=? AND daySec=?";
        r4 = 2;
        r4 = new java.lang.String[r4];	 Catch:{ Exception -> 0x0039, all -> 0x0055 }
        r5 = 0;
        r4[r5] = r11;	 Catch:{ Exception -> 0x0039, all -> 0x0055 }
        r5 = 1;
        r4[r5] = r12;	 Catch:{ Exception -> 0x0039, all -> 0x0055 }
        r5 = 0;
        r6 = 0;
        r7 = 0;
        r2 = r0.query(r1, r2, r3, r4, r5, r6, r7);	 Catch:{ Exception -> 0x0039, all -> 0x0055 }
        if (r2 == 0) goto L_0x0067;
    L_0x0022:
        r0 = r2.moveToFirst();	 Catch:{ Exception -> 0x0062 }
        if (r0 == 0) goto L_0x0067;
    L_0x0028:
        r0 = new com.tencent.mm.plugin.expt.roomexpt.e;	 Catch:{ Exception -> 0x0062 }
        r0.<init>();	 Catch:{ Exception -> 0x0062 }
        r0.d(r2);	 Catch:{ Exception -> 0x0065 }
    L_0x0030:
        if (r2 == 0) goto L_0x0035;
    L_0x0032:
        r2.close();
    L_0x0035:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r9);
        return r0;
    L_0x0039:
        r1 = move-exception;
        r2 = r8;
        r0 = r8;
    L_0x003c:
        r3 = "MicroMsg.ChatRoomExptStorage";
        r4 = "getRoomExpt item error[%s]";
        r5 = 1;
        r5 = new java.lang.Object[r5];	 Catch:{ all -> 0x0060 }
        r6 = 0;
        r1 = r1.toString();	 Catch:{ all -> 0x0060 }
        r5[r6] = r1;	 Catch:{ all -> 0x0060 }
        com.tencent.mm.sdk.platformtools.ab.e(r3, r4, r5);	 Catch:{ all -> 0x0060 }
        if (r2 == 0) goto L_0x0035;
    L_0x0051:
        r2.close();
        goto L_0x0035;
    L_0x0055:
        r0 = move-exception;
        r2 = r8;
    L_0x0057:
        if (r2 == 0) goto L_0x005c;
    L_0x0059:
        r2.close();
    L_0x005c:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r9);
        throw r0;
    L_0x0060:
        r0 = move-exception;
        goto L_0x0057;
    L_0x0062:
        r1 = move-exception;
        r0 = r8;
        goto L_0x003c;
    L_0x0065:
        r1 = move-exception;
        goto L_0x003c;
    L_0x0067:
        r0 = r8;
        goto L_0x0030;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.expt.roomexpt.b.eh(java.lang.String, java.lang.String):com.tencent.mm.plugin.expt.roomexpt.e");
    }

    public final boolean b(e eVar) {
        AppMethodBeat.i(73583);
        boolean a = super.a(eVar, false);
        AppMethodBeat.o(73583);
        return a;
    }

    public final boolean c(e eVar) {
        AppMethodBeat.i(73584);
        if (eVar == null) {
            AppMethodBeat.o(73584);
            return false;
        }
        boolean b = super.b(eVar, false, new String[]{"chatroom", "daySec"});
        AppMethodBeat.o(73584);
        return b;
    }

    public final Cursor brm() {
        Cursor cursor = null;
        AppMethodBeat.i(73585);
        try {
            cursor = this.bSd.rawQuery("SELECT chatroom, nickname, isMute, count(daySec), sum(score) FROM RoomMuteExpt group by chatroom", null);
        } catch (Exception e) {
            ab.printErrStackTrace("MicroMsg.ChatRoomExptStorage", e, "get calc cursor", new Object[0]);
        }
        AppMethodBeat.o(73585);
        return cursor;
    }

    /* JADX WARNING: Removed duplicated region for block: B:21:0x0051  */
    public final java.util.List<com.tencent.mm.plugin.expt.roomexpt.e> brn() {
        /*
        r11 = this;
        r10 = 73586; // 0x11f72 float:1.03116E-40 double:3.63563E-319;
        r8 = 0;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r10);
        r9 = new java.util.ArrayList;
        r9.<init>();
        r0 = r11.bSd;	 Catch:{ Exception -> 0x005a, all -> 0x004d }
        r1 = "RoomMuteExpt";
        r2 = 0;
        r3 = 0;
        r4 = 0;
        r5 = 0;
        r6 = 0;
        r7 = "chatroom,daySec ASC";
        r1 = r0.query(r1, r2, r3, r4, r5, r6, r7);	 Catch:{ Exception -> 0x005a, all -> 0x004d }
        if (r1 == 0) goto L_0x0047;
    L_0x001f:
        r0 = r1.moveToNext();	 Catch:{ Exception -> 0x0031 }
        if (r0 == 0) goto L_0x0047;
    L_0x0025:
        r0 = new com.tencent.mm.plugin.expt.roomexpt.e;	 Catch:{ Exception -> 0x0031 }
        r0.<init>();	 Catch:{ Exception -> 0x0031 }
        r0.d(r1);	 Catch:{ Exception -> 0x0031 }
        r9.add(r0);	 Catch:{ Exception -> 0x0031 }
        goto L_0x001f;
    L_0x0031:
        r0 = move-exception;
    L_0x0032:
        r2 = "MicroMsg.ChatRoomExptStorage";
        r3 = "getAllExpt";
        r4 = 0;
        r4 = new java.lang.Object[r4];	 Catch:{ all -> 0x0058 }
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r2, r0, r3, r4);	 Catch:{ all -> 0x0058 }
        if (r1 == 0) goto L_0x0043;
    L_0x0040:
        r1.close();
    L_0x0043:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r10);
        return r9;
    L_0x0047:
        if (r1 == 0) goto L_0x0043;
    L_0x0049:
        r1.close();
        goto L_0x0043;
    L_0x004d:
        r0 = move-exception;
        r1 = r8;
    L_0x004f:
        if (r1 == 0) goto L_0x0054;
    L_0x0051:
        r1.close();
    L_0x0054:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r10);
        throw r0;
    L_0x0058:
        r0 = move-exception;
        goto L_0x004f;
    L_0x005a:
        r0 = move-exception;
        r1 = r8;
        goto L_0x0032;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.expt.roomexpt.b.brn():java.util.List");
    }
}
