package x2;

import a.AbstractC0386a;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Pattern;
import w2.C1699b;

/* JADX INFO: renamed from: x2.a, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1711a {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final String f18571c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final Set f18572d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final C1711a f18573e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final C1711a f18574f;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final String f18575a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final String f18576b;

    static {
        String strU = AbstractC0386a.u("hts/frbslgiggolai.o/0clgbthfra=snpoo", "tp:/ieaeogn.ogepscmvc/o/ac?omtjo_rt3");
        f18571c = strU;
        String strU2 = AbstractC0386a.u("hts/frbslgigp.ogepscmv/ieo/eaybtho", "tp:/ieaeogn-agolai.o/1frlglgc/aclg");
        String strU3 = AbstractC0386a.u("AzSCki82AwsLzKd5O8zo", "IayckHiZRO1EFl1aGoK");
        f18572d = Collections.unmodifiableSet(new HashSet(Arrays.asList(new C1699b("proto"), new C1699b("json"))));
        f18573e = new C1711a(strU, null);
        f18574f = new C1711a(strU2, strU3);
    }

    public C1711a(String str, String str2) {
        this.f18575a = str;
        this.f18576b = str2;
    }

    public static C1711a a(byte[] bArr) {
        String str = new String(bArr, Charset.forName("UTF-8"));
        if (!str.startsWith("1$")) {
            throw new IllegalArgumentException("Version marker missing from extras");
        }
        String[] strArrSplit = str.substring(2).split(Pattern.quote("\\"), 2);
        if (strArrSplit.length != 2) {
            throw new IllegalArgumentException("Extra is not a valid encoded LegacyFlgDestination");
        }
        String str2 = strArrSplit[0];
        if (str2.isEmpty()) {
            throw new IllegalArgumentException("Missing endpoint in CCTDestination extras");
        }
        String str3 = strArrSplit[1];
        if (str3.isEmpty()) {
            str3 = null;
        }
        return new C1711a(str2, str3);
    }
}
