package com.google.firebase.messaging; import android.text.TextUtils; import android.util.Log; import com.google.android.gms.common.internal.Objects; import java.util.regex.Pattern; /* loaded from: classes2.dex */ final class y0 { /* renamed from: d, reason: collision with root package name */ private static final Pattern f5690d = Pattern.compile("[a-zA-Z0-9-_.~%]{1,900}"); /* renamed from: a, reason: collision with root package name */ private final String f5691a; /* renamed from: b, reason: collision with root package name */ private final String f5692b; /* renamed from: c, reason: collision with root package name */ private final String f5693c; private y0(String str, String str2) { this.f5691a = d(str2, str); this.f5692b = str; this.f5693c = str + "!" + str2; } static y0 a(String str) { if (TextUtils.isEmpty(str)) { return null; } String[] split = str.split("!", -1); if (split.length != 2) { return null; } return new y0(split[0], split[1]); } private static String d(String str, String str2) { if (str != null && str.startsWith("/topics/")) { Log.w("FirebaseMessaging", String.format("Format /topics/topic-name is deprecated. Only 'topic-name' should be used in %s.", str2)); str = str.substring(8); } if (str == null || !f5690d.matcher(str).matches()) { throw new IllegalArgumentException(String.format("Invalid topic name: %s does not match the allowed format %s.", str, "[a-zA-Z0-9-_.~%]{1,900}")); } return str; } public String b() { return this.f5692b; } public String c() { return this.f5691a; } public String e() { return this.f5693c; } public boolean equals(Object obj) { if (!(obj instanceof y0)) { return false; } y0 y0Var = (y0) obj; return this.f5691a.equals(y0Var.f5691a) && this.f5692b.equals(y0Var.f5692b); } public int hashCode() { return Objects.hashCode(this.f5692b, this.f5691a); } }