SG6 GAME v1.2版本的 MD5 值为:e05d9d2dd2bb5cc643956d31ab441e99
以下内容为反编译后的 AFc1rSDK.java 源代码,内容仅作参考
package com.appsflyer.internal;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.internal.AFc1uSDK;
import com.google.common.net.HttpHeaders;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.Map;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt;
import kotlin.io.TextStreamsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.Charsets;
@Metadata(d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0012\n\u0002\b\u0002\n\u0002\u0010$\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0006\n\u0002\u0010\u0000\b\u0000\u0018\u0000 \u00012\u00020\u0013:\u0001\u0001B/\u0012\u0006\u0010\u000e\u001a\u00020\u0002\u0012\u0014\u0010\u000f\u001a\u0010\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0005\u0012\b\b\u0002\u0010\u0010\u001a\u00020\n¢\u0006\u0004\b\u0011\u0010\u0012J\u000f\u0010\u0003\u001a\u00020\fH\u0007¢\u0006\u0004\b\u0003\u0010\rR\u0012\u0010\u0003\u001a\u00020\u0002X\u0087\u0002¢\u0006\u0006\n\u0004\b\u0003\u0010\u0004R \u0010\t\u001a\u0010\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0005X\u0087\u0002¢\u0006\u0006\n\u0004\b\u0007\u0010\bR\u0011\u0010\u0007\u001a\u00020\nX\u0007¢\u0006\u0006\n\u0004\b\t\u0010\u000b"}, d2 = {"Lcom/appsflyer/internal/AFc1rSDK;", "AFa1ySDK", "", "AFInAppEventType", "[B", "", "", "AFKeystoreWrapper", "Ljava/util/Map;", "values", "", "I", "", "()Z", "p0", "p1", "p2", "<init>", "([BLjava/util/Map;I)V", ""}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class AFc1rSDK {
public byte[] AFInAppEventType;
public Map<String, String> AFKeystoreWrapper;
public int values;
public static final AFa1ySDK AFa1ySDK = new AFa1ySDK(null);
public static String AFInAppEventParameterName = "https://%smonitorsdk.%s/remote-debug/exception-manager";
public AFc1rSDK(byte[] bArr, Map<String, String> map, int i) {
Intrinsics.checkNotNullParameter(bArr, "");
this.AFInAppEventType = bArr;
this.AFKeystoreWrapper = map;
this.values = i;
}
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0010\u0000\b\u0086\u0003\u0018\u00002\u00020\u0007B\t\b\u0002¢\u0006\u0004\b\u0005\u0010\u0006R\u0012\u0010\u0004\u001a\u00020\u0001X\u0087\u0002¢\u0006\u0006\n\u0004\b\u0002\u0010\u0003"}, d2 = {"Lcom/appsflyer/internal/AFc1rSDK$AFa1ySDK;", "", "AFInAppEventParameterName", "Ljava/lang/String;", "valueOf", "<init>", "()V", ""}, k = 1, mv = {1, 6, 0}, xi = 48)
public static final class AFa1ySDK {
public AFa1ySDK(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private AFa1ySDK() {
}
}
public final boolean AFInAppEventType() {
URLConnection openConnection;
InputStream errorStream;
String str;
long currentTimeMillis = System.currentTimeMillis();
boolean z = false;
HttpURLConnection httpURLConnection = null;
try {
String format = String.format(AFInAppEventParameterName, AppsFlyerLib.getInstance().getHostPrefix(), AFa1dSDK.valueOf().getHostName());
Intrinsics.checkNotNullExpressionValue(format, "");
Intrinsics.checkNotNullParameter(format, "");
openConnection = new URL(format).openConnection();
} catch (Throwable th) {
th = th;
}
if (openConnection != null) {
HttpURLConnection httpURLConnection2 = (HttpURLConnection) openConnection;
try {
httpURLConnection2.setRequestMethod("POST");
StringBuilder sb = new StringBuilder();
sb.append(httpURLConnection2.getRequestMethod());
sb.append(':');
sb.append(httpURLConnection2.getURL());
StringBuilder sb2 = new StringBuilder(sb.toString());
sb2.append("\n length: ");
sb2.append(new String(this.AFInAppEventType, Charsets.UTF_8).length());
Map<String, String> map = this.AFKeystoreWrapper;
if (map != null) {
for (Map.Entry<String, String> entry : map.entrySet()) {
sb2.append("\n ");
sb2.append(entry.getKey());
sb2.append(": ");
sb2.append(entry.getValue());
}
}
StringBuilder sb3 = new StringBuilder("HTTP: [");
sb3.append(httpURLConnection2.hashCode());
sb3.append("] ");
sb3.append((Object) sb2);
String obj = sb3.toString();
Intrinsics.checkNotNullParameter(obj, "");
AFLogger.afRDLog("[Exception Manager]: ".concat(String.valueOf(obj)));
httpURLConnection2.setInstanceFollowRedirects(false);
httpURLConnection2.setUseCaches(false);
httpURLConnection2.setReadTimeout(this.values);
httpURLConnection2.setConnectTimeout(this.values);
httpURLConnection2.addRequestProperty(HttpHeaders.CONTENT_TYPE, "application/json");
Map<String, String> map2 = this.AFKeystoreWrapper;
if (map2 != null) {
for (Map.Entry<String, String> entry2 : map2.entrySet()) {
httpURLConnection2.addRequestProperty(entry2.getKey(), entry2.getValue());
}
}
httpURLConnection2.setDoOutput(true);
httpURLConnection2.setRequestProperty(HttpHeaders.CONTENT_LENGTH, String.valueOf(this.AFInAppEventType.length));
OutputStream outputStream = httpURLConnection2.getOutputStream();
Intrinsics.checkNotNullExpressionValue(outputStream, "");
BufferedOutputStream bufferedOutputStream = outputStream instanceof BufferedOutputStream ? (BufferedOutputStream) outputStream : new BufferedOutputStream(outputStream, 8192);
bufferedOutputStream.write(this.AFInAppEventType);
bufferedOutputStream.close();
if (AFc1uSDK.AFa1wSDK.AFKeystoreWrapper(httpURLConnection2)) {
errorStream = httpURLConnection2.getInputStream();
} else {
errorStream = httpURLConnection2.getErrorStream();
}
if (errorStream != null) {
Intrinsics.checkNotNullExpressionValue(errorStream, "");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(errorStream, Charsets.UTF_8), 8192);
str = CollectionsKt.joinToString$default(TextStreamsKt.readLines(bufferedReader), null, null, null, 0, null, null, 63, null);
bufferedReader.close();
}
str = "";
StringBuilder sb4 = new StringBuilder("response code:");
sb4.append(httpURLConnection2.getResponseCode());
sb4.append(' ');
sb4.append(httpURLConnection2.getResponseMessage());
sb4.append("\n\tbody:");
sb4.append(str);
sb4.append("\n\ttook ");
sb4.append(System.currentTimeMillis() - currentTimeMillis);
sb4.append("ms");
String obj2 = sb4.toString();
StringBuilder sb5 = new StringBuilder("HTTP: [");
sb5.append(httpURLConnection2.hashCode());
sb5.append("] ");
sb5.append(obj2);
String obj3 = sb5.toString();
Intrinsics.checkNotNullParameter(obj3, "");
AFLogger.afRDLog("[Exception Manager]: ".concat(String.valueOf(obj3)));
z = AFc1uSDK.AFa1wSDK.AFKeystoreWrapper(httpURLConnection2);
if (httpURLConnection2 != null) {
httpURLConnection2.disconnect();
}
} catch (Throwable th2) {
th = th2;
httpURLConnection = httpURLConnection2;
try {
long currentTimeMillis2 = System.currentTimeMillis() - currentTimeMillis;
StringBuilder sb6 = new StringBuilder("error: ");
sb6.append(th);
sb6.append("\n\ttook ");
sb6.append(currentTimeMillis2);
sb6.append("ms\n\t");
sb6.append(th.getMessage());
String obj4 = sb6.toString();
StringBuilder sb7 = new StringBuilder("HTTP: [");
sb7.append(httpURLConnection != null ? httpURLConnection.hashCode() : 0);
sb7.append("] ");
sb7.append(obj4);
String obj5 = sb7.toString();
Intrinsics.checkNotNullParameter(obj5, "");
AFLogger.afRDLog("[Exception Manager]: ".concat(String.valueOf(obj5)));
return z;
} finally {
if (httpURLConnection != null) {
httpURLConnection.disconnect();
}
}
}
return z;
}
throw new NullPointerException("null cannot be cast to non-null type java.net.HttpURLConnection");
}
}