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

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


package com.appsflyer.internal;

import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import com.appsflyer.AFLogger;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerProperties;
import com.appsflyer.FirebaseMessagingServiceListener;
import com.appsflyer.internal.d;
import com.huawei.hms.ads.fv;
import com.huawei.hms.support.feature.result.CommonConstant;
import java.lang.ref.WeakReference;
import java.net.HttpURLConnection;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.TimeUnit;

public final class az extends bh {

    @VisibleForTesting
    private static String onAppOpenAttributionNative;
    private final SharedPreferences onAttributionFailureNative;

    static {
        StringBuilder sb = new StringBuilder("https://%sregister.%s/api/v");
        sb.append(af.AFInAppEventType);
        onAppOpenAttributionNative = sb.toString();
    }

    public az(@NonNull Context context) {
        super(null, r0.toString(), null, null, null, context);
        StringBuilder sb = new StringBuilder();
        sb.append(String.format(onAppOpenAttributionNative, AppsFlyerLib.getInstance().getHostPrefix(), af.AFInAppEventParameterName().getHostName()));
        sb.append(context.getPackageName());
        this.onAttributionFailureNative = af.AFInAppEventType(context);
    }

    public static boolean values(Context context) {
        if (AppsFlyerLib.getInstance().isStopped()) {
            return false;
        }
        try {
            Class.forName("com.google.firebase.messaging.FirebaseMessagingService");
        } catch (ClassNotFoundException unused) {
        } catch (Throwable th) {
            AFLogger.values("An error occurred while trying to verify manifest declarations: ", th);
        }
        return ac.values(context, new Intent("com.google.firebase.MESSAGING_EVENT", null, context, FirebaseMessagingServiceListener.class));
    }

    @Nullable
    public m AFInAppEventParameterName() {
        String string;
        String string2;
        String string3 = this.onAttributionFailureNative.getString("afUninstallToken", null);
        long j = this.onAttributionFailureNative.getLong("afUninstallToken_received_time", 0L);
        boolean z = this.onAttributionFailureNative.getBoolean("afUninstallToken_queued", false);
        this.onAttributionFailureNative.edit().putBoolean("afUninstallToken_queued", false).apply();
        if (string3 == null && (string2 = AppsFlyerProperties.getInstance().getString("afUninstallToken")) != null) {
            string3 = string2.split(",")[r0.length - 1];
        }
        if (j == 0 && (string = AppsFlyerProperties.getInstance().getString("afUninstallToken")) != null) {
            String[] split = string.split(",");
            if (split.length >= 2) {
                try {
                    j = Long.parseLong(split[split.length - 2]);
                } catch (NumberFormatException unused) {
                }
            }
        }
        if (string3 != null) {
            return new m(string3, j, z);
        }
        return null;
    }

    public final void AFKeystoreWrapper(String str) {
        if (str != null) {
            AFLogger.AFInAppEventParameterName("Firebase Refreshed Token = ".concat(str));
            m AFInAppEventParameterName = AFInAppEventParameterName();
            if (AFInAppEventParameterName == null || !str.equals(AFInAppEventParameterName.AFKeystoreWrapper)) {
                long currentTimeMillis = System.currentTimeMillis();
                boolean z = af.AFKeystoreWrapper(this.onAttributionFailureNative) && (AFInAppEventParameterName == null || currentTimeMillis - AFInAppEventParameterName.AFInAppEventType > TimeUnit.SECONDS.toMillis(2L));
                AFInAppEventParameterName(new m(str, currentTimeMillis, !z));
                if (z) {
                    valueOf(str);
                }
            }
        }
    }

    public void valueOf(String str) {
        Application application = this.valueOf;
        final af AFInAppEventParameterName = af.AFInAppEventParameterName();
        if (af.AFInAppEventType()) {
            AFLogger.AFInAppEventParameterName("CustomerUserId not set, Tracking is disabled", true);
            return;
        }
        String valueOf = af.valueOf(AppsFlyerProperties.AF_KEY);
        if (valueOf == null) {
            AFLogger.AFVersionDeclaration("[registerUninstall] AppsFlyer's SDK cannot send any event without providing DevKey.");
            return;
        }
        PackageManager packageManager = application.getPackageManager();
        try {
            PackageInfo packageInfo = packageManager.getPackageInfo(application.getPackageName(), 0);
            this.AFInAppEventType.put("app_version_code", Integer.toString(packageInfo.versionCode));
            this.AFInAppEventType.put("app_version_name", packageInfo.versionName);
            this.AFInAppEventType.put("app_name", packageManager.getApplicationLabel(packageInfo.applicationInfo).toString());
            long j = packageInfo.firstInstallTime;
            this.AFInAppEventType.put("installDate", af.AFInAppEventType(new SimpleDateFormat("yyyy-MM-dd_HHmmssZ", Locale.US), j));
        } catch (Throwable th) {
            AFLogger.values("Exception while collecting application version info.", th);
        }
        af.AFKeystoreWrapper(application, (Map<String, ? super String>) this.AFInAppEventType);
        String string = AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.APP_USER_ID);
        if (string != null) {
            this.AFInAppEventType.put("appUserId", string);
        }
        try {
            this.AFInAppEventType.put("model", Build.MODEL);
            this.AFInAppEventType.put(com.huawei.openalliance.ad.constant.ao.r, Build.BRAND);
        } catch (Throwable th2) {
            AFLogger.values("Exception while collecting device brand and model.", th2);
        }
        if (AppsFlyerProperties.getInstance().getBoolean(AppsFlyerProperties.DEVICE_TRACKING_DISABLED, false)) {
            this.AFInAppEventType.put(AppsFlyerProperties.DEVICE_TRACKING_DISABLED, fv.Code);
        }
        d.a.C0055d AFKeystoreWrapper = ab.AFKeystoreWrapper(application.getContentResolver());
        if (AFKeystoreWrapper != null) {
            this.AFInAppEventType.put("amazon_aid", AFKeystoreWrapper.valueOf);
            this.AFInAppEventType.put("amazon_aid_limit", String.valueOf(AFKeystoreWrapper.AFInAppEventType));
        }
        String string2 = AppsFlyerProperties.getInstance().getString("advertiserId");
        if (string2 != null) {
            this.AFInAppEventType.put("advertiserId", string2);
        }
        this.AFInAppEventType.put("devkey", valueOf);
        this.AFInAppEventType.put(CommonConstant.KEY_UID, ak.AFKeystoreWrapper(new WeakReference(application)));
        this.AFInAppEventType.put("af_gcm_token", str);
        this.AFInAppEventType.put("launch_counter", Integer.toString(af.AFInAppEventParameterName(this.onAttributionFailureNative, "appsFlyerCount", false)));
        this.AFInAppEventType.put("sdk", Integer.toString(Build.VERSION.SDK_INT));
        String AFInAppEventParameterName2 = AFInAppEventParameterName.AFInAppEventParameterName(application);
        if (AFInAppEventParameterName2 != null) {
            this.AFInAppEventType.put("channel", AFInAppEventParameterName2);
        }
        new Thread(new Runnable() {
            @Override
            public final void run() {
                try {
                    az azVar = az.this;
                    azVar.onConversionDataSuccess = AFInAppEventParameterName.isStopped();
                    HttpURLConnection values = new k(azVar).values();
                    if (values != null) {
                        if (values.getResponseCode() == 200) {
                            az.AFKeystoreWrapper(az.this);
                        }
                        values.disconnect();
                    }
                } catch (Throwable th3) {
                    AFLogger.values(th3.getMessage(), th3);
                }
            }
        }).start();
    }

    public static boolean values(@NonNull SharedPreferences sharedPreferences) {
        return sharedPreferences.getBoolean("sentRegisterRequestToAF", false);
    }

    public static void AFKeystoreWrapper(az azVar) {
        azVar.onAttributionFailureNative.edit().putBoolean("sentRegisterRequestToAF", true).apply();
        AFLogger.AFInAppEventType("Successfully registered for Uninstall Tracking");
    }

    private void AFInAppEventParameterName(m mVar) {
        this.onAttributionFailureNative.edit().putString("afUninstallToken", mVar.AFKeystoreWrapper).putLong("afUninstallToken_received_time", mVar.AFInAppEventType).putBoolean("afUninstallToken_queued", mVar.AFKeystoreWrapper()).apply();
    }
}