Roblox v2.616.655版本的 MD5 值为:0bc7d8a921fe7f043454ac7c31685936

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


package com.appsflyer.internal;

import android.content.Context;
import android.net.Uri;
import android.os.Build;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerProperties;
import com.appsflyer.deeplink.DeepLink;
import com.appsflyer.deeplink.DeepLinkResult;
import com.appsflyer.internal.bt;
import com.appsflyer.internal.d;
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.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.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public final class aq extends bf {
    private static String onAttributionFailure = "https://%sdlsdk.%s/v1.0/android/";
    public static long onInstallConversionDataLoadedNative;
    private boolean AppsFlyerConversionListener;
    private int AppsFlyerInAppPurchaseValidatorListener;
    private int AppsFlyerLib;
    private final List<bt> onAppOpenAttribution;
    private final CountDownLatch onConversionDataSuccess;
    private final au onDeepLinking;
    public int onDeepLinkingNative;
    private final JSONObject onValidateInAppFailure;

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

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

    public aq(Context context, au auVar) {
        super(null, onAttributionFailure, Boolean.FALSE, Boolean.TRUE, null, context);
        this.onAppOpenAttribution = new ArrayList();
        this.onConversionDataSuccess = new CountDownLatch(1);
        this.onValidateInAppFailure = new JSONObject();
        this.onDeepLinking = auVar;
    }

    private Map<String, Object> AFInAppEventParameterName(final d.e.C0080d c0080d) {
        Boolean bool;
        boolean z10 = false;
        if (c0080d != null && c0080d.values != null && ((bool = c0080d.valueOf) == null || !bool.booleanValue())) {
            z10 = true;
        }
        if (z10) {
            return new HashMap<String, Object>() {
                {
                    put("type", "unhashed");
                    put("value", d.e.C0080d.this.values);
                }
            };
        }
        return null;
    }

    public void AFKeystoreWrapper(Context context) {
        HashMap hashMap;
        this.onDeepLinkingNative++;
        StringBuilder sb2 = new StringBuilder("[DDL] Preparing request ");
        sb2.append(this.onDeepLinkingNative);
        AFLogger.values(sb2.toString());
        if (this.onDeepLinkingNative == 1) {
            ae values = ae.values();
            this.AFInAppEventType.put("is_first", Boolean.valueOf(ae.AFInAppEventParameterName(context)));
            Map<String, Object> map = this.AFInAppEventType;
            StringBuilder sb3 = new StringBuilder();
            sb3.append(Locale.getDefault().getLanguage());
            sb3.append("-");
            sb3.append(Locale.getDefault().getCountry());
            map.put("lang", sb3.toString());
            this.AFInAppEventType.put("os", Build.VERSION.RELEASE);
            this.AFInAppEventType.put("type", Build.MODEL);
            this.AFInAppEventType.put("request_id", values.getAppsFlyerUID(context));
            String[] strArr = values.getLevel;
            if (strArr != null) {
                this.AFInAppEventType.put("sharing_filter", strArr);
            }
            Map<String, Object> AFInAppEventParameterName = AFInAppEventParameterName(ab.valueOf(context, new HashMap()));
            Map<String, Object> AFInAppEventParameterName2 = AFInAppEventParameterName(ab.values(context));
            if (AFInAppEventParameterName != null) {
                this.AFInAppEventType.put("gaid", AFInAppEventParameterName);
            }
            if (AFInAppEventParameterName2 != null) {
                this.AFInAppEventType.put("oaid", AFInAppEventParameterName2);
            }
        }
        Map<String, Object> map2 = this.AFInAppEventType;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US);
        long currentTimeMillis = System.currentTimeMillis();
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
        map2.put("timestamp", simpleDateFormat.format(new Date(currentTimeMillis)));
        this.AFInAppEventType.put("request_count", Integer.valueOf(this.onDeepLinkingNative));
        ArrayList arrayList = new ArrayList();
        for (bt btVar : this.onAppOpenAttribution) {
            if (btVar.AFInAppEventParameterName == bt.e.FINISHED) {
                hashMap = new HashMap();
                String str = (String) btVar.AFKeystoreWrapper.get("referrer");
                if (str != null) {
                    hashMap.put("source", (String) btVar.AFKeystoreWrapper.get("source"));
                    hashMap.put("value", str);
                    if (hashMap == null) {
                        arrayList.add(hashMap);
                    }
                }
            }
            hashMap = null;
            if (hashMap == null) {
            }
        }
        if (!arrayList.isEmpty()) {
            this.AFInAppEventType.put("referrers", arrayList);
        }
        String string = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.AF_KEY);
        Uri.Builder appendPath = Uri.parse(String.format(this.onAppOpenAttributionNative, AppsFlyerLib.getInstance().getHostPrefix(), ae.values().getHostName())).buildUpon().appendPath(context.getPackageName());
        StringBuilder sb4 = new StringBuilder();
        sb4.append(this.AFInAppEventType.get("timestamp"));
        sb4.append(string);
        AFInAppEventParameterName(appendPath.appendQueryParameter("af_sig", af.values(sb4.toString(), string)).appendQueryParameter("sdk_version", ae.AFInAppEventType).build().toString());
    }

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

    public final void values(DeepLinkResult deepLinkResult) {
        try {
            this.onValidateInAppFailure.put("status", deepLinkResult.getStatus().toString());
            this.onValidateInAppFailure.put("timeout_value", onInstallConversionDataLoadedNative);
        } catch (JSONException unused) {
        }
        au auVar = this.onDeepLinking;
        auVar.valueOf.edit().putString("ddl", this.onValidateInAppFailure.toString()).apply();
        ap.AFInAppEventParameterName(deepLinkResult);
    }

    static void AFInAppEventParameterName(aq aqVar) {
        bt[] btVarArr;
        ArrayList<bt> arrayList = new ArrayList();
        for (bt btVar : ae.values().onAppOpenAttributionNative) {
            if (btVar != null && btVar.AFInAppEventParameterName != bt.e.NOT_STARTED) {
                arrayList.add(btVar);
            }
        }
        aqVar.AppsFlyerLib = arrayList.size();
        for (final bt btVar2 : arrayList) {
            int i10 = AnonymousClass1.valueOf[btVar2.AFInAppEventParameterName.ordinal()];
            if (i10 == 1) {
                StringBuilder sb2 = new StringBuilder("[DDL] ");
                sb2.append(btVar2.AFKeystoreWrapper.get("source"));
                sb2.append(" referrer collected earlier");
                AFLogger.values(sb2.toString());
                aqVar.valueOf(btVar2);
            } else if (i10 == 2) {
                btVar2.addObserver(new Observer() {
                    @Override
                    public final void update(Observable observable, Object obj) {
                        StringBuilder sb3 = new StringBuilder("[DDL] ");
                        sb3.append(btVar2.AFKeystoreWrapper.get("source"));
                        sb3.append(" referrer collected via observer");
                        AFLogger.values(sb3.toString());
                        aq.this.valueOf((bt) observable);
                    }
                });
            }
        }
    }

    public void valueOf(bt btVar) {
        if (AFKeystoreWrapper(btVar)) {
            this.onAppOpenAttribution.add(btVar);
            this.onConversionDataSuccess.countDown();
            StringBuilder sb2 = new StringBuilder("[DDL] Added non-organic ");
            sb2.append(btVar.getClass().getSimpleName());
            AFLogger.values(sb2.toString());
            return;
        }
        int i10 = this.AppsFlyerInAppPurchaseValidatorListener + 1;
        this.AppsFlyerInAppPurchaseValidatorListener = i10;
        if (i10 == this.AppsFlyerLib) {
            this.onConversionDataSuccess.countDown();
        }
    }

    static DeepLinkResult valueOf(aq aqVar, Context context) throws IOException, JSONException, InterruptedException {
        DeepLink AFInAppEventParameterName;
        while (true) {
            long currentTimeMillis = System.currentTimeMillis();
            if (aqVar.onDeepLinkingNative == 1) {
                aqVar.onValidateInAppFailure.put("from_fg", currentTimeMillis - aqVar.onDeepLinking.valueOf.getLong("fg_ts", 0L));
            }
            HttpURLConnection AFInAppEventType = new m(aqVar).AFInAppEventType();
            JSONArray optJSONArray = aqVar.onValidateInAppFailure.optJSONArray("net");
            if (optJSONArray == null) {
                optJSONArray = new JSONArray();
            }
            long currentTimeMillis2 = System.currentTimeMillis();
            optJSONArray.put(aqVar.onDeepLinkingNative - 1, currentTimeMillis2 - currentTimeMillis);
            aqVar.onValidateInAppFailure.put("net", optJSONArray);
            if (AFInAppEventType.getResponseCode() == 200) {
                ae.values();
                JSONObject jSONObject = new JSONObject(ae.AFKeystoreWrapper(AFInAppEventType));
                aqVar.AppsFlyerConversionListener = 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 (aqVar.onDeepLinkingNative > 1 || !aqVar.valueOf() || !aqVar.AppsFlyerConversionListener) {
                    break;
                }
                AFLogger.values("[DDL] Waiting for referrers...");
                aqVar.onConversionDataSuccess.await();
                aqVar.onValidateInAppFailure.put("rfr_wait", System.currentTimeMillis() - currentTimeMillis2);
                if (aqVar.AppsFlyerInAppPurchaseValidatorListener == aqVar.AppsFlyerLib) {
                    return new DeepLinkResult(null, null);
                }
                aqVar.AFKeystoreWrapper(context);
            } else {
                StringBuilder sb2 = new StringBuilder("[DDL] Error occurred. Server response code = ");
                sb2.append(AFInAppEventType.getResponseCode());
                AFLogger.values(sb2.toString());
                return new DeepLinkResult(null, DeepLinkResult.Error.HTTP_STATUS_CODE);
            }
        }
    }

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