package com.tencent.mm.plugin.scanner;

import android.os.Bundle;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ipcinvoker.f;
import com.tencent.mm.kernel.g;
import com.tencent.mm.m.c;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ah;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.ttpic.baseutils.ApiHelper$VERSION_CODES;
import com.tencent.ytcommon.BuildConfig;
import java.util.HashSet;
import java.util.Set;

public final class a {
    static /* synthetic */ Set aIR() {
        AppMethodBeat.i(79168);
        Set cgw = cgw();
        AppMethodBeat.o(79168);
        return cgw;
    }

    /* JADX WARNING: Removed duplicated region for block: B:16:0x0044  */
    /* JADX WARNING: Missing block: B:11:0x0034, code skipped:
            if (com.tencent.mm.ipcinvoker.b.PL().le("com.tencent.mm") == false) goto L_0x0036;
     */
    public static boolean ba(int r6, java.lang.String r7) {
        /*
        r1 = 0;
        r5 = 79165; // 0x1353d float:1.10934E-40 double:3.91127E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r5);
        r0 = 22;
        if (r6 == r0) goto L_0x000f;
    L_0x000b:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r5);
    L_0x000e:
        return r1;
    L_0x000f:
        r0 = com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r7);
        if (r0 == 0) goto L_0x0019;
    L_0x0015:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r5);
        goto L_0x000e;
    L_0x0019:
        r0 = com.tencent.mm.sdk.platformtools.ah.bqo();
        if (r0 != 0) goto L_0x0036;
    L_0x001f:
        r0 = android.os.Looper.myLooper();
        r2 = android.os.Looper.getMainLooper();
        if (r0 != r2) goto L_0x0055;
    L_0x0029:
        r0 = "com.tencent.mm";
        r2 = com.tencent.mm.ipcinvoker.b.PL();
        r0 = r2.le(r0);
        if (r0 != 0) goto L_0x0055;
    L_0x0036:
        r0 = cgw();
    L_0x003a:
        r2 = r0.iterator();
    L_0x003e:
        r0 = r2.hasNext();
        if (r0 == 0) goto L_0x0079;
    L_0x0044:
        r0 = r2.next();
        r0 = (java.lang.String) r0;
        r0 = r7.startsWith(r0);
        if (r0 == 0) goto L_0x003e;
    L_0x0050:
        r1 = 1;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r5);
        goto L_0x000e;
    L_0x0055:
        r2 = new java.util.HashSet;
        r2.<init>();
        r0 = cgv();
        r3 = "|";
        r3 = r0.split(r3);
        r0 = r1;
    L_0x0066:
        r4 = r3.length;
        if (r0 >= r4) goto L_0x007d;
    L_0x0069:
        r4 = r3[r0];
        r4 = com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r4);
        if (r4 != 0) goto L_0x0076;
    L_0x0071:
        r4 = r3[r0];
        r2.add(r4);
    L_0x0076:
        r0 = r0 + 1;
        goto L_0x0066;
    L_0x0079:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r5);
        goto L_0x000e;
    L_0x007d:
        r0 = r2;
        goto L_0x003a;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.scanner.a.ba(int, java.lang.String):boolean");
    }

    public static boolean BQ(int i) {
        switch (i) {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
            case 11:
            case ApiHelper$VERSION_CODES.HONEYCOMB_MR1 /*12*/:
            case ApiHelper$VERSION_CODES.HONEYCOMB_MR2 /*13*/:
            case ApiHelper$VERSION_CODES.ICE_CREAM_SANDWICH /*14*/:
            case ApiHelper$VERSION_CODES.ICE_CREAM_SANDWICH_MR1 /*15*/:
            case ApiHelper$VERSION_CODES.JELLY_BEAN /*16*/:
            case ApiHelper$VERSION_CODES.JELLY_BEAN_MR1 /*17*/:
                return true;
            default:
                return false;
        }
    }

    public static boolean BR(int i) {
        switch (i) {
            case ApiHelper$VERSION_CODES.KITKAT /*19*/:
            case ApiHelper$VERSION_CODES.KITKAT_WATCH /*20*/:
            case ApiHelper$VERSION_CODES.LOLLIPOP /*21*/:
                return true;
            default:
                return false;
        }
    }

    private static String cgv() {
        String string;
        AppMethodBeat.i(79166);
        Bundle bundle = (Bundle) f.a("com.tencent.mm", null, a.class);
        String str = BuildConfig.FLAVOR;
        if (bundle != null) {
            string = bundle.getString("wxCodePrefix", BuildConfig.FLAVOR);
        } else {
            string = str;
        }
        AppMethodBeat.o(79166);
        return string;
    }

    private static Set<String> cgw() {
        AppMethodBeat.i(79167);
        HashSet hashSet = new HashSet();
        hashSet.add("k");
        hashSet.add("l");
        if (ah.bqo()) {
            String O;
            String str = BuildConfig.FLAVOR;
            c Nv = ((com.tencent.mm.plugin.zero.b.a) g.K(com.tencent.mm.plugin.zero.b.a.class)).Nv();
            if (Nv != null) {
                O = Nv.O("ScanCode", "weAppCodePrefix");
            } else {
                O = str;
            }
            ab.v("MicroMsg.QRCodeLogic", "getWxCodePrefix(%s)", new Object[]{O});
            if (!bo.isNullOrNil(O)) {
                String[] split = O.split("|");
                for (int i = 0; i < split.length; i++) {
                    if (!bo.isNullOrNil(split[i])) {
                        hashSet.add(split[i]);
                    }
                }
            }
        }
        AppMethodBeat.o(79167);
        return hashSet;
    }
}
