package o;

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;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Hf, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C0187Hf implements InterfaceC0488Sv {
    public static final String c;
    public static final Set d;
    public static final C0187Hf e;
    public static final C0187Hf f;
    public final String a;
    public final String b;

    static {
        String strD = AbstractC0940cn0.D("hts/frbslgiggolai.o/0clgbthfra=snpoo", "tp:/ieaeogn.ogepscmvc/o/ac?omtjo_rt3");
        c = strD;
        String strD2 = AbstractC0940cn0.D("hts/frbslgigp.ogepscmv/ieo/eaybtho", "tp:/ieaeogn-agolai.o/1frlglgc/aclg");
        String strD3 = AbstractC0940cn0.D("AzSCki82AwsLzKd5O8zo", "IayckHiZRO1EFl1aGoK");
        d = Collections.unmodifiableSet(new HashSet(Arrays.asList(new C0618Xv("proto"), new C0618Xv("json"))));
        e = new C0187Hf(strD, null);
        f = new C0187Hf(strD2, strD3);
    }

    public C0187Hf(String str, String str2) {
        this.a = str;
        this.b = str2;
    }

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