Dynamic Spot Pro v1.0版本的 MD5 值为:5adb64d1f11ed2f16f84b684ff810780

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


package com.appsflyer.internal;

import android.app.Application;
import com.appsflyer.AFInAppEventParameterName;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.oaid.BuildConfig;
import java.lang.ref.WeakReference;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.json.JSONObject;

public final class bc implements Runnable {
    public static final List<String> AFInAppEventType = Arrays.asList("googleplay", "playstore", "googleplaystore");
    public static String valueOf = "https://%sgcdsdk.%s/install_data/v4.0/";
    public final String AFInAppEventParameterName;
    public final ScheduledExecutorService AFKeystoreWrapper;
    public final ah AFLogger$LogLevel;
    public final AtomicInteger AFVersionDeclaration;
    public final int init;
    public final Application values;

    public bc(ah ahVar, Application application, String str) {
        if (l.AFKeystoreWrapper == null) {
            l.AFKeystoreWrapper = new l();
        }
        this.AFKeystoreWrapper = l.AFKeystoreWrapper.values();
        this.AFVersionDeclaration = new AtomicInteger(0);
        this.AFLogger$LogLevel = ahVar;
        this.values = application;
        this.AFInAppEventParameterName = str;
        this.init = 0;
    }

    public bc(bc bcVar) {
        if (l.AFKeystoreWrapper == null) {
            l.AFKeystoreWrapper = new l();
        }
        this.AFKeystoreWrapper = l.AFKeystoreWrapper.values();
        this.AFVersionDeclaration = new AtomicInteger(0);
        this.AFLogger$LogLevel = bcVar.AFLogger$LogLevel;
        this.values = bcVar.values;
        this.AFInAppEventParameterName = bcVar.AFInAppEventParameterName;
        this.init = bcVar.init + 1;
    }

    public static void AFKeystoreWrapper(String str) {
        if (ah.AFInAppEventType != null) {
            AFLogger.AFKeystoreWrapper("[GCD-A02] Calling onConversionFailure with:\n".concat(String.valueOf(str)));
            ah.AFInAppEventType.onConversionDataFail(str);
        }
    }

    public static void valueOf(Map<String, Object> map) {
        StringBuilder sb = new StringBuilder("[GCD-A02] Calling onConversionDataSuccess with:\n");
        sb.append(map.toString());
        AFLogger.AFKeystoreWrapper(sb.toString());
        ah.AFInAppEventType.onConversionDataSuccess(map);
    }

    @Override
    public final void run() {
        String str;
        int responseCode;
        String AFInAppEventType2;
        String format;
        String str2 = this.AFInAppEventParameterName;
        if (str2 == null || str2.length() == 0) {
            AFLogger.AFKeystoreWrapper("[GCD-E05] AppsFlyer dev key is missing");
            AFKeystoreWrapper("AppsFlyer dev key is missing");
            return;
        }
        if (this.AFLogger$LogLevel.isStopped()) {
            AFLogger.AFKeystoreWrapper("[GCD-E03] 'isStopTracking' enabled");
            AFKeystoreWrapper("'isStopTracking' enabled");
            return;
        }
        this.AFVersionDeclaration.incrementAndGet();
        HttpURLConnection httpURLConnection = null;
        try {
        } catch (Throwable th) {
            th = th;
        }
        if (this.values == null) {
            AFLogger.AFKeystoreWrapper("[GCD-E06] Context null");
            AFKeystoreWrapper("Context null");
            this.AFVersionDeclaration.decrementAndGet();
            return;
        }
        String values = this.AFLogger$LogLevel.values(this.values, this.AFLogger$LogLevel.AFInAppEventType(this.values));
        if (values != null) {
            if (!AFInAppEventType.contains(values.toLowerCase())) {
                str = "-".concat(values);
                StringBuilder sb = new StringBuilder();
                sb.append(String.format(valueOf, AppsFlyerLib.getInstance().getHostPrefix(), ah.AFInAppEventParameterName().getHostName()));
                sb.append(this.values.getPackageName());
                sb.append(str);
                sb.append("?devkey=");
                sb.append(this.AFInAppEventParameterName);
                sb.append("&device_id=");
                sb.append(an.AFKeystoreWrapper(new WeakReference(this.values)));
                String obj = sb.toString();
                ap.AFInAppEventParameterName().valueOf("server_request", obj, BuildConfig.FLAVOR);
                ak.values("[GCD-B01] URL: ".concat(String.valueOf(obj)));
                long currentTimeMillis = System.currentTimeMillis();
                HttpURLConnection httpURLConnection2 = (HttpURLConnection) new URL(obj).openConnection();
                httpURLConnection2.setRequestMethod("GET");
                httpURLConnection2.setConnectTimeout(10000);
                httpURLConnection2.setRequestProperty("Connection", "close");
                httpURLConnection2.connect();
                responseCode = httpURLConnection2.getResponseCode();
                AFInAppEventType2 = this.AFLogger$LogLevel.AFInAppEventType(httpURLConnection2);
                ap.AFInAppEventParameterName().valueOf("server_response", obj, String.valueOf(responseCode), AFInAppEventType2);
                if (responseCode != 200 && responseCode != 404) {
                    if ((responseCode != 403 || responseCode >= 500) && this.init < 2) {
                        bc bcVar = new bc(this);
                        ah.AFKeystoreWrapper(bcVar.AFKeystoreWrapper, bcVar, 10L, TimeUnit.MILLISECONDS);
                    } else {
                        AFKeystoreWrapper("Error connection to server: ".concat(String.valueOf(responseCode)));
                    }
                    this.AFVersionDeclaration.decrementAndGet();
                    httpURLConnection2.disconnect();
                    this.AFKeystoreWrapper.shutdown();
                    AFLogger.AFKeystoreWrapper("[GCD-A03] Server retrieving attempt finished");
                }
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("net", System.currentTimeMillis() - currentTimeMillis);
                jSONObject.put("retries", this.init);
                this.AFLogger$LogLevel.AppsFlyer2dXConversionCallback.AFInAppEventType.edit().putString("gcd", jSONObject.toString()).apply();
                ak.values("Attribution data: ".concat(String.valueOf(AFInAppEventType2)));
                if (AFInAppEventType2.length() > 0) {
                    Map<String, Object> valueOf2 = az.valueOf(AFInAppEventType2);
                    Boolean bool = (Boolean) valueOf2.get("iscache");
                    if (responseCode == 404) {
                        valueOf2.remove("error_reason");
                        valueOf2.remove("status_code");
                        valueOf2.put("af_status", "Organic");
                        valueOf2.put("af_message", "organic install");
                    }
                    if (bool != null && !bool.booleanValue()) {
                        this.AFLogger$LogLevel.values(this.values, "appsflyerConversionDataCacheExpiration", System.currentTimeMillis());
                    }
                    if (valueOf2.containsKey("af_siteid")) {
                        if (valueOf2.containsKey(AFInAppEventParameterName.AF_CHANNEL)) {
                            StringBuilder sb2 = new StringBuilder("[Invite] Detected App-Invite via channel: ");
                            sb2.append(valueOf2.get(AFInAppEventParameterName.AF_CHANNEL));
                            format = sb2.toString();
                        } else {
                            format = String.format("[CrossPromotion] App was installed via %s's Cross Promotion", valueOf2.get("af_siteid"));
                        }
                        AFLogger.AFKeystoreWrapper(format);
                    }
                    if (valueOf2.containsKey("af_siteid")) {
                        StringBuilder sb3 = new StringBuilder("[Invite] Detected App-Invite via channel: ");
                        sb3.append(valueOf2.get(AFInAppEventParameterName.AF_CHANNEL));
                        AFLogger.AFKeystoreWrapper(sb3.toString());
                    }
                    valueOf2.put("is_first_launch", Boolean.FALSE);
                    String jSONObject2 = new JSONObject(valueOf2).toString();
                    if (jSONObject2 != null) {
                        ah.AFKeystoreWrapper(this.values, "attributionId", jSONObject2);
                    } else {
                        ah.AFKeystoreWrapper(this.values, "attributionId", AFInAppEventType2);
                    }
                    if (ah.AFInAppEventType != null && this.AFVersionDeclaration.intValue() <= 1) {
                        try {
                            Map<String, Object> AFInAppEventType3 = az.AFInAppEventType(this.values);
                            if (!ah.values(this.values).getBoolean("sixtyDayConversionData", false)) {
                                AFInAppEventType3.put("is_first_launch", Boolean.TRUE);
                            }
                            valueOf2 = AFInAppEventType3;
                        } catch (ay e2) {
                            AFLogger.values("Exception while trying to fetch attribution data. ", e2);
                        }
                        StringBuilder sb4 = new StringBuilder("[GCD-A02] Calling onConversionDataSuccess with:\n");
                        sb4.append(valueOf2.toString());
                        AFLogger.AFKeystoreWrapper(sb4.toString());
                        ah.AFInAppEventType.onConversionDataSuccess(valueOf2);
                    }
                }
                this.AFVersionDeclaration.decrementAndGet();
                httpURLConnection2.disconnect();
                this.AFKeystoreWrapper.shutdown();
                AFLogger.AFKeystoreWrapper("[GCD-A03] Server retrieving attempt finished");
            }
            AFLogger.AFInAppEventParameterName(String.format("AF detected using redundant Google-Play channel for attribution - %s. Using without channel postfix.", values));
        }
        str = BuildConfig.FLAVOR;
        StringBuilder sb5 = new StringBuilder();
        sb5.append(String.format(valueOf, AppsFlyerLib.getInstance().getHostPrefix(), ah.AFInAppEventParameterName().getHostName()));
        sb5.append(this.values.getPackageName());
        sb5.append(str);
        sb5.append("?devkey=");
        sb5.append(this.AFInAppEventParameterName);
        sb5.append("&device_id=");
        sb5.append(an.AFKeystoreWrapper(new WeakReference(this.values)));
        String obj2 = sb5.toString();
        ap.AFInAppEventParameterName().valueOf("server_request", obj2, BuildConfig.FLAVOR);
        ak.values("[GCD-B01] URL: ".concat(String.valueOf(obj2)));
        long currentTimeMillis2 = System.currentTimeMillis();
        HttpURLConnection httpURLConnection22 = (HttpURLConnection) new URL(obj2).openConnection();
        httpURLConnection22.setRequestMethod("GET");
        httpURLConnection22.setConnectTimeout(10000);
        httpURLConnection22.setRequestProperty("Connection", "close");
        httpURLConnection22.connect();
        responseCode = httpURLConnection22.getResponseCode();
        AFInAppEventType2 = this.AFLogger$LogLevel.AFInAppEventType(httpURLConnection22);
        ap.AFInAppEventParameterName().valueOf("server_response", obj2, String.valueOf(responseCode), AFInAppEventType2);
        if (responseCode != 200) {
            if (responseCode != 403) {
            }
            bc bcVar2 = new bc(this);
            ah.AFKeystoreWrapper(bcVar2.AFKeystoreWrapper, bcVar2, 10L, TimeUnit.MILLISECONDS);
            this.AFVersionDeclaration.decrementAndGet();
            httpURLConnection22.disconnect();
            this.AFKeystoreWrapper.shutdown();
            AFLogger.AFKeystoreWrapper("[GCD-A03] Server retrieving attempt finished");
        }
        JSONObject jSONObject3 = new JSONObject();
        jSONObject3.put("net", System.currentTimeMillis() - currentTimeMillis2);
        jSONObject3.put("retries", this.init);
        this.AFLogger$LogLevel.AppsFlyer2dXConversionCallback.AFInAppEventType.edit().putString("gcd", jSONObject3.toString()).apply();
        ak.values("Attribution data: ".concat(String.valueOf(AFInAppEventType2)));
        if (AFInAppEventType2.length() > 0) {
        }
        this.AFVersionDeclaration.decrementAndGet();
        httpURLConnection22.disconnect();
        this.AFKeystoreWrapper.shutdown();
        AFLogger.AFKeystoreWrapper("[GCD-A03] Server retrieving attempt finished");
    }
}