TikTok.apk(点击下载) / C36940Ef3.java


package X;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import java.io.File;
import java.util.Locale;

/* renamed from: X.Ef3  reason: case insensitive filesystem */
public class C36940Ef3 {
    public static final String LIZ = C36940Ef3.class.getCanonicalName();
    public static final long[] LIZIZ = {300000, 900000, 1800000, 3600000, 21600000, 43200000, 86400000, 172800000, 259200000, 604800000, 1209600000, 1814400000, 2419200000L, 5184000000L, 7776000000L, 10368000000L, 12960000000L, 15552000000L, 31536000000L};

    static {
        Covode.recordClassIndex(34562);
    }

    public static int LIZ(long j) {
        if (C36912Eeb.LIZ(C36940Ef3.class)) {
            return 0;
        }
        int i2 = 0;
        while (true) {
            try {
                long[] jArr = LIZIZ;
                if (i2 >= jArr.length || jArr[i2] >= j) {
                    return i2;
                }
                i2++;
            } catch (Throwable th) {
                C36912Eeb.LIZ(th, C36940Ef3.class);
                return 0;
            }
        }
        return i2;
    }

    public static String LIZ(Context context) {
        PackageInfo packageInfo;
        ApplicationInfo applicationInfo;
        if (C36912Eeb.LIZ(C36940Ef3.class)) {
            return null;
        }
        try {
            PackageManager packageManager = context.getPackageManager();
            String packageName = context.getPackageName();
            Context LIZ2 = AnonymousClass0WE.LJJI.LIZ();
            if (C16420l5.LJIIIZ) {
                TextUtils.equals(packageName, LIZ2.getPackageName());
            }
            if (!C16420l5.LJIIIZ || !TextUtils.equals(packageName, LIZ2.getPackageName())) {
                if (C16420l5.LJIIIZ) {
                    TextUtils.equals(packageName, LIZ2.getPackageName());
                }
                if (C16420l5.LJIIIZ) {
                    TextUtils.equals(packageName, LIZ2.getPackageName());
                }
                packageInfo = packageManager.getPackageInfo(packageName, 0);
            } else {
                if (C16420l5.LIZLLL == null) {
                    C16420l5.LIZLLL = packageManager.getPackageInfo(packageName, 0);
                }
                packageInfo = C16420l5.LIZLLL;
            }
            String concat = "PCKGCHKSUM;".concat(String.valueOf(packageInfo.versionName));
            SharedPreferences LIZ3 = C13630ga.LIZ(context, "com.facebook.sdk.appEventPreferences", 0);
            String string = LIZ3.getString(concat, null);
            if (string != null && string.length() == 32) {
                return string;
            }
            String packageName2 = context.getPackageName();
            Context LIZ4 = AnonymousClass0WE.LJJI.LIZ();
            if (C16420l5.LJIIIZ) {
                TextUtils.equals(packageName2, LIZ4.getPackageName());
            }
            if (!C16420l5.LJIIIZ || !TextUtils.equals(packageName2, LIZ4.getPackageName())) {
                applicationInfo = packageManager.getApplicationInfo(packageName2, 0);
            } else {
                if (C16420l5.LIZJ == null) {
                    C16420l5.LIZJ = packageManager.getApplicationInfo(packageName2, 0);
                }
                applicationInfo = C16420l5.LIZJ;
            }
            String LIZ5 = C151215x0.LIZ(new File(applicationInfo.sourceDir));
            LIZ3.edit().putString(concat, LIZ5).apply();
            return LIZ5;
        } catch (Exception unused) {
            return null;
        } catch (Throwable th) {
            C36912Eeb.LIZ(th, C36940Ef3.class);
            return null;
        }
    }

    public static void LIZ() {
        if (!C36912Eeb.LIZ(C36940Ef3.class)) {
            try {
                C36824EdB.LIZ(EnumC36939Ef2.APP_EVENTS, LIZ, "Clock skew detected");
            } catch (Throwable th) {
                C36912Eeb.LIZ(th, C36940Ef3.class);
            }
        }
    }

    public static void LIZ(String str, C36942Ef5 ef5, String str2) {
        if (!C36912Eeb.LIZ(C36940Ef3.class) && ef5 != null) {
            try {
                Long valueOf = Long.valueOf(ef5.LIZ() - ef5.LIZIZ.longValue());
                if (valueOf.longValue() < 0) {
                    valueOf = 0L;
                    LIZ();
                }
                Long valueOf2 = Long.valueOf(ef5.LIZIZ());
                if (valueOf2.longValue() < 0) {
                    LIZ();
                    valueOf2 = 0L;
                }
                Bundle bundle = new Bundle();
                bundle.putInt("fb_mobile_app_interruptions", ef5.LIZJ);
                bundle.putString("fb_mobile_time_between_sessions", AnonymousClass0EJ.LIZ(Locale.ROOT, "session_quanta_%d", new Object[]{Integer.valueOf(LIZ(valueOf.longValue()))}));
                C36941Ef4 ef4 = ef5.LJ;
                bundle.putString("fb_mobile_launch_source", ef4 != null ? ef4.toString() : "Unclassified");
                bundle.putLong("_logTime", ef5.LIZIZ.longValue() / 1000);
                C36906EeV eeV = new C36906EeV(str, str2);
                double longValue = (double) valueOf2.longValue();
                Double.isNaN(longValue);
                eeV.LIZ(longValue / 1000.0d);
            } catch (Throwable th) {
                C36912Eeb.LIZ(th, C36940Ef3.class);
            }
        }
    }

    public static void LIZ(String str, String str2, Context context) {
        if (!C36912Eeb.LIZ(C36940Ef3.class)) {
            try {
                Bundle bundle = new Bundle();
                bundle.putString("fb_mobile_launch_source", "Unclassified");
                bundle.putString("fb_mobile_pckg_fp", LIZ(context));
                bundle.putString("fb_mobile_app_cert_hash", AnonymousClass26L.LIZ(context));
                C36906EeV eeV = new C36906EeV(str, str2);
                eeV.LIZ();
                if (C36880Ee5.LIZ() != EnumC36865Edq.EXPLICIT_ONLY) {
                    eeV.LJ();
                }
            } catch (Throwable th) {
                C36912Eeb.LIZ(th, C36940Ef3.class);
            }
        }
    }
}