四虎影院 v4.1.6版本的 MD5 值为:3c86dc44d368396917a29935d39af88b
以下内容为反编译后的 j.java 源代码,内容仅作参考
package g.a.b.utils;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import cn.luckxy.vod.App;
import java.net.NetworkInterface;
import java.net.Proxy;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;
import okhttp3.Cookie;
import okhttp3.CookieJar;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import org.jetbrains.annotations.NotNull;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.converter.scalars.ScalarsConverterFactory;
public enum j {
INSTANCE;
public static final int f9956d = 5;
public static final int f9957e = 5;
public Retrofit a;
public Retrofit b;
public class a implements HttpLoggingInterceptor.b {
public a() {
}
@Override
public void i(@NotNull String str) {
Log.i("Retrofit2Utils", str);
}
}
j() {
OkHttpClient.a aVar = new OkHttpClient.a();
aVar.b(5L, TimeUnit.SECONDS);
aVar.e(5L, TimeUnit.SECONDS);
aVar.d(5L, TimeUnit.SECONDS);
aVar.a(Proxy.NO_PROXY);
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor(new a());
httpLoggingInterceptor.a(HttpLoggingInterceptor.a.BODY);
aVar.a(httpLoggingInterceptor);
aVar.a(new b());
aVar.c(true);
this.a = new Retrofit.Builder().client(aVar.a()).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).addConverterFactory(GsonConverterFactory.create()).baseUrl("https://cjt521.com").build();
this.b = new Retrofit.Builder().client(aVar.a()).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).addConverterFactory(ScalarsConverterFactory.create()).baseUrl("https://cjt521.com").build();
}
public <T> T a(Class<T> cls) {
if (b() || a()) {
return null;
}
return (T) INSTANCE.a.create(cls);
}
public <T> T b(Class<T> cls) {
if (b() || a()) {
return null;
}
return (T) INSTANCE.b.create(cls);
}
public class b implements CookieJar {
public b() {
}
@Override
public void a(@NotNull HttpUrl httpUrl, @NotNull List<Cookie> list) {
if (httpUrl.O().toString().contains("https://cjt521.com/api.php/v1.auth/login")) {
UserUtils.a(list);
}
}
@Override
@NotNull
public List<Cookie> a(@NotNull HttpUrl httpUrl) {
ArrayList arrayList = new ArrayList();
String path = httpUrl.O().getPath();
Iterator<String> it = UserUtils.b().iterator();
while (true) {
if (!it.hasNext()) {
break;
}
if (path.equals(it.next())) {
arrayList.addAll(UserUtils.a());
break;
}
}
return arrayList;
}
}
public <T> T a(Class<T> cls, String str) {
if (b() || a()) {
return null;
}
OkHttpClient.a aVar = new OkHttpClient.a();
aVar.b(5L, TimeUnit.SECONDS);
aVar.e(5L, TimeUnit.SECONDS);
aVar.d(5L, TimeUnit.SECONDS);
aVar.a(Proxy.NO_PROXY);
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
httpLoggingInterceptor.a(HttpLoggingInterceptor.a.BODY);
aVar.a(httpLoggingInterceptor);
aVar.c(true);
return (T) new Retrofit.Builder().client(aVar.a()).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).addConverterFactory(GsonConverterFactory.create()).baseUrl(str).build().create(cls);
}
public <T> T b(Class<T> cls, String str) {
if (b() || a()) {
return null;
}
OkHttpClient.a aVar = new OkHttpClient.a();
aVar.b(5L, TimeUnit.SECONDS);
aVar.e(5L, TimeUnit.SECONDS);
aVar.d(5L, TimeUnit.SECONDS);
aVar.a(Proxy.NO_PROXY);
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
httpLoggingInterceptor.a(HttpLoggingInterceptor.a.BODY);
aVar.a(httpLoggingInterceptor);
aVar.c(true);
return (T) new Retrofit.Builder().client(aVar.a()).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).addConverterFactory(ScalarsConverterFactory.create()).baseUrl(str).build().create(cls);
}
public static boolean a() {
try {
Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
if (networkInterfaces == null) {
return false;
}
Iterator it = Collections.list(networkInterfaces).iterator();
while (it.hasNext()) {
NetworkInterface networkInterface = (NetworkInterface) it.next();
if (networkInterface.isUp() && networkInterface.getInterfaceAddresses().size() != 0) {
Log.d("-----", "isVpnUsed() NetworkInterface Name: " + networkInterface.getName());
if ("tun0".equals(networkInterface.getName()) || "ppp0".equals(networkInterface.getName())) {
return true;
}
}
}
return false;
} catch (Throwable th) {
th.printStackTrace();
return false;
}
}
private boolean b() {
String host;
int port;
if (Build.VERSION.SDK_INT >= 14) {
host = System.getProperty("http.proxyHost");
String property = System.getProperty("http.proxyPort");
if (property == null) {
property = "-1";
}
port = Integer.parseInt(property);
} else {
host = android.net.Proxy.getHost(App.d().a());
port = android.net.Proxy.getPort(App.d().a());
}
return (TextUtils.isEmpty(host) || port == -1) ? false : true;
}
}