OPPGAME v3.0版本的 MD5 值为:1ceb0a1abb48ac61fa374f3f5276c4ff

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


package com.appsflyer.internal;

import android.net.Uri;
import android.os.Build;
import com.appsflyer.AFLogger;
import com.appsflyer.attribution.AppsFlyerRequestListener;
import com.appsflyer.deeplink.DeepLink;
import com.appsflyer.deeplink.DeepLinkResult;
import com.appsflyer.internal.AFi1hSDK;
import com.appsflyer.internal.components.network.http.ResponseNetwork;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Observable;
import java.util.Observer;
import java.util.TimeZone;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import kotlin.TuplesKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt__StringsJVMKt;
import kotlin.text.StringsKt__StringsKt;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;

public final class AFf1kSDK extends AFf1nSDK<AFc1pSDK> {

    @NotNull
    private final CountDownLatch afDebugLog;

    @NotNull
    private final List<AFi1hSDK> afErrorLog;

    @NotNull
    private final AFd1sSDK afInfoLog;
    private int afRDLog;
    private int afVerboseLog;
    private int afWarnLog;

    @NotNull
    private final AFi1aSDK force;

    @NotNull
    private final AFh1wSDK i;

    @NotNull
    private final AFc1jSDK unregisterClient;

    @NotNull
    private final AFd1pSDK v;

    @NotNull
    private final AFc1vSDK w;

    public class AFa1tSDK {
        public static final int[] valueOf;
        public static final int[] values;

        static {
            AFe1bSDK.values();
            AFe1bSDK aFe1bSDK = AFe1bSDK.SUCCESS;
            AFe1bSDK aFe1bSDK2 = AFe1bSDK.FAILURE;
            valueOf = new int[]{1, 2};
            AFi1hSDK.AFa1ySDK.values();
            AFi1hSDK.AFa1ySDK aFa1ySDK = AFi1hSDK.AFa1ySDK.FINISHED;
            AFi1hSDK.AFa1ySDK aFa1ySDK2 = AFi1hSDK.AFa1ySDK.STARTED;
            values = new int[]{0, 2, 1};
        }
    }

    public AFf1kSDK(@NotNull AFc1jSDK aFc1jSDK, @NotNull AFd1kSDK aFd1kSDK) {
        super(AFf1zSDK.DLSDK, new AFf1zSDK[]{AFf1zSDK.RC_CDN, AFf1zSDK.FETCH_ADVERTISING_ID}, aFd1kSDK, "DdlSdk");
        Intrinsics.checkNotNullParameter(aFc1jSDK, "");
        Intrinsics.checkNotNullParameter(aFd1kSDK, "");
        this.unregisterClient = aFc1jSDK;
        this.afDebugLog = new CountDownLatch(1);
        this.afErrorLog = new ArrayList();
        AFd1sSDK AFInAppEventType = aFd1kSDK.AFInAppEventType();
        Intrinsics.checkNotNullExpressionValue(AFInAppEventType, "");
        this.afInfoLog = AFInAppEventType;
        AFd1pSDK level = aFd1kSDK.getLevel();
        Intrinsics.checkNotNullExpressionValue(level, "");
        this.v = level;
        AFc1vSDK afRDLog = aFd1kSDK.afRDLog();
        Intrinsics.checkNotNullExpressionValue(afRDLog, "");
        this.w = afRDLog;
        AFh1wSDK AFLogger = aFd1kSDK.AFLogger();
        Intrinsics.checkNotNullExpressionValue(AFLogger, "");
        this.i = AFLogger;
        AFi1aSDK force = aFd1kSDK.force();
        Intrinsics.checkNotNullExpressionValue(force, "");
        this.force = force;
        AFi1hSDK[] AFKeystoreWrapper = force.AFKeystoreWrapper();
        Intrinsics.checkNotNullExpressionValue(AFKeystoreWrapper, "");
        ArrayList<AFi1hSDK> arrayList = new ArrayList();
        int length = AFKeystoreWrapper.length;
        for (int i = 0; i < length; i++) {
            AFi1hSDK aFi1hSDK = AFKeystoreWrapper[i];
            if ((aFi1hSDK == null || aFi1hSDK.unregisterClient == AFi1hSDK.AFa1ySDK.NOT_STARTED) ? false : true) {
                arrayList.add(aFi1hSDK);
            }
        }
        this.afRDLog = arrayList.size();
        for (final AFi1hSDK aFi1hSDK2 : arrayList) {
            AFi1hSDK.AFa1ySDK aFa1ySDK = aFi1hSDK2.unregisterClient;
            int i2 = aFa1ySDK == null ? -1 : AFa1tSDK.values[aFa1ySDK.ordinal()];
            if (i2 == 1) {
                AFLogger aFLogger = AFLogger.INSTANCE;
                AFg1aSDK aFg1aSDK = AFg1aSDK.DDL;
                StringBuilder sb = new StringBuilder();
                sb.append(aFi1hSDK2.AFInAppEventParameterName.get("source"));
                sb.append(" referrer collected earlier");
                AFg1fSDK.d$default(aFLogger, aFg1aSDK, sb.toString(), false, 4, null);
                Intrinsics.checkNotNullExpressionValue(aFi1hSDK2, "");
                AFInAppEventParameterName(aFi1hSDK2);
            } else if (i2 == 2) {
                aFi1hSDK2.addObserver(new Observer() {
                    @Override
                    public final void update(Observable observable, Object obj) {
                        AFf1kSDK.AFInAppEventType(AFi1hSDK.this, this, observable, obj);
                    }
                });
            }
        }
    }

    private final void AFInAppEventParameterName(AFi1hSDK aFi1hSDK) {
        if (!AFKeystoreWrapper(aFi1hSDK)) {
            int i = this.afVerboseLog + 1;
            this.afVerboseLog = i;
            if (i == this.afRDLog) {
                this.afDebugLog.countDown();
                return;
            }
            return;
        }
        this.afErrorLog.add(aFi1hSDK);
        this.afDebugLog.countDown();
        AFLogger aFLogger = AFLogger.INSTANCE;
        AFg1aSDK aFg1aSDK = AFg1aSDK.DDL;
        StringBuilder sb = new StringBuilder("Added non-organic ");
        sb.append(aFi1hSDK.getClass().getSimpleName());
        AFg1fSDK.d$default(aFLogger, aFg1aSDK, sb.toString(), false, 4, null);
    }

    public static final void AFInAppEventType(AFi1hSDK aFi1hSDK, AFf1kSDK aFf1kSDK, Observable observable, Object obj) {
        Intrinsics.checkNotNullParameter(aFf1kSDK, "");
        AFLogger aFLogger = AFLogger.INSTANCE;
        AFg1aSDK aFg1aSDK = AFg1aSDK.DDL;
        StringBuilder sb = new StringBuilder();
        sb.append(aFi1hSDK.AFInAppEventParameterName.get("source"));
        sb.append(" referrer collected via observer");
        AFg1fSDK.d$default(aFLogger, aFg1aSDK, sb.toString(), false, 4, null);
        Objects.requireNonNull(observable, "null cannot be cast to non-null type com.appsflyer.internal.referrer.Referrer");
        aFf1kSDK.AFInAppEventParameterName((AFi1hSDK) observable);
    }

    private static boolean AFKeystoreWrapper(AFi1hSDK aFi1hSDK) {
        Object obj = aFi1hSDK.AFInAppEventParameterName.get("click_ts");
        Long l2 = obj instanceof Long ? (Long) obj : null;
        if (l2 != null) {
            if (System.currentTimeMillis() - TimeUnit.SECONDS.toMillis(l2.longValue()) < TimeUnit.DAYS.toMillis(1L)) {
                return true;
            }
        }
        return false;
    }

    private static Map<String, String> valueOf(AFb1zSDK aFb1zSDK) {
        String str;
        if (aFb1zSDK == null || (str = aFb1zSDK.AFInAppEventParameterName) == null) {
            return null;
        }
        Intrinsics.checkNotNullExpressionValue(str, "");
        Boolean bool = aFb1zSDK.AFKeystoreWrapper;
        if (bool == null || !bool.booleanValue()) {
            return MapsKt__MapsKt.mapOf(TuplesKt.to("type", "unhashed"), TuplesKt.to("value", str));
        }
        return null;
    }

    private final boolean w() {
        Object obj = this.unregisterClient.AFInAppEventParameterName().get("referrers");
        List list = obj instanceof List ? (List) obj : null;
        return (list != null ? list.size() : 0) < this.afRDLog && !this.unregisterClient.AFInAppEventParameterName().containsKey("referrers");
    }

    @Override
    public final long AFInAppEventParameterName() {
        return this.w.registerClient;
    }

    @Override
    @NotNull
    public final AFe1bSDK AFKeystoreWrapper() {
        DeepLinkResult deepLinkResult;
        AFe1bSDK AFKeystoreWrapper;
        DeepLinkResult deepLinkResult2;
        AFc1vSDK aFc1vSDK;
        AFe1bSDK aFe1bSDK = AFe1bSDK.FAILURE;
        try {
            AFKeystoreWrapper = super.AFKeystoreWrapper();
            Intrinsics.checkNotNullExpressionValue(AFKeystoreWrapper, "");
        } catch (Exception e) {
            e = e;
        }
        try {
            AFh1wSDK aFh1wSDK = this.i;
            int i = this.afWarnLog;
            if (i <= 0 || i > 2) {
                AFLogger.afErrorLogForExcManagerOnly("Unexpected ddl requestCount - end", new IllegalStateException("Metrics: Unexpected ddl requestCount = ".concat(String.valueOf(i))));
            } else {
                int i2 = i - 1;
                aFh1wSDK.AFLogger[i2] = System.currentTimeMillis();
                long[] jArr = aFh1wSDK.e;
                if (jArr[i2] != 0) {
                    long[] jArr2 = aFh1wSDK.d;
                    jArr2[i2] = aFh1wSDK.AFLogger[i2] - jArr[i2];
                    aFh1wSDK.valueOf.put("net", jArr2);
                    aFh1wSDK.AFInAppEventParameterName.AFInAppEventParameterName("ddl", new JSONObject(aFh1wSDK.valueOf).toString());
                } else {
                    StringBuilder sb = new StringBuilder("Metrics: ddlStart[");
                    sb.append(i2);
                    sb.append("] ts is missing");
                    AFLogger.afInfoLog(sb.toString());
                }
            }
            int i3 = AFa1tSDK.valueOf[AFKeystoreWrapper.ordinal()];
            if (i3 == 1) {
                ResponseNetwork responseNetwork = ((AFf1nSDK) this).registerClient;
                Intrinsics.checkNotNull(responseNetwork);
                Object body = responseNetwork.getBody();
                Intrinsics.checkNotNullExpressionValue(body, "");
                AFc1pSDK aFc1pSDK = (AFc1pSDK) body;
                DeepLink deepLink = aFc1pSDK.values;
                if (deepLink != null) {
                    DeepLinkResult deepLinkResult3 = new DeepLinkResult(deepLink, null);
                    this.i.AFInAppEventParameterName(deepLinkResult3, this.w.registerClient);
                    this.w.values(deepLinkResult3);
                    return AFKeystoreWrapper;
                }
                if (this.afWarnLog <= 1 && aFc1pSDK.getAFInAppEventType() && w()) {
                    AFg1fSDK.d$default(AFLogger.INSTANCE, AFg1aSDK.DDL, "Waiting for referrers...", false, 4, null);
                    this.afDebugLog.await();
                    AFh1wSDK aFh1wSDK2 = this.i;
                    long currentTimeMillis = System.currentTimeMillis();
                    long[] jArr3 = aFh1wSDK2.AFLogger;
                    if (jArr3[0] != 0) {
                        aFh1wSDK2.valueOf.put("rfr_wait", Long.valueOf(currentTimeMillis - jArr3[0]));
                        aFh1wSDK2.AFInAppEventParameterName.AFInAppEventParameterName("ddl", new JSONObject(aFh1wSDK2.valueOf).toString());
                    } else {
                        AFLogger.afInfoLog("Metrics: ddlEnd[0] ts is missing");
                    }
                    if (this.afVerboseLog != this.afRDLog) {
                        return AFKeystoreWrapper();
                    }
                    DeepLinkResult deepLinkResult4 = new DeepLinkResult(null, null);
                    this.i.AFInAppEventParameterName(deepLinkResult4, this.w.registerClient);
                    this.w.values(deepLinkResult4);
                    return AFe1bSDK.SUCCESS;
                }
                deepLinkResult2 = new DeepLinkResult(null, null);
                this.i.AFInAppEventParameterName(deepLinkResult2, this.w.registerClient);
                aFc1vSDK = this.w;
            } else {
                if (i3 != 2) {
                    return AFKeystoreWrapper;
                }
                AFLogger aFLogger = AFLogger.INSTANCE;
                AFg1aSDK aFg1aSDK = AFg1aSDK.DDL;
                StringBuilder sb2 = new StringBuilder("Error occurred. Server response code = ");
                ResponseNetwork responseNetwork2 = ((AFf1nSDK) this).registerClient;
                sb2.append(responseNetwork2 != null ? Integer.valueOf(responseNetwork2.getStatusCode()) : null);
                AFg1fSDK.d$default(aFLogger, aFg1aSDK, sb2.toString(), false, 4, null);
                deepLinkResult2 = new DeepLinkResult(null, DeepLinkResult.Error.HTTP_STATUS_CODE);
                this.i.AFInAppEventParameterName(deepLinkResult2, this.w.registerClient);
                aFc1vSDK = this.w;
            }
            aFc1vSDK.values(deepLinkResult2);
            return AFKeystoreWrapper;
        } catch (Exception e2) {
            e = e2;
            aFe1bSDK = AFKeystoreWrapper;
            Throwable cause = e.getCause();
            if (!(cause instanceof InterruptedException ? true : cause instanceof InterruptedIOException)) {
                boolean z = cause instanceof IOException;
                AFLogger aFLogger2 = AFLogger.INSTANCE;
                AFg1aSDK aFg1aSDK2 = AFg1aSDK.DDL;
                if (z) {
                    AFg1fSDK.d$default(aFLogger2, aFg1aSDK2, "Http Exception: the request was not sent to the server", false, 4, null);
                    deepLinkResult = new DeepLinkResult(null, DeepLinkResult.Error.NETWORK);
                } else {
                    AFg1fSDK.d$default(aFLogger2, aFg1aSDK2, "Unexpected Exception: ".concat(String.valueOf(e)), false, 4, null);
                    deepLinkResult = new DeepLinkResult(null, DeepLinkResult.Error.UNEXPECTED);
                }
                this.i.AFInAppEventParameterName(deepLinkResult, this.w.registerClient);
                this.w.values(deepLinkResult);
                return aFe1bSDK;
            }
            AFLogger.afErrorLogForExcManagerOnly("[DDL] Timeout", new TimeoutException());
            AFLogger aFLogger3 = AFLogger.INSTANCE;
            AFg1aSDK aFg1aSDK3 = AFg1aSDK.DDL;
            StringBuilder sb3 = new StringBuilder("Timeout, didn't manage to find deferred deeplink after ");
            sb3.append(this.afWarnLog);
            sb3.append(" attempt(s) within ");
            sb3.append(this.w.registerClient);
            sb3.append(" milliseconds");
            AFg1fSDK.d$default(aFLogger3, aFg1aSDK3, sb3.toString(), false, 4, null);
            DeepLinkResult deepLinkResult5 = new DeepLinkResult(null, DeepLinkResult.Error.TIMEOUT);
            this.i.AFInAppEventParameterName(deepLinkResult5, this.w.registerClient);
            this.w.values(deepLinkResult5);
            return AFe1bSDK.TIMEOUT;
        }
    }

    @Override
    @NotNull
    public final AFe1sSDK<AFc1pSDK> AFKeystoreWrapper(@NotNull String str) {
        int i;
        Map map;
        Object obj;
        Intrinsics.checkNotNullParameter(str, "");
        boolean z = true;
        this.afWarnLog++;
        AFLogger aFLogger = AFLogger.INSTANCE;
        AFg1aSDK aFg1aSDK = AFg1aSDK.DDL;
        StringBuilder sb = new StringBuilder("Preparing request ");
        sb.append(this.afWarnLog);
        AFg1fSDK.d$default(aFLogger, aFg1aSDK, sb.toString(), false, 4, null);
        Map<String, Object> AFInAppEventParameterName = this.unregisterClient.AFInAppEventParameterName();
        AFj1uSDK aFj1uSDK = null;
        Object[] objArr = 0;
        if (this.afWarnLog == 1) {
            AFInAppEventParameterName.put("is_first", Boolean.valueOf(this.afInfoLog.AFKeystoreWrapper.valueOf("appsFlyerCount", 0) == 0));
            StringBuilder sb2 = new StringBuilder();
            sb2.append(Locale.getDefault().getLanguage());
            sb2.append('-');
            sb2.append(Locale.getDefault().getCountry());
            AFInAppEventParameterName.put("lang", sb2.toString());
            AFInAppEventParameterName.put("os", Build.VERSION.RELEASE);
            AFInAppEventParameterName.put("type", Build.MODEL);
            AFd1sSDK aFd1sSDK = this.afInfoLog;
            AFInAppEventParameterName.put("request_id", AFb1kSDK.valueOf(aFd1sSDK.valueOf, aFd1sSDK.AFKeystoreWrapper));
            AFd1wSDK aFd1wSDK = this.v.AFKeystoreWrapper;
            if (aFd1wSDK != null && (obj = aFd1wSDK.AFInAppEventType) != null) {
                Intrinsics.checkNotNullExpressionValue(obj, "");
                AFInAppEventParameterName.put("sharing_filter", obj);
            }
            AFh1uSDK aFh1uSDK = this.afInfoLog.AFInAppEventType.AFLogger;
            Object valueOf = valueOf(aFh1uSDK != null ? new AFb1zSDK(aFh1uSDK.values, aFh1uSDK.registerClient) : null);
            if (valueOf != null) {
                AFInAppEventParameterName.put("gaid", valueOf);
            }
            Object valueOf2 = valueOf(AFb1rSDK.AFInAppEventType(this.afInfoLog.valueOf.AFKeystoreWrapper));
            if (valueOf2 != null) {
                AFInAppEventParameterName.put("oaid", valueOf2);
            }
        }
        long currentTimeMillis = System.currentTimeMillis();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US);
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
        AFInAppEventParameterName.put("timestamp", simpleDateFormat.format(new Date(currentTimeMillis)));
        AFInAppEventParameterName.put("request_count", Integer.valueOf(this.afWarnLog));
        List<AFi1hSDK> list = this.afErrorLog;
        ArrayList arrayList = new ArrayList();
        Iterator<T> it = list.iterator();
        while (true) {
            i = 2;
            if (!it.hasNext()) {
                break;
            }
            AFi1hSDK aFi1hSDK = (AFi1hSDK) it.next();
            if (aFi1hSDK.unregisterClient == AFi1hSDK.AFa1ySDK.FINISHED) {
                Object obj2 = aFi1hSDK.AFInAppEventParameterName.get("referrer");
                String str2 = obj2 instanceof String ? (String) obj2 : null;
                if (str2 != null) {
                    Object obj3 = aFi1hSDK.AFInAppEventParameterName.get("source");
                    Objects.requireNonNull(obj3, "null cannot be cast to non-null type kotlin.String");
                    map = MapsKt__MapsKt.mapOf(TuplesKt.to("source", (String) obj3), TuplesKt.to("value", str2));
                    if (map == null) {
                        arrayList.add(map);
                    }
                }
            }
            map = null;
            if (map == null) {
            }
        }
        if (!arrayList.isEmpty()) {
            AFInAppEventParameterName.put("referrers", arrayList);
        }
        AFc1jSDK aFc1jSDK = this.unregisterClient;
        AFj1xSDK aFj1xSDK = new AFj1xSDK(this.afInfoLog, aFj1uSDK, i, objArr == true ? 1 : 0);
        String str3 = ((AFf1nSDK) this).d.AFLogger;
        Object obj4 = this.unregisterClient.AFInAppEventParameterName().get("timestamp");
        Objects.requireNonNull(obj4, "null cannot be cast to non-null type kotlin.String");
        String str4 = (String) obj4;
        String packageName = aFj1xSDK.valueOf.valueOf.AFKeystoreWrapper.getPackageName();
        Intrinsics.checkNotNullExpressionValue(packageName, "");
        String d = aFj1xSDK.valueOf.d();
        if (d != null && !StringsKt__StringsJVMKt.isBlank(d)) {
            z = false;
        }
        if (!z) {
            d = "-".concat(String.valueOf(StringsKt__StringsKt.trim((CharSequence) d).toString()));
        }
        if (d == null) {
            d = "";
        }
        String obj5 = StringsKt__StringsKt.trim((CharSequence) d).toString();
        Uri.Builder buildUpon = Uri.parse(aFj1xSDK.values.AFInAppEventParameterName("https://%sdlsdk.%s/v1.0/android/")).buildUpon();
        StringBuilder sb3 = new StringBuilder();
        sb3.append(packageName);
        sb3.append(obj5);
        Uri.Builder appendPath = buildUpon.appendPath(sb3.toString());
        Intrinsics.checkNotNullExpressionValue(appendPath, "");
        String obj6 = AFj1xSDK.AFInAppEventParameterName(appendPath, str3, str4).appendQueryParameter("sdk_version", AFb1vSDK.AFInAppEventParameterName).build().toString();
        Intrinsics.checkNotNullExpressionValue(obj6, "");
        aFc1jSDK.valueOf(obj6);
        AFh1wSDK aFh1wSDK = this.i;
        int i2 = this.afWarnLog;
        if (i2 <= 0 || i2 > 2) {
            AFLogger.afErrorLogForExcManagerOnly("Unexpected ddl requestCount - start", new IllegalStateException("Metrics: Unexpected ddl requestCount = ".concat(String.valueOf(i2))));
        } else {
            int i3 = i2 - 1;
            aFh1wSDK.e[i3] = System.currentTimeMillis();
            if (i3 == 0) {
                long j2 = aFh1wSDK.unregisterClient;
                if (j2 != 0) {
                    aFh1wSDK.valueOf.put("from_fg", Long.valueOf(aFh1wSDK.e[i3] - j2));
                    aFh1wSDK.AFInAppEventParameterName.AFInAppEventParameterName("ddl", new JSONObject(aFh1wSDK.valueOf).toString());
                } else {
                    AFLogger.afInfoLog("Metrics: fg ts is missing");
                }
            }
        }
        AFe1sSDK<AFc1pSDK> AFKeystoreWrapper = ((AFf1nSDK) this).AFLogger.AFKeystoreWrapper(this.unregisterClient);
        Intrinsics.checkNotNullExpressionValue(AFKeystoreWrapper, "");
        return AFKeystoreWrapper;
    }

    @Override
    public final boolean a_() {
        return false;
    }

    @Override
    public final AppsFlyerRequestListener e() {
        return null;
    }

    @Override
    public final boolean i() {
        return false;
    }

    @Override
    public final boolean valueOf() {
        return false;
    }
}