package z3;

import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;

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

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

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final w f37052d;

    public x(String str, String str2, boolean z10, w wVar) {
        if (str2.isEmpty() || str2.charAt(0) != '/') {
            throw new IllegalArgumentException("Path should start with a slash '/'.");
        }
        if (!str2.endsWith("/")) {
            throw new IllegalArgumentException("Path should end with a slash '/'");
        }
        this.f37050b = str;
        this.f37051c = str2;
        this.f37049a = z10;
        this.f37052d = wVar;
    }

    @Nullable
    @WorkerThread
    public w match(@NonNull Uri uri) {
        if (uri.getScheme().equals("http") && !this.f37049a) {
            return null;
        }
        if ((uri.getScheme().equals("http") || uri.getScheme().equals("https")) && uri.getAuthority().equals(this.f37050b) && uri.getPath().startsWith(this.f37051c)) {
            return this.f37052d;
        }
        return null;
    }
}
