package com.google.firebase.messaging;

import android.util.Log;
import java.util.Arrays;
import java.util.regex.Pattern;
import p0.AbstractC0928a;

/* JADX INFO: loaded from: classes.dex */
public final class A {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final Pattern f5816d = Pattern.compile("[a-zA-Z0-9-_.~%]{1,900}");

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final String f5817a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final String f5818b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final String f5819c;

    public A(String str, String str2) {
        String strSubstring;
        if (str2 == null || !str2.startsWith("/topics/")) {
            strSubstring = str2;
        } else {
            Log.w("FirebaseMessaging", "Format /topics/topic-name is deprecated. Only 'topic-name' should be used in " + str + ".");
            strSubstring = str2.substring(8);
        }
        if (strSubstring == null || !f5816d.matcher(strSubstring).matches()) {
            throw new IllegalArgumentException(AbstractC0928a.l("Invalid topic name: ", strSubstring, " does not match the allowed format [a-zA-Z0-9-_.~%]{1,900}."));
        }
        this.f5817a = strSubstring;
        this.f5818b = str;
        this.f5819c = str + "!" + str2;
    }

    public final boolean equals(Object obj) {
        if (!(obj instanceof A)) {
            return false;
        }
        A a5 = (A) obj;
        return this.f5817a.equals(a5.f5817a) && this.f5818b.equals(a5.f5818b);
    }

    public final int hashCode() {
        return Arrays.hashCode(new Object[]{this.f5818b, this.f5817a});
    }
}
