导航菜单

页面标题

页面副标题

pg 娱乐 v1.0.7.202506242308 - BaseRequest.java 源代码

正在查看: pg 娱乐 v1.0.7.202506242308 应用的 BaseRequest.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.drake.net.request;

import androidx.exifinterface.media.ExifInterface;
import com.drake.net.NetConfig;
import com.drake.net.cache.CacheMode;
import com.drake.net.cache.ForceCache;
import com.drake.net.convert.NetConverter;
import com.drake.net.exception.ConvertException;
import com.drake.net.exception.NetException;
import com.drake.net.exception.URLParseException;
import com.drake.net.interceptor.RequestInterceptor;
import com.drake.net.interfaces.ProgressListener;
import com.drake.net.okhttp.OkHttpBuilderKt;
import com.drake.net.okhttp.OkHttpExtensionKt;
import com.drake.net.response.ResponseExtensionKt;
import com.drake.net.tag.NetTag;
import com.engagelab.privates.common.constants.MTCommonConstants;
import com.engagelab.privates.push.constants.MTPushConstants;
import java.io.File;
import java.lang.reflect.Type;
import java.net.URL;
import java.util.concurrent.CancellationException;
import java.util.concurrent.TimeUnit;
import kotlin.Metadata;
import kotlin.Result;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.reflect.KType;
import kotlin.reflect.TypesJVMKt;
import okhttp3.Cache;
import okhttp3.CacheControl;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Headers;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.OkHttpUtils;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.internal.cache.DiskLruCache;

@Metadata(d1 = {"\u0000Ì\u0001\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0004\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\b&\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u000e\u0010\"\u001a\u00020#2\u0006\u0010$\u001a\u00020%J\u0016\u0010&\u001a\u00020#2\u0006\u0010'\u001a\u00020(2\u0006\u0010\u0015\u001a\u00020(J\u001d\u0010)\u001a\u00020#2\u0006\u0010'\u001a\u00020(2\b\u0010\u0015\u001a\u0004\u0018\u00010*¢\u0006\u0002\u0010+J\u0018\u0010)\u001a\u00020#2\u0006\u0010'\u001a\u00020(2\b\u0010\u0015\u001a\u0004\u0018\u00010,J\"\u0010)\u001a\u00020#2\u0006\u0010'\u001a\u00020(2\b\u0010\u0015\u001a\u0004\u0018\u00010(2\b\b\u0002\u0010-\u001a\u00020*J\b\u0010.\u001a\u00020/H\u0016J\u000e\u00100\u001a\u0002012\u0006\u00102\u001a\u000203J\u0016\u00104\u001a\u0002H5\"\u0006\b\u0000\u00105\u0018\u0001H\u0086\b¢\u0006\u0002\u00106J\u0019\u00104\u001a\u0002H5\"\u0004\b\u0000\u001052\u0006\u00107\u001a\u000208¢\u0006\u0002\u00109J\u0006\u0010:\u001a\u00020;J\u001f\u0010<\u001a\u00020#2\u0006\u0010'\u001a\u00020(2\b\u0010\u0015\u001a\u0004\u0018\u00010*H&¢\u0006\u0002\u0010+J\u001a\u0010<\u001a\u00020#2\u0006\u0010'\u001a\u00020(2\b\u0010\u0015\u001a\u0004\u0018\u00010,H&J\u001a\u0010<\u001a\u00020#2\u0006\u0010'\u001a\u00020(2\b\u0010\u0015\u001a\u0004\u0018\u00010(H&J\"\u0010<\u001a\u00020#2\u0006\u0010'\u001a\u00020(2\b\u0010\u0015\u001a\u0004\u0018\u00010(2\u0006\u0010-\u001a\u00020*H&J\u000e\u0010=\u001a\u00020#2\u0006\u0010'\u001a\u00020(J\u000e\u0010>\u001a\u00020#2\u0006\u0010?\u001a\u00020@J\u000e\u0010A\u001a\u00020#2\u0006\u0010B\u001a\u00020(J\u000e\u0010C\u001a\u00020#2\u0006\u0010D\u001a\u00020EJ\u0018\u0010F\u001a\u00020#2\u0006\u0010G\u001a\u00020H2\b\b\u0002\u0010I\u001a\u00020JJ\u001f\u0010K\u001a\u00020#2\u0017\u00102\u001a\u0013\u0012\u0004\u0012\u00020M\u0012\u0004\u0012\u00020#0L¢\u0006\u0002\bNJ\u000e\u0010O\u001a\u00020#2\u0006\u0010'\u001a\u00020PJ\u000e\u0010O\u001a\u00020#2\u0006\u0010'\u001a\u00020(J\u000e\u0010Q\u001a\u00020#2\u0006\u0010'\u001a\u00020(J\u0010\u0010R\u001a\u00020#2\b\b\u0002\u0010S\u001a\u00020*J\u0010\u0010T\u001a\u00020#2\b\b\u0002\u0010S\u001a\u00020*J\u0010\u0010U\u001a\u00020#2\b\b\u0002\u0010S\u001a\u00020*J\u0010\u0010V\u001a\u00020#2\b\b\u0002\u0010S\u001a\u00020*J\u0018\u0010W\u001a\u00020#2\u0006\u0010'\u001a\u00020(2\b\u0010X\u001a\u0004\u0018\u00010\u0001J\u0010\u0010Y\u001a\u00020#2\b\u0010Z\u001a\u0004\u0018\u00010\u0001J\u0016\u0010[\u001a\u00020#2\u0006\u0010'\u001a\u00020(2\u0006\u0010\u0015\u001a\u00020(J\u000e\u0010\\\u001a\u00020#2\u0006\u0010:\u001a\u00020]J\u0010\u0010^\u001a\u00020#2\b\u0010_\u001a\u0004\u0018\u00010\u0001J\u0011\u0010`\u001a\u00020#\"\u0006\b\u0000\u0010a\u0018\u0001H\u0086\bJ\u0010\u0010b\u001a\u00020#2\b\u0010c\u001a\u0004\u0018\u00010(J\u001d\u0010d\u001a\u00020#2\u0006\u0010'\u001a\u00020(2\b\u0010\u0015\u001a\u0004\u0018\u00010*¢\u0006\u0002\u0010+J\u0018\u0010d\u001a\u00020#2\u0006\u0010'\u001a\u00020(2\b\u0010\u0015\u001a\u0004\u0018\u00010,J\"\u0010d\u001a\u00020#2\u0006\u0010'\u001a\u00020(2\b\u0010\u0015\u001a\u0004\u0018\u00010(2\b\b\u0002\u0010-\u001a\u00020*J\u0010\u0010e\u001a\u00020#2\u0006\u0010f\u001a\u00020gH\u0016J\u0010\u0010e\u001a\u00020#2\u0006\u0010f\u001a\u00020(H\u0016J\u0010\u0010e\u001a\u00020#2\u0006\u0010f\u001a\u00020hH\u0016J+\u0010X\u001a\u00020#\"\u0004\b\u0000\u0010a2\u000e\u00107\u001a\n\u0012\u0006\b\u0000\u0012\u0002Ha0i2\b\u0010X\u001a\u0004\u0018\u0001Ha¢\u0006\u0002\u0010jJ\u0010\u0010X\u001a\u00020#2\b\u0010X\u001a\u0004\u0018\u00010\u0001J \u0010k\u001a\u00020#\"\u0006\b\u0000\u0010a\u0018\u00012\b\u0010X\u001a\u0004\u0018\u0001HaH\u0086\b¢\u0006\u0002\u0010lJ'\u0010m\u001a\b\u0012\u0004\u0012\u0002H50n\"\u0006\b\u0000\u00105\u0018\u0001H\u0086\bø\u0001\u0000ø\u0001\u0001ø\u0001\u0002¢\u0006\u0004\bo\u00106R\u001a\u0010\u0003\u001a\u00020\u0004X\u0096\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0005\u0010\u0006\"\u0004\b\u0007\u0010\bR\u001a\u0010\t\u001a\u00020\nX\u0096\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000b\u0010\f\"\u0004\b\r\u0010\u000eR\u001a\u0010\u000f\u001a\u00020\u0010X\u0096\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0011\u0010\u0012\"\u0004\b\u0013\u0010\u0014R$\u0010\u0017\u001a\u00020\u00162\u0006\u0010\u0015\u001a\u00020\u0016@VX\u0096\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0018\u0010\u0019\"\u0004\b\u001a\u0010\u001bR\u001a\u0010\u001c\u001a\u00020\u001dX\u0096\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u001e\u0010\u001f\"\u0004\b \u0010!\u0082\u0002\u000f\n\u0002\b!\n\u0005\b¡\u001e0\u0001\n\u0002\b\u0019¨\u0006p"}, d2 = {"Lcom/drake/net/request/BaseRequest;", "", "()V", "converter", "Lcom/drake/net/convert/NetConverter;", "getConverter", "()Lcom/drake/net/convert/NetConverter;", "setConverter", "(Lcom/drake/net/convert/NetConverter;)V", "httpUrl", "Lokhttp3/HttpUrl$Builder;", "getHttpUrl", "()Lokhttp3/HttpUrl$Builder;", "setHttpUrl", "(Lokhttp3/HttpUrl$Builder;)V", "method", "Lcom/drake/net/request/Method;", "getMethod", "()Lcom/drake/net/request/Method;", "setMethod", "(Lcom/drake/net/request/Method;)V", "value", "Lokhttp3/OkHttpClient;", "okHttpClient", "getOkHttpClient", "()Lokhttp3/OkHttpClient;", "setOkHttpClient", "(Lokhttp3/OkHttpClient;)V", "okHttpRequest", "Lokhttp3/Request$Builder;", "getOkHttpRequest", "()Lokhttp3/Request$Builder;", "setOkHttpRequest", "(Lokhttp3/Request$Builder;)V", "addDownloadListener", "", "progressListener", "Lcom/drake/net/interfaces/ProgressListener;", "addHeader", MTCommonConstants.Network.KEY_NAME, "", "addQuery", "", "(Ljava/lang/String;Ljava/lang/Boolean;)V", "", "encoded", "buildRequest", "Lokhttp3/Request;", "enqueue", "Lokhttp3/Call;", "block", "Lokhttp3/Callback;", "execute", "R", "()Ljava/lang/Object;", "type", "Ljava/lang/reflect/Type;", "(Ljava/lang/reflect/Type;)Ljava/lang/Object;", "headers", "Lokhttp3/Headers$Builder;", "param", "removeHeader", "setCacheControl", "cacheControl", "Lokhttp3/CacheControl;", "setCacheKey", "key", "setCacheMode", "mode", "Lcom/drake/net/cache/CacheMode;", "setCacheValidTime", "duration", "", "unit", "Ljava/util/concurrent/TimeUnit;", "setClient", "Lkotlin/Function1;", "Lokhttp3/OkHttpClient$Builder;", "Lkotlin/ExtensionFunctionType;", "setDownloadDir", "Ljava/io/File;", "setDownloadFileName", "setDownloadFileNameConflict", "enabled", "setDownloadFileNameDecode", "setDownloadMd5Verify", "setDownloadTempFile", "setExtra", MTPushConstants.Operation.KEY_TAG, "setGroup", "group", "setHeader", "setHeaders", "Lokhttp3/Headers;", "setId", "id", "setKType", ExifInterface.GPS_DIRECTION_TRUE, "setPath", "path", "setQuery", "setUrl", "url", "Ljava/net/URL;", "Lokhttp3/HttpUrl;", "Ljava/lang/Class;", "(Ljava/lang/Class;Ljava/lang/Object;)V", "tagOf", "(Ljava/lang/Object;)V", "toResult", "Lkotlin/Result;", "toResult-d1pmJ48", "net_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
public abstract class BaseRequest {
    private HttpUrl.Builder httpUrl = new HttpUrl.Builder();
    private NetConverter converter = NetConfig.INSTANCE.getConverter();
    private Method method = Method.GET;
    private Request.Builder okHttpRequest = new Request.Builder();
    private OkHttpClient okHttpClient = NetConfig.INSTANCE.getOkHttpClient();

    public abstract void param(String name, Boolean value);

    public abstract void param(String name, Number value);

    public abstract void param(String name, String value);

    public abstract void param(String name, String value, boolean encoded);

    public HttpUrl.Builder getHttpUrl() {
        return this.httpUrl;
    }

    public void setHttpUrl(HttpUrl.Builder builder) {
        Intrinsics.checkNotNullParameter(builder, "<set-?>");
        this.httpUrl = builder;
    }

    public NetConverter getConverter() {
        return this.converter;
    }

    public void setConverter(NetConverter netConverter) {
        Intrinsics.checkNotNullParameter(netConverter, "<set-?>");
        this.converter = netConverter;
    }

    public Method getMethod() {
        return this.method;
    }

    public void setMethod(Method method) {
        Intrinsics.checkNotNullParameter(method, "<set-?>");
        this.method = method;
    }

    public Request.Builder getOkHttpRequest() {
        return this.okHttpRequest;
    }

    public void setOkHttpRequest(Request.Builder builder) {
        Intrinsics.checkNotNullParameter(builder, "<set-?>");
        this.okHttpRequest = builder;
    }

    public OkHttpClient getOkHttpClient() {
        return this.okHttpClient;
    }

    public void setOkHttpClient(OkHttpClient okHttpClient) {
        ForceCache forceCache;
        Intrinsics.checkNotNullParameter(okHttpClient, "value");
        OkHttpClient netOkhttp = OkHttpExtensionKt.toNetOkhttp(okHttpClient);
        this.okHttpClient = netOkhttp;
        Cache cache = netOkhttp.cache();
        if (cache != null) {
            DiskLruCache diskLruCache = OkHttpUtils.diskLruCache(cache);
            Intrinsics.checkNotNullExpressionValue(diskLruCache, "diskLruCache(it)");
            forceCache = new ForceCache(diskLruCache);
        } else {
            forceCache = null;
        }
        getOkHttpRequest().tag(ForceCache.class, forceCache);
    }

    public final void setClient(Function1<? super OkHttpClient.Builder, Unit> block) {
        Intrinsics.checkNotNullParameter(block, "block");
        OkHttpClient.Builder newBuilder = getOkHttpClient().newBuilder();
        block.invoke(newBuilder);
        setOkHttpClient(OkHttpBuilderKt.toNetOkhttp(newBuilder).build());
    }

    public final void setId(Object id) {
        RequestBuilderKt.setId(getOkHttpRequest(), id);
    }

    public final void setGroup(Object group) {
        RequestBuilderKt.setGroup(getOkHttpRequest(), group);
    }

    public void setUrl(String url) {
        Intrinsics.checkNotNullParameter(url, "url");
        try {
            setHttpUrl(HttpUrl.Companion.get(url).newBuilder());
        } catch (Exception e) {
            throw new URLParseException(url, e);
        }
    }

    public void setUrl(HttpUrl url) {
        Intrinsics.checkNotNullParameter(url, "url");
        setHttpUrl(url.newBuilder());
    }

    public void setUrl(URL url) {
        Intrinsics.checkNotNullParameter(url, "url");
        String url2 = url.toString();
        Intrinsics.checkNotNullExpressionValue(url2, "url.toString()");
        setUrl(url2);
    }

    public final void setPath(String path) {
        HttpUrl parse = path != null ? HttpUrl.Companion.parse(path) : null;
        if (parse == null) {
            try {
                setHttpUrl(HttpUrl.Companion.get(NetConfig.INSTANCE.getHost() + path).newBuilder());
                return;
            } catch (Throwable th) {
                throw new URLParseException(NetConfig.INSTANCE.getHost() + path, th);
            }
        }
        setHttpUrl(parse.newBuilder());
    }

    public static void setQuery$default(BaseRequest baseRequest, String str, String str2, boolean z, int i, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: setQuery");
        }
        if ((i & 4) != 0) {
            z = false;
        }
        baseRequest.setQuery(str, str2, z);
    }

    public final void setQuery(String name, String value, boolean encoded) {
        Intrinsics.checkNotNullParameter(name, MTCommonConstants.Network.KEY_NAME);
        if (encoded) {
            getHttpUrl().setEncodedQueryParameter(name, value);
        } else {
            getHttpUrl().setQueryParameter(name, value);
        }
    }

    public final void setQuery(String name, Number value) {
        String number;
        Intrinsics.checkNotNullParameter(name, MTCommonConstants.Network.KEY_NAME);
        if (value == null || (number = value.toString()) == null) {
            return;
        }
        setQuery$default(this, name, number, false, 4, null);
    }

    public final void setQuery(String name, Boolean value) {
        String bool;
        Intrinsics.checkNotNullParameter(name, MTCommonConstants.Network.KEY_NAME);
        if (value == null || (bool = value.toString()) == null) {
            return;
        }
        setQuery$default(this, name, bool, false, 4, null);
    }

    public static void addQuery$default(BaseRequest baseRequest, String str, String str2, boolean z, int i, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: addQuery");
        }
        if ((i & 4) != 0) {
            z = false;
        }
        baseRequest.addQuery(str, str2, z);
    }

    public final void addQuery(String name, String value, boolean encoded) {
        Intrinsics.checkNotNullParameter(name, MTCommonConstants.Network.KEY_NAME);
        if (encoded) {
            getHttpUrl().addEncodedQueryParameter(name, value);
        } else {
            getHttpUrl().addQueryParameter(name, value);
        }
    }

    public final void addQuery(String name, Number value) {
        String number;
        Intrinsics.checkNotNullParameter(name, MTCommonConstants.Network.KEY_NAME);
        if (value == null || (number = value.toString()) == null) {
            return;
        }
        addQuery$default(this, name, number, false, 4, null);
    }

    public final void addQuery(String name, Boolean value) {
        String bool;
        Intrinsics.checkNotNullParameter(name, MTCommonConstants.Network.KEY_NAME);
        if (value == null || (bool = value.toString()) == null) {
            return;
        }
        addQuery$default(this, name, bool, false, 4, null);
    }

    public final void setExtra(String name, Object tag) {
        Intrinsics.checkNotNullParameter(name, MTCommonConstants.Network.KEY_NAME);
        RequestBuilderKt.setExtra(getOkHttpRequest(), name, tag);
    }

    public final void tag(Object tag) {
        getOkHttpRequest().tag(tag);
    }

    public final <T> void tag(Class<? super T> type, T tag) {
        Intrinsics.checkNotNullParameter(type, "type");
        getOkHttpRequest().tag(type, tag);
    }

    public final <T> void tagOf(T tag) {
        Request.Builder okHttpRequest = getOkHttpRequest();
        Intrinsics.reifiedOperationMarker(4, ExifInterface.GPS_DIRECTION_TRUE);
        okHttpRequest.tag(Object.class, tag);
    }

    public final void addHeader(String name, String value) {
        Intrinsics.checkNotNullParameter(name, MTCommonConstants.Network.KEY_NAME);
        Intrinsics.checkNotNullParameter(value, "value");
        getOkHttpRequest().addHeader(name, value);
    }

    public final void setHeader(String name, String value) {
        Intrinsics.checkNotNullParameter(name, MTCommonConstants.Network.KEY_NAME);
        Intrinsics.checkNotNullParameter(value, "value");
        getOkHttpRequest().header(name, value);
    }

    public final void removeHeader(String name) {
        Intrinsics.checkNotNullParameter(name, MTCommonConstants.Network.KEY_NAME);
        getOkHttpRequest().removeHeader(name);
    }

    public final void setHeaders(Headers headers) {
        Intrinsics.checkNotNullParameter(headers, "headers");
        getOkHttpRequest().headers(headers);
    }

    public final Headers.Builder headers() {
        return RequestBuilderKt.headers(getOkHttpRequest());
    }

    public final void setCacheControl(CacheControl cacheControl) {
        Intrinsics.checkNotNullParameter(cacheControl, "cacheControl");
        getOkHttpRequest().cacheControl(cacheControl);
    }

    public final void setCacheKey(String key) {
        Intrinsics.checkNotNullParameter(key, "key");
        getOkHttpRequest().tag(NetTag.CacheKey.class, NetTag.CacheKey.m367boximpl(NetTag.CacheKey.m368constructorimpl(key)));
    }

    public static void setCacheValidTime$default(BaseRequest baseRequest, long j, TimeUnit timeUnit, int i, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: setCacheValidTime");
        }
        if ((i & 2) != 0) {
            timeUnit = TimeUnit.MILLISECONDS;
        }
        baseRequest.setCacheValidTime(j, timeUnit);
    }

    public final void setCacheValidTime(long duration, TimeUnit unit) {
        Intrinsics.checkNotNullParameter(unit, "unit");
        getOkHttpRequest().tag(NetTag.CacheValidTime.class, NetTag.CacheValidTime.m374boximpl(NetTag.CacheValidTime.m375constructorimpl(unit.toMillis(duration))));
    }

    public final void setDownloadFileName(String name) {
        Intrinsics.checkNotNullParameter(name, MTCommonConstants.Network.KEY_NAME);
        getOkHttpRequest().tag(NetTag.DownloadFileName.class, NetTag.DownloadFileName.m405boximpl(NetTag.DownloadFileName.m406constructorimpl(name)));
    }

    public final void setDownloadDir(String name) {
        Intrinsics.checkNotNullParameter(name, MTCommonConstants.Network.KEY_NAME);
        getOkHttpRequest().tag(NetTag.DownloadFileDir.class, NetTag.DownloadFileDir.m389boximpl(NetTag.DownloadFileDir.m391constructorimpl(name)));
    }

    public final void setDownloadDir(File name) {
        Intrinsics.checkNotNullParameter(name, MTCommonConstants.Network.KEY_NAME);
        getOkHttpRequest().tag(NetTag.DownloadFileDir.class, NetTag.DownloadFileDir.m389boximpl(NetTag.DownloadFileDir.m390constructorimpl(name)));
    }

    public static void setDownloadMd5Verify$default(BaseRequest baseRequest, boolean z, int i, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: setDownloadMd5Verify");
        }
        if ((i & 1) != 0) {
            z = true;
        }
        baseRequest.setDownloadMd5Verify(z);
    }

    public final void setDownloadMd5Verify(boolean enabled) {
        getOkHttpRequest().tag(NetTag.DownloadFileMD5Verify.class, NetTag.DownloadFileMD5Verify.m397boximpl(NetTag.DownloadFileMD5Verify.m398constructorimpl(enabled)));
    }

    public static void setDownloadFileNameConflict$default(BaseRequest baseRequest, boolean z, int i, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: setDownloadFileNameConflict");
        }
        if ((i & 1) != 0) {
            z = true;
        }
        baseRequest.setDownloadFileNameConflict(z);
    }

    public final void setDownloadFileNameConflict(boolean enabled) {
        getOkHttpRequest().tag(NetTag.DownloadFileConflictRename.class, NetTag.DownloadFileConflictRename.m381boximpl(NetTag.DownloadFileConflictRename.m382constructorimpl(enabled)));
    }

    public static void setDownloadFileNameDecode$default(BaseRequest baseRequest, boolean z, int i, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: setDownloadFileNameDecode");
        }
        if ((i & 1) != 0) {
            z = true;
        }
        baseRequest.setDownloadFileNameDecode(z);
    }

    public final void setDownloadFileNameDecode(boolean enabled) {
        getOkHttpRequest().tag(NetTag.DownloadFileNameDecode.class, NetTag.DownloadFileNameDecode.m412boximpl(NetTag.DownloadFileNameDecode.m413constructorimpl(enabled)));
    }

    public static void setDownloadTempFile$default(BaseRequest baseRequest, boolean z, int i, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: setDownloadTempFile");
        }
        if ((i & 1) != 0) {
            z = true;
        }
        baseRequest.setDownloadTempFile(z);
    }

    public final void setDownloadTempFile(boolean enabled) {
        getOkHttpRequest().tag(NetTag.DownloadTempFile.class, NetTag.DownloadTempFile.m420boximpl(NetTag.DownloadTempFile.m421constructorimpl(enabled)));
    }

    public final void addDownloadListener(ProgressListener progressListener) {
        Intrinsics.checkNotNullParameter(progressListener, "progressListener");
        RequestBuilderKt.downloadListeners(getOkHttpRequest()).add(progressListener);
    }

    public final <T> void setKType() {
        Request.Builder okHttpRequest = getOkHttpRequest();
        Intrinsics.reifiedOperationMarker(6, ExifInterface.GPS_DIRECTION_TRUE);
        RequestBuilderKt.setKType(okHttpRequest, null);
    }

    public Request buildRequest() {
        return RequestBuilderKt.setConverter(getOkHttpRequest().method(getMethod().name(), (RequestBody) null).url(getHttpUrl().build()), getConverter()).build();
    }

    public final <R> R execute() {
        RequestInterceptor requestInterceptor = NetConfig.INSTANCE.getRequestInterceptor();
        if (requestInterceptor != null) {
            requestInterceptor.interceptor(this);
        }
        Request.Builder okHttpRequest = getOkHttpRequest();
        Intrinsics.reifiedOperationMarker(6, "R");
        RequestBuilderKt.setKType(okHttpRequest, null);
        Response execute = getOkHttpClient().newCall(buildRequest()).execute();
        try {
            NetConverter converter = RequestExtensionKt.converter(execute.request());
            Intrinsics.reifiedOperationMarker(6, "R");
            R r = (R) converter.onConvert(TypesJVMKt.getJavaType((KType) null), execute);
            Intrinsics.reifiedOperationMarker(1, "R");
            R r2 = r;
            return r;
        } catch (NetException e) {
            throw e;
        } catch (CancellationException e2) {
            throw e2;
        } catch (Throwable th) {
            throw new ConvertException(execute, "An unexpected error occurred in the converter", th, null, 8, null);
        }
    }

    public final <R> R execute(Type type) {
        Intrinsics.checkNotNullParameter(type, "type");
        RequestInterceptor requestInterceptor = NetConfig.INSTANCE.getRequestInterceptor();
        if (requestInterceptor != null) {
            requestInterceptor.interceptor(this);
        }
        return (R) ResponseExtensionKt.convert(getOkHttpClient().newCall(buildRequest()).execute(), type);
    }

    public final <R> Object m358toResultd1pmJ48() {
        RequestInterceptor requestInterceptor = NetConfig.INSTANCE.getRequestInterceptor();
        if (requestInterceptor != null) {
            requestInterceptor.interceptor(this);
        }
        Request.Builder okHttpRequest = getOkHttpRequest();
        Intrinsics.reifiedOperationMarker(6, "R");
        RequestBuilderKt.setKType(okHttpRequest, null);
        try {
            Response execute = getOkHttpClient().newCall(buildRequest()).execute();
            try {
                try {
                    try {
                        NetConverter converter = RequestExtensionKt.converter(execute.request());
                        Intrinsics.reifiedOperationMarker(6, "R");
                        Object onConvert = converter.onConvert(TypesJVMKt.getJavaType((KType) null), execute);
                        Intrinsics.reifiedOperationMarker(1, "R");
                        Object obj = onConvert;
                        Result.Companion companion = Result.Companion;
                        return Result.constructor-impl(onConvert);
                    } catch (CancellationException e) {
                        throw e;
                    }
                } catch (Throwable th) {
                    throw new ConvertException(execute, "An unexpected error occurred in the converter", th, null, 8, null);
                }
            } catch (NetException e2) {
                throw e2;
            }
        } catch (Exception e3) {
            Result.Companion companion2 = Result.Companion;
            return Result.constructor-impl(ResultKt.createFailure(e3));
        }
    }

    public final Call enqueue(Callback block) {
        Intrinsics.checkNotNullParameter(block, "block");
        RequestInterceptor requestInterceptor = NetConfig.INSTANCE.getRequestInterceptor();
        if (requestInterceptor != null) {
            requestInterceptor.interceptor(this);
        }
        Call newCall = getOkHttpClient().newCall(buildRequest());
        newCall.enqueue(block);
        return newCall;
    }

    public final void setCacheMode(CacheMode mode) {
        Intrinsics.checkNotNullParameter(mode, "mode");
        getOkHttpRequest().tag(CacheMode.class, mode);
    }
}