package com.google.android.datatransport.cct; import com.google.android.gms.ads.RequestConfiguration; 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 q2.g; /* loaded from: classes.dex */ public final class a implements g { /* renamed from: c, reason: collision with root package name */ static final String f4237c; /* renamed from: d, reason: collision with root package name */ static final String f4238d; /* renamed from: e, reason: collision with root package name */ private static final String f4239e; /* renamed from: f, reason: collision with root package name */ private static final Set f4240f; /* renamed from: g, reason: collision with root package name */ public static final a f4241g; /* renamed from: h, reason: collision with root package name */ public static final a f4242h; /* renamed from: a, reason: collision with root package name */ private final String f4243a; /* renamed from: b, reason: collision with root package name */ private final String f4244b; static { String a10 = e.a("hts/frbslgiggolai.o/0clgbthfra=snpoo", "tp:/ieaeogn.ogepscmvc/o/ac?omtjo_rt3"); f4237c = a10; String a11 = e.a("hts/frbslgigp.ogepscmv/ieo/eaybtho", "tp:/ieaeogn-agolai.o/1frlglgc/aclg"); f4238d = a11; String a12 = e.a("AzSCki82AwsLzKd5O8zo", "IayckHiZRO1EFl1aGoK"); f4239e = a12; f4240f = Collections.unmodifiableSet(new HashSet(Arrays.asList(o2.b.b("proto"), o2.b.b("json")))); f4241g = new a(a10, null); f4242h = new a(a11, a12); } public a(String str, String str2) { this.f4243a = str; this.f4244b = str2; } public static a d(byte[] bArr) { String str = new String(bArr, Charset.forName("UTF-8")); if (!str.startsWith("1$")) { throw new IllegalArgumentException("Version marker missing from extras"); } String[] split = str.substring(2).split(Pattern.quote("\\"), 2); if (split.length != 2) { throw new IllegalArgumentException("Extra is not a valid encoded LegacyFlgDestination"); } String str2 = split[0]; if (str2.isEmpty()) { throw new IllegalArgumentException("Missing endpoint in CCTDestination extras"); } String str3 = split[1]; if (str3.isEmpty()) { str3 = null; } return new a(str2, str3); } @Override // q2.f public String a() { return "cct"; } @Override // q2.g public Set b() { return f4240f; } public byte[] c() { String str = this.f4244b; if (str == null && this.f4243a == null) { return null; } Object[] objArr = new Object[4]; objArr[0] = "1$"; objArr[1] = this.f4243a; objArr[2] = "\\"; if (str == null) { str = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; } objArr[3] = str; return String.format("%s%s%s%s", objArr).getBytes(Charset.forName("UTF-8")); } public String e() { return this.f4244b; } public String f() { return this.f4243a; } @Override // q2.f public byte[] getExtras() { return c(); } }