悦享送 v3.5.1版本的 MD5 值为:111dc8a16f422da8b2f1cf208abae9ea
以下内容为反编译后的 C0178a.java 源代码,内容仅作参考
package io.card.payment;
import android.content.Context;
import android.util.Base64;
import com.facebook.common.util.UriUtil;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadPoolExecutor;
import org.apache.http.HttpEntity;
import org.apache.http.HttpVersion;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.conn.params.ConnManagerParams;
import org.apache.http.conn.params.ConnPerRouteBean;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpProtocolParams;
import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.HttpContext;
import org.apache.http.protocol.SyncBasicHttpContext;
public final class C0178a {
private static int a = 10;
private static int b = 10000;
private final DefaultHttpClient c;
private final HttpContext d;
private ThreadPoolExecutor e;
private final Map f;
private final Map g;
public C0178a() {
BasicHttpParams basicHttpParams = new BasicHttpParams();
ConnManagerParams.setTimeout(basicHttpParams, b);
ConnManagerParams.setMaxConnectionsPerRoute(basicHttpParams, new ConnPerRouteBean(a));
ConnManagerParams.setMaxTotalConnections(basicHttpParams, 10);
HttpConnectionParams.setSoTimeout(basicHttpParams, b);
HttpConnectionParams.setConnectionTimeout(basicHttpParams, b);
HttpConnectionParams.setTcpNoDelay(basicHttpParams, true);
HttpConnectionParams.setSocketBufferSize(basicHttpParams, 8192);
HttpProtocolParams.setVersion(basicHttpParams, HttpVersion.HTTP_1_1);
HttpProtocolParams.setUserAgent(basicHttpParams, String.format("android-async-http/%s (http://loopj.com/android-async-http)", "1.3.2"));
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme(UriUtil.HTTP_SCHEME, PlainSocketFactory.getSocketFactory(), 80));
schemeRegistry.register(new Scheme(UriUtil.HTTPS_SCHEME, SSLSocketFactory.getSocketFactory(), 443));
ThreadSafeClientConnManager threadSafeClientConnManager = new ThreadSafeClientConnManager(basicHttpParams, schemeRegistry);
this.d = new SyncBasicHttpContext(new BasicHttpContext());
DefaultHttpClient defaultHttpClient = new DefaultHttpClient(threadSafeClientConnManager, basicHttpParams);
this.c = defaultHttpClient;
defaultHttpClient.addRequestInterceptor(new af(this));
defaultHttpClient.addResponseInterceptor(new ag());
defaultHttpClient.setHttpRequestRetryHandler(new ak());
this.e = (ThreadPoolExecutor) Executors.newCachedThreadPool();
this.f = new WeakHashMap();
this.g = new HashMap();
}
private void a(DefaultHttpClient defaultHttpClient, HttpContext httpContext, HttpUriRequest httpUriRequest, String str, C0183f c0183f, Context context) {
if (str != null) {
httpUriRequest.addHeader("Content-Type", str);
}
Future<?> submit = this.e.submit(new ai(defaultHttpClient, httpContext, httpUriRequest, c0183f));
if (context != null) {
List list = (List) this.f.get(context);
if (list == null) {
list = new LinkedList();
this.f.put(context, list);
}
list.add(new WeakReference(submit));
}
}
public final void a(Context context, String str, C0183f c0183f) {
a(this.c, this.d, new HttpGet(str), null, c0183f, context);
}
public final void a(Context context, String str, HttpEntity httpEntity, String str2, C0183f c0183f) {
DefaultHttpClient defaultHttpClient = this.c;
HttpContext httpContext = this.d;
HttpPost httpPost = new HttpPost(str);
if (httpEntity != null) {
httpPost.setEntity(httpEntity);
}
a(defaultHttpClient, httpContext, httpPost, str2, c0183f, context);
}
public final void a(String str) {
HttpProtocolParams.setUserAgent(this.c.getParams(), str);
}
public final void a(String str, String str2) {
this.g.remove("Authorization");
if (str == null) {
return;
}
if (str == null) {
str = "";
}
this.g.put("Authorization", String.format("Basic %s", Base64.encodeToString(str.getBytes(), 2)));
}
public final void a(SSLSocketFactory sSLSocketFactory) {
this.c.getConnectionManager().getSchemeRegistry().register(new Scheme(UriUtil.HTTPS_SCHEME, sSLSocketFactory, 443));
}
}