Warkop v5.73.0版本的 MD5 值为:a4330ec2d6f5e146f59fc7622f3cdb45

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


package com.appsflyer.internal;

import android.net.Uri;
import android.os.Build;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.deeplink.DeepLink;
import com.appsflyer.deeplink.DeepLinkResult;
import com.appsflyer.internal.AFc1uSDK;
import com.appsflyer.internal.AFf1pSDK;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import j$.util.DesugarTimeZone;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Observable;
import java.util.Observer;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.json.JSONException;
import org.json.JSONObject;
import sinet.startup.inDriver.core.data.data.NotificationData;

public final class AFb1mSDK extends AFe1jSDK {
    private static String AFLogger$LogLevel = "https://%sdlsdk.%s/v1.0/android/";
    private final AFe1mSDK AFVersionDeclaration;
    private final ExecutorService AppsFlyer2dXConversionCallback;
    private final CountDownLatch afWarnLog;
    private final List<AFf1pSDK> getLevel;
    private final AFe1wSDK init;
    private final AFb1tSDK onAppOpenAttributionNative;
    private int onAttributionFailureNative;
    private boolean onConversionDataSuccess;
    private final AFb1sSDK onDeepLinkingNative;
    private final AFb1gSDK onInstallConversionDataLoadedNative;
    private final AFf1oSDK onInstallConversionFailureNative;
    private int onResponseErrorNative;
    private int onResponseNative;

    public static class AnonymousClass1 {
        static final int[] values;

        static {
            int[] iArr = new int[AFf1pSDK.AFa1zSDK.values().length];
            values = iArr;
            try {
                iArr[AFf1pSDK.AFa1zSDK.FINISHED.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                values[AFf1pSDK.AFa1zSDK.STARTED.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
        }
    }

    public AFb1mSDK(AFc1xSDK aFc1xSDK) {
        super(null, AFLogger$LogLevel, Boolean.FALSE, Boolean.TRUE, null);
        this.getLevel = new ArrayList();
        this.afWarnLog = new CountDownLatch(1);
        this.AFVersionDeclaration = aFc1xSDK.afDebugLog();
        this.onInstallConversionDataLoadedNative = aFc1xSDK.AFInAppEventParameterName();
        this.init = aFc1xSDK.afWarnLog();
        this.onInstallConversionFailureNative = aFc1xSDK.AFLogger$LogLevel();
        this.AppsFlyer2dXConversionCallback = aFc1xSDK.AFInAppEventType();
        this.onAppOpenAttributionNative = aFc1xSDK.afErrorLogForExcManagerOnly();
        this.onDeepLinkingNative = aFc1xSDK.AppsFlyer2dXConversionCallback();
    }

    private static boolean AFInAppEventParameterName(AFf1pSDK aFf1pSDK) {
        Long l15 = (Long) aFf1pSDK.AFInAppEventParameterName.get("click_ts");
        if (l15 == null || System.currentTimeMillis() - TimeUnit.SECONDS.toMillis(l15.longValue()) >= TimeUnit.DAYS.toMillis(1L)) {
            return false;
        }
        return true;
    }

    public void AFLogger$LogLevel() {
        String[] strArr;
        boolean z15 = true;
        this.onResponseNative++;
        StringBuilder sb5 = new StringBuilder("[DDL] Preparing request ");
        sb5.append(this.onResponseNative);
        AFLogger.afDebugLog(sb5.toString());
        if (this.onResponseNative == 1) {
            AFa1eSDK valueOf = AFa1eSDK.valueOf();
            Map<String, Object> map = this.AFKeystoreWrapper;
            if (this.onInstallConversionDataLoadedNative.AFInAppEventType.values("appsFlyerCount", 0) != 0) {
                z15 = false;
            }
            map.put("is_first", Boolean.valueOf(z15));
            Map<String, Object> map2 = this.AFKeystoreWrapper;
            StringBuilder sb6 = new StringBuilder();
            sb6.append(Locale.getDefault().getLanguage());
            sb6.append("-");
            sb6.append(Locale.getDefault().getCountry());
            map2.put("lang", sb6.toString());
            this.AFKeystoreWrapper.put(com.sumsub.sentry.q.f36506g, Build.VERSION.RELEASE);
            this.AFKeystoreWrapper.put(NotificationData.JSON_TYPE, Build.MODEL);
            Map<String, Object> map3 = this.AFKeystoreWrapper;
            AFb1gSDK aFb1gSDK = this.onInstallConversionDataLoadedNative;
            map3.put("request_id", AFb1zSDK.valueOf(aFb1gSDK.valueOf, aFb1gSDK.AFInAppEventType));
            AFa1cSDK aFa1cSDK = valueOf.afInfoLog;
            if (aFa1cSDK != null && (strArr = aFa1cSDK.AFInAppEventType) != null) {
                this.AFKeystoreWrapper.put("sharing_filter", strArr);
            }
            Map<String, Object> values = values(AFa1cSDK.values(this.onInstallConversionDataLoadedNative.valueOf.AFInAppEventType, new HashMap()));
            Map<String, Object> values2 = values(AFa1cSDK.values(this.onInstallConversionDataLoadedNative.valueOf.AFInAppEventType));
            if (values != null) {
                this.AFKeystoreWrapper.put("gaid", values);
            }
            if (values2 != null) {
                this.AFKeystoreWrapper.put("oaid", values2);
            }
        }
        Map<String, Object> map4 = this.AFKeystoreWrapper;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US);
        long currentTimeMillis = System.currentTimeMillis();
        simpleDateFormat.setTimeZone(DesugarTimeZone.getTimeZone("UTC"));
        map4.put("timestamp", simpleDateFormat.format(new Date(currentTimeMillis)));
        this.AFKeystoreWrapper.put("request_count", Integer.valueOf(this.onResponseNative));
        ArrayList arrayList = new ArrayList();
        Iterator<AFf1pSDK> it = this.getLevel.iterator();
        while (it.hasNext()) {
            Map<String, String> valueOf2 = valueOf(it.next());
            if (valueOf2 != null) {
                arrayList.add(valueOf2);
            }
        }
        if (!arrayList.isEmpty()) {
            this.AFKeystoreWrapper.put("referrers", arrayList);
        }
        AFKeystoreWrapper(AppsFlyer2dXConversionCallback());
    }

    private String AppsFlyer2dXConversionCallback() {
        String str;
        String str2 = this.init.AFInAppEventParameterName;
        String packageName = this.onInstallConversionDataLoadedNative.valueOf.AFInAppEventType.getPackageName();
        String values = this.onInstallConversionDataLoadedNative.values();
        if (values != null && !values.trim().isEmpty()) {
            str = "-".concat(values);
        } else {
            str = "";
        }
        Uri.Builder buildUpon = Uri.parse(String.format(AFLogger$LogLevel, AppsFlyerLib.getInstance().getHostPrefix(), AFa1eSDK.valueOf().getHostName())).buildUpon();
        StringBuilder sb5 = new StringBuilder();
        sb5.append(packageName);
        sb5.append(str);
        Uri.Builder appendPath = buildUpon.appendPath(sb5.toString());
        StringBuilder sb6 = new StringBuilder();
        sb6.append(this.AFKeystoreWrapper.get("timestamp"));
        sb6.append(str2);
        return appendPath.appendQueryParameter("af_sig", AFc1nSDK.valueOf(sb6.toString(), str2)).appendQueryParameter("sdk_version", AFa1eSDK.AFKeystoreWrapper).build().toString();
    }

    private boolean afWarnLog() {
        int i15;
        List list = (List) this.AFKeystoreWrapper.get("referrers");
        if (list != null) {
            i15 = list.size();
        } else {
            i15 = 0;
        }
        if (i15 >= this.onAttributionFailureNative || this.AFKeystoreWrapper.containsKey("referrers")) {
            return false;
        }
        return true;
    }

    private static Map<String, String> valueOf(AFf1pSDK aFf1pSDK) {
        if (aFf1pSDK.afDebugLog != AFf1pSDK.AFa1zSDK.FINISHED) {
            return null;
        }
        HashMap hashMap = new HashMap();
        String str = (String) aFf1pSDK.AFInAppEventParameterName.get("referrer");
        if (str == null) {
            return null;
        }
        hashMap.put("source", (String) aFf1pSDK.AFInAppEventParameterName.get("source"));
        hashMap.put(AppMeasurementSdk.ConditionalUserProperty.VALUE, str);
        return hashMap;
    }

    private Map<String, Object> values(final AFc1uSDK.AFa1wSDK aFa1wSDK) {
        if (aFa1wSDK != null && aFa1wSDK.valueOf != null) {
            Boolean bool = aFa1wSDK.AFInAppEventType;
            if (bool == null || !bool.booleanValue()) {
                return new HashMap<String, Object>() {
                    {
                        put(NotificationData.JSON_TYPE, "unhashed");
                        put(AppMeasurementSdk.ConditionalUserProperty.VALUE, aFa1wSDK.valueOf);
                    }
                };
            }
            return null;
        }
        return null;
    }

    public final DeepLinkResult AFLogger() {
        DeepLinkResult.Error error;
        AFLogger.afDebugLog("[DDL] start");
        FutureTask futureTask = new FutureTask(new Callable<DeepLinkResult>() {
            @Override
            public final DeepLinkResult call() throws Exception {
                AFb1mSDK.valueOf(AFb1mSDK.this);
                AFb1mSDK.this.AFLogger$LogLevel();
                return AFb1mSDK.AFInAppEventType(AFb1mSDK.this);
            }
        });
        this.AppsFlyer2dXConversionCallback.execute(futureTask);
        try {
            DeepLinkResult deepLinkResult = (DeepLinkResult) futureTask.get(this.onDeepLinkingNative.afInfoLog, TimeUnit.MILLISECONDS);
            this.AFVersionDeclaration.values(deepLinkResult, this.onDeepLinkingNative.afInfoLog);
            this.onDeepLinkingNative.AFInAppEventType(deepLinkResult);
            return deepLinkResult;
        } catch (InterruptedException e15) {
            e = e15;
            AFLogger.afErrorLog("[DDL] Error occurred", e, true);
            if (!(e.getCause() instanceof IOException)) {
                error = DeepLinkResult.Error.NETWORK;
            } else {
                error = DeepLinkResult.Error.UNEXPECTED;
            }
            DeepLinkResult deepLinkResult2 = new DeepLinkResult(null, error);
            this.AFVersionDeclaration.values(deepLinkResult2, this.onDeepLinkingNative.afInfoLog);
            this.onDeepLinkingNative.AFInAppEventType(deepLinkResult2);
            return deepLinkResult2;
        } catch (ExecutionException e16) {
            e = e16;
            AFLogger.afErrorLog("[DDL] Error occurred", e, true);
            if (!(e.getCause() instanceof IOException)) {
            }
            DeepLinkResult deepLinkResult22 = new DeepLinkResult(null, error);
            this.AFVersionDeclaration.values(deepLinkResult22, this.onDeepLinkingNative.afInfoLog);
            this.onDeepLinkingNative.AFInAppEventType(deepLinkResult22);
            return deepLinkResult22;
        } catch (TimeoutException e17) {
            AFLogger.afErrorLogForExcManagerOnly("[DDL] Timeout", e17);
            StringBuilder sb5 = new StringBuilder("[DDL] Timeout, didn't manage to find deferred deep link after ");
            sb5.append(this.onResponseNative);
            sb5.append(" attempt(s) within ");
            sb5.append(this.onDeepLinkingNative.afInfoLog);
            sb5.append(" milliseconds");
            AFLogger.afDebugLog(sb5.toString());
            DeepLinkResult deepLinkResult3 = new DeepLinkResult(null, DeepLinkResult.Error.TIMEOUT);
            this.AFVersionDeclaration.values(deepLinkResult3, this.onDeepLinkingNative.afInfoLog);
            this.onDeepLinkingNative.AFInAppEventType(deepLinkResult3);
            return deepLinkResult3;
        }
    }

    public void AFKeystoreWrapper(AFf1pSDK aFf1pSDK) {
        if (AFInAppEventParameterName(aFf1pSDK)) {
            this.getLevel.add(aFf1pSDK);
            this.afWarnLog.countDown();
            StringBuilder sb5 = new StringBuilder("[DDL] Added non-organic ");
            sb5.append(aFf1pSDK.getClass().getSimpleName());
            AFLogger.afDebugLog(sb5.toString());
            return;
        }
        int i15 = this.onResponseErrorNative + 1;
        this.onResponseErrorNative = i15;
        if (i15 == this.onAttributionFailureNative) {
            this.afWarnLog.countDown();
        }
    }

    @Override
    public final AFd1vSDK AFInAppEventType() {
        return AFd1vSDK.DLSDK;
    }

    static DeepLinkResult AFInAppEventType(AFb1mSDK aFb1mSDK) throws IOException, JSONException, InterruptedException {
        DeepLink values;
        while (true) {
            AFe1mSDK aFe1mSDK = aFb1mSDK.AFVersionDeclaration;
            int i15 = aFb1mSDK.onResponseNative;
            if (i15 > 0 && i15 <= 2) {
                int i16 = i15 - 1;
                aFe1mSDK.afDebugLog[i16] = System.currentTimeMillis();
                if (i16 == 0) {
                    long j15 = aFe1mSDK.afErrorLog;
                    if (j15 != 0) {
                        aFe1mSDK.AFInAppEventType.put("from_fg", Long.valueOf(aFe1mSDK.afDebugLog[i16] - j15));
                        aFe1mSDK.valueOf.AFInAppEventParameterName("ddl", new JSONObject(aFe1mSDK.AFInAppEventType).toString());
                    } else {
                        AFLogger.afInfoLog("Metrics: fg ts is missing");
                    }
                }
            } else {
                AFLogger.afErrorLogForExcManagerOnly("Unexpected ddl requestCount - start", new IllegalStateException("Metrics: Unexpected ddl requestCount = ".concat(String.valueOf(i15))));
            }
            HttpURLConnection AFInAppEventParameterName = new AFa1uSDK(aFb1mSDK, aFb1mSDK.onAppOpenAttributionNative).AFInAppEventParameterName(aFb1mSDK.init.AFInAppEventParameterName);
            AFe1mSDK aFe1mSDK2 = aFb1mSDK.AFVersionDeclaration;
            int i17 = aFb1mSDK.onResponseNative;
            if (i17 > 0 && i17 <= 2) {
                int i18 = i17 - 1;
                aFe1mSDK2.afInfoLog[i18] = System.currentTimeMillis();
                long j16 = aFe1mSDK2.afDebugLog[i18];
                if (j16 != 0) {
                    long[] jArr = aFe1mSDK2.afRDLog;
                    jArr[i18] = aFe1mSDK2.afInfoLog[i18] - j16;
                    aFe1mSDK2.AFInAppEventType.put("net", jArr);
                    aFe1mSDK2.valueOf.AFInAppEventParameterName("ddl", new JSONObject(aFe1mSDK2.AFInAppEventType).toString());
                } else {
                    StringBuilder sb5 = new StringBuilder("Metrics: ddlStart[");
                    sb5.append(i18);
                    sb5.append("] ts is missing");
                    AFLogger.afInfoLog(sb5.toString());
                }
            } else {
                AFLogger.afErrorLogForExcManagerOnly("Unexpected ddl requestCount - end", new IllegalStateException("Metrics: Unexpected ddl requestCount = ".concat(String.valueOf(i17))));
            }
            if (AFInAppEventParameterName.getResponseCode() == 200) {
                JSONObject jSONObject = new JSONObject(AFa1eSDK.values(AFInAppEventParameterName));
                aFb1mSDK.onConversionDataSuccess = jSONObject.optBoolean("is_second_ping", true);
                if (jSONObject.optBoolean("found")) {
                    values = DeepLink.values(jSONObject.optJSONObject("click_event"));
                    values.valueOf.put("is_deferred", true);
                } else {
                    values = null;
                }
                if (values != null) {
                    return new DeepLinkResult(values, null);
                }
                if (aFb1mSDK.onResponseNative > 1 || !aFb1mSDK.afWarnLog() || !aFb1mSDK.onConversionDataSuccess) {
                    break;
                }
                AFLogger.afDebugLog("[DDL] Waiting for referrers...");
                aFb1mSDK.afWarnLog.await();
                AFe1mSDK aFe1mSDK3 = aFb1mSDK.AFVersionDeclaration;
                long currentTimeMillis = System.currentTimeMillis();
                long j17 = aFe1mSDK3.afInfoLog[0];
                if (j17 != 0) {
                    aFe1mSDK3.AFInAppEventType.put("rfr_wait", Long.valueOf(currentTimeMillis - j17));
                    aFe1mSDK3.valueOf.AFInAppEventParameterName("ddl", new JSONObject(aFe1mSDK3.AFInAppEventType).toString());
                } else {
                    AFLogger.afInfoLog("Metrics: ddlEnd[0] ts is missing");
                }
                if (aFb1mSDK.onResponseErrorNative == aFb1mSDK.onAttributionFailureNative) {
                    return new DeepLinkResult(null, null);
                }
                aFb1mSDK.AFLogger$LogLevel();
            } else {
                StringBuilder sb6 = new StringBuilder("[DDL] Error occurred. Server response code = ");
                sb6.append(AFInAppEventParameterName.getResponseCode());
                AFLogger.afDebugLog(sb6.toString());
                return new DeepLinkResult(null, DeepLinkResult.Error.HTTP_STATUS_CODE);
            }
        }
    }

    static void valueOf(AFb1mSDK aFb1mSDK) {
        ArrayList<AFf1pSDK> arrayList = new ArrayList();
        for (AFf1pSDK aFf1pSDK : aFb1mSDK.onInstallConversionFailureNative.valueOf()) {
            if (aFf1pSDK != null && aFf1pSDK.afDebugLog != AFf1pSDK.AFa1zSDK.NOT_STARTED) {
                arrayList.add(aFf1pSDK);
            }
        }
        aFb1mSDK.onAttributionFailureNative = arrayList.size();
        for (final AFf1pSDK aFf1pSDK2 : arrayList) {
            int i15 = AnonymousClass1.values[aFf1pSDK2.afDebugLog.ordinal()];
            if (i15 == 1) {
                StringBuilder sb5 = new StringBuilder("[DDL] ");
                sb5.append(aFf1pSDK2.AFInAppEventParameterName.get("source"));
                sb5.append(" referrer collected earlier");
                AFLogger.afDebugLog(sb5.toString());
                aFb1mSDK.AFKeystoreWrapper(aFf1pSDK2);
            } else if (i15 == 2) {
                aFf1pSDK2.addObserver(new Observer() {
                    @Override
                    public final void update(Observable observable, Object obj) {
                        StringBuilder sb6 = new StringBuilder("[DDL] ");
                        sb6.append(aFf1pSDK2.AFInAppEventParameterName.get("source"));
                        sb6.append(" referrer collected via observer");
                        AFLogger.afDebugLog(sb6.toString());
                        AFb1mSDK.this.AFKeystoreWrapper((AFf1pSDK) observable);
                    }
                });
            }
        }
    }
}