package com.cvte.dss.ups.sp20e;

import g.a.a.a.a;
import kotlin.Metadata;
import kotlin.jvm.internal.o;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0018\u0000 \n2\u00020\u0001:\u0001\nB\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0010\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\tH\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0003X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u000b"}, d2 = {"Lcom/cvte/dss/ups/sp20e/RetryIntercepter;", "Lokhttp3/Interceptor;", "maxRetry", "", "(I)V", "retryNum", "intercept", "Lokhttp3/Response;", "chain", "Lokhttp3/Interceptor$Chain;", "Companion", "lib_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class RetryIntercepter implements Interceptor {
    public static final String TAG = "RetryIntercepter";
    private final int maxRetry;
    private int retryNum;

    public RetryIntercepter(int i2) {
        this.maxRetry = i2;
    }

    @Override // okhttp3.Interceptor
    public Response intercept(Interceptor.a aVar) {
        Response responseA;
        int i2;
        o.f(aVar, "chain");
        Request requestE = aVar.e();
        while (true) {
            responseA = aVar.a(requestE);
            if (responseA.c() || (i2 = this.retryNum) >= this.maxRetry) {
                break;
            }
            this.retryNum = i2 + 1;
            a.p0(a.F("retryNum="), this.retryNum, TAG);
        }
        return responseA;
    }
}
