WeChat.apk(点击下载) / v.java


package com.tencent.mm.plugin.scanner;

import android.os.Bundle;
import android.os.Looper;
import com.tencent.mm.R;
import com.tencent.mm.ipcinvoker.f;
import com.tencent.mm.ipcinvoker.o;
import com.tencent.mm.ipcinvoker.r;
import com.tencent.mm.sdk.http.HttpWrapperBase;
import com.tencent.mm.sdk.platformtools.MMApplicationContext;
import com.tencent.mm.sdk.platformtools.Util;
import com.tencent.mm.sdk.platformtools.WeChatHosts;
import d60.z;
import ek.d;
import gy.x;
import ie1.h;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import yz3.j;

public class v {

    /* renamed from: a  reason: collision with root package name */
    public static final String f144316a = MMApplicationContext.getApplicationId();

    /* renamed from: b  reason: collision with root package name */
    public static final String[] f144317b = {HttpWrapperBase.PROTOCAL_HTTP + WeChatHosts.domainString(R.string.fyt) + "/g/", HttpWrapperBase.PROTOCAL_HTTPS + WeChatHosts.domainString(R.string.fyt) + "/g/"};

    /* renamed from: c  reason: collision with root package name */
    public static final String[] f144318c = {HttpWrapperBase.PROTOCAL_HTTP + WeChatHosts.domainString(R.string.fyp) + "/", HttpWrapperBase.PROTOCAL_HTTPS + WeChatHosts.domainString(R.string.fyp) + "/"};

    /* renamed from: d  reason: collision with root package name */
    public static final String[] f144319d = {HttpWrapperBase.PROTOCAL_HTTP + WeChatHosts.domainString(R.string.fyv) + "/u/", HttpWrapperBase.PROTOCAL_HTTP + WeChatHosts.domainString(R.string.fyv) + "/ct/", HttpWrapperBase.PROTOCAL_HTTPS + WeChatHosts.domainString(R.string.fyv) + "/u/", HttpWrapperBase.PROTOCAL_HTTPS + WeChatHosts.domainString(R.string.fyv) + "/ct/"};

    /* renamed from: e  reason: collision with root package name */
    public static final String[] f144320e = {"http://c.weixin.com/g/", "https://c.weixin.com/g/"};

    /* renamed from: f  reason: collision with root package name */
    public static final String[] f144321f;

    /* renamed from: g  reason: collision with root package name */
    public static final String[] f144322g;

    /* renamed from: h  reason: collision with root package name */
    public static final String[] f144323h = {"m", "n"};

    /* renamed from: i  reason: collision with root package name */
    public static final String[] f144324i = {HttpWrapperBase.PROTOCAL_HTTPS + WeChatHosts.domainString(R.string.fyt) + "/f/", HttpWrapperBase.PROTOCAL_HTTP + WeChatHosts.domainString(R.string.fyt) + "/f/"};

    /* renamed from: j  reason: collision with root package name */
    public static final String f144325j = x.f222759a;

    /* renamed from: k  reason: collision with root package name */
    public static final String f144326k = x.f222760b;

    /* renamed from: l  reason: collision with root package name */
    public static final String f144327l = x.f222761c;

    /* renamed from: m  reason: collision with root package name */
    public static final String f144328m = x.f222762d;

    /* renamed from: n  reason: collision with root package name */
    public static int f144329n = 1;

    /* renamed from: o  reason: collision with root package name */
    public static int f144330o = 2;

    /* renamed from: p  reason: collision with root package name */
    public static int f144331p = 4;

    public static class a implements r<Bundle, Bundle> {
        private a() {
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // com.tencent.mm.ipcinvoker.r
        public Bundle invoke(Bundle bundle) {
            Bundle bundle2 = new Bundle();
            Set<String> a15 = v.a();
            StringBuilder sb5 = new StringBuilder();
            HashSet hashSet = (HashSet) a15;
            if (!hashSet.isEmpty()) {
                Iterator it = hashSet.iterator();
                sb5.append((String) it.next());
                while (it.hasNext()) {
                    sb5.append("|");
                    sb5.append((String) it.next());
                }
                bundle2.putString("brandCodePrefix", sb5.toString());
            }
            return bundle2;
        }
    }

    public static class b implements r<Bundle, Bundle> {
        private b() {
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // com.tencent.mm.ipcinvoker.r
        public Bundle invoke(Bundle bundle) {
            Bundle bundle2 = new Bundle();
            Set<String> b15 = v.b();
            StringBuilder sb5 = new StringBuilder();
            HashSet hashSet = (HashSet) b15;
            if (!hashSet.isEmpty()) {
                Iterator it = hashSet.iterator();
                sb5.append((String) it.next());
                while (it.hasNext()) {
                    sb5.append("|");
                    sb5.append((String) it.next());
                }
                bundle2.putString("wxCodePrefix", sb5.toString());
            }
            return bundle2;
        }
    }

    static {
        StringBuilder sb5 = new StringBuilder();
        sb5.append(HttpWrapperBase.PROTOCAL_HTTPS);
        sb5.append(WeChatHosts.domainString(R.string.fye));
        sb5.append("/qr/");
        String sb6 = sb5.toString();
        String[] strArr = {"https://wx.tenpay.com/f2f", "wxp://f2f", sb6, "https://payapp.wechatpay.cn/qr/", "https://payapp.wechatpay.cn/sjt/qr/", "https://payapp.weixin.qq.com/sjt/qr/"};
        f144321f = strArr;
        f144322g = new String[]{strArr[0], strArr[1], sb6, "weixin://wxpay/bizpayurl", "wxp://wbf2f", "weixin://wxpay/bindurl", "wxhb://f2f", strArr[3]};
    }

    public static Set<String> a() {
        String str;
        HashSet hashSet = new HashSet();
        hashSet.add(f144325j);
        hashSet.add(f144326k);
        hashSet.add(f144327l);
        hashSet.add(f144328m);
        if (MMApplicationContext.isMainProcess()) {
            d ni02 = ((jt3.b) z.q(jt3.b.class)).ni0();
            if (ni02 != null) {
                str = ni02.a(1, "ScanCode", "brandCodePrefix");
            } else {
                str = "";
            }
            if (!Util.isNullOrNil(str)) {
                String[] split = str.split("\\|");
                for (int i15 = 0; i15 < split.length; i15++) {
                    if (!Util.isNullOrNil(split[i15])) {
                        hashSet.add(split[i15]);
                    }
                }
            }
        }
        return hashSet;
    }

    public static Set<String> b() {
        String str;
        HashSet hashSet = new HashSet();
        hashSet.add("k");
        hashSet.add("l");
        if (MMApplicationContext.isMMProcess()) {
            d ni02 = ((jt3.b) z.q(jt3.b.class)).ni0();
            if (ni02 != null) {
                str = ni02.a(1, "ScanCode", "weAppCodePrefix");
            } else {
                str = "";
            }
            if (!Util.isNullOrNil(str)) {
                String[] split = str.split("\\|");
                for (int i15 = 0; i15 < split.length; i15++) {
                    if (!Util.isNullOrNil(split[i15])) {
                        hashSet.add(split[i15]);
                    }
                }
            }
        }
        return hashSet;
    }

    public static boolean c(int i15, String str, boolean z15, boolean z16) {
        if (str == null || str.isEmpty()) {
            return false;
        }
        int Xj0 = ((h) j.c(h.class)).Xj0(h.c.f232357ss, 7);
        if (o(i15, str) && f(Xj0, z15, z16)) {
            return true;
        }
        int Xj02 = ((h) j.c(h.class)).Xj0(h.c.f232393ts, 3);
        if (l(i15, str) && f(Xj02, z15, z16)) {
            return true;
        }
        int Xj03 = ((h) j.c(h.class)).Xj0(h.c.f232429us, 3);
        if (h(i15, str) && f(Xj03, z15, z16)) {
            return true;
        }
        int Xj04 = ((h) j.c(h.class)).Xj0(h.c.f232465vs, 0);
        if (j(i15, str) && f(Xj04, z15, z16)) {
            return true;
        }
        int Xj05 = ((h) j.c(h.class)).Xj0(h.c.f232501ws, 3);
        if (n(i15, str) && f(Xj05, z15, z16)) {
            return true;
        }
        int Xj06 = ((h) j.c(h.class)).Xj0(h.c.f232538xs, 3);
        if (i(i15, str) && f(Xj06, z15, z16)) {
            return true;
        }
        int Xj07 = ((h) j.c(h.class)).Xj0(h.c.f232575ys, 3);
        if (d(i15, str) && f(Xj07, z15, z16)) {
            return true;
        }
        int Xj08 = ((h) j.c(h.class)).Xj0(h.c.f232611zs, 0);
        if (!g(i15, str) || !f(Xj08, z15, z16)) {
            return f(((h) j.c(h.class)).Xj0(h.c.As, 0), z15, z16);
        }
        return true;
    }

    /* JADX DEBUG: Failed to insert an additional move for type inference into block B:35:0x0077 */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r5v3, types: [java.util.Set] */
    /* JADX WARN: Type inference failed for: r5v5, types: [java.util.Set] */
    /* JADX WARN: Type inference failed for: r5v7, types: [java.util.HashSet] */
    /* JADX WARNING: Code restructure failed: missing block: B:16:0x003b, code lost:
        if (r5 == false) goto L_0x0073;
     */
    /* JADX WARNING: Removed duplicated region for block: B:31:0x0081  */
    /* JADX WARNING: Unknown variable types count: 1 */
    public static boolean d(int i15, String str) {
        ?? r55;
        if (i15 != 19 || Util.isNullOrNil(str)) {
            return false;
        }
        if (!MMApplicationContext.isMainProcess()) {
            if (Looper.myLooper() == Looper.getMainLooper()) {
                String str2 = f144316a;
                f b15 = f.b();
                b15.getClass();
            }
            r55 = new HashSet();
            Bundle bundle = (Bundle) o.f(f144316a, null, a.class);
            String str3 = "";
            if (bundle != null) {
                str3 = bundle.getString("brandCodePrefix", str3);
            }
            String[] split = str3.split("\\|");
            for (int i16 = 0; i16 < split.length; i16++) {
                if (!Util.isNullOrNil(split[i16])) {
                    r55.add(split[i16]);
                }
            }
            for (String str4 : r55) {
                if (str.startsWith(str4)) {
                    return true;
                }
            }
            return false;
        }
        r55 = a();
        while (r5.hasNext()) {
        }
        return false;
    }

    public static boolean e(int i15, String str) {
        String trim = str.trim();
        if (o(i15, trim) || d(i15, trim) || h(i15, trim) || l(i15, trim) || n(i15, trim) || k(i15, trim) || m(i15, trim) || g(i15, trim)) {
            return true;
        }
        return false;
    }

    public static boolean f(int i15, boolean z15, boolean z16) {
        if (z15) {
            if ((i15 & f144330o) != 0) {
                return true;
            }
            return false;
        } else if (z16) {
            if ((i15 & f144331p) != 0) {
                return true;
            }
            return false;
        } else if ((i15 & f144329n) != 0) {
            return true;
        } else {
            return false;
        }
    }

    public static boolean g(int i15, String str) {
        if (!(i15 == 19 || i15 == 23) || Util.isNullOrNil(str)) {
            return false;
        }
        for (String str2 : f144324i) {
            if (str.startsWith(str2)) {
                return true;
            }
        }
        return false;
    }

    public static boolean h(int i15, String str) {
        if (i15 != 19 || Util.isNullOrNil(str)) {
            return false;
        }
        for (String str2 : f144317b) {
            if (str.startsWith(str2)) {
                return true;
            }
        }
        return false;
    }

    public static boolean i(int i15, String str) {
        if (i15 != 19 || Util.isNullOrNil(str)) {
            return false;
        }
        for (String str2 : f144320e) {
            if (str.startsWith(str2)) {
                return true;
            }
        }
        return false;
    }

    public static boolean j(int i15, String str) {
        if (m(i15, str)) {
            return true;
        }
        if (i15 != 19 || Util.isNullOrNil(str)) {
            return false;
        }
        for (String str2 : f144322g) {
            if (str.startsWith(str2)) {
                return true;
            }
        }
        return false;
    }

    public static boolean k(int i15, String str) {
        if (i15 != 19 || Util.isNullOrNil(str)) {
            return false;
        }
        for (String str2 : f144321f) {
            if (str.startsWith(str2)) {
                return true;
            }
        }
        return false;
    }

    public static boolean l(int i15, String str) {
        if (i15 != 19 || Util.isNullOrNil(str)) {
            return false;
        }
        for (String str2 : f144318c) {
            if (str.startsWith(str2)) {
                return true;
            }
        }
        return false;
    }

    public static boolean m(int i15, String str) {
        if (i15 != 22 || Util.isNullOrNil(str)) {
            return false;
        }
        for (String str2 : f144323h) {
            if (str.startsWith(str2)) {
                return true;
            }
        }
        return false;
    }

    public static boolean n(int i15, String str) {
        if (i15 != 19 || Util.isNullOrNil(str)) {
            return false;
        }
        for (String str2 : f144319d) {
            if (str.startsWith(str2)) {
                return true;
            }
        }
        return false;
    }

    /* JADX DEBUG: Failed to insert an additional move for type inference into block B:35:0x0079 */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r5v3, types: [java.util.Set] */
    /* JADX WARN: Type inference failed for: r5v5, types: [java.util.Set] */
    /* JADX WARN: Type inference failed for: r5v7, types: [java.util.HashSet] */
    /* JADX WARNING: Code restructure failed: missing block: B:16:0x003b, code lost:
        if ((!com.tencent.mm.ipcinvoker.n.c(r5) && ((java.util.concurrent.ConcurrentHashMap) r2.f75765c).get(r5) != null) == false) goto L_0x0075;
     */
    /* JADX WARNING: Removed duplicated region for block: B:31:0x0083  */
    /* JADX WARNING: Unknown variable types count: 1 */
    public static boolean o(int i15, String str) {
        ?? r55;
        if (i15 != 22 || Util.isNullOrNil(str)) {
            return false;
        }
        if (!MMApplicationContext.isMMProcess()) {
            if (Looper.myLooper() == Looper.getMainLooper()) {
                String str2 = f144316a;
                f b15 = f.b();
                b15.getClass();
            }
            r55 = new HashSet();
            Bundle bundle = (Bundle) o.f(f144316a, null, b.class);
            String str3 = "";
            if (bundle != null) {
                str3 = bundle.getString("wxCodePrefix", str3);
            }
            String[] split = str3.split("|");
            for (int i16 = 0; i16 < split.length; i16++) {
                if (!Util.isNullOrNil(split[i16])) {
                    r55.add(split[i16]);
                }
            }
            for (String str4 : r55) {
                if (str.startsWith(str4)) {
                    return true;
                }
            }
            return false;
        }
        r55 = b();
        while (r5.hasNext()) {
        }
        return false;
    }
}