四虎影院 v4.1.6版本的 MD5 值为:3c86dc44d368396917a29935d39af88b
以下内容为反编译后的 i.java 源代码,内容仅作参考
package g.a.b.utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
import java.io.IOException;
import java.net.Proxy;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import okhttp3.Call;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import q.b.a.c.l;
public class i {
public static final byte[] b = new byte[0];
public static i f9954c;
public OkHttpClient a;
public class a implements HostnameVerifier {
public a() {
}
@Override
public boolean verify(String str, SSLSession sSLSession) {
return true;
}
}
public class b implements okhttp3.g {
public final f a;
public b(f fVar) {
this.a = fVar;
}
@Override
public void onFailure(Call call, IOException iOException) {
this.a.a(call, iOException);
}
@Override
public void onResponse(Call call, Response response) {
this.a.a(call, response);
}
}
public class c implements okhttp3.g {
public final f a;
public c(f fVar) {
this.a = fVar;
}
@Override
public void onFailure(Call call, IOException iOException) {
this.a.a(call, iOException);
}
@Override
public void onResponse(Call call, Response response) {
this.a.a(call, response);
}
}
public class d implements okhttp3.g {
public final f a;
public d(f fVar) {
this.a = fVar;
}
@Override
public void onFailure(Call call, IOException iOException) {
this.a.a(call, iOException);
}
@Override
public void onResponse(Call call, Response response) {
this.a.a(call, response);
}
}
public class e implements okhttp3.g {
public final f a;
public e(f fVar) {
this.a = fVar;
}
@Override
public void onFailure(Call call, IOException iOException) {
this.a.a(call, iOException);
}
@Override
public void onResponse(Call call, Response response) {
this.a.a(call, response);
}
}
public interface f {
void a(Call call, IOException iOException);
void a(Call call, Response response);
}
public class g implements X509TrustManager {
public g() {
}
@Override
public void checkClientTrusted(X509Certificate[] x509CertificateArr, String str) {
}
@Override
public void checkServerTrusted(X509Certificate[] x509CertificateArr, String str) {
}
@Override
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}
}
public i() {
OkHttpClient.a aVar = new OkHttpClient.a();
aVar.d(8L, TimeUnit.SECONDS);
aVar.b(8L, TimeUnit.SECONDS);
aVar.e(8L, TimeUnit.SECONDS);
aVar.a(Proxy.NO_PROXY);
aVar.b(a());
aVar.a(new a());
this.a = aVar.a();
}
public static i b() {
if (f9954c == null) {
synchronized (b) {
if (f9954c == null) {
f9954c = new i();
}
}
}
return f9954c;
}
public void a(String str, f fVar) {
this.a.a(new Request.a().c().c(str).a("User-Agent").a("User-Agent", "okhttp/4.1.0/luob.app").a(l.R, "https://cjt521.com").a()).a(new b(fVar));
}
public void a(String str, Map<String, String> map, f fVar) {
this.a.a(new Request.a().c(a(map)).c(str).a()).a(new d(fVar));
}
public void b(String str, f fVar) {
this.a.a(new Request.a().c().c(str).a("User-Agent").a("User-Agent", "666").a()).a(new c(fVar));
}
public void a(String str, Map<String, String> map, Map<String, String> map2, f fVar) {
Request.a c2 = new Request.a().c(a(map)).c(str);
for (Map.Entry<String, String> entry : map2.entrySet()) {
c2.a(entry.getKey(), entry.getValue());
}
this.a.a(c2.a()).a(new e(fVar));
}
private RequestBody a(Map<String, String> map) {
FormBody.a aVar = new FormBody.a();
if (map != null) {
Iterator<String> it = map.keySet().iterator();
while (it.hasNext()) {
String str = it.next().toString();
aVar.a(str, map.get(str));
Log.d("post http", "post_Params===" + str + "====" + map.get(str));
}
}
return aVar.a();
}
public static boolean a(Context context) {
NetworkInfo[] allNetworkInfo;
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
if (connectivityManager != null && (allNetworkInfo = connectivityManager.getAllNetworkInfo()) != null) {
for (NetworkInfo networkInfo : allNetworkInfo) {
if (networkInfo.getState() == NetworkInfo.State.CONNECTED) {
return true;
}
}
}
return false;
}
public SSLSocketFactory a() {
try {
SSLContext sSLContext = SSLContext.getInstance("TLS");
sSLContext.init(null, new TrustManager[]{new g()}, new SecureRandom());
return sSLContext.getSocketFactory();
} catch (Exception unused) {
return null;
}
}
}