正在查看: jsgt v4.8.1 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: jsgt v4.8.1 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package ee;
import android.content.Context;
import android.os.Bundle;
import android.os.SystemClock;
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.URLEncoder;
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.ArrayList;
import java.util.HashMap;
import java.util.InvalidPropertiesFormatException;
import java.util.UUID;
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 qk.c0;
import qk.t;
import qk.u;
import qk.v;
import qk.x;
import qk.y;
public final class b {
public static class a extends Exception {
public a(int i) {
super(android.support.v4.media.a.f("http status code error:", i));
}
}
public static class C0019b extends Exception {
public C0019b() {
super("network unavailable");
}
}
public static be.b a(String str, String str2, Bundle bundle) throws IOException {
Bundle bundle2;
Bundle bundle3 = bundle != null ? new Bundle(bundle) : new Bundle();
if (str2.equalsIgnoreCase("GET")) {
HashMap b = b(bundle3);
if (bundle3.containsKey("access_token") || bundle3.containsKey("pay_token") || bundle3.containsKey("pfkey") || bundle3.containsKey("expires_in") || bundle3.containsKey("openid") || bundle3.containsKey("proxy_code") || bundle3.containsKey("proxy_expires_in")) {
bundle2 = new Bundle(bundle3);
bundle2.remove("access_token");
bundle2.remove("pay_token");
bundle2.remove("pfkey");
bundle2.remove("expires_in");
bundle2.remove("openid");
bundle2.remove("proxy_code");
bundle2.remove("proxy_expires_in");
} else {
bundle2 = bundle3;
}
if (bundle2 != bundle3) {
de.a.f("openSDK_LOG.HttpUtils", "-->openUrl encodedParam =" + bundle2.toString() + " -- url = " + str);
} else {
de.a.f("openSDK_LOG.HttpUtils", "-->openUrl encodedParam =" + b.toString() + " -- url = " + str);
}
return be.a.a().c(str, b);
}
if (!str2.equalsIgnoreCase("POST")) {
de.a.c("openSDK_LOG.HttpUtils", "openUrl: http method " + str2 + " is not supported.");
throw new IOException("http method is not supported.");
}
HashMap b2 = b(bundle3);
HashMap hashMap = new HashMap(0);
if (bundle3.size() != 0) {
for (String str3 : bundle3.keySet()) {
Object obj = bundle3.get(str3);
if (obj instanceof byte[]) {
hashMap.put(str3, (byte[]) obj);
}
}
}
if (hashMap.size() == 0) {
return be.a.a().d(str, b2);
}
de.a.i("openSDK_LOG.HttpUtils", "openUrl: has binary " + hashMap.size());
be.a a2 = be.a.a();
a2.getClass();
if (hashMap.size() == 0) {
return a2.d(str, b2);
}
de.a.f("openSDK_LOG.OpenHttpService", "post data, has byte data");
String uuid = UUID.randomUUID().toString();
t tVar = u.e;
ArrayList arrayList = new ArrayList();
bl.h d = bl.h.d(uuid);
if (b2.size() > 0) {
for (String str4 : b2.keySet()) {
String str5 = (String) b2.get(str4);
if (str5 != null) {
arrayList.add(u.b.b(str4, null, c0.c(null, str5)));
}
}
}
for (String str6 : hashMap.keySet()) {
byte[] bArr = (byte[]) hashMap.get(str6);
if (bArr != null && bArr.length > 0) {
arrayList.add(u.b.b(str6, str6, c0.d(t.b("content/unknown"), bArr)));
de.a.i("openSDK_LOG.OpenHttpService", "post byte data.");
}
}
if (arrayList.isEmpty()) {
throw new IllegalStateException("Multipart body must have at least one part.");
}
u uVar = new u(d, tVar, arrayList);
y.a aVar = new y.a();
aVar.e(str);
aVar.b("POST", uVar);
y a3 = aVar.a();
v vVar = a2.a;
vVar.getClass();
return new be.b(x.b(vVar, a3, false).execute(), (int) uVar.a());
}
public static HashMap b(Bundle bundle) {
HashMap hashMap = new HashMap();
if (bundle.size() != 0) {
for (String str : bundle.keySet()) {
Object obj = bundle.get(str);
if (!(obj instanceof String) && !(obj instanceof String[])) {
de.a.i("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;
}
public static String c(HashMap hashMap) {
if (hashMap.size() == 0) {
return "";
}
StringBuilder sb = new StringBuilder();
boolean z = true;
for (String str : hashMap.keySet()) {
if (z) {
z = false;
} else {
sb.append("&");
}
sb.append(URLEncoder.encode(str));
sb.append("=");
sb.append(URLEncoder.encode((String) hashMap.get(str)));
}
return sb.toString();
}
public static int d(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 void e(vd.f fVar, Context context, String str, Bundle bundle, String str2) throws IOException, JSONException, C0019b, a {
String str3;
String str4;
int i;
long j;
long j2;
int i2;
de.a.f("openSDK_LOG.HttpUtils", "OpenApi request");
if (!l.n(context)) {
throw new C0019b();
}
if (str.toLowerCase().startsWith("http")) {
str3 = str;
str4 = str3;
} else {
str3 = i.a().b(context, "https://openmobile.qq.com/") + str;
str4 = i.a().b(context, "https://openmobile.qq.com/") + str;
}
int i3 = 0;
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) {
ne.c.A(context, fVar, str);
}
long elapsedRealtime = SystemClock.elapsedRealtime();
int a2 = h.b(context, fVar.a).a("Common_HttpRetryCount");
StringBuilder n = aa.a.n("config 1:Common_HttpRetryCount config_value:", a2, " appid:");
String str5 = fVar.a;
n.append(str5);
n.append(" url:");
n.append(str4);
de.a.h("OpenConfig_test", n.toString());
if (a2 == 0) {
a2 = 3;
}
de.a.h("OpenConfig_test", "config 1:Common_HttpRetryCount result_value:" + a2 + " appid:" + str5 + " url:" + str4);
long j3 = elapsedRealtime;
while (true) {
int i4 = i3 + 1;
try {
try {
be.b a3 = a(str3, str2, bundle);
int i5 = a3.c;
de.a.f("openSDK_LOG.HttpUtils", "request statusCode " + i5);
if (i5 != 200) {
ce.h.b().d(str4, j3, 0L, 0L, i5);
throw new a(i5);
}
try {
i2 = l.s(a3.a()).getInt("ret");
} catch (JSONException unused) {
i2 = -4;
}
long j4 = a3.d;
j2 = a3.e;
i = i2;
j = j4;
} catch (JSONException e) {
e.printStackTrace();
ce.h.b().d(str4, j3, 0L, 0L, -4);
throw e;
}
} catch (MalformedURLException e2) {
e2.printStackTrace();
ce.h.b().d(str4, j3, 0L, 0L, -3);
throw e2;
} catch (SocketTimeoutException e3) {
e3.printStackTrace();
i = -8;
j = 0;
j2 = 0;
if (i4 >= a2) {
ce.h.b().d(str4, j3, 0L, 0L, -8);
throw e3;
}
j3 = SystemClock.elapsedRealtime();
if (i4 >= a2) {
break;
} else {
i3 = i4;
}
} catch (IOException e4) {
e4.printStackTrace();
ce.h.b().d(str4, j3, 0L, 0L, d(e4));
throw e4;
}
}
ce.h.b().d(str4, j3, j, j2, i);
}
}