Perfume Of Love v2.14.9版本的 MD5 值为:16011aefc5a55805771706ce3b259b4e

以下内容为反编译后的 AFc1jSDK.java 源代码,内容仅作参考


package com.appsflyer.internal;

import androidx.browser.trusted.sharing.ShareTarget;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.internal.AFc1qSDK;
import com.tapjoy.TJAdUnitConstants;
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\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0006\n\u0002\u0010\u0000\b\u0000\u0018\u0000 \u00012\u00020\u0014:\u0001\u0001B/\u0012\u0006\u0010\u000f\u001a\u00020\u0002\u0012\u0014\u0010\u0010\u001a\u0010\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0005\u0012\b\b\u0002\u0010\u0011\u001a\u00020\n¢\u0006\u0004\b\u0012\u0010\u0013J\u000f\u0010\u0007\u001a\u00020\rH\u0007¢\u0006\u0004\b\u0007\u0010\u000eR\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\u000b\u0010\f"}, d2 = {"Lcom/appsflyer/internal/AFc1jSDK;", "AFa1zSDK", "", "AFInAppEventParameterName", "[B", "", "", "AFInAppEventType", "Ljava/util/Map;", TJAdUnitConstants.String.USAGE_TRACKER_VALUES, "", "AFKeystoreWrapper", "I", "", "()Z", "p0", "p1", "p2", "<init>", "([BLjava/util/Map;I)V", ""}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class AFc1jSDK {
    public static final AFa1zSDK AFa1zSDK = new AFa1zSDK(null);
    public static String valueOf = "https://%smonitorsdk.%s/remote-debug/exception-manager";
    public byte[] AFInAppEventParameterName;
    public Map<String, String> AFInAppEventType;
    public int AFKeystoreWrapper;

    public AFc1jSDK(byte[] bArr, Map<String, String> map, int i) {
        Intrinsics.checkNotNullParameter(bArr, "");
        this.AFInAppEventParameterName = bArr;
        this.AFInAppEventType = map;
        this.AFKeystoreWrapper = 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/AFc1jSDK$AFa1zSDK;", "", "valueOf", "Ljava/lang/String;", TJAdUnitConstants.String.USAGE_TRACKER_VALUES, "<init>", "()V", ""}, k = 1, mv = {1, 6, 0}, xi = 48)
    public static final class AFa1zSDK {
        public AFa1zSDK(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private AFa1zSDK() {
        }
    }

    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(valueOf, AppsFlyerLib.getInstance().getHostPrefix(), AFb1xSDK.AFInAppEventType().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(ShareTarget.METHOD_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.AFInAppEventParameterName, Charsets.UTF_8).length());
                Map<String, String> map = this.AFInAppEventType;
                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.AFKeystoreWrapper);
                httpURLConnection2.setConnectTimeout(this.AFKeystoreWrapper);
                httpURLConnection2.addRequestProperty("Content-Type", "application/json");
                Map<String, String> map2 = this.AFInAppEventType;
                if (map2 != null) {
                    for (Map.Entry<String, String> entry2 : map2.entrySet()) {
                        httpURLConnection2.addRequestProperty(entry2.getKey(), entry2.getValue());
                    }
                }
                httpURLConnection2.setDoOutput(true);
                httpURLConnection2.setRequestProperty("Content-Length", String.valueOf(this.AFInAppEventParameterName.length));
                OutputStream outputStream = httpURLConnection2.getOutputStream();
                Intrinsics.checkNotNullExpressionValue(outputStream, "");
                BufferedOutputStream bufferedOutputStream = outputStream instanceof BufferedOutputStream ? (BufferedOutputStream) outputStream : new BufferedOutputStream(outputStream, 8192);
                bufferedOutputStream.write(this.AFInAppEventParameterName);
                bufferedOutputStream.close();
                if (AFc1qSDK.AFa1vSDK.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 = AFc1qSDK.AFa1vSDK.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");
    }
}