package r;

import android.net.Uri;
import b0.C;
import com.cvte.vman.instance.InvokeCmd;
import okhttp3.HttpUrl;

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

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

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private int f6315d;

    public g(String str, long j2, long j3) {
        this.f6314c = str == null ? HttpUrl.FRAGMENT_ENCODE_SET : str;
        this.f6312a = j2;
        this.f6313b = j3;
    }

    public g a(g gVar, String str) {
        String strC = c(str);
        if (gVar != null && strC.equals(gVar.c(str))) {
            long j2 = this.f6313b;
            if (j2 != -1) {
                long j3 = this.f6312a;
                if (j3 + j2 == gVar.f6312a) {
                    long j4 = gVar.f6313b;
                    return new g(strC, j3, j4 != -1 ? j2 + j4 : -1L);
                }
            }
            long j5 = gVar.f6313b;
            if (j5 != -1) {
                long j6 = gVar.f6312a;
                if (j6 + j5 == this.f6312a) {
                    return new g(strC, j6, j2 != -1 ? j5 + j2 : -1L);
                }
            }
        }
        return null;
    }

    public Uri b(String str) {
        return C.d(str, this.f6314c);
    }

    public String c(String str) {
        return C.c(str, this.f6314c);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || g.class != obj.getClass()) {
            return false;
        }
        g gVar = (g) obj;
        return this.f6312a == gVar.f6312a && this.f6313b == gVar.f6313b && this.f6314c.equals(gVar.f6314c);
    }

    public int hashCode() {
        if (this.f6315d == 0) {
            this.f6315d = ((((InvokeCmd.CMD_XBUG_SET_VMAN_DOCROR_NBT + ((int) this.f6312a)) * 31) + ((int) this.f6313b)) * 31) + this.f6314c.hashCode();
        }
        return this.f6315d;
    }
}
