package z3;

import android.net.Uri;
import android.webkit.WebResourceResponse;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
import java.util.ArrayList;
import java.util.List;

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

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

    public z(ArrayList arrayList) {
        this.f37054a = arrayList;
    }

    @Nullable
    @WorkerThread
    public WebResourceResponse shouldInterceptRequest(@NonNull Uri uri) {
        WebResourceResponse webResourceResponseHandle;
        for (x xVar : this.f37054a) {
            w wVarMatch = xVar.match(uri);
            if (wVarMatch != null && (webResourceResponseHandle = wVarMatch.handle(uri.getPath().replaceFirst(xVar.f37051c, ""))) != null) {
                return webResourceResponseHandle;
            }
        }
        return null;
    }
}
