package xyz.stream.utils;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Process;
import java.util.Locale;
import tv.danmaku.ijk.media.player.ui.IjkPlayerRuntime;
import xyz.stream.utils.entity.AppInfoEntity;
import xyz.stream.utils.entity.CheckResultEntity;

/* JADX INFO: loaded from: classes3.dex */
public final class e {

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public static volatile e f36111o;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public Context f36112a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public String f36113b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public String f36114c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public AppInfoEntity f36115d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f36116e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public String f36117f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public boolean f36118g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public boolean f36119h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public boolean f36120i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public boolean f36121j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public boolean f36122k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public String f36123l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public Runnable f36124m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public CheckResultEntity f36125n;

    public static void a(Activity activity) {
        activity.finishAndRemoveTask();
        Process.killProcess(Process.myPid());
        System.exit(0);
    }

    public static e d() {
        if (f36111o == null) {
            synchronized (e.class) {
                try {
                    if (f36111o == null) {
                        e eVar = new e();
                        eVar.f36113b = "";
                        eVar.f36114c = "";
                        eVar.f36116e = false;
                        eVar.f36117f = "";
                        eVar.f36118g = false;
                        eVar.f36119h = false;
                        eVar.f36120i = false;
                        eVar.f36121j = true;
                        eVar.f36122k = false;
                        eVar.f36123l = "";
                        f36111o = eVar;
                    }
                } finally {
                }
            }
        }
        return f36111o;
    }

    public static String e() {
        return f0.o().q(IjkPlayerRuntime.SP_LANGUAGE, kotlinx.coroutines.y.w());
    }

    public static String f() {
        String strE = e();
        if (strE != null && strE.length() >= 2) {
            return strE.substring(0, 2);
        }
        String strW = kotlinx.coroutines.y.w();
        if (strW.length() >= 2) {
            return strW.substring(0, 2);
        }
        String language = Locale.getDefault().getLanguage();
        return language.length() >= 2 ? language.substring(0, 2) : "en";
    }

    public static boolean g(String str) {
        return (str == null || str.startsWith("http://") || str.startsWith("https://") || str.startsWith("file://") || str.startsWith("smb://") || str.startsWith("/data/") || str.startsWith("/storage") || str.startsWith("ftp://") || str.startsWith("rtsp://") || str.startsWith("rtmp://") || str.startsWith("mms://") || str.startsWith("ws://") || str.startsWith("wss://") || str.startsWith("sftp://") || str.startsWith("storage://") || str.startsWith("content://")) ? false : true;
    }

    public static boolean h() {
        return f0.o().j("sp_is_login_new", Boolean.FALSE);
    }

    public final String b() {
        String str = this.f36114c;
        if (str == null || str.isEmpty()) {
            this.f36114c = kotlinx.coroutines.y.q(this.f36112a);
        }
        return this.f36114c;
    }

    public final CheckResultEntity c() {
        CheckResultEntity checkResultEntity = this.f36125n;
        return checkResultEntity == null ? (CheckResultEntity) f0.o().k(CheckResultEntity.class, "flutter.object_checkData") : checkResultEntity;
    }

    public final void i() {
        Intent intent = new Intent();
        intent.setClassName(d().f36112a.getPackageName(), this.f36117f);
        intent.addFlags(268468224);
        d().f36112a.startActivity(intent);
        Runnable runnable = this.f36124m;
        if (runnable != null) {
            runnable.run();
        }
        Process.killProcess(Process.myPid());
        System.exit(1);
    }

    public final void j(CheckResultEntity checkResultEntity) {
        this.f36125n = checkResultEntity;
        if (checkResultEntity != null) {
            f0.o().B(checkResultEntity, "flutter.object_checkData");
        } else {
            f0.o().y("flutter.object_checkData");
        }
    }
}
