Play House Simulation v3.0版本的 MD5 值为:4dbd745af43e6bcde3a0dca90b9e5934

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


package com.appsflyer.internal;

import android.content.pm.PackageManager;
import android.os.Build;
import android.text.TextUtils;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerProperties;
import com.huawei.agconnect.apms.collect.model.EventType;
import com.huawei.hms.support.feature.result.CommonConstant;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import com.huawei.openalliance.ad.views.PPSLabelView;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public final class am {
    private static am AFInAppEventType = null;
    private static String values = "https://%smonitorsdk.%s/remote-debug?app_id=";
    public boolean AFInAppEventParameterName;
    private JSONObject AFKeystoreWrapper;
    private boolean AFLogger$LogLevel;
    private boolean AFVersionDeclaration;
    private int AppsFlyer2dXConversionCallback;
    private boolean valueOf = true;
    private final List<String> getLevel = new ArrayList();
    private String init = "-1";

    private am() {
        this.AppsFlyer2dXConversionCallback = 0;
        boolean z = AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.DPM, false);
        this.AFVersionDeclaration = z;
        this.AFInAppEventParameterName = true ^ z;
        this.AppsFlyer2dXConversionCallback = 0;
        this.AFLogger$LogLevel = false;
    }

    public static am AFKeystoreWrapper() {
        if (AFInAppEventType == null) {
            AFInAppEventType = new am();
        }
        return AFInAppEventType;
    }

    private synchronized void AFVersionDeclaration() {
        this.getLevel.clear();
        this.AppsFlyer2dXConversionCallback = 0;
    }

    private synchronized String AppsFlyer2dXConversionCallback() {
        String str;
        try {
            this.AFKeystoreWrapper.put("data", new JSONArray((Collection) this.getLevel));
            str = this.AFKeystoreWrapper.toString();
            try {
                AFVersionDeclaration();
            } catch (JSONException unused) {
            }
        } catch (JSONException unused2) {
            str = null;
        }
        return str;
    }

    private boolean getLevel() {
        if (this.AFInAppEventParameterName) {
            return this.valueOf || this.AFLogger$LogLevel;
        }
        return false;
    }

    public final synchronized void AFInAppEventParameterName() {
        valueOf("r_debugging_off", new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ", Locale.ENGLISH).format(Long.valueOf(System.currentTimeMillis())), new String[0]);
        this.AFLogger$LogLevel = false;
        this.valueOf = false;
    }

    public final synchronized void AFInAppEventType() {
        this.AFKeystoreWrapper = null;
        AFInAppEventType = null;
    }

    public final boolean AFLogger$LogLevel() {
        return this.AFLogger$LogLevel;
    }

    public final synchronized void valueOf() {
        this.AFLogger$LogLevel = true;
        valueOf("r_debugging_on", new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ", Locale.ENGLISH).format(Long.valueOf(System.currentTimeMillis())), new String[0]);
    }

    public final synchronized void values(String str) {
        this.init = str;
    }

    private synchronized void values(String str, PackageManager packageManager) {
        AppsFlyerProperties appsFlyerProperties = AppsFlyerProperties.getInstance();
        af AFInAppEventParameterName = af.AFInAppEventParameterName();
        String string = appsFlyerProperties.getString("remote_debug_static_data");
        if (string != null) {
            try {
                this.AFKeystoreWrapper = new JSONObject(string);
            } catch (Throwable unused) {
            }
        } else {
            this.AFKeystoreWrapper = new JSONObject();
            AFInAppEventType(Build.BRAND, Build.MODEL, Build.VERSION.RELEASE, appsFlyerProperties.getString("advertiserId"), AFInAppEventParameterName.AppsFlyer2dXConversionCallback, AFInAppEventParameterName.AFVersionDeclaration);
            StringBuilder sb = new StringBuilder("6.3.0.");
            sb.append(af.values);
            AFInAppEventType(sb.toString(), appsFlyerProperties.getString(AppsFlyerProperties.AF_KEY), appsFlyerProperties.getString("KSAppsFlyerId"), appsFlyerProperties.getString(CommonConstant.KEY_UID));
            try {
                int i = packageManager.getPackageInfo(str, 0).versionCode;
                AFInAppEventParameterName(str, String.valueOf(i), appsFlyerProperties.getString("channel"), appsFlyerProperties.getString("preInstallName"));
            } catch (Throwable unused2) {
            }
            appsFlyerProperties.set("remote_debug_static_data", this.AFKeystoreWrapper.toString());
        }
        try {
            this.AFKeystoreWrapper.put("launch_counter", this.init);
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    private synchronized void AFInAppEventType(String str, String str2, String str3, String str4, String str5, String str6) {
        try {
            this.AFKeystoreWrapper.put(com.huawei.openalliance.ad.constant.ao.r, str);
            this.AFKeystoreWrapper.put("model", str2);
            this.AFKeystoreWrapper.put(EventType.PLATFORM, "Android");
            this.AFKeystoreWrapper.put("platform_version", str3);
            if (str4 != null && str4.length() > 0) {
                this.AFKeystoreWrapper.put("advertiserId", str4);
            }
            if (str5 != null && str5.length() > 0) {
                this.AFKeystoreWrapper.put("imei", str5);
            }
            if (str6 != null && str6.length() > 0) {
                this.AFKeystoreWrapper.put("android_id", str6);
            }
        } catch (Throwable unused) {
        }
    }

    public final synchronized void valueOf(String str, String str2, String... strArr) {
        String obj;
        if (getLevel()) {
            if (this.AppsFlyer2dXConversionCallback < 98304) {
                try {
                    long currentTimeMillis = System.currentTimeMillis();
                    String join = TextUtils.join(", ", strArr);
                    if (str != null) {
                        StringBuilder sb = new StringBuilder();
                        sb.append(currentTimeMillis);
                        sb.append(PPSLabelView.Code);
                        sb.append(Thread.currentThread().getId());
                        sb.append(" _/AppsFlyer_6.3.0 [");
                        sb.append(str);
                        sb.append("] ");
                        sb.append(str2);
                        sb.append(PPSLabelView.Code);
                        sb.append(join);
                        obj = sb.toString();
                    } else {
                        StringBuilder sb2 = new StringBuilder();
                        sb2.append(currentTimeMillis);
                        sb2.append(PPSLabelView.Code);
                        sb2.append(Thread.currentThread().getId());
                        sb2.append(PPSLabelView.Code);
                        sb2.append(str2);
                        sb2.append("/AppsFlyer_6.3.0 ");
                        sb2.append(join);
                        obj = sb2.toString();
                    }
                    this.getLevel.add(obj);
                    this.AppsFlyer2dXConversionCallback += obj.length() << 1;
                } catch (Throwable unused) {
                }
            }
        }
    }

    private synchronized void AFInAppEventParameterName(String str, String str2, String str3, String str4) {
        if (str != null) {
            try {
                if (str.length() > 0) {
                    this.AFKeystoreWrapper.put(HiAnalyticsConstant.BI_KEY_APP_ID, str);
                }
            } catch (Throwable unused) {
                return;
            }
        }
        if (str2 != null && str2.length() > 0) {
            this.AFKeystoreWrapper.put("app_version", str2);
        }
        if (str3 != null && str3.length() > 0) {
            this.AFKeystoreWrapper.put("channel", str3);
        }
        if (str4 != null && str4.length() > 0) {
            this.AFKeystoreWrapper.put("preInstall", str4);
        }
    }

    public static String[] AFInAppEventParameterName(String str, StackTraceElement[] stackTraceElementArr) {
        if (stackTraceElementArr == null) {
            return new String[]{str};
        }
        String[] strArr = new String[stackTraceElementArr.length + 1];
        strArr[0] = str;
        for (int i = 1; i < stackTraceElementArr.length; i++) {
            strArr[i] = stackTraceElementArr[i].toString();
        }
        return strArr;
    }

    private synchronized void AFInAppEventType(String str, String str2, String str3, String str4) {
        try {
            this.AFKeystoreWrapper.put("sdk_version", str);
            if (str2 != null && str2.length() > 0) {
                this.AFKeystoreWrapper.put("devkey", str2);
            }
            if (str3 != null && str3.length() > 0) {
                this.AFKeystoreWrapper.put("originalAppsFlyerId", str3);
            }
            if (str4 != null && str4.length() > 0) {
                this.AFKeystoreWrapper.put(CommonConstant.KEY_UID, str4);
            }
        } catch (Throwable unused) {
        }
    }

    public static void AFInAppEventParameterName(String str, PackageManager packageManager) {
        try {
            if (AFInAppEventType == null) {
                AFInAppEventType = new am();
            }
            AFInAppEventType.values(str, packageManager);
            if (AFInAppEventType == null) {
                AFInAppEventType = new am();
            }
            String AppsFlyer2dXConversionCallback = AFInAppEventType.AppsFlyer2dXConversionCallback();
            bk bkVar = new bk();
            bkVar.onAttributionFailureNative = AppsFlyer2dXConversionCallback;
            bkVar.onConversionDataSuccess = AppsFlyerLib.getInstance().isStopped();
            StringBuilder sb = new StringBuilder();
            sb.append(String.format(values, AppsFlyerLib.getInstance().getHostPrefix(), af.AFInAppEventParameterName().getHostName()));
            sb.append(str);
            new Thread(new k((bh) bkVar.values(sb.toString()))).start();
        } catch (Throwable th) {
            AFLogger.AFInAppEventType(th);
        }
    }

    public final synchronized void values() {
        this.valueOf = false;
        AFVersionDeclaration();
    }
}