package p138.p176.p177.p178.p179;

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 p000.p001.p002.p003.p004.C0567;
import p138.p176.p177.p178.C3253;
import p138.p176.p177.p178.p181.InterfaceC3298;

/* JADX INFO: renamed from: ދ.ހ.֏.֏.ނ.֏, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C3257 implements InterfaceC3298 {

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public static final String f9602 = C0567.m1942("hts/frbslgiggolai.o/0clgbthfra=snpoo", "tp:/ieaeogn.ogepscmvc/o/ac?omtjo_rt3");

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public static final String f9603 = C0567.m1942("hts/frbslgigp.ogepscmv/ieo/eaybtho", "tp:/ieaeogn-agolai.o/1frlglgc/aclg");

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public static final String f9604 = C0567.m1942("AzSCki82AwsLzKd5O8zo", "IayckHiZRO1EFl1aGoK");

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public static final Set<C3253> f9605 = Collections.unmodifiableSet(new HashSet(Arrays.asList(new C3253("proto"), new C3253("json"))));

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final String f9606;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final String f9607;

    static {
        new C3257(f9602, null);
        new C3257(f9603, f9604);
    }

    public C3257(String str, String str2) {
        this.f9606 = str;
        this.f9607 = str2;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C3257 m5345(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 C3257(str2, str3);
    }

    @Override // p138.p176.p177.p178.p181.InterfaceC3298
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public Set<C3253> mo5346() {
        return f9605;
    }

    @Override // p138.p176.p177.p178.p181.InterfaceC3298
    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public String mo5347() {
        return "cct";
    }

    @Override // p138.p176.p177.p178.p181.InterfaceC3298
    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public byte[] mo5348() {
        if (this.f9607 == null && this.f9606 == null) {
            return null;
        }
        Object[] objArr = new Object[4];
        objArr[0] = "1$";
        objArr[1] = this.f9606;
        objArr[2] = "\\";
        String str = this.f9607;
        if (str == null) {
            str = "";
        }
        objArr[3] = str;
        return String.format("%s%s%s%s", objArr).getBytes(Charset.forName("UTF-8"));
    }
}
