package z0;

import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.SocketTimeoutException;

/* JADX INFO: loaded from: classes.dex */
public class r extends i {

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

    public r() {
        super(2008);
        this.f19171s = 1;
    }

    public static r a(int i, IOException iOException) {
        String message = iOException.getMessage();
        int i5 = iOException instanceof SocketTimeoutException ? 2002 : iOException instanceof InterruptedIOException ? 1004 : (message == null || !s7.d.F(message).matches("cleartext.*not permitted.*")) ? 2001 : 2007;
        return i5 == 2007 ? new q("Cleartext HTTP traffic not permitted. See https://developer.android.com/guide/topics/media/issues/cleartext-not-permitted", iOException, 2007) : new r(i5, i, iOException);
    }

    /* JADX WARN: Illegal instructions before constructor call */
    public r(int i, int i5, IOException iOException) {
        if (i == 2000 && i5 == 1) {
            i = 2001;
        }
        super(iOException, i);
        this.f19171s = i5;
    }

    public r(String str, IOException iOException, int i) {
        super(str, iOException, i == 2000 ? 2001 : i);
        this.f19171s = 1;
    }
}
