MT Manager v2.15.3版本的 MD5 值为:1cbd6ee7afdac97645dd3a8c4751ecf0
以下内容为反编译后的 C7529.java 源代码,内容仅作参考
package l;
import android.content.Context;
import android.os.Bundle;
import android.os.SystemClock;
import com.alipay.sdk.m.l.a;
import java.io.CharConversionException;
import java.io.EOFException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InvalidClassException;
import java.io.InvalidObjectException;
import java.io.NotActiveException;
import java.io.NotSerializableException;
import java.io.OptionalDataException;
import java.io.StreamCorruptedException;
import java.io.SyncFailedException;
import java.io.UTFDataFormatException;
import java.io.UnsupportedEncodingException;
import java.io.WriteAbortedException;
import java.net.BindException;
import java.net.ConnectException;
import java.net.HttpRetryException;
import java.net.MalformedURLException;
import java.net.NoRouteToHostException;
import java.net.PortUnreachableException;
import java.net.ProtocolException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.net.UnknownServiceException;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.FileLockInterruptionException;
import java.nio.charset.MalformedInputException;
import java.nio.charset.UnmappableCharacterException;
import java.util.HashMap;
import java.util.InvalidPropertiesFormatException;
import java.util.Map;
import java.util.concurrent.RejectedExecutionException;
import java.util.zip.ZipException;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLKeyException;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLProtocolException;
import org.json.JSONException;
import org.json.JSONObject;
public final class C7529 {
public static JSONObject m18380(C1070 c1070, Context context, String str, Bundle bundle, String str2) {
String str3;
String str4;
String str5;
int i;
int i2;
long j;
long j2;
InterfaceC8418 m18379;
int i3;
String str6 = "openSDK_LOG.HttpUtils";
C14358.m30098("openSDK_LOG.HttpUtils", "OpenApi request");
if (!C7669.m18582(context)) {
throw new Exception("network unavailable");
}
if (str.toLowerCase().startsWith(a.r)) {
str3 = str;
str4 = str3;
} else {
str3 = C5141.m13333().m13334(context, "https://openmobile.qq.com/") + str;
str4 = C5141.m13333().m13334(context, "https://openmobile.qq.com/") + str;
}
if (str.indexOf("add_share") > -1 || str.indexOf("upload_pic") > -1 || str.indexOf("add_topic") > -1 || str.indexOf("set_user_face") > -1 || str.indexOf("add_t") > -1 || str.indexOf("add_pic_t") > -1 || str.indexOf("add_pic_url") > -1 || str.indexOf("add_video") > -1) {
C9817.m22627(context, c1070, str);
}
long elapsedRealtime = SystemClock.elapsedRealtime();
int m14960 = C5984.m14954(context, c1070.m3754()).m14960("Common_HttpRetryCount");
StringBuilder m29212 = C13737.m29212("config 1:Common_HttpRetryCount config_value:", m14960, " appid:");
m29212.append(c1070.m3754());
m29212.append(" url:");
m29212.append(str4);
C14358.m30091("OpenConfig_test", m29212.toString());
int i4 = m14960 == 0 ? 3 : m14960;
StringBuilder m292122 = C13737.m29212("config 1:Common_HttpRetryCount result_value:", i4, " appid:");
m292122.append(c1070.m3754());
m292122.append(" url:");
m292122.append(str4);
C14358.m30091("OpenConfig_test", m292122.toString());
int i5 = 0;
JSONObject jSONObject = null;
long j3 = elapsedRealtime;
while (true) {
int i6 = i5 + 1;
try {
try {
try {
m18379 = m18379(str3, str2, bundle);
int d = m18379.d();
C14358.m30098(str6, "request statusCode " + d);
if (d == 200) {
break;
}
C4251.m11213().getClass();
str5 = str6;
i = i6;
try {
C4251.m11209(str4, j3, 0L, 0L, d);
throw new C4158(d);
break;
} catch (SocketTimeoutException e) {
e = e;
i2 = -8;
j2 = 0;
j = 0;
if (i < i4) {
j3 = SystemClock.elapsedRealtime();
if (i >= i4) {
C4251.m11213().getClass();
C4251.m11209(str4, j3, j2, j, i2);
return jSONObject;
}
i5 = i;
str6 = str5;
} else {
C4251.m11213().getClass();
C4251.m11209(str4, j3, 0L, 0L, -8);
throw e;
}
}
} catch (SocketTimeoutException e2) {
e = e2;
str5 = str6;
i = i6;
}
i5 = i;
str6 = str5;
} catch (JSONException e3) {
C4251.m11213().getClass();
C4251.m11209(str4, j3, 0L, 0L, -4);
throw e3;
}
} catch (MalformedURLException e4) {
C4251.m11213().getClass();
C4251.m11209(str4, j3, 0L, 0L, -3);
throw e4;
} catch (IOException e5) {
int m18377 = m18377(e5);
C4251.m11213().getClass();
C4251.m11209(str4, j3, 0L, 0L, m18377);
throw e5;
}
}
C4251.m11213().getClass();
C4251.m11209(str4, j3, j2, j, i2);
return jSONObject;
long c = m18379.c();
j = m18379.b();
i2 = i3;
j2 = c;
C4251.m11213().getClass();
C4251.m11209(str4, j3, j2, j, i2);
return jSONObject;
}
public static void m18381(C1070 c1070, Context context, String str, Bundle bundle, String str2, C11506 c11506) {
C14358.m30098("openSDK_LOG.HttpUtils", "OpenApi requestAsync");
try {
C6827.f21633.execute(new RunnableC1632(c1070, context, str, bundle, str2, c11506));
} catch (RejectedExecutionException unused) {
}
}
public static int m18377(IOException iOException) {
if (iOException instanceof CharConversionException) {
return -20;
}
if (iOException instanceof MalformedInputException) {
return -21;
}
if (iOException instanceof UnmappableCharacterException) {
return -22;
}
if (iOException instanceof ClosedChannelException) {
return -24;
}
if (iOException instanceof EOFException) {
return -26;
}
if (iOException instanceof FileLockInterruptionException) {
return -27;
}
if (iOException instanceof FileNotFoundException) {
return -28;
}
if (iOException instanceof HttpRetryException) {
return -29;
}
if (iOException instanceof SocketTimeoutException) {
return -8;
}
if (iOException instanceof InvalidPropertiesFormatException) {
return -30;
}
if (iOException instanceof MalformedURLException) {
return -3;
}
if (iOException instanceof InvalidClassException) {
return -33;
}
if (iOException instanceof InvalidObjectException) {
return -34;
}
if (iOException instanceof NotActiveException) {
return -35;
}
if (iOException instanceof NotSerializableException) {
return -36;
}
if (iOException instanceof OptionalDataException) {
return -37;
}
if (iOException instanceof StreamCorruptedException) {
return -38;
}
if (iOException instanceof WriteAbortedException) {
return -39;
}
if (iOException instanceof ProtocolException) {
return -40;
}
if (iOException instanceof SSLHandshakeException) {
return -41;
}
if (iOException instanceof SSLKeyException) {
return -42;
}
if (iOException instanceof SSLPeerUnverifiedException) {
return -43;
}
if (iOException instanceof SSLProtocolException) {
return -44;
}
if (iOException instanceof BindException) {
return -45;
}
if (iOException instanceof ConnectException) {
return -46;
}
if (iOException instanceof NoRouteToHostException) {
return -47;
}
if (iOException instanceof PortUnreachableException) {
return -48;
}
if (iOException instanceof SyncFailedException) {
return -49;
}
if (iOException instanceof UTFDataFormatException) {
return -50;
}
if (iOException instanceof UnknownHostException) {
return -51;
}
if (iOException instanceof UnknownServiceException) {
return -52;
}
if (iOException instanceof UnsupportedEncodingException) {
return -53;
}
return iOException instanceof ZipException ? -54 : -2;
}
public static InterfaceC8418 m18379(String str, String str2, Bundle bundle) {
Bundle bundle2;
Bundle bundle3;
if (bundle != null) {
bundle2 = new Bundle(bundle);
} else {
bundle2 = new Bundle();
}
if (str2.equalsIgnoreCase("GET")) {
HashMap m18378 = m18378(bundle2);
if (bundle2.containsKey("access_token") || bundle2.containsKey("pay_token") || bundle2.containsKey("pfkey") || bundle2.containsKey("expires_in") || bundle2.containsKey("openid") || bundle2.containsKey("proxy_code") || bundle2.containsKey("proxy_expires_in")) {
bundle3 = new Bundle(bundle2);
bundle3.remove("access_token");
bundle3.remove("pay_token");
bundle3.remove("pfkey");
bundle3.remove("expires_in");
bundle3.remove("openid");
bundle3.remove("proxy_code");
bundle3.remove("proxy_expires_in");
} else {
bundle3 = bundle2;
}
if (bundle3 != bundle2) {
C14358.m30098("openSDK_LOG.HttpUtils", "-->openUrl encodedParam =" + bundle3.toString() + " -- url = " + str);
} else {
C14358.m30098("openSDK_LOG.HttpUtils", "-->openUrl encodedParam =" + m18378.toString() + " -- url = " + str);
}
return C10102.m23145().m23149(str, (Map) m18378);
}
if (str2.equalsIgnoreCase("POST")) {
HashMap m183782 = m18378(bundle2);
HashMap hashMap = new HashMap(0);
if (bundle2.size() != 0) {
for (String str3 : bundle2.keySet()) {
Object obj = bundle2.get(str3);
if (obj instanceof byte[]) {
hashMap.put(str3, (byte[]) obj);
}
}
}
if (hashMap.size() == 0) {
return C10102.m23145().m23147(str, m183782);
}
C14358.m30092("openSDK_LOG.HttpUtils", "openUrl: has binary " + hashMap.size());
return C10102.m23145().m23148(str, m183782, hashMap);
}
C14358.m30101("openSDK_LOG.HttpUtils", "openUrl: http method " + str2 + " is not supported.");
throw new IOException("http method is not supported.");
}
public static String m18382(Bundle bundle) {
HashMap m18378 = m18378(bundle);
if (m18378.size() == 0) {
return "";
}
StringBuilder sb = new StringBuilder();
boolean z = true;
for (String str : m18378.keySet()) {
if (z) {
z = false;
} else {
sb.append(com.alipay.sdk.m.s.a.n);
}
sb.append(C2293.encode(str));
sb.append("=");
sb.append(C2293.encode((String) m18378.get(str)));
}
return sb.toString();
}
public static HashMap m18378(Bundle bundle) {
HashMap hashMap = new HashMap();
if (bundle.size() == 0) {
return hashMap;
}
for (String str : bundle.keySet()) {
Object obj = bundle.get(str);
if (!(obj instanceof String) && !(obj instanceof String[])) {
C14358.m30092("openSDK_LOG.HttpUtils", "parseBundleToMap: the type " + obj.getClass() + " is unsupported");
} else if (obj instanceof String[]) {
String[] strArr = (String[]) obj;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < strArr.length; i++) {
if (i != 0) {
sb.append(",");
}
sb.append(strArr[i]);
}
hashMap.put(str, sb.toString());
} else {
hashMap.put(str, (String) obj);
}
}
return hashMap;
}
}