花瓣 v4.6.12版本的 MD5 值为:6a3515d4d16d98931f1b3d25a91b257e
以下内容为反编译后的 g.java 源代码,内容仅作参考
package com.huaban.android.vendors;
import android.util.Log;
import com.facebook.stetho.okhttp3.StethoInterceptor;
import com.huaban.android.vendors.b;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import kotlin.c0;
import kotlin.o2.w;
import kotlin.x2.w.k0;
import kotlin.x2.w.m0;
import kotlin.z;
import okhttp3.Dns;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public final class g implements Dns {
private final z a;
private final z b;
private final z c;
private final z f9172d;
static final class a extends m0 implements kotlin.x2.v.a<com.huaban.android.vendors.a> {
public static final a a = new a();
a() {
super(0);
}
@Override
public final com.huaban.android.vendors.a invoke() {
return (com.huaban.android.vendors.a) new Retrofit.Builder().client(new OkHttpClient.Builder().connectTimeout(5L, TimeUnit.SECONDS).readTimeout(10L, TimeUnit.SECONDS).addNetworkInterceptor(new StethoInterceptor()).build()).addConverterFactory(GsonConverterFactory.create()).baseUrl("https://223.5.5.5/").build().create(com.huaban.android.vendors.a.class);
}
}
static final class b extends m0 implements kotlin.x2.v.a<String> {
public static final b a = new b();
b() {
super(0);
}
@Override
public final String invoke() {
return System.getProperty("http.proxyHost");
}
}
static final class c extends m0 implements kotlin.x2.v.a<String> {
public static final c a = new c();
c() {
super(0);
}
@Override
public final String invoke() {
return System.getProperty("http.proxyPort");
}
}
static final class d extends m0 implements kotlin.x2.v.a<Boolean> {
d() {
super(0);
}
public final boolean a() {
return (g.this.e() == null || g.this.f() == null) ? false : true;
}
@Override
public Boolean invoke() {
return Boolean.valueOf(a());
}
}
public g() {
z c2;
z c3;
z c4;
z c5;
c2 = c0.c(b.a);
this.a = c2;
c3 = c0.c(c.a);
this.b = c3;
c4 = c0.c(new d());
this.c = c4;
c5 = c0.c(a.a);
this.f9172d = c5;
}
private final String c(List<? extends b.a> list) {
for (b.a aVar : list) {
Integer type = aVar.getType();
if (type != null && type.intValue() == 1) {
String a2 = aVar.a();
if (a2 != null) {
if (!(a2.length() == 0)) {
}
}
return aVar.a();
}
}
return null;
}
private final com.huaban.android.vendors.a d() {
return (com.huaban.android.vendors.a) this.f9172d.getValue();
}
public final String e() {
return (String) this.a.getValue();
}
public final String f() {
return (String) this.b.getValue();
}
private final boolean g() {
return ((Boolean) this.c.getValue()).booleanValue();
}
private final String h(String str) {
com.huaban.android.vendors.b body = d().a(str, 1).execute().body();
k0.o(body, "response.body()");
List<b.a> b2 = body.b();
if (b2 != null) {
return c(b2);
}
return null;
}
@Override
@h.c.a.d
public List<InetAddress> lookup(@h.c.a.d String str) throws UnknownHostException {
List<InetAddress> k;
k0.p(str, "hostname");
if (g()) {
return Dns.SYSTEM.lookup(str);
}
try {
String h2 = h(str);
if (h2 != null) {
if (h2.length() > 0) {
InetAddress byName = InetAddress.getByName(h2);
Log.d("OkHttpDns", "resolve " + str + " = " + byName);
k = w.k(byName);
return k;
}
}
} catch (Exception e2) {
e2.printStackTrace();
}
return Dns.SYSTEM.lookup(str);
}
}