apk(点击下载) / MyGitFile$testQn$1.java


package com.gaoyuan.mianshu.network;

import android.content.Context;
import android.util.Log;
import androidx.core.app.NotificationCompat;
import com.gaoyuan.mianshu.f;
import com.google.gson.Gson;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import com.netease.nim.uikit.utils.SPUtils;
import java.io.IOException;
import kotlin.h;
import kotlin.jvm.internal.i;
import kotlin.text.o;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
import okhttp3.ResponseBody;

@h
/* compiled from: MyGitFile.kt */
public final class MyGitFile$testQn$1 implements Callback {
    final /* synthetic */ Context $context;
    final /* synthetic */ String $myUrl;
    final /* synthetic */ long $startTime;

    MyGitFile$testQn$1(String str, Context context, long j) {
        this.$myUrl = str;
        this.$context = context;
        this.$startTime = j;
    }

    @Override // okhttp3.Callback
    public void onFailure(Call call, IOException iOException) {
        i.e(call, NotificationCompat.CATEGORY_CALL);
        i.e(iOException, "e");
        f.a.B(PushConstants.PUSH_TYPE_NOTIFY, o.x(this.$myUrl, "http://rs.qiniu.com", "", false, 4, null), o.x(String.valueOf(iOException.getMessage()), "String index out of range: -2", "QN读取失败", false, 4, null));
        MyGitFile.INSTANCE.setInnerQn(this.$context);
    }

    @Override // okhttp3.Callback
    public void onResponse(Call call, Response response) {
        i.e(call, NotificationCompat.CATEGORY_CALL);
        i.e(response, "response");
        try {
            Gson gson = SPUtils.INSTANCE.getGson();
            ResponseBody body = response.body();
            String a = ((com.gaoyuan.mianshu.bean.f) gson.i(body != null ? body.string() : null, com.gaoyuan.mianshu.bean.f.class)).a().a();
            String substring = a.substring(1, a.length() - 1);
            i.d(substring, "this as java.lang.String…ing(startIndex, endIndex)");
            MyGitFile.INSTANCE.dealDomain(this.$context, f.a.a(substring), "Q");
        } catch (Exception e) {
            e.printStackTrace();
            Log.e("QIN2", String.valueOf(e.getMessage()));
            f.a.B(PushConstants.PUSH_TYPE_NOTIFY, o.x(this.$myUrl, "http://rs.qiniu.com", "", false, 4, null), o.x(String.valueOf(e.getMessage()), "String index out of range: -2", "QN读取失败", false, 4, null));
            MyGitFile.INSTANCE.setInnerQn(this.$context);
        }
        Log.e("QIN", "totalTime=" + (System.currentTimeMillis() - this.$startTime));
    }
}