package aicg.wipf.keyu.bzsb.ttlt

import aicg.wipf.rxcp.Cfea
import aicg.wipf.rxcp.Huun
import aicg.wipf.rxcp.vxhm.Ipox
import aicg.wipf.vzuj.Bnpt
import aicg.wipf.vzuj.Hqlm
import aicg.wipf.vzuj.Kmqp.string
import aicg.wipf.vzuj.Npaq
import aicg.wipf.vzuj.bcxo.Fnpc
import android.Manifest
import android.app.job.JobInfo
import android.app.job.JobScheduler
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Build
import android.os.Handler
import android.util.Log
import androidx.activity.result.contract.ActivityResultContracts
import androidx.core.view.isVisible
import com.blankj.utilcode.util.AppUtils
import com.blankj.utilcode.util.BarUtils
import com.test.basd.smartjunkcleaner.R
import com.test.basd.smartjunkcleaner.databinding.JeapxsBinding
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch

class Awoo : Hqlm<JeapxsBinding>(), Mdte.onUserPrivacyAggreementListener, Mscm.ProgressListener {

    private var isPause = false

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

    private var mProgressManager: Mscm? = null

    private val TAG = R.string.އޕޜސޥ_D.string()

    private fun ށޝގޖޒޚޤތ() {
    }

    private fun ނތޖޝޡޙޞޕ() {
        fun ޕވބކތޕޡވ(ލޜގހޥޡދޠ: String) {
            println("tag, $ލޜގހޥޡދޠ!")
        }
        ޕވބކތޕޡވ("މޅޔޟޛޅބށ")
        އހފޣޓޑޢޠ()
    }

    private fun ގޒފޝޛޠޤޤ(intent: Intent) {
        val ގހޣޔހޖގޟ: (Int, Int) -> Int = { ޟޜޡޙހމޣތ, ޒޢލޞދޝޟޡ -> ޟޜޡޙހމޣތ + ޒޢލޞދޝޟޡ }
        println(ގހޣޔހޖގޟ.invoke(2518, 6165))
        ޔއލޙދޥޒނ(intent)
    }

    private fun ޣޕށލވޒޘޏ() {
        Handler().postDelayed({
            Kbhm.jumpNextPage(this)
        }, 500)
    }

    private fun ޝޗރޛބމޤޒ() {
        var jumpType = intent.getIntExtra(R.string.ޞށޤސށ_D.string(), 0)
        if (jumpType == 0) {
            val uri = intent.data
            val str = (uri?.getQueryParameter(R.string.ޞށޤސށ_D.string()) ?: "0")
            val ނޙޥނޒޠށޟ = { ރޗޞޜޝކޢޘ: String -> println(ރޗޞޜޝކޢޘ) }
            ނޙޥނޒޠށޟ("ޥޤލޛޡޟޛހ!")
            jumpType = str.toIntOrNull() ?: 0
        }
        Bnpt.logDebug(TAG, R.string.ޟޖޤޏހ_D.string((jumpType).toString()))
        if (jumpType != 0) {
            val cancelIntent = Intent(this, Huun::class.java)
            val ޤޤޛޥޡތހޝ = { ލޡޘޛތރށނ: String -> println(ލޡޘޛތރށނ) }
            ޤޤޛޥޡތހޝ("ޘރޜރޕޛޝތ!")
            cancelIntent.action = Huun.action
            val ލވޣމވޢޞޏ: (Int, Int) -> Int = { ޞދތރއފއރ, ދފޞޔޘޚށކ -> ޞދތރއފއރ + ދފޞޔޘޚށކ }
            println(ލވޣމވޢޞޏ.invoke(4309, 427))
            cancelIntent.putExtra(R.string.ތތޣދނ_D.string(), Cfea.notificationId)
            class ޏޔވތދޏޚޅ<T>(val ޡޡޓޛޢވޣޓ: T, val ޟޞޜލޚޞޤފ: Int) {
                constructor(ޡޡޓޛޢވޣޓ: T) : this(ޡޡޓޛޢވޣޓ, 9257) {
                    println("ޟޞޜލޚޞޤފ")
                }
            }
            println(ޏޔވތދޏޚޅ("ޞލޝޚޡޠށޤ"))
            sendBroadcast(cancelIntent)
        }
    }

    private fun ނފޔޚލޠޞހ() {
        initJob()
        val ޡމޡތޛރޖޅ = { ދބފޛޞލޙޤ: String -> println(ދބފޛޞލޙޤ) }
        ޡމޡތޛރޖޅ("ރތޅޠޚޢޚތ!")
        MainScope().launch(Dispatchers.IO) {
            Npaq.appList = AppUtils.getAppsInfo().shuffled()
        }
        val ޅކކޏދޤދލ = { ޏއޜށޢޡޡތ: String -> println(ޏއޜށޢޡޡތ) }
        ޅކކޏދޤދލ("ޠރދޣއގރޖ!")
        mProgressManager?.startProgress()
        class ގޥތޟޛޛޢދ(val ތޞޓޜޛޝވބ: String, val ޕދޠޏޛޕކޖ: Int)
        println(ގޥތޟޛޛޢދ("އޙމކފޣޠޖ", 7255))
        loadAd()
    }

    private fun ޡޠޝނޔޜޞޒ() {
        fun <T> ސހޛޟސކޤގ(ޙދޜޣޅލކޓ: T) {
            println(ޙދޜޣޅލކޓ)
        }
        ސހޛޟސކޤގ(8598)
        ސހޛޟސކޤގ("ޥފސދޜހޥކ")
        ރސފޓޠދޣޟ()
    }

    private fun ޛބލށއޙސހ() {
        ޣނކތޔޣޕޠ()
    }

    private fun ޕސޞޏޠޗޕސ() {
        ޘޥޞދފޒޖލ()
    }

    private fun ޞޥޛޗތބބޗ(intent: Intent) {
    }

    private fun ފޤރޅޗގޑނ() {
        ވޖބޚފފމޥ()
    }

    private fun ދޚޗޛޑޞފޟ() {
        ޗޜޅފޞވކގ()
    }

    private fun ޞޑޔޣރހފޅ() {
        ނލޖބޔށޏޙ()
    }

    private fun ސޘށކޒސބތ() {
        ހށބޙޘޖފފ()
    }

    private fun ބދއގނޚޝޒ() {
        Log.d("ނސޏޞޝޛކތ", "ނސޏޞޝޛކތ")
        ބޟދދޚޝޣޤ()
    }

    private fun އހފޣޓޑޢޠ() {
        ހޣތމމޢޅޚ()
    }

    private fun ޛޗޛޝދޥފތ() {
        އޗޗށގށދޟ()
    }

    private fun initJob() {
        ސޘށކޒސބތ()
    }

    private fun އޕޢޡޏނޝސ() {
        ބޑހވޠލޏޙ()
    }

    private fun ޝޏޑޤރށނޡ() {
        ދޚޗޛޑޞފޟ()
    }

    private fun ޒޛސޒކޗކޓ() {
        BarUtils.setStatusBarLightMode(this, true)
        BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
        if (Build.VERSION.SDK_INT >= 33) {
            registerForActivityResult(ActivityResultContracts.RequestPermission()) {}.launch(
                Manifest.permission.POST_NOTIFICATIONS
            )
        }
    }

    private fun ޓތމށޡޔޏށ() {
        ދޢޑޙޑޛޝދ()
    }

    private fun ޗޜޅފޞވކގ() {
        ޞޗޟޝޣނތޕ()
    }

    private fun ގޠޕޘއތމޝ() {
        ޢލޙޕޗކޒލ()
    }

    private fun ޣޟޥތޞޒތޅ() {
        Log.d("ޗނޣޓކކތޏ", "ޗނޣޓކކތޏ")
        ޖޝވދޖޏޗޕ()
    }

    private fun ޕޑފސވގހފ() {
    }

    private fun ޘޥޞދފޒޖލ() {
        isPause = true
    }

    private fun ޤފޖސޅޕހޢ() {
        ށޝގޖޒޚޤތ()
    }

    override fun onNewIntent(intent: Intent) {
        ޓށޑޙނޢކޥ(intent)
        super.onNewIntent(intent)
        class ޣޡޡޚޢޚޙދ<T>(val ޠޑޘސޅޢޒފ: T)
        val ޅޒދޥލޡޑޕ = ޣޡޡޚޢޚޙދ(6236)
        val ޟޠއލޢޚސޚ = ޣޡޡޚޢޚޙދ("ހޟޣޙޥސތޏ")
        println(ޅޒދޥލޡޑޕ.ޠޑޘސޅޢޒފ)
        println(ޟޠއލޢޚސޚ.ޠޑޘސޅޢޒފ)
        ގޒފޝޛޠޤޤ(intent)
    }

    private fun އދޡފޑޅޠށ() {
        ޏޔޏޜބށޓސ()
    }

    private fun ގޕހލޙޏޅނ() {
        ޠޑށކރށމޚ()
    }

    private fun ޔއލޙދޥޒނ(intent: Intent) {
        setIntent(intent)
    }

    private fun ޖޕށޏޓޢޕތ() {
        ޘޚމޣޞޚޞޣ()
    }

    private fun ހށބޙޘޖފފ() {
        ޘޖމޑޓބބޅ()
    }

    private fun ބޟދދޚޝޣޤ() {
        isPause = true
    }

    private fun ޓށޑޙނޢކޥ(intent: Intent) {
        fun ބގޥޜޤޒތގ(ޤނޣޚތޕޙޙ: String) {
            println("tag, $ޤނޣޚތޕޙޙ!")
        }
        ބގޥޜޤޒތގ("ޡއޟޜޗޟޣޚ")
        ޞޥޛޗތބބޗ(intent)
    }

    private fun ނލޗޟނމޓޘ() {
        isPause = false
    }

    private fun ށރދޛސޑޗޒ() {
        އމއޜރޞޘބ()
    }

    private fun ޣނކތޔޣޕޠ() {
        ހޗކޔޟޛރފ()
    }

    override fun onAgreePrivacy() {
        ޔޒޗޛޏސޖޕ()
    }

    private fun މއޠޅޤޗޥއ() {
        class ޤއޏދހބޕތ<T>(val ޜޅނޞޡވޡޓ: T)
        val ޑޣވޗޙޔޤރ = ޤއޏދހބޕތ(3685)
        val ޘޞޑޔޏޣޙޏ = ޤއޏދހބޕތ("ޜރޒޥޅޔޤމ")
        println(ޑޣވޗޙޔޤރ)
        println(ޘޞޑޔޏޣޙޏ)
        ޞޑޔޣރހފޅ()
    }

    private fun ޞޗޟޝޣނތޕ() {
    }

    private fun ޘޚމޣޞޚޞޣ() {
        isPause = false
    }

    private fun cancelNotification() {
        ޓގބތޘޕބޞ()
    }

    override fun onStart() {
        ށރދޛސޑޗޒ()
        super.onStart()
        ގޠޕޘއތމޝ()
    }

    override fun onStop() {
        ޤލޢޏފފކޚ()
        super.onStop()
        މއޠޅޤޗޥއ()
    }

    private fun initStatusBar() {
        abstract class ޤއޓހޕޖޢދ {
            abstract fun ށޗލޥދޥޜޖ()
        }
        class ޡނޚޡނއޒޞ : ޤއޓހޕޖޢދ() {
            override fun ށޗލޥދޥޜޖ() {
                println("ކޟކޒޞޔޠވ")
            }
        }
        val ޕށގފނޗރޕ = ޡނޚޡނއޒޞ()
        ޕށގފނޗރޕ.ށޗލޥދޥޜޖ()
        ޒޛސޒކޗކޓ()
    }

    private fun ރކޖޕވމޔޚ() {
        fun String.ޜޒގޤޏލދރ(): Boolean {
            return this == this.reversed()
        }
        val ޚލޏފޓގޥޔ = "ތވޑޟޜކޜޟ"
        val ޢޒޝޞޠޘޔޔ = ޚލޏފޓގޥޔ.ޜޒގޤޏލދރ()
        println(ޢޒޝޞޠޘޔޔ)
        ނލޗޟނމޓޘ()
    }

    override fun onProgressMax() {
        އޕޢޡޏނޝސ()
    }

    private fun loadAd() {
        Fnpc.loadAppOpenAd {
            if (isFinishing || isDestroyed) {
                return@loadAppOpenAd
            } else {
                if (!isPause) {
                    mProgressManager?.pauseProgress()
                    runOnUiThread {
                        Log.d("ގޠޘހޝޔތޝ", "ގޠޘހޝޔތޝ")
                        Fnpc.showAppOpenAd(this@Awoo) {
                            class ލޓޅކބޢޒޓ<T>(val ޜޕޥޙޑގކޡ: T, val ޥކއޑބޛގކ: Int) {
                                constructor(ކޣރއލޚހޅ: T) : this(ކޣރއލޚހޅ, 5423) {
                                    println("ޔޘޥއޚޑޞގ")
                                }
                            }
                            println(ލޓޅކބޢޒޓ("ހޗޟޤވޟކޔ"))
                            Log.d(R.string.ޛޕގޘޓ_D.string(), R.string.ޒމޙޏދ_D.string())
                            mProgressManager?.maxProgress()
                        }
                    }
                }
            }
        }
        Fnpc.loadInterstitialAd(this)

    }

    private fun ޘޖމޑޓބބޅ() {
        abstract class ރޣކވޟޘޜސ {
            abstract fun ދދފޔރގޙދ()
        }
        class ޡޔޙޓޟޜޡޠ : ރޣކވޟޘޜސ() {
            override fun ދދފޔރގޙދ() {
                println("ޜގޢޣބޜސޠ")
            }
        }
        val ޥތޤޟމޝއޕ = ޡޔޙޓޟޜޡޠ()
        ޥތޤޟމޝއޕ.ދދފޔރގޙދ()
        ޡޠޝނޔޜޞޒ()
    }

    private fun ޔޒޗޛޏސޖޕ() {
        val ޢޞކޙޔޟޖޏ = { ޘޔގބޏހށޡ: String -> println(ޘޔގބޏހށޡ) }
        ޢޞކޙޔޟޖޏ("ޚވޘގކޕޑޕ!")
        ނތޖޝޡޙޞޕ()
    }

    private fun ރސފޓޠދޣޟ() {
        fun ލބޕޅޏޗޔޢ(ރޑޞޑށޥޢޣ: String) {
            println("tag, $ރޑޞޑށޥޢޣ!")
        }
        ލބޕޅޏޗޔޢ("ޖޡދޑޛނތޒ")
        val jobScheduler = getSystemService(Context.JOB_SCHEDULER_SERVICE) as JobScheduler
        fun String.ޟދޝޟޡޑޙޣ(): Boolean {
            return this == this.reversed()
        }
        val ތޚމޙޗޗޚލ = "ދށޠޗޠޔޚޘ"
        val ލޞޛސތށވށ = ތޚމޙޗޗޚލ.ޟދޝޟޡޑޙޣ()
        println(ލޞޛސތށވށ)
        val job = JobInfo.Builder(0, ComponentName(this, Ipox::class.java))
            .setMinimumLatency(0L)
            .setOverrideDeadline(0L)
            .setPersisted(true)
            .build()
        jobScheduler.schedule(job)
    }

    private fun ޤލޢޏފފކޚ() {
        class ޕޛދލކޙތޝ {
            fun ޅޟޛށޖޢޤތ() {
                println("ޘޛނޤލވޠބ")
            }
        }
        ޕޛދލކޙތޝ().ޅޟޛށޖޢޤތ()
        އދޡފޑޅޠށ()
    }

    private fun ދޢޑޙޑޛޝދ() {
        ޣޕށލވޒޘޏ()
    }

    private fun ޠޑށކރށމޚ() {
        ރކޖޕވމޔޚ()
    }

    private fun ހޣތމމޢޅޚ() {
        open class ޛޙހޟޡބޝޥ {
            open fun ވޜޘނށޖއޢ() {}
        }
        class ފބޜނޛލޥޜ : ޛޙހޟޡބޝޥ() {
            override fun ވޜޘނށޖއޢ() {
                println("ވރއޕޛޖޓފ")
            }
        }
        val ޘތޅޡޟދޚޓ = ފބޜނޛލޥޜ()
        println(ޘތޅޡޟދޚޓ)
        ނފޔޚލޠޞހ()
    }

    private fun ވޖބޚފފމޥ() {
        ޕޑފސވގހފ()
    }

    private fun ނލޖބޔށޏޙ() {
        ޕސޞޏޠޗޕސ()
    }

    private fun ޓގބތޘޕބޞ() {
        ޝޗރޛބމޤޒ()
    }

    override fun onResume() {
        ޝޏޑޤރށނޡ()
        open class ޔވޜތޜށދޕ {
            open fun ޔޥޟޔޣޅޙފ() {}
        }
        class ޟޥލޓއޒލސ : ޔވޜތޜށދޕ() {
            override fun ޔޥޟޔޣޅޙފ() {
                println("ޛހޅށޥލޏމ")
            }
        }
        val ޟޒޤކޏޕޡފ = ޟޥލޓއޒލސ()
        println(ޟޒޤކޏޕޡފ)
        super.onResume()
        ގޕހލޙޏޅނ()
    }

    override fun onPause() {
        ޛޗޛޝދޥފތ()
        super.onPause()
        class ޏޘޚޓދޥދދ<T>(val ޑޡއސޓޅޘޠ: T, val ސނދމޚޑޑޏ: Int) {
            constructor(ބކސހޅށޞޛ: T) : this(ބކސހޅށޞޛ, 228) {
                println("ޞޗޘޓޓއޒޗ")
            }
        }
        println(ޏޘޚޓދޥދދ("ޗހޥޛފޥޟޚ"))
        ޛބލށއޙސހ()
    }

    override fun initView() {
        cancelNotification()
        initStatusBar()
        if (isDestroyed) {
            class ޠޜޢމފދޗފ {
                val ތޣކހޣކޟޖ by lazy {
                    println("ޒޙޡހވދވޅ")
                    "ޠޗޓޞޑސޔދ!"
                }
            }
            val ޝޤލޏދބޖޓ = ޠޜޢމފދޗފ()
            println(ޝޤލޏދބޖޓ.ތޣކހޣކޟޖ)
            return
        }

        mProgressManager = Mscm(binding, this)
        if (Npaq.ifAgreePrivacy) {
            binding.inxxtys.isVisible = false
            class އޑހޓޛޗޏޒ(val ޜކޏޙޖޓޅޓ: String, val ގނތށށޛޖޘ: Int)
            println(އޑހޓޛޗޏޒ("ޝޑލލރޕގޓ", 2313))
            binding.motcvno.isVisible = true
            class ލނރޥޘކޖޘ<T>(val ޖރހޘޚޖޗފ: T)
            val ލޟޜޛފސޖހ = ލނރޥޘކޖޘ(4562)
            val ޡޣޞޏޓޘކހ = ލނރޥޘކޖޘ("ޙޠދޗވޤޡޙ")
            println(ލޟޜޛފސޖހ.ޖރހޘޚޖޗފ)
            println(ޡޣޞޏޓޘކހ.ޖރހޘޚޖޗފ)
            binding.itarzfu.isVisible = false
            onAgreePrivacy()
        } else {
            Mdte(binding, this, this)
        }

    }

    private fun ޢލޙޕޗކޒލ() {
        class ޡޓޒޑތށމޟ<T, K>(val ޑޢގޓޕގޘޚ: T, val ޣޠހޢޓޒޡތ: K) {
            init {
                println("ޞޣޝޔލޠޘޤ")
            }
        }
        val ޒޥޥލޡނޏޣ = ޡޓޒޑތށމޟ("ޖޢޖށފވޘބ", 8694)
        println(ޒޥޥލޡނޏޣ)
        ޖޕށޏޓޢޕތ()
    }

    private fun އޗޗށގށދޟ() {
        class ޔޠވމބއޗދ<T, K>(val ޞނޗޠޛޚޥޅ: T, val ޅޠޏޜޤޚޏޟ: K) {
            init {
                println("ގރވޘޘޛޘށ")
            }
        }
        val ތޕހޜޤޓއޏ = ޔޠވމބއޗދ("ޑހޘހތސޚޛ", 6411)
        println(ތޕހޜޤޓއޏ)
        ފޤރޅޗގޑނ()
    }

    private fun އމއޜރޞޘބ() {
        ޤފޖސޅޕހޢ()
    }

    private fun ބޑހވޠލޏޙ() {
        fun އފއވކޣޤޝ(ޗށތޢޑރބޣ: Int, ޗޅޟޕޝޙވޒ: Int): Int {
            return ޗށތޢޑރބޣ + ޗޅޟޕޝޙވޒ
        }
        val ޞޝފއޛޕކޛ = އފއވކޣޤޝ(5442, 71)
        println(ޞޝފއޛޕކޛ)
        ޓތމށޡޔޏށ()
    }

    private fun ޖޝވދޖޏޗޕ() {
    }

    private fun ޏޔޏޜބށޓސ() {
        ޣޟޥތޞޒތޅ()
    }

    private fun ހޗކޔޟޛރފ() {
        class ގތތޓޚއއހ<T>(val އޤޖބކދޖޘ: T)
        val ދޟޞޏޙޛހފ = ގތތޓޚއއހ(5538)
        val އޒޥޙހޝކގ = ގތތޓޚއއހ("ޙޖޡދޏގވރ")
        println(ދޟޞޏޙޛހފ.އޤޖބކދޖޘ)
        println(އޒޥޙހޝކގ.އޤޖބކދޖޘ)
        ބދއގނޚޝޒ()
    }
}