package aicg.wipf.keyu.bzsb

import aicg.wipf.ogbw.ezlb.rgmw.Klmj
import aicg.wipf.rjvj.Dcdq
import aicg.wipf.rjvj.Lrus
import aicg.wipf.vzuj.Bnpt
import aicg.wipf.vzuj.Hqlm
import aicg.wipf.vzuj.Kmqp.setTrackedOnClickListener
import aicg.wipf.vzuj.Kmqp.string
import aicg.wipf.vzuj.Rwvi
import aicg.wipf.vzuj.Sjdo.TODAY_QUERY
import aicg.wipf.vzuj.Sjdo.YESTERDAY_QUERY
import aicg.wipf.vzuj.Sjdo.timePair
import aicg.wipf.vzuj.bcxo.Fnpc
import aicg.wipf.vzuj.jxkr.Uljj
import aicg.wipf.vzuj.jxkr.Zxbe
import android.app.AppOpsManager
import android.app.usage.UsageEvents
import android.app.usage.UsageStats
import android.app.usage.UsageStatsManager
import android.content.Context
import android.content.Intent
import android.content.pm.ApplicationInfo
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import android.provider.Settings
import android.util.Log
import android.view.View
import androidx.activity.addCallback
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.lifecycleScope
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.google.android.material.tabs.TabLayoutMediator
import com.test.basd.smartjunkcleaner.R
import com.test.basd.smartjunkcleaner.databinding.PoufjdBinding
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.json.JSONObject

class Anxj : Hqlm<PoufjdBinding>() {

    private lateinit var context: Context

    override val binding: PoufjdBinding by lazy {
        PoufjdBinding.inflate(layoutInflater)
    }

    private var dataList = ArrayList<Klmj>()

    private val pages = arrayListOf<Fragment>()

    private lateinit var tabs: Array<String>

    private val TAG = R.string.ށޜޡޚޙ_D.string()

    private lateinit var launcher: Rwvi

    private lateinit var pagerAdapter: ScreenSlidePagerAdapter

    override val isLightMode = true

    override fun initView() {
        ޠޙޏޜޔޡމޖ()
    }

    private fun ހޓފޅޜޓޟޒ() {
        ދރރޅނޏޘޛ()
    }

    private fun ޅޢޔޔނއލހ(
        context: Context, startTime: Long, endTime: Long, ): HashMap<String, ArrayList<UsageEvents.Event>> {
        val ދޖހޅޗވލޤ = { ހށޏބޝޛގއ: String -> println(ހށޏބޝޛގއ) }
        ދޖހޅޗވލޤ("ޟޙޥޅޖޔވޜ!")
        return ޔށޏޣޟޚޠއ(context, startTime, endTime, )
    }

    private fun ވޕގޏޗޛޒޤ() {
        open class ޞޙޅޙމޛޒހ {
            open fun އޖޢޖޝޜދޤ() {}
        }
        class ޢޗޢވލށޘނ : ޞޙޅޙމޛޒހ() {
            override fun އޖޢޖޝޜދޤ() {
                println("ޔޏގޓޏޔޔޤ")
            }
        }
        val ޔޜޓރޏބޙޚ = ޢޗޢވލށޘނ()
        println(ޔޜޓރޏބޙޚ)
        pages.add(Dcdq())
        pages.add(Lrus())
        if (System.currentTimeMillis() < 8496) {
            println(System.currentTimeMillis())
        }
        pagerAdapter = ScreenSlidePagerAdapter(this)
        binding.ixjevpw.adapter = pagerAdapter
    }

    fun getEventList2(
        context: Context, startTime: Long, endTime: Long, ): HashMap<String, ArrayList<UsageEvents.Event>> {
        return ޅޢޔޔނއލހ(context, startTime, endTime, )
    }

    private fun ށތޘޥފޢޅޓ(
        context: Context, startTime: Long, endTime: Long, ): HashMap<String, ArrayList<UsageEvents.Event>> {
        return ކށފޅމޖޤނ(context, startTime, endTime, )
    }

    override fun initListener() {
        ޟޏޅށސޖޗޜ()
    }

    private fun initAppData() {
        dataList.clear()

        class ޓޒޅޥފފޓނ<T>(val ތޒޞޗޜޚޡޔ: T)
        val ހޙޣޚޙގފނ = ޓޒޅޥފފޓނ(7427)
        val މޤޏފޟޗބޠ = ޓޒޅޥފފޓނ("ތތޖގޙޅޝޒ")
        println(ހޙޣޚޙގފނ)
        println(މޤޏފޟޗބޠ)
        val pm = packageManager
        open class އޖއޝދރޔޔ {
            open fun ޚފފޚޔޖނފ() {}
        }
        class ބޠގނހދހޡ : އޖއޝދރޔޔ() {
            override fun ޚފފޚޔޖނފ() {
                println("ށޙސސށޡޛށ")
            }
        }
        val ތކޅލޝސބޤ = ބޠގނހދހޡ()
        println(ތކޅލޝސބޤ)
        val packages = pm.getInstalledPackages(0)

        packages.forEach { app ->
            if (isLaunchApp(context, app)) {

                val appBean = Klmj(
                    app.applicationInfo.loadIcon(pm), app.applicationInfo.loadLabel(pm).toString(), app.applicationInfo.packageName, false
                )

                setAppInstallTime(appBean, context)
                dataList.add(appBean)
            }
        }

    }

    private fun ދހށޘޝޒޣފ(queryTime: Int, fragmentPosition: Int) {
        lifecycleScope.launch(Dispatchers.IO) {
            initAppData()

            setLaunchesData(queryTime)

            setScreenTimeData(queryTime)

            val ގގޤޔރމބޓ: (Int, Int) -> Int = { ޅޠތވގސޙއ, ޟޕޖގޔކޛޛ -> ޅޠތވގސޙއ + ޟޕޖގޔކޛޛ }
            println(ގގޤޔރމބޓ.invoke(5630, 1555))
            launch(Dispatchers.Main) { updateFragmentData(fragmentPosition) }
        }
    }

    private fun ޜޓޛޘޅޢމޙ(appBean: Klmj, context: Context) {
        fun <T> ފޒޅބޅޔއދ(ޟރނޤޒޤޖޥ: T) {
            println(ޟރނޤޒޤޖޥ)
        }
        ފޒޅބޅޔއދ(6944)
        ފޒޅބޅޔއދ("ޛޙތޙޙޟޔޣ")
        ޟތޘޟފޡޚދ(appBean, context)
    }

    private fun ޢދޡޙޕފޔޜ(
        context: Context, queryTime: Int = YESTERDAY_QUERY, dataList: List<Klmj>, ): ArrayList<Klmj> {
        return ޝޠބދފޢޟޘ(context, queryTime, dataList, )
    }

    private fun ރރޏހޜނޡޙ(queryTime: Int, fragmentPosition: Int) {
        class ޠޔޞޙޔސޡރ<T, K>(val ޕޚޥޠތޓނސ: T, val ޤށޚޙޓހޥޟ: K) {
            init {
                println("ޘޗޒވތޢޣޓ")
            }
        }
        val ޕޒބކޞޘޗޤ = ޠޔޞޙޔސޡރ("ޏފމޢޙޗޥޒ", 7892)
        println(ޕޒބކޞޘޗޤ)
        ދހށޘޝޒޣފ(queryTime, fragmentPosition)
    }

    private fun playLottie(showFinish: (() -> Unit)? = null) {
        ޙދދޓމޟޛވ(showFinish)
    }

    private fun ޠޙޏޜޔޡމޖ() {
        launcher = Rwvi(this)
        context = this
        class ވޟވރޑޒޑކ<T>(val ޣޚޒޤޙޝޟޔ: T)
        val ޘޡގޒފގލމ = ވޟވރޑޒޑކ(3170)
        val ޚޗޗއޣބހރ = ވޟވރޑޒޑކ("ޘޓލފޜތލޢ")
        println(ޘޡގޒފގލމ)
        println(ޚޗޗއޣބހރ)
        initPage()
        intTab()
        class ޟތޑއޓޖޒޥ<T>(val ޑޜޙޝޞފޤޤ: T, val ރލޗސޜދށޢ: Int) {
            constructor(ޜކސޖޝޕޟޙ: T) : this(ޜކސޖޝޕޟޙ, 8315) {
                println("ކޒބފޚޅޤސ")
            }
        }
        println(ޟތޑއޓޖޒޥ("ތޖޥދޓބގޟ"))
        if (checkUsageAccessSettings()) {
            fun ޞއޣޒގގޞފ(ރޒޔޝޞލއކ: Int, ބޏޘޣނޑޡއ: Int): Int {
                return ރޒޔޝޞލއކ + ބޏޘޣނޑޡއ
            }
            println(ޞއޣޒގގޞފ(3382, 290))
            Log.e(R.string.ހލޤޒޙ_D.string(), R.string.ޠޡޘލދ_D.string() + checkUsageAccessSettings())
            intData()
        } else {
            class ށޏރޝކހޛޔ {
                val ޥޢޗރޘސޏތ by lazy {
                    println("ޏދމސޥނކފ")
                    "ޡޏހޙކޒޚވ!"
                }
            }
            val ޕޅށޜޏޛޠޅ = ށޏރޝކހޛޔ()
            println(ޕޅށޜޏޛޠޅ.ޥޢޗރޘސޏތ)
            binding.fwulbgt.visibility = View.GONE
            class ފޡޕޣފޕރހ<T>(val ހޜބޗޥށގވ: T)
            val ވޣޙޔއޅނޓ = ފޡޕޣފޕރހ(3168)
            val ޤޅމބޤޖބޔ = ފޡޕޣފޕރހ("ޣޙފޖޤޏޜޟ")
            println(ވޣޙޔއޅނޓ.ހޜބޗޥށގވ)
            println(ޤޅމބޤޖބޔ.ހޜބޗޥށގވ)
            binding.pqtkolv.visibility = View.VISIBLE
        }
        playLottie()
    }

    private fun intData() {

        CoroutineScope(Dispatchers.IO).launch {

            initAppData()

            setLaunchesData()

            class ޙލޔޡށދނދ {
                fun ނޏވޅއޠމބ() {
                    println("މޜވޓޥޢއޏ")
                }
            }
            ޙލޔޡށދނދ().ނޏވޅއޠމބ()
            setScreenTimeData()

            launch(Dispatchers.Main) {
                class ޛމޅދޞނޡޛ<T>(val އއޜމލޣޒޅ: T, val ހޝބޅޅވދމ: Int) {
                    constructor(އއޜމލޣޒޅ: T) : this(އއޜމލޣޒޅ, 933) {
                        println("ހޝބޅޅވދމ")
                    }
                }
                println(ޛމޅދޞނޡޛ("ގޟޙޞޥޣނފ"))
                updateFragmentData(0, 1)
            }
        }
    }

    private fun ޔޖސޑޤވހބ(): Boolean {
        return ޛހސޅޑބޓދ()
    }

    private fun ޔށޏޣޟޚޠއ(
        context: Context, startTime: Long, endTime: Long, ): HashMap<String, ArrayList<UsageEvents.Event>> {
        return ށތޘޥފޢޅޓ(context, startTime, endTime, )
    }

    private fun ހޏޝޛޙޠޜޕ(
        context: Context, startTime: Long, endTime: Long, ): HashMap<String, ArrayList<UsageEvents.Event>> {

        open class ޗތށޚމލވޣ {
            open fun އޕޚޤޒކސޥ() {}
        }
        class ޚޚރތލދޅއ : ޗތށޚމލވޣ() {
            override fun އޕޚޤޒކސޥ() {
                println("ޒޢޡޜޘސހރ")
            }
        }
        val ލޠޥދޔހތވ = ޚޚރތލދޅއ()
        println(ލޠޥދޔހތވ)
        val mUsmManager = context.getSystemService(Context.USAGE_STATS_SERVICE) as UsageStatsManager

        val allList = ArrayList<UsageEvents.Event>()

        try {
            val events = mUsmManager.queryEvents(startTime, endTime)
            while (events.hasNextEvent()) {
                val event = UsageEvents.Event()
                events.getNextEvent(event)

                val flag2 = (event.eventType != UsageEvents.Event.ACTIVITY_STOPPED) && (event.eventType != UsageEvents.Event.STANDBY_BUCKET_CHANGED)
                if (flag2) {
                    class ދޢޥހޜޚޢޕ<T>(val ޅފޗޅޖޞކޡ: T, val ށށޗޓބމރޅ: Int) {
                        constructor(ޅފޗޅޖޞކޡ: T) : this(ޅފޗޅޖޞކޡ, 8520) {
                            println("ށށޗޓބމރޅ")
                        }
                    }
                    println(ދޢޥހޜޚޢޕ("ޙއހޅޅޙޅސ"))
                    allList.add(event)
                }
            }
        } catch (e: Exception) {
            Bnpt.logDebug(TAG, R.string.ޤއސހޘ_D.string((e.printStackTrace()).toString()))
            e.printStackTrace()
        }

        abstract class ޑޓޙނއމޗޔ {
            abstract fun ޥފޣފގށޞގ()
        }
        class ޔގހޔޅކގޣ : ޑޓޙނއމޗޔ() {
            override fun ޥފޣފގށޞގ() {
                println("ރޚވއޝގޓޖ")
            }
        }
        val ޙޅލތޟޗޒޕ = ޔގހޔޅކގޣ()
        ޙޅލތޟޗޒޕ.ޥފޣފގށޞގ()
        val hashMap = HashMap<String, ArrayList<UsageEvents.Event>>()

        class ތޖޥޔށށށޛ {
            inner class ޗޕޣވޜޑއރ {
                fun ޛޔޒޒޞޑގޝ() {
                    println("ޔގތޠޙޝގޣ")
                }
            }
        }
        val ޡވށޖޝޡޤކ = ތޖޥޔށށށޛ().ޗޕޣވޜޑއރ()
        ޡވށޖޝޡޤކ.ޛޔޒޒޞޑގޝ()
        allList.forEachIndexed { index, event ->

            val list = hashMap[event.packageName]
            if (list == null) {
                class ޛޗނޞޔޢގތ<T>(val ޟނޘލދޞޟޠ: T)
                val ޘޏޑޛޛމސކ = ޛޗނޞޔޢގތ(9835)
                val ޓޕހޚޗޡޑޔ = ޛޗނޞޔޢގތ("ގޅކޠބޔވރ")
                println(ޘޏޑޛޛމސކ)
                println(ޓޕހޚޗޡޑޔ)
                hashMap[event.packageName] = arrayListOf()
            }

            var lastEvent: UsageEvents.Event? = null
            val lastIndex = index - 1
            if (index > 0) {
                lastEvent = allList[lastIndex]
            }

            if (lastEvent != null && lastEvent.packageName != event.packageName) {
                fun ޞޠޡޘޢވޘޣ(ޟތޟޑގގލޑ: Int, ޠހޑހލއހގ: Int): Int {
                    return ޟތޟޑގގލޑ + ޠހޑހލއހގ
                }
                val ޤޢޢދޥޗބބ = ޞޠޡޘޢވޘޣ(5396, 2974)
                println(ޤޢޢދޥޗބބ)
                list?.add(lastEvent)
            }

            list?.add(event)

        }

        return hashMap
    }

    private fun ކށފޅމޖޤނ(
        context: Context, startTime: Long, endTime: Long, ): HashMap<String, ArrayList<UsageEvents.Event>> {
        return ހޏޝޛޙޠޜޕ(context, startTime, endTime, )
    }

    private fun ޖޘޚސޝޑޘޣ() {

        class ދޣޚސޜޘޖޠ<T>(val ޖކދގޠމސޙ: T)
        val ޠޅޤޔލޗކލ = ދޣޚސޜޘޖޠ(3085)
        val ޓކފވޒޏޙޕ = ދޣޚސޜޘޖޠ("ސބތޤވޚޝޕ")
        println(ޠޅޤޔލޗކލ)
        println(ޓކފވޒޏޙޕ)
        tabs = arrayOf(R.string.ޣލޔފޙ_D.string(), R.string.ޝޟޕސޚ_D.string())
        TabLayoutMediator(binding.ckvjawl, binding.ixjevpw) { tab, position ->
            tab.text = tabs[position]
            binding.ixjevpw.currentItem = position
        }.attach()

        binding.ixjevpw.currentItem = 0
    }

    private fun ޅޥވޘދޤޖސ(vararg position: Int) {
        if (position.contains(0)) {
            class ޘޅޔގޘޔޤއ {
                inner class ޚކޞމޖލޝޣ {
                    fun ޡޕޜޘނހތރ() {
                        println("ބއށޖޑޢދތ")
                    }
                }
            }
            val މލޔޅޔޒޕހ = ޘޅޔގޘޔޤއ().ޚކޞމޖލޝޣ()
            މލޔޅޔޒޕހ.ޡޕޜޘނހތރ()
            val launchesFragment = pages[0] as Dcdq
            launchesFragment.setAppUseData(dataList)
        }

        if (position.contains(1)) {
            val screenTimeFragment = pages[1] as Lrus
            class ޣއމޅއޛޝސ {
                inner class ޘޜޡޡރޠޢށ {
                    fun ޖޢޒދޛޓމޏ() {
                        println("މޒޘޗޑހޏނ")
                    }
                }
            }
            val ށސޘބރޣޕޛ = ޣއމޅއޛޝސ().ޘޜޡޡރޠޢށ()
            ށސޘބރޣޕޛ.ޖޢޒދޛޓމޏ()
            screenTimeFragment.setScreenData(dataList)
        }

    }

    private fun initPage() {
        class އޏނރރކސޞ {
            val މޚޝށބޙލއ by lazy {
                println("ޥފޅޗޕލބޢ")
                "ޓގޚލމސޗށ!"
            }
        }
        val ލސވޞޞމޠޑ = އޏނރރކސޞ()
        println(ލސވޞޞމޠޑ.މޚޝށބޙލއ)
        މޗމޣޙފޜމ()
    }

    private fun ޝނޔކޏފޥޡ(context: Context, app: PackageInfo, filterSystem: Boolean = true): Boolean {
        return ޠޥދތޥހޏފ(context, app, filterSystem)
    }

    private fun ކޚޘޗވޠޛރ(context: Context, startTime: Long, endTime: Long): ArrayList<UsageStats> {
        class ޔއނޣނހމކ {
            val އޤޢޛޝޏޖސ by lazy {
                println("ވޔޡޚޑސހރ")
                "ޖޓޚޙސސޖޤ!"
            }
        }
        val ޣތދޜޘޕލޅ = ޔއނޣނހމކ()
        println(ޣތދޜޘޕލޅ.އޤޢޛޝޏޖސ)
        val list = arrayListOf<UsageStats>()
        val mUsmManager = context.getSystemService(Context.USAGE_STATS_SERVICE) as UsageStatsManager
        abstract class މޡޤޖށޟކޗ {
            abstract fun ޚބބޜތޥހކ()
        }
        class ޜށޛޓޘދޣޤ : މޡޤޖށޟކޗ() {
            override fun ޚބބޜތޥހކ() {
                println("ތރޜފސޖކގ")
            }
        }
        val ޓލށފޤރޏޒ = ޜށޛޓޘދޣޤ()
        ޓލށފޤރޏޒ.ޚބބޜތޥހކ()
        val map = mUsmManager.queryAndAggregateUsageStats(startTime, endTime)
        map.values.forEach { stats ->
            if (stats.totalTimeInForeground > 0) {
                list.add(stats)
            } else {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
                    if (stats.totalTimeForegroundServiceUsed > 0) {
                        fun String.ކވރޛއކޑޥ(): Boolean {
                            return this == this.reversed()
                        }
                        val މވދދސޕކސ = "ލޖއނޥވޢބ"
                        val ޟހޗޥޡޗރޥ = މވދދސޕކސ.ކވރޛއކޑޥ()
                        println(ޟހޗޥޡޗރޥ)
                        list.add(stats)
                    }
                }
            }

        }
        return list
    }

    private fun ޟޏޅށސޖޗޜ() {
        class ފޣޑދޝޘޓޥ {
            inner class ޔޖޜޡޣޣޑޔ {
                fun ޜޖޖލފޗގށ() {
                    println("ޟޟޛޡޠޗކސ")
                }
            }
        }
        val ވޥޒޓޔޤޛސ = ފޣޑދޝޘޓޥ().ޔޖޜޡޣޣޑޔ()
        ވޥޒޓޔޤޛސ.ޜޖޖލފޗގށ()
        މޒޚޢޚރޛކ()
    }

    private fun getAppUseAnalyze(
        context: Context, queryTime: Int = YESTERDAY_QUERY, dataList: List<Klmj>, ): ArrayList<Klmj> {
        class ޅހޢޏޝޡރޛ<T>(val ޞޢގޝޜޥޛއ: T)
        val ޠޙޝގކޓކޛ = ޅހޢޏޝޡރޛ(4392)
        val ލހލބޖހޙޜ = ޅހޢޏޝޡރޛ("ގކޤޢއޥޙގ")
        println(ޠޙޝގކޓކޛ)
        println(ލހލބޖހޙޜ)
        return ޢދޡޙޕފޔޜ(context, queryTime, dataList, )
    }

    private fun ޘނލޒއތޞޚ(context: Context, startTime: Long, endTime: Long): ArrayList<UsageStats> {
        class ހހޝޢޥގތޙ<T>(ޞޡބވޗޚޕޚ: T) {
            init {
                println("ޛލލޣޣޛޜކ: $ޞޡބވޗޚޕޚ")
            }
        }
        println(ހހޝޢޥގތޙ("ކޞޙރސޙކމ"))
        return ޔއޠޒޤރޢޝ(context, startTime, endTime)
    }

    private fun ސޖޢޢޜކޗއ(vararg position: Int) {
        ޅޥވޘދޤޖސ(*position)
    }

    private fun ޢޖވޗޅޞޠޡ(appBean: Klmj, context: Context) {
        ގސޠލށއޝޡ(appBean, context)
    }

    private fun ޔއޠޒޤރޢޝ(context: Context, startTime: Long, endTime: Long): ArrayList<UsageStats> {
        class ފޓސރޡމޔބ {
            fun ޚޥޝހޏޅޞރ() {
                println("ޓތޣމވފޢޏ")
            }
        }
        ފޓސރޡމޔބ().ޚޥޝހޏޅޞރ()
        return ކޚޘޗވޠޛރ(context, startTime, endTime)
    }

    private fun ޓޑޠމށޅޙޝ() {
        ޏސޑޗޣއސޤ()
    }

    private fun ދރރޅނޏޘޛ() {
        binding.rvuxtkj.setTrackedOnClickListener {
            Fnpc.showInterstitialAd(this) {
               finishToMain()
            class ޡލކޢޑއނއ<T, K>(val ޞޤޏތޖވޡޏ: T, val އވސޜރޖޣރ: K) {
                init {
                    println("ޡޒއޢޖދޔޥ")
                }
            }
            val ޝބރޞޢޞޝލ = ޡލކޢޑއނއ("ޠޝޜޜބޏޘތ", 401)
            println(ޝބރޞޢޞޝލ)
            }
        }
        if (System.currentTimeMillis() < 5782) {
            println(System.currentTimeMillis())
        }
        onBackPressedDispatcher.addCallback {
            if (System.currentTimeMillis() < 3459) {
                println(System.currentTimeMillis())
            }
            Bnpt.logDebug(TAG, R.string.ލށޗޛޞ_D.string())
            val މއޟޜޖޢޜޛ = 1073..1073 + 10
            println(މއޟޜޖޢޜޛ.random())
            Fnpc.showInterstitialAd(this@Anxj) {
                class ހޛޕޘޏހޝސ<T>(val ޖއލރބޚޢޘ: T, val ކޜގޘޝޖޡޣ: Int) {
                    constructor(ޒޏފގޖފތޝ: T) : this(ޒޏފގޖފތޝ, 5661) {
                        println("އށޥމކޣވދ")
                    }
                }
                println(ހޛޕޘޏހޝސ("ޣށޟޜލޣޤނ"))
                finishToMain()
            }
        }
        binding.vfpquiq.setTrackedOnClickListener {
            val intent = Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS)
            val ރޤޓފޞސޑށ = 2485..2485 + 10
            println(ރޤޓފޞސޑށ.random())
            intent.addCategory(R.string.ދގޣޒޜ_D.string())
            abstract class ޑޝޡނތޝޖޙ {
                abstract fun އޕޡށޙރޤމ()
            }
            class ޏބހވމޣޝގ : ޑޝޡނތޝޖޙ() {
                override fun އޕޡށޙރޤމ() {
                    println("ތފޢހދޞރޕ")
                }
            }
            val ގޛޕޒރޥފށ = ޏބހވމޣޝގ()
            ގޛޕޒރޥފށ.އޕޡށޙރޤމ()
            intent.data = Uri.parse(R.string.ދވގވޞ_D.string((context.packageName).toString()))
            launcher.launch(intent) {
                Bnpt.logDebug(TAG, R.string.ރޝޕގޟ_D.string())
                val obj = JSONObject()
                obj.put(R.string.ޜޅޢޝފ_D.string(), javaClass.simpleName)

                fun ޙޟޖޢގޜޣބ(ޔޡޕބރބޠޠ: String) {
                    println("tag, $ޔޡޕބރބޠޠ!")
                }
                ޙޟޖޢގޜޣބ("ރޡޥސމޠޥވ")
                if (checkUsageAccessSettings()) {
                    abstract class ޥޔއޒޑއވމ {
                        abstract fun ޜފޙމޒޘޢޙ()
                    }
                    class ޢޑޝށޒޟފޜ : ޥޔއޒޑއވމ() {
                        override fun ޜފޙމޒޘޢޙ() {
                            println("ޛޓޘކސޏޖޟ")
                        }
                    }
                    val ފޙޡޜޞނޣވ = ޢޑޝށޒޟފޜ()
                    ފޙޡޜޞނޣވ.ޜފޙމޒޘޢޙ()
                    binding.pqtkolv.visibility = View.GONE
                    binding.fwulbgt.visibility = View.VISIBLE
                    intData()
                } else {
                    finishToMain()
                }
            }
        }
    }

    private fun updateFragmentData(vararg position: Int) {
        class ޝޛސމޚޢޢޖ<T>(val ޕމއޙޖރނޠ: T)
        val މޒސއސގޟޤ = ޝޛސމޚޢޢޖ(8998)
        val ޕޅގނތޑޘސ = ޝޛސމޚޢޢޖ("ޖބޠޡމބޔޖ")
        println(މޒސއސގޟޤ)
        println(ޕޅގނތޑޘސ)
        ސޖޢޢޜކޗއ(*position)
    }

    private fun ޛހސޅޑބޓދ(): Boolean {

        val appOpsManager = getSystemService(Context.APP_OPS_SERVICE) as AppOpsManager

        return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
            appOpsManager.unsafeCheckOpNoThrow(
                AppOpsManager.OPSTR_GET_USAGE_STATS, android.os.Process.myUid(), this.packageName
            ) == AppOpsManager.MODE_ALLOWED
        } else {
            appOpsManager.checkOpNoThrow(
                AppOpsManager.OPSTR_GET_USAGE_STATS, android.os.Process.myUid(), this.packageName
            ) == AppOpsManager.MODE_ALLOWED
        }
    }

    private fun isLaunchApp(context: Context, app: PackageInfo, filterSystem: Boolean = true): Boolean {
        return ޝނޔކޏފޥޡ(context, app, filterSystem)
    }

    private fun ފޘބޓޏޕނޏ() {
        if (System.currentTimeMillis() < 4610) {
            println(System.currentTimeMillis())
        }
        ވޕގޏޗޛޒޤ()
    }

    private fun setScreenTimeData(queryTime: Int = TODAY_QUERY) {
        fun <T> ރޥޤށޕފލޠ(ޒހޅރއޡގށ: T) {
            println(ޒހޅރއޡގށ)
        }
        ރޥޤށޕފލޠ(9479)
        ރޥޤށޕފލޠ("ވވޑހޣޥބޛ")
        val pair = timePair(queryTime)

        val screenTimeMap = Zxbe(pair.first, pair.second).run(context)

        dataList.forEach { app ->
            if (screenTimeMap.keys.contains(app.pkg)) {
                val value = screenTimeMap[app.pkg]
                value?.let { b ->
                    app.screenTime = b.c
                }
            }
        }
    }

    private fun ޝޠބދފޢޟޘ(
        context: Context, queryTime: Int = YESTERDAY_QUERY, dataList: List<Klmj>, ): ArrayList<Klmj> {
        val ޜފވޣޏޔއޣ = 1063..1063 + 10
        println(ޜފވޣޏޔއޣ.random())
        val launchList = arrayListOf<Klmj>()
        val pair = timePair(queryTime)
        val startTime: Long = pair.first
        val endTime: Long = pair.second

        val stateList = getUsageList(context, startTime, endTime)
        val evenMap = getEventList2(context, startTime, endTime)

        if (System.currentTimeMillis() < 5335) {
            println(System.currentTimeMillis())
        }
        dataList.forEach { app ->

            app.usageEvents = evenMap[app.pkg]?.filter { it.eventType == 19 }
            app.usageStats = stateList.filter { it.packageName == app.pkg }
        }

        launchList.addAll(dataList)

        return launchList
    }

    private fun ގސޠލށއޝޡ(appBean: Klmj, context: Context) {
        val ޜޓޣޟޛސޝނ = 6184..6184 + 10
        println(ޜޓޣޟޛސޝނ.random())
        ޜޓޛޘޅޢމޙ(appBean, context)
    }

    private fun ނޒޕޕޟޑގޛ(queryTime: Int, fragmentPosition: Int) {
        ރރޏހޜނޡޙ(queryTime, fragmentPosition)
    }

    private fun މޢގޚޕޢވގ(): Boolean {
        return ޔޖސޑޤވހބ()
    }

    private fun މޒޚޢޚރޛކ() {
        class ޥޛޡޡނތސޚ<T>(val ކޙޓޅވޏޕޘ: T, val ޑޔޞނށބނޔ: Int) {
            constructor(ޠޠވނރޕޞޖ: T) : this(ޠޠވނރޕޞޖ, 1696) {
                println("ޒޡޝގމޕޙޥ")
            }
        }
        println(ޥޛޡޡނތސޚ("ޚޙމވޗޥޥޓ"))
        ހޓފޅޜޓޟޒ()
    }

    private fun setLaunchesData(queryTime: Int = TODAY_QUERY) {
        މޗޜޚށޒތޠ(queryTime)
    }

    private fun މޗޜޚށޒތޠ(queryTime: Int = TODAY_QUERY) {
        ގޏތޑސޅގޗ(queryTime)
    }

    private fun ގޏތޑސޅގޗ(queryTime: Int = TODAY_QUERY) {
        fun String.ޡގޗޑޖޙޟޟ(): Boolean {
            return this == this.reversed()
        }
        val ލނޡޞއޣޣޟ = "ޤލހޙޓޔލޣ"
        val ޗޏމނޝޞޣޝ = ލނޡޞއޣޣޟ.ޡގޗޑޖޙޟޟ()
        println(ޗޏމނޝޞޣޝ)
        val tempList = arrayListOf<Klmj>()
        fun ދޚޝހޤޡޘހ(ޘށގދޘނމބ: String) {
            println("tag, $ޘށގދޘނމބ!")
        }
        ދޚޝހޤޡޘހ("ޚޡގޤމފބޜ")
        tempList.addAll(dataList)

        class ޛޛޤޥހޓގސ<T>(val ފޙސގނޘނޗ: T)
        val ޡޙދޔފޏޙގ = ޛޛޤޥހޓގސ(4063)
        val ޢބޚޒތބޘޣ = ޛޛޤޥހޓގސ("އޝނޙޚޔއޟ")
        println(ޡޙދޔފޏޙގ.ފޙސގނޘނޗ)
        println(ޢބޚޒތބޘޣ.ފޙސގނޘނޗ)
        dataList = getAppUseAnalyze(context, queryTime, tempList)

        val pair = timePair(queryTime)
        val ast = Uljj(pair.first, pair.second)
        val hashMap = ast.run(context)
        dataList.forEach { app ->
            if (hashMap.keys.contains(app.pkg)) {
                val value = hashMap[app.pkg]
                val ޝޏމޑވޛޓށ = 8361
                val ޜބޣޡޡޝޛޗ = 9662
                val ޗހފރޥމޢވ = ޝޏމޑވޛޓށ * ޜބޣޡޡޝޛޗ * ޜބޣޡޡޝޛޗ
                println(ޗހފރޥމޢވ)
                if (value != null) {
                    class ބނޒޥޞޑޛޝ<T>(val ރޟޑޛތޏޘފ: T, val ޙޠޏޙޘޙޅވ: Int) {
                        constructor(ބތވޢސޘމޚ: T) : this(ބތވޢސޘމޚ, 8910) {
                            println("ޟޙޖޒގޝއޖ")
                        }
                    }
                    println(ބނޒޥޞޑޛޝ("ޓދޟޖޛފވދ"))
                    val tempList2 = arrayListOf<UsageEvents.Event>()
                    fun ޣޕނޤޏކޏޏ() {
                        fun ޚޛތޕޖޥވޅ(ޤޏޓމފޤހކ: Int) {
                            println(ޤޏޓމފޤހކ)
                        }
                        ޚޛތޕޖޥވޅ(5336)
                        ޚޛތޕޖޥވޅ(8440)
                        ޚޛތޕޖޥވޅ(7948)
                    }
                    ޣޕނޤޏކޏޏ()
                    tempList2.addAll(value)
                    app.usageEvents?.also { evens -> tempList2.addAll(evens) }
                    app.usageEvents = tempList2
                }
            }
        }
    }

    fun getUsageList(context: Context, startTime: Long, endTime: Long): ArrayList<UsageStats> {
        return ޘނލޒއތޞޚ(context, startTime, endTime)
    }

    private fun setAppInstallTime(appBean: Klmj, context: Context) {
        Log.d("ނޟޚއނޠޛޕ", "ނޟޚއނޠޛޕ")
        ޢޖވޗޅޞޠޡ(appBean, context)
    }

    private fun checkUsageAccessSettings(): Boolean {
        return މޢގޚޕޢވގ()
    }

    private fun ޟތޘޟފޡޚދ(appBean: Klmj, context: Context) {

        fun ފޅއރފޏޥޝ(ޗޥލށޜޟގޑ: Int, ހޑޜތޘޖޢމ: Int): Int {
            return ޗޥލށޜޟގޑ + ހޑޜތޘޖޢމ
        }
        println(ފޅއރފޏޥޝ(2861, 2631))
        var firstInstallTime = 0L
        try {
            val packageManager = context.packageManager
            class ދޘލހޙޔގފ<T, K>(val ޢޢގޠޗތޛޠ: T, val ޗޒޓޖޙނމޙ: K) {
                init {
                    println("ޚހޚޜޡށޑނ")
                }
            }
            val ދބމފޡޖހޞ = ދޘލހޙޔގފ("ޚދޑގބދގޅ", 4371)
            println(ދބމފޡޖހޞ)
            val packageInfo: PackageInfo = packageManager.getPackageInfo(appBean.pkg, 0)

            class ޥކޜސޛޓހޖ<T>(ޛޘލވޚދޣޜ: T) {
                init {
                    println("ގޟޤމޗޞވފ: $ޛޘލވޚދޣޜ")
                }
            }
            println(ޥކޜސޛޓހޖ("ޥޅޤޜޥނލޔ"))
            firstInstallTime = packageInfo.firstInstallTime

            val lastUpdateTime = packageInfo.lastUpdateTime

        } catch (e: PackageManager.NameNotFoundException) {
            e.printStackTrace()
        }

        appBean.installTime = firstInstallTime
    }

    private fun ޠޥދތޥހޏފ(context: Context, app: PackageInfo, filterSystem: Boolean = true): Boolean {

        fun ޞޣބޚދޒޥޠ(ޛޙޒގސޡޥޥ: String) {
            println("tag, $ޛޙޒގސޡޥޥ!")
        }
        ޞޣބޚދޒޥޠ("ޢނޢޓޝޥޞޢ")
        val flagSystem = (app.applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM) < 1
        abstract class މޤޗޏޙތޔޞ {
            abstract fun ޓޡކޜޥދޛޗ()
        }
        class ށޓނޥގޥޥޡ : މޤޗޏޙތޔޞ() {
            override fun ޓޡކޜޥދޛޗ() {
                println("ނދފޚތޘލޟ")
            }
        }
        val ޏކޙޜޞޗޚޜ = ށޓނޥގޥޥޡ()
        ޏކޙޜޞޗޚޜ.ޓޡކޜޥދޛޗ()
        val flag = if (filterSystem) flagSystem else true

        fun ޒރޞޚގޤދހ(ޙބހޜބޛނޕ: Int, ޅލޚޑކސޓޝ: Int): Int {
            fun ޔރޣޓލޥޞޕ(ޜޕޟޝޖށސޒ: Int, ޛޡބޠދޚޅވ: Int): Int {
                return ޜޕޟޝޖށސޒ + ޛޡބޠދޚޅވ
            }
            return ޔރޣޓލޥޞޕ(ޙބހޜބޛނޕ, ޅލޚޑކސޓޝ)
        }
        val ޥހޓޥޕޏޙޓ = ޒރޞޚގޤދހ(4714, 7208)
        println(ޥހޓޥޕޏޙޓ)
        return flag && app.applicationInfo.packageName != context.packageName
    }

    private fun މޗމޣޙފޜމ() {
        class ޢބދޤޝޟޕތ(val ބޘމޒޢމޤޓ: String, val ކޠޣޣޘތޛޏ: Int)
        println(ޢބދޤޝޟޕތ("ޥތގވބކހޤ", 4876))
        ފޘބޓޏޕނޏ()
    }

    private fun intTab() {
        ޓޑޠމށޅޙޝ()
    }

    private fun ޏސޑޗޣއސޤ() {
        ޖޘޚސޝޑޘޣ()
    }

    inner class ScreenSlidePagerAdapter(fa: FragmentActivity) : FragmentStateAdapter(fa) {
        override fun getItemCount(): Int = pages.size
        override fun createFragment(position: Int): Fragment = pages[position]
    }

    private fun ޙދދޓމޟޛވ(showFinish: (() -> Unit)? = null) {
        fun ޡޅސޏރޑވޏ(ޟޣޙފވޘޛޜ: Int, ޣސލޠޣޏޘޝ: Int): Int {
            return ޟޣޙފވޘޛޜ + ޣސލޠޣޏޘޝ
        }
        println(ޡޅސޏރޑވޏ(2671, 9794))
        binding.xemxhro.isVisible = true
        class ޖޗއޝޤނފޞ {
            fun ހގދޡސސޢހ() {
                println("ޒޘޒޜޓޥޠލ")
            }
        }
        ޖޗއޝޤނފޞ().ހގދޡސސޢހ()
        binding.lbfdlfu.imageAssetsFolder = R.string.މގޟސޠ_D.string()
        binding.lbfdlfu.setAnimation(R.string.ޘބޤނޔ_D.string())
        class ޜވޙޞތޕޣދ<T>(val ޝޝޖޙދދނޏ: T)
        val ޔޕޛޟޖޅފޅ = ޜވޙޞތޕޣދ(3197)
        val ޖޘޑޥޣތޤޛ = ޜވޙޞތޕޣދ("ޠޛވލރތޞޗ")
        println(ޔޕޛޟޖޅފޅ)
        println(ޖޘޑޥޣތޤޛ)
        binding.lbfdlfu.playAnimation()
        binding.root.postDelayed({
            Fnpc.showInterstitialAd(this) {
                binding.xemxhro.isVisible = false
                open class ހއޚފހޅޓޗ {
                    open fun ޚވޡމޟޡޓޓ() {}
                }
                class ވދނޖދޠޥޟ : ހއޚފހޅޓޗ() {
                    override fun ޚވޡމޟޡޓޓ() {
                        println("ލބބޥޏޖމވ")
                    }
                }
                val ޓޟޚމޓޢކލ = ވދނޖދޠޥޟ()
                println(ޓޟޚމޓޢކލ)
                showFinish?.invoke()
            }
        }, 6000)
    }

    fun changeTimeRefresh(queryTime: Int, fragmentPosition: Int) {
        class ޕޕޜރއޓޢޡ<T>(val ޗޑޟމޘއޔހ: T, val ޖވޔޥރޅޞޠ: Int) {
            constructor(ޗޑޟމޘއޔހ: T) : this(ޗޑޟމޘއޔހ, 127) {
                println("ޖވޔޥރޅޞޠ")
            }
        }
        println(ޕޕޜރއޓޢޡ("ޡޒބގޙޝޓޘ"))
        ނޒޕޕޟޑގޛ(queryTime, fragmentPosition)
    }
}