导航菜单

页面标题

页面副标题

Mantra Counter v25.01 - Splash.java 源代码

正在查看: Mantra Counter v25.01 应用的 Splash.java JAVA 源代码文件

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


package com.sweetedge.mantracounter;

import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.splashscreen.SplashScreen;
import com.sweetedge.mantracounter.Authentication.Authentication;
import com.sweetedge.mantracounter.Authentication.UserWebService;
import com.sweetedge.mantracounter.group.GroupConst;
import java.util.Iterator;
import java.util.Locale;
import save_data.Const;
import sweetedge.extra.PLog;
import sweetedge.popup.PToast;
import sweetedge.preference.PSharedPreference;
import sweetedge.screen.PIntent;

public class Splash extends Activity {
    private void setAppTheme(int i) {
        AppCompatDelegate.setDefaultNightMode(i);
    }

    private void loadThemePreference() {
        int integer = PSharedPreference.getInteger(this, "THEME_LIGHT_DARK", 1);
        if (integer == 1) {
            setAppTheme(1);
        } else if (integer == 0) {
            setAppTheme(2);
        } else {
            setAppTheme(-1);
        }
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        if (getIntent().getExtras() != null) {
            Iterator<String> it = getIntent().getExtras().keySet().iterator();
            while (it.hasNext()) {
                if (it.next().equals("class")) {
                    MainActivity.NotiClass = getIntent().getExtras().get("class").toString();
                }
            }
        }
        SplashScreen.installSplashScreen(this).setKeepOnScreenCondition(new SplashScreen.KeepOnScreenCondition() {
            public boolean shouldKeepOnScreen() {
                return true;
            }
        });
        loadThemePreference();
        String string = PSharedPreference.getString(this, Const.GMAIL, "null");
        PLog.print("Splash on CeraetPhone = " + string);
        if (!string.equals("null")) {
            if (UserWebService.isNetworkAvailable(this)) {
                UserWebService.fetchData(this, true, string);
                return;
            }
            MainActivity.PrimeChecked = false;
            PSharedPreference.setBoolean(this, GroupConst.isGroup, false);
            PToast.showT(this, "No Connection ! Unable to connect with server.");
            PIntent.goNewScreenwithFinishedThis(this, MainActivity.class);
            return;
        }
        if (PSharedPreference.getString(this, "Language", "none").equals("none")) {
            PIntent.goNewScreenwithFinishedThis(this, Country.class);
            return;
        }
        setLang(PSharedPreference.getString(this, "Language", "en"));
        if (PSharedPreference.getString(this, Const.GMAIL, "null").equals("null")) {
            PIntent.goNewScreenwithFinishedThis(this, Authentication.class);
        } else {
            PIntent.goNewScreenwithFinishedThis(this, MainActivity.class);
        }
    }

    protected void setLang(String str) {
        String trim = Locale.getDefault().getDisplayCountry().trim();
        if (trim.length() > 1) {
            PSharedPreference.setString(this, "CNTY", trim);
        }
        PSharedPreference.setString(this, "Language", str);
        Locale locale = new Locale(str);
        Locale.setDefault(locale);
        Configuration configuration = new Configuration();
        configuration.locale = locale;
        getResources().updateConfiguration(configuration, getResources().getDisplayMetrics());
    }
}