导航菜单

页面标题

页面副标题

VivaMoneda v1.4 - AFc1oSDK.java 源代码

正在查看: VivaMoneda v1.4 应用的 AFc1oSDK.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.appsflyer.internal;

import android.os.Build;
import com.appsflyer.AFLogger;
import com.appsflyer.deeplink.DeepLink;
import com.appsflyer.deeplink.DeepLinkResult;
import com.appsflyer.internal.AFh1mSDK;
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.TimeZone;
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.JSONObject;

public final class AFc1oSDK extends AFg1pSDK {
    private final List<AFh1mSDK> AFLogger$LogLevel;
    private final CountDownLatch AFVersionDeclaration;
    private final AFc1kSDK AppsFlyer2dXConversionCallback;
    private final AFd1vSDK afErrorLogForExcManagerOnly;
    private final AFf1iSDK afWarnLog;
    private final AFg1uSDK getLevel;
    private final AFh1nSDK init;
    private final AFb1hSDK onAppOpenAttributionNative;
    private boolean onConversionDataSuccess;
    private int onDeepLinkingNative;
    private int onInstallConversionDataLoadedNative;
    private final ExecutorService onInstallConversionFailureNative;
    private int onResponseNative;

    public static class AnonymousClass5 {
        static final int[] AFKeystoreWrapper;

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

    public AFc1oSDK(AFd1pSDK aFd1pSDK) {
        super(null, "https://%sdlsdk.%s/v1.0/android/", Boolean.FALSE, Boolean.TRUE, null);
        this.AFLogger$LogLevel = new ArrayList();
        this.AFVersionDeclaration = new CountDownLatch(1);
        this.getLevel = aFd1pSDK.AFLogger();
        this.afErrorLogForExcManagerOnly = aFd1pSDK.valueOf();
        this.afWarnLog = aFd1pSDK.afErrorLogForExcManagerOnly();
        this.init = aFd1pSDK.getLevel();
        this.onInstallConversionFailureNative = aFd1pSDK.AFInAppEventType();
        this.onAppOpenAttributionNative = aFd1pSDK.AFLogger$LogLevel();
        this.AppsFlyer2dXConversionCallback = aFd1pSDK.onInstallConversionDataLoadedNative();
    }

    public void AFInAppEventParameterName(AFh1mSDK aFh1mSDK) {
        if (AFInAppEventType(aFh1mSDK)) {
            this.AFLogger$LogLevel.add(aFh1mSDK);
            this.AFVersionDeclaration.countDown();
            StringBuilder sb = new StringBuilder("[DDL] Added non-organic ");
            sb.append(aFh1mSDK.getClass().getSimpleName());
            AFLogger.afDebugLog(sb.toString());
            return;
        }
        int i9 = this.onInstallConversionDataLoadedNative + 1;
        this.onInstallConversionDataLoadedNative = i9;
        if (i9 == this.onDeepLinkingNative) {
            this.AFVersionDeclaration.countDown();
        }
    }

    public void afErrorLogForExcManagerOnly() {
        String[] strArr;
        this.onResponseNative++;
        StringBuilder sb = new StringBuilder("[DDL] Preparing request ");
        sb.append(this.onResponseNative);
        AFLogger.afDebugLog(sb.toString());
        if (this.onResponseNative == 1) {
            AFb1tSDK AFKeystoreWrapper = AFb1tSDK.AFKeystoreWrapper();
            this.valueOf.put("is_first", Boolean.valueOf(this.afErrorLogForExcManagerOnly.valueOf.AFKeystoreWrapper("appsFlyerCount", 0) == 0));
            Map<String, Object> map = this.valueOf;
            StringBuilder sb2 = new StringBuilder();
            sb2.append(Locale.getDefault().getLanguage());
            sb2.append("-");
            sb2.append(Locale.getDefault().getCountry());
            map.put("lang", sb2.toString());
            this.valueOf.put("os", Build.VERSION.RELEASE);
            this.valueOf.put("type", Build.MODEL);
            Map<String, Object> map2 = this.valueOf;
            AFd1vSDK aFd1vSDK = this.afErrorLogForExcManagerOnly;
            map2.put("request_id", AFb1iSDK.AFKeystoreWrapper(aFd1vSDK.AFKeystoreWrapper, aFd1vSDK.valueOf));
            AFc1bSDK aFc1bSDK = AFKeystoreWrapper.AFLogger;
            if (aFc1bSDK != null && (strArr = aFc1bSDK.AFKeystoreWrapper) != null) {
                this.valueOf.put("sharing_filter", strArr);
            }
            Map<String, Object> AFInAppEventType = AFInAppEventType(AFb1qSDK.AFKeystoreWrapper(this.afErrorLogForExcManagerOnly.AFKeystoreWrapper.AFInAppEventType, new HashMap()));
            Map<String, Object> AFInAppEventType2 = AFInAppEventType(AFb1qSDK.AFInAppEventParameterName(this.afErrorLogForExcManagerOnly.AFKeystoreWrapper.AFInAppEventType));
            if (AFInAppEventType != null) {
                this.valueOf.put("gaid", AFInAppEventType);
            }
            if (AFInAppEventType2 != null) {
                this.valueOf.put("oaid", AFInAppEventType2);
            }
        }
        Map<String, Object> map3 = this.valueOf;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US);
        long currentTimeMillis = System.currentTimeMillis();
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
        map3.put("timestamp", simpleDateFormat.format(new Date(currentTimeMillis)));
        this.valueOf.put("request_count", Integer.valueOf(this.onResponseNative));
        ArrayList arrayList = new ArrayList();
        Iterator<AFh1mSDK> it = this.AFLogger$LogLevel.iterator();
        while (it.hasNext()) {
            Map<String, String> valueOf = valueOf(it.next());
            if (valueOf != null) {
                arrayList.add(valueOf);
            }
        }
        if (!arrayList.isEmpty()) {
            this.valueOf.put("referrers", arrayList);
        }
        AFInAppEventType(init());
    }

    private boolean getLevel() {
        List list = (List) this.valueOf.get("referrers");
        return (list != null ? list.size() : 0) < this.onDeepLinkingNative && !this.valueOf.containsKey("referrers");
    }

    private String init() {
        return new AFi1zSDK(this.afErrorLogForExcManagerOnly).AFInAppEventParameterName(this.afWarnLog.afErrorLog, (String) this.valueOf.get("timestamp"));
    }

    private static Map<String, String> valueOf(AFh1mSDK aFh1mSDK) {
        if (aFh1mSDK.afDebugLog != AFh1mSDK.AFa1ySDK.FINISHED) {
            return null;
        }
        HashMap hashMap = new HashMap();
        String str = (String) aFh1mSDK.AFKeystoreWrapper.get("referrer");
        if (str == null) {
            return null;
        }
        hashMap.put("source", (String) aFh1mSDK.AFKeystoreWrapper.get("source"));
        hashMap.put("value", str);
        return hashMap;
    }

    public final DeepLinkResult AFLogger() {
        AFLogger.afDebugLog("[DDL] start");
        FutureTask futureTask = new FutureTask(new Callable<DeepLinkResult>() {
            @Override
            public final DeepLinkResult call() {
                AFc1oSDK.AFInAppEventType(AFc1oSDK.this);
                AFc1oSDK.this.afErrorLogForExcManagerOnly();
                return AFc1oSDK.AFInAppEventParameterName(AFc1oSDK.this);
            }
        });
        this.onInstallConversionFailureNative.execute(futureTask);
        try {
            DeepLinkResult deepLinkResult = (DeepLinkResult) futureTask.get(this.AppsFlyer2dXConversionCallback.AFLogger, TimeUnit.MILLISECONDS);
            this.getLevel.AFInAppEventType(deepLinkResult, this.AppsFlyer2dXConversionCallback.AFLogger);
            this.AppsFlyer2dXConversionCallback.valueOf(deepLinkResult);
            return deepLinkResult;
        } catch (InterruptedException e9) {
            e = e9;
            AFLogger.afErrorLog("[DDL] Error occurred", e, true, false);
            DeepLinkResult deepLinkResult2 = new DeepLinkResult(null, !(e.getCause() instanceof IOException) ? DeepLinkResult.Error.NETWORK : DeepLinkResult.Error.UNEXPECTED);
            this.getLevel.AFInAppEventType(deepLinkResult2, this.AppsFlyer2dXConversionCallback.AFLogger);
            this.AppsFlyer2dXConversionCallback.valueOf(deepLinkResult2);
            return deepLinkResult2;
        } catch (ExecutionException e10) {
            e = e10;
            AFLogger.afErrorLog("[DDL] Error occurred", e, true, false);
            DeepLinkResult deepLinkResult22 = new DeepLinkResult(null, !(e.getCause() instanceof IOException) ? DeepLinkResult.Error.NETWORK : DeepLinkResult.Error.UNEXPECTED);
            this.getLevel.AFInAppEventType(deepLinkResult22, this.AppsFlyer2dXConversionCallback.AFLogger);
            this.AppsFlyer2dXConversionCallback.valueOf(deepLinkResult22);
            return deepLinkResult22;
        } catch (TimeoutException e11) {
            AFLogger.afErrorLogForExcManagerOnly("[DDL] Timeout", e11);
            StringBuilder sb = new StringBuilder("[DDL] Timeout, didn't manage to find deferred deep link after ");
            sb.append(this.onResponseNative);
            sb.append(" attempt(s) within ");
            sb.append(this.AppsFlyer2dXConversionCallback.AFLogger);
            sb.append(" milliseconds");
            AFLogger.afDebugLog(sb.toString());
            DeepLinkResult deepLinkResult3 = new DeepLinkResult(null, DeepLinkResult.Error.TIMEOUT);
            this.getLevel.AFInAppEventType(deepLinkResult3, this.AppsFlyer2dXConversionCallback.AFLogger);
            this.AppsFlyer2dXConversionCallback.valueOf(deepLinkResult3);
            return deepLinkResult3;
        }
    }

    private static boolean AFInAppEventType(AFh1mSDK aFh1mSDK) {
        Long l9 = (Long) aFh1mSDK.AFKeystoreWrapper.get("click_ts");
        return l9 != null && System.currentTimeMillis() - TimeUnit.SECONDS.toMillis(l9.longValue()) < TimeUnit.DAYS.toMillis(1L);
    }

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

    private Map<String, Object> AFInAppEventType(final AFa1aSDK aFa1aSDK) {
        Boolean bool;
        boolean z8 = false;
        if (aFa1aSDK != null && aFa1aSDK.AFKeystoreWrapper != null && ((bool = aFa1aSDK.AFInAppEventParameterName) == null || !bool.booleanValue())) {
            z8 = true;
        }
        if (z8) {
            return new HashMap<String, Object>() {
                {
                    put("type", "unhashed");
                    put("value", aFa1aSDK.AFKeystoreWrapper);
                }
            };
        }
        return null;
    }

    public static DeepLinkResult AFInAppEventParameterName(AFc1oSDK aFc1oSDK) {
        DeepLink AFInAppEventParameterName;
        while (true) {
            AFg1uSDK aFg1uSDK = aFc1oSDK.getLevel;
            int i9 = aFc1oSDK.onResponseNative;
            if (i9 > 0 && i9 <= 2) {
                int i10 = i9 - 1;
                aFg1uSDK.afErrorLog[i10] = System.currentTimeMillis();
                if (i10 == 0) {
                    long j9 = aFg1uSDK.AFLogger;
                    if (j9 != 0) {
                        aFg1uSDK.values.put("from_fg", Long.valueOf(aFg1uSDK.afErrorLog[i10] - j9));
                        aFg1uSDK.AFKeystoreWrapper.valueOf("ddl", new JSONObject(aFg1uSDK.values).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(i9))));
            }
            HttpURLConnection AFInAppEventType = new AFb1vSDK(aFc1oSDK, aFc1oSDK.onAppOpenAttributionNative).AFInAppEventType(aFc1oSDK.afWarnLog.afErrorLog);
            AFg1uSDK aFg1uSDK2 = aFc1oSDK.getLevel;
            int i11 = aFc1oSDK.onResponseNative;
            if (i11 > 0 && i11 <= 2) {
                int i12 = i11 - 1;
                aFg1uSDK2.afRDLog[i12] = System.currentTimeMillis();
                long j10 = aFg1uSDK2.afErrorLog[i12];
                if (j10 != 0) {
                    long[] jArr = aFg1uSDK2.afDebugLog;
                    jArr[i12] = aFg1uSDK2.afRDLog[i12] - j10;
                    aFg1uSDK2.values.put("net", jArr);
                    aFg1uSDK2.AFKeystoreWrapper.valueOf("ddl", new JSONObject(aFg1uSDK2.values).toString());
                } else {
                    StringBuilder sb = new StringBuilder("Metrics: ddlStart[");
                    sb.append(i12);
                    sb.append("] ts is missing");
                    AFLogger.afInfoLog(sb.toString());
                }
            } else {
                AFLogger.afErrorLogForExcManagerOnly("Unexpected ddl requestCount - end", new IllegalStateException("Metrics: Unexpected ddl requestCount = ".concat(String.valueOf(i11))));
            }
            if (AFInAppEventType.getResponseCode() == 200) {
                JSONObject jSONObject = new JSONObject(AFb1tSDK.AFInAppEventType(AFInAppEventType));
                aFc1oSDK.onConversionDataSuccess = jSONObject.optBoolean("is_second_ping", true);
                if (jSONObject.optBoolean("found")) {
                    AFInAppEventParameterName = DeepLink.AFInAppEventParameterName(jSONObject.optJSONObject("click_event"));
                    AFInAppEventParameterName.AFInAppEventParameterName.put("is_deferred", true);
                } else {
                    AFInAppEventParameterName = null;
                }
                if (AFInAppEventParameterName != null) {
                    return new DeepLinkResult(AFInAppEventParameterName, null);
                }
                if (aFc1oSDK.onResponseNative > 1 || !aFc1oSDK.getLevel() || !aFc1oSDK.onConversionDataSuccess) {
                    break;
                }
                AFLogger.afDebugLog("[DDL] Waiting for referrers...");
                aFc1oSDK.AFVersionDeclaration.await();
                AFg1uSDK aFg1uSDK3 = aFc1oSDK.getLevel;
                long currentTimeMillis = System.currentTimeMillis();
                long j11 = aFg1uSDK3.afRDLog[0];
                if (j11 != 0) {
                    aFg1uSDK3.values.put("rfr_wait", Long.valueOf(currentTimeMillis - j11));
                    aFg1uSDK3.AFKeystoreWrapper.valueOf("ddl", new JSONObject(aFg1uSDK3.values).toString());
                } else {
                    AFLogger.afInfoLog("Metrics: ddlEnd[0] ts is missing");
                }
                if (aFc1oSDK.onInstallConversionDataLoadedNative == aFc1oSDK.onDeepLinkingNative) {
                    return new DeepLinkResult(null, null);
                }
                aFc1oSDK.afErrorLogForExcManagerOnly();
            } else {
                StringBuilder sb2 = new StringBuilder("[DDL] Error occurred. Server response code = ");
                sb2.append(AFInAppEventType.getResponseCode());
                AFLogger.afDebugLog(sb2.toString());
                return new DeepLinkResult(null, DeepLinkResult.Error.HTTP_STATUS_CODE);
            }
        }
    }

    public static void AFInAppEventType(AFc1oSDK aFc1oSDK) {
        ArrayList<AFh1mSDK> arrayList = new ArrayList();
        for (AFh1mSDK aFh1mSDK : aFc1oSDK.init.values()) {
            if (aFh1mSDK != null && aFh1mSDK.afDebugLog != AFh1mSDK.AFa1ySDK.NOT_STARTED) {
                arrayList.add(aFh1mSDK);
            }
        }
        aFc1oSDK.onDeepLinkingNative = arrayList.size();
        for (final AFh1mSDK aFh1mSDK2 : arrayList) {
            int i9 = AnonymousClass5.AFKeystoreWrapper[aFh1mSDK2.afDebugLog.ordinal()];
            if (i9 == 1) {
                StringBuilder sb = new StringBuilder("[DDL] ");
                sb.append(aFh1mSDK2.AFKeystoreWrapper.get("source"));
                sb.append(" referrer collected earlier");
                AFLogger.afDebugLog(sb.toString());
                aFc1oSDK.AFInAppEventParameterName(aFh1mSDK2);
            } else if (i9 == 2) {
                aFh1mSDK2.addObserver(new Observer() {
                    @Override
                    public final void update(Observable observable, Object obj) {
                        StringBuilder sb2 = new StringBuilder("[DDL] ");
                        sb2.append(aFh1mSDK2.AFKeystoreWrapper.get("source"));
                        sb2.append(" referrer collected via observer");
                        AFLogger.afDebugLog(sb2.toString());
                        AFc1oSDK.this.AFInAppEventParameterName((AFh1mSDK) observable);
                    }
                });
            }
        }
    }
}