正在查看: moonshot.企业版 v8.14.46 应用的 C1459.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: moonshot.企业版 v8.14.46 应用的 C1459.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package kp1AiJpjqJHu1Tcnj96z.saktfaQObACC6AiCgP8Y.zSFvmU2XOpXZrEfUxlHp.kp1AiJpjqJHu1Tcnj96z;
import android.util.Pair;
import com.tencent.smtt.sdk.TbsReaderView;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.DataOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
public final class C1459 {
private static void m7460(Closeable closeable) {
if (closeable == null) {
return;
}
try {
closeable.close();
} catch (Exception e) {
C1476.m7588(e);
}
}
private static Pair<Integer, String> m7461(String str, String str2, Map<String, String> map) {
InputStream inputStream;
DataOutputStream dataOutputStream;
String message;
InputStream errorStream;
HttpURLConnection httpURLConnection = null;
int i = -1;
try {
HttpURLConnection httpURLConnection2 = (HttpURLConnection) new URL(str).openConnection();
try {
httpURLConnection2.setRequestMethod("POST");
httpURLConnection2.setDoOutput(true);
httpURLConnection2.setDoInput(true);
httpURLConnection2.setUseCaches(false);
httpURLConnection2.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
m7462(httpURLConnection2, map);
httpURLConnection2.setConnectTimeout(TbsReaderView.ReaderCallback.GET_BAR_ANIMATING);
httpURLConnection2.setReadTimeout(TbsReaderView.ReaderCallback.GET_BAR_ANIMATING);
httpURLConnection2.connect();
byte[] bytes = str2.getBytes("UTF-8");
dataOutputStream = new DataOutputStream(httpURLConnection2.getOutputStream());
try {
dataOutputStream.write(bytes);
dataOutputStream.flush();
dataOutputStream.close();
i = httpURLConnection2.getResponseCode();
errorStream = i >= 400 ? httpURLConnection2.getErrorStream() : httpURLConnection2.getInputStream();
} catch (Throwable th) {
th = th;
httpURLConnection = httpURLConnection2;
inputStream = null;
}
} catch (Throwable th2) {
th = th2;
dataOutputStream = null;
httpURLConnection = httpURLConnection2;
inputStream = null;
}
try {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(errorStream, "UTF-8"));
StringBuilder sb = new StringBuilder();
while (true) {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
}
sb.append(readLine);
sb.append("\r\n");
}
bufferedReader.close();
message = sb.toString();
m7460(null);
m7460(errorStream);
if (httpURLConnection2 != null) {
httpURLConnection2.disconnect();
}
} catch (Throwable th3) {
httpURLConnection = httpURLConnection2;
inputStream = errorStream;
th = th3;
dataOutputStream = null;
try {
C1476.m7588(th);
message = th.getMessage();
return new Pair<>(Integer.valueOf(i), message);
} finally {
m7460(dataOutputStream);
m7460(inputStream);
if (httpURLConnection != null) {
httpURLConnection.disconnect();
}
}
}
} catch (Throwable th4) {
th = th4;
inputStream = null;
dataOutputStream = null;
}
return new Pair<>(Integer.valueOf(i), message);
}
private static void m7462(HttpURLConnection httpURLConnection, Map<String, String> map) {
if (httpURLConnection == null || map == null || map.isEmpty()) {
return;
}
for (Map.Entry<String, String> entry : map.entrySet()) {
httpURLConnection.setRequestProperty(entry.getKey(), entry.getValue());
}
}
public static Pair<Integer, String> m7463(List<String> list) {
try {
HashMap hashMap = new HashMap();
hashMap.put("Atta-Type", "batch-report");
JSONObject jSONObject = new JSONObject();
jSONObject.put("attaid", "0d000062340").put("token", "2273782735").put("type", "batch").put("version", "v1.0.0");
JSONArray jSONArray = new JSONArray();
Iterator<String> it = list.iterator();
while (it.hasNext()) {
jSONArray.put(it.next());
}
jSONObject.put("datas", jSONArray);
return m7461("https://h.trace.qq.com/kv", jSONObject.toString(), hashMap);
} catch (Throwable th) {
C1476.m7588(th);
return new Pair<>(-1, th.getMessage());
}
}
}