MT Manager v2.15.3版本的 MD5 值为:34ea5286e529d87838c6cae0a2220d93
以下内容为反编译后的 C1261.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 C1261 {
public static JSONObject m3829(C2898 c2898, Context context, String str, Bundle bundle, String str2) {
String str3;
String str4;
String str5;
int i;
int i2;
long j;
long j2;
InterfaceC7624 m3828;
int i3;
String str6 = "openSDK_LOG.HttpUtils";
C5471.m13573("openSDK_LOG.HttpUtils", "OpenApi request");
if (!C8325.m19357(context)) {
throw new Exception("network unavailable");
}
if (str.toLowerCase().startsWith(a.r)) {
str3 = str;
str4 = str3;
} else {
str3 = C6922.m16719().m16720(context, "https://openmobile.qq.com/") + str;
str4 = C6922.m16719().m16720(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) {
C4035.m10636(context, c2898, str);
}
long elapsedRealtime = SystemClock.elapsedRealtime();
int m940 = C0187.m935(context, c2898.m8193()).m940("Common_HttpRetryCount");
StringBuilder m11598 = C4485.m11598("config 1:Common_HttpRetryCount config_value:", m940, " appid:");
m11598.append(c2898.m8193());
m11598.append(" url:");
m11598.append(str4);
C5471.m13581("OpenConfig_test", m11598.toString());
int i4 = m940 == 0 ? 3 : m940;
StringBuilder m115982 = C4485.m11598("config 1:Common_HttpRetryCount result_value:", i4, " appid:");
m115982.append(c2898.m8193());
m115982.append(" url:");
m115982.append(str4);
C5471.m13581("OpenConfig_test", m115982.toString());
int i5 = 0;
JSONObject jSONObject = null;
long j3 = elapsedRealtime;
while (true) {
int i6 = i5 + 1;
try {
try {
try {
m3828 = m3828(str3, str2, bundle);
int d = m3828.d();
C5471.m13573(str6, "request statusCode " + d);
if (d == 200) {
break;
}
C12676.m27090().getClass();
str5 = str6;
i = i6;
try {
C12676.m27086(str4, j3, 0L, 0L, d);
throw new C13049(d);
break;
} catch (SocketTimeoutException e) {
e = e;
i2 = -8;
j2 = 0;
j = 0;
if (i < i4) {
j3 = SystemClock.elapsedRealtime();
if (i >= i4) {
C12676.m27090().getClass();
C12676.m27086(str4, j3, j2, j, i2);
return jSONObject;
}
i5 = i;
str6 = str5;
} else {
C12676.m27090().getClass();
C12676.m27086(str4, j3, 0L, 0L, -8);
throw e;
}
}
} catch (SocketTimeoutException e2) {
e = e2;
str5 = str6;
i = i6;
}
i5 = i;
str6 = str5;
} catch (JSONException e3) {
C12676.m27090().getClass();
C12676.m27086(str4, j3, 0L, 0L, -4);
throw e3;
}
} catch (MalformedURLException e4) {
C12676.m27090().getClass();
C12676.m27086(str4, j3, 0L, 0L, -3);
throw e4;
} catch (IOException e5) {
int m3826 = m3826(e5);
C12676.m27090().getClass();
C12676.m27086(str4, j3, 0L, 0L, m3826);
throw e5;
}
}
C12676.m27090().getClass();
C12676.m27086(str4, j3, j2, j, i2);
return jSONObject;
long c = m3828.c();
j = m3828.b();
i2 = i3;
j2 = c;
C12676.m27090().getClass();
C12676.m27086(str4, j3, j2, j, i2);
return jSONObject;
}
public static void m3830(C2898 c2898, Context context, String str, Bundle bundle, String str2, C11599 c11599) {
C5471.m13573("openSDK_LOG.HttpUtils", "OpenApi requestAsync");
try {
C1028.f3555.execute(new RunnableC2945(c2898, context, str, bundle, str2, c11599));
} catch (RejectedExecutionException unused) {
}
}
public static int m3826(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 InterfaceC7624 m3828(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 m3827 = m3827(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) {
C5471.m13573("openSDK_LOG.HttpUtils", "-->openUrl encodedParam =" + bundle3.toString() + " -- url = " + str);
} else {
C5471.m13573("openSDK_LOG.HttpUtils", "-->openUrl encodedParam =" + m3827.toString() + " -- url = " + str);
}
return C3414.m9492().m9496(str, (Map) m3827);
}
if (str2.equalsIgnoreCase("POST")) {
HashMap m38272 = m3827(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 C3414.m9492().m9494(str, m38272);
}
C5471.m13582("openSDK_LOG.HttpUtils", "openUrl: has binary " + hashMap.size());
return C3414.m9492().m9495(str, m38272, hashMap);
}
C5471.m13580("openSDK_LOG.HttpUtils", "openUrl: http method " + str2 + " is not supported.");
throw new IOException("http method is not supported.");
}
public static String m3831(Bundle bundle) {
HashMap m3827 = m3827(bundle);
if (m3827.size() == 0) {
return "";
}
StringBuilder sb = new StringBuilder();
boolean z = true;
for (String str : m3827.keySet()) {
if (z) {
z = false;
} else {
sb.append(com.alipay.sdk.m.s.a.n);
}
sb.append(C6773.encode(str));
sb.append("=");
sb.append(C6773.encode((String) m3827.get(str)));
}
return sb.toString();
}
public static HashMap m3827(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[])) {
C5471.m13582("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;
}
}