package d3;

import android.net.Uri;
import android.text.TextUtils;

/* JADX INFO: loaded from: classes.dex */
public final class M1 extends G1 {
    public static final boolean H(String str) {
        String str2 = (String) I.f11587t.a(null);
        if (TextUtils.isEmpty(str2)) {
            return false;
        }
        for (String str3 : str2.split(",")) {
            if (str.equalsIgnoreCase(str3.trim())) {
                return true;
            }
        }
        return false;
    }

    public final String F(String str) {
        C0803m0 c0803m0 = this.f11473r.f11681q;
        Q1.L(c0803m0);
        String strU = c0803m0.U(str);
        if (TextUtils.isEmpty(strU)) {
            return (String) I.f11581r.a(null);
        }
        Uri uri = Uri.parse((String) I.f11581r.a(null));
        Uri.Builder builderBuildUpon = uri.buildUpon();
        builderBuildUpon.authority(strU + "." + uri.getAuthority());
        return builderBuildUpon.build().toString();
    }

    public final boolean G(String str, String str2) {
        Q1 q12 = this.f11473r;
        C0803m0 c0803m0 = q12.f11681q;
        Q1.L(c0803m0);
        com.google.android.gms.internal.measurement.G0 g0T = c0803m0.T(str);
        if (g0T == null) {
            return false;
        }
        C0805n c0805n = q12.f11683s;
        Q1.L(c0805n);
        V vB0 = c0805n.B0(str);
        if (vB0 == null) {
            return false;
        }
        if (g0T.G() && g0T.u().n() == 100) {
            return true;
        }
        W1 w12 = ((C0817r0) this.f5146q).f12122B;
        C0817r0.i(w12);
        if (w12.u0(str, vB0.i())) {
            return true;
        }
        return !TextUtils.isEmpty(str2) && Math.abs(str2.hashCode() % 100) < g0T.u().n();
    }
}
