流利说-英语 v8.47.26版本的 MD5 值为:0079dce5ff96e6cdbc95c261b3f51387

以下内容为反编译后的 b.java 源代码,内容仅作参考


package com.liulishuo.lingodarwin.profile.util;

import android.content.Context;
import com.liulishuo.lingodarwin.profile.d;
import kotlin.i;
import kotlin.jvm.internal.t;
import kotlin.text.m;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.ResponseBody;
import org.json.JSONObject;

@i
public final class b {
    public static final b fas = new b();

    private b() {
    }

    public final String eN(Context context) {
        t.g(context, "context");
        try {
            ResponseBody body = new OkHttpClient.Builder().build().newCall(new Request.Builder().url("http://pv.sohu.com/cityjson").get().build()).execute().body();
            t.cy(body);
            String respStr = body.string();
            t.e(respStr, "respStr");
            String substring = respStr.substring(m.a((CharSequence) respStr, "{", 0, false, 6, (Object) null), m.a((CharSequence) respStr, "}", 0, false, 6, (Object) null) + 1);
            t.e(substring, "(this as java.lang.Strin…ing(startIndex, endIndex)");
            JSONObject jSONObject = new JSONObject(substring);
            return jSONObject.getString("cip") + '(' + jSONObject.getString("cname") + ')';
        } catch (Exception e) {
            com.liulishuo.lingodarwin.profile.c.e("InternetUtil", "get ip address failure", e);
            String string = context.getString(d.i.un_know_ip);
            t.e(string, "context.getString(R.string.un_know_ip)");
            return string;
        }
    }
}