package M2;

import P2.w;
import android.os.Parcel;
import android.os.RemoteException;
import android.util.Log;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;

/* JADX INFO: loaded from: classes.dex */
public abstract class m extends Y2.a implements P2.r {

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final int f4186f;

    public m(byte[] bArr) {
        super("com.google.android.gms.common.internal.ICertData");
        w.a(bArr.length == 25);
        this.f4186f = Arrays.hashCode(bArr);
    }

    public static byte[] L(String str) {
        try {
            return str.getBytes("ISO-8859-1");
        } catch (UnsupportedEncodingException e8) {
            throw new AssertionError(e8);
        }
    }

    @Override // P2.r
    public final int G() {
        return this.f4186f;
    }

    @Override // Y2.a
    public final boolean K(int i, Parcel parcel, Parcel parcel2) {
        if (i == 1) {
            V2.a aVarB = b();
            parcel2.writeNoException();
            Z2.b.c(parcel2, aVarB);
            return true;
        }
        if (i != 2) {
            return false;
        }
        parcel2.writeNoException();
        parcel2.writeInt(this.f4186f);
        return true;
    }

    public abstract byte[] M();

    @Override // P2.r
    public final V2.a b() {
        return new V2.b(M());
    }

    public final boolean equals(Object obj) {
        V2.a aVarB;
        if (obj != null && (obj instanceof P2.r)) {
            try {
                P2.r rVar = (P2.r) obj;
                if (rVar.G() == this.f4186f && (aVarB = rVar.b()) != null) {
                    return Arrays.equals(M(), (byte[]) V2.b.M(aVarB));
                }
            } catch (RemoteException e8) {
                Log.e("GoogleCertificates", "Failed to get Google certificates from remote", e8);
            }
        }
        return false;
    }

    public final int hashCode() {
        return this.f4186f;
    }
}
