package p3;

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 n2.AbstractC2612c;

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

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

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

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

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

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

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

    static {
        String strR = AbstractC2612c.r("hts/frbslgiggolai.o/0clgbthfra=snpoo", "tp:/ieaeogn.ogepscmvc/o/ac?omtjo_rt3");
        f22968c = strR;
        String strR2 = AbstractC2612c.r("hts/frbslgigp.ogepscmv/ieo/eaybtho", "tp:/ieaeogn-agolai.o/1frlglgc/aclg");
        String strR3 = AbstractC2612c.r("AzSCki82AwsLzKd5O8zo", "IayckHiZRO1EFl1aGoK");
        f22969d = Collections.unmodifiableSet(new HashSet(Arrays.asList(new o3.b("proto"), new o3.b("json"))));
        f22970e = new C2721a(strR, null);
        f22971f = new C2721a(strR2, strR3);
    }

    public C2721a(String str, String str2) {
        this.f22972a = str;
        this.f22973b = str2;
    }

    public static C2721a 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 C2721a(str2, str3);
    }
}
