导航菜单

页面标题

页面副标题

Hopscotch v9.7.2 - a.java 源代码

正在查看: Hopscotch v9.7.2 应用的 a.java JAVA 源代码文件

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


package in.hopscotch.android.remote.impl.webapp;

import in.hopscotch.android.common.util.t;
import in.hopscotch.android.core.util.d;
import in.hopscotch.android.core.webapp.model.b;
import in.hopscotch.android.core.webapp.model.c;
import in.hopscotch.android.core.webapp.repository.f;
import in.hopscotch.android.remote.service.WebAppService;
import java.io.IOException;
import kotlin.jvm.internal.Intrinsics;
import okhttp3.ResponseBody;
import org.jetbrains.annotations.NotNull;
import retrofit2.Call;
import retrofit2.Response;

public final class a implements f {
    public d a;

    @NotNull
    private final in.hopscotch.android.remote.service.a hopscotchApiServiceFactory;

    public a(@NotNull in.hopscotch.android.remote.service.a hopscotchApiServiceFactory) {
        Intrinsics.checkNotNullParameter(hopscotchApiServiceFactory, "hopscotchApiServiceFactory");
        this.hopscotchApiServiceFactory = hopscotchApiServiceFactory;
    }

    public final b a(String str) {
        ResponseBody body;
        Call<ResponseBody> downloadWebAssetFile;
        if (str != null) {
            try {
                if (t.a(str)) {
                    WebAppService j = this.hopscotchApiServiceFactory.j();
                    Response<ResponseBody> execute = (j == null || (downloadWebAssetFile = j.downloadWebAssetFile(str)) == null) ? null : downloadWebAssetFile.execute();
                    if (execute != null && execute.isSuccessful() && (body = execute.body()) != null) {
                        return new b(Long.valueOf(body.contentLength()), body.byteStream());
                    }
                }
            } catch (IOException e) {
                d dVar = this.a;
                if (dVar == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("logger");
                    dVar = null;
                }
                dVar.d(e);
            }
        }
        return null;
    }

    public final c b() {
        Call<c> webAppAssets;
        try {
            WebAppService j = this.hopscotchApiServiceFactory.j();
            Response<c> execute = (j == null || (webAppAssets = j.getWebAppAssets("https://www.hopscotch.in/v2/assets.json")) == null) ? null : webAppAssets.execute();
            if (execute == null || !execute.isSuccessful()) {
                return null;
            }
            return execute.body();
        } catch (IOException e) {
            d dVar = this.a;
            if (dVar == null) {
                Intrinsics.throwUninitializedPropertyAccessException("logger");
                dVar = null;
            }
            dVar.d(e);
            return null;
        }
    }
}