70 lines
2.0 KiB
Java
70 lines
2.0 KiB
Java
package com.google.firebase.messaging;
|
|
|
|
import android.text.TextUtils;
|
|
import com.google.android.gms.common.internal.Objects;
|
|
import java.util.regex.Pattern;
|
|
|
|
/* loaded from: classes2.dex */
|
|
final class zzz {
|
|
private static final Pattern zza = Pattern.compile("[a-zA-Z0-9-_.~%]{1,900}");
|
|
private final String zzb;
|
|
private final String zzc;
|
|
private final String zzd;
|
|
|
|
private zzz(String str, String str2) {
|
|
String str3;
|
|
if (str2 == null || !str2.startsWith("/topics/")) {
|
|
str3 = str2;
|
|
} else {
|
|
new Object[]{str};
|
|
str3 = str2.substring(8);
|
|
}
|
|
if (str3 == null || !zza.matcher(str3).matches()) {
|
|
throw new IllegalArgumentException(String.format("Invalid topic name: %s does not match the allowed format %s.", str3, "[a-zA-Z0-9-_.~%]{1,900}"));
|
|
}
|
|
this.zzb = str3;
|
|
this.zzc = str;
|
|
StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 1 + String.valueOf(str2).length());
|
|
sb.append(str);
|
|
sb.append("!");
|
|
sb.append(str2);
|
|
this.zzd = sb.toString();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static zzz zzc(String str) {
|
|
if (TextUtils.isEmpty(str)) {
|
|
return null;
|
|
}
|
|
String[] split = str.split("!", -1);
|
|
if (split.length != 2) {
|
|
return null;
|
|
}
|
|
return new zzz(split[0], split[1]);
|
|
}
|
|
|
|
public final boolean equals(Object obj) {
|
|
if (!(obj instanceof zzz)) {
|
|
return false;
|
|
}
|
|
zzz zzzVar = (zzz) obj;
|
|
return this.zzb.equals(zzzVar.zzb) && this.zzc.equals(zzzVar.zzc);
|
|
}
|
|
|
|
public final int hashCode() {
|
|
return Objects.hashCode(this.zzc, this.zzb);
|
|
}
|
|
|
|
public final String zzc() {
|
|
return this.zzd;
|
|
}
|
|
|
|
public final String zzb() {
|
|
return this.zzc;
|
|
}
|
|
|
|
public final String zza() {
|
|
return this.zzb;
|
|
}
|
|
}
|