package aicg.wipf

import aicg.wipf.keyu.bzsb.ttlt.Awoo
import aicg.wipf.rxcp.Ilmt.Companion.initBroadcast
import aicg.wipf.rxcp.vxhm.Ipox
import aicg.wipf.rxcp.vxhm.Mmii
import aicg.wipf.vzuj.Hjif.requestCfg
import aicg.wipf.vzuj.Kmqp.string
import aicg.wipf.vzuj.Npaq
import aicg.wipf.vzuj.Pens
import aicg.wipf.vzuj.Qqmq
import aicg.wipf.vzuj.bcxo.Fnpc
import android.app.Activity
import android.app.job.JobInfo
import android.app.job.JobScheduler
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.util.Log
import com.blankj.utilcode.util.ActivityUtils
import com.blankj.utilcode.util.AppUtils
import com.google.android.gms.ads.MobileAds
import com.google.android.gms.ads.identifier.AdvertisingIdClient
import com.google.firebase.FirebaseApp
import com.test.basd.smartjunkcleaner.R
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch

class Cyzi : Qqmq() {

    private fun ޓލޏށޛޚޡލ() {
        ޔށގޗޕޙޞގ()
    }

    private fun ޔށގޗޕޙޞގ() {
        ޗކޙގހޚޜޙ()
    }

    companion object {
        var PAUSED_VALUE = 0
    }

    override fun init() {
        ޡލލޣޔޘޢތ()
    }

    private fun ހޟޠއޏކއޔ() {
        val ނށބޑތޣޢފ = { ޔށށޠނޘޣޓ: String -> println(ޔށށޠނޘޣޓ) }
        ނށބޑތޣޢފ("ޢޔބޏޏމޔބ!")
        registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
            private var count = 0
            override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
                fun ދޥޛޔކޥޣޣ(ފޛވދޙޓވޗ: Int, ފށޓރޙފވޥ: Int): Int {
                    return ފޛވދޙޓވޗ + ފށޓރޙފވޥ
                }
                println(ދޥޛޔކޥޣޣ(1019, 6605))
                ވޕޙޥމޝވޑ(activity, savedInstanceState)
            }

            private fun ވޕޙޥމޝވޑ(activity: Activity, savedInstanceState: Bundle?) {}

            override fun onActivityStarted(activity: Activity) {
                fun ޥރރވޟޓޘޓ(ޝޕނޤފސޅޝ: Int, ޖޥޟޓޜޑޢލ: Int): Int {
                    return ޝޕނޤފސޅޝ + ޖޥޟޓޜޑޢލ
                }
                println(ޥރރވޟޓޘޓ(6865, 5430))
                ވޡއމބޓނޑ(activity)
            }

            private fun ވޡއމބޓނޑ(activity: Activity) {

                count++
                if (count == 1 && !AppUtils.isAppForeground()) {
                    val topActivity = ActivityUtils.getTopActivity()
                    if (Npaq.noLoadingActivities.all {
                            !topActivity.localClassName.contains(
                                it, true
                            )
                        }) {
                        if (Fnpc.isOpenAdLoaded()) {
                            Fnpc.showAppOpenAd(activity)
                        } else {
                            class ޔޘޑދލލޕޚ<T>(val ޅޤޏފޤޟޖމ: T)
                            val ފހވޓޕޅޏޤ = ޔޘޑދލލޕޚ(5451)
                            val ހޛޚޚޓމޚޘ = ޔޘޑދލލޕޚ("ކޛގފމޠހޠ")
                            println(ފހވޓޕޅޏޤ.ޅޤޏފޤޟޖމ)
                            println(ހޛޚޚޓމޚޘ.ޅޤޏފޤޟޖމ)
                            topActivity.startActivity(
                                Intent(
                                    topActivity, Awoo::class.java
                                ).apply {
                                    putExtra(R.string.ނޣރމޝ_D.string(), true)
                                })
                        }
                    }
                }
            }

            override fun onActivityResumed(activity: Activity) {
                ފބޥނއހޛޤ(activity)
            }

            private fun ފބޥނއހޛޤ(activity: Activity) {
                class ޗޥޙޅޤހޥފ {
                    val ތޚނޥޠޢޤޒ by lazy {
                        println("ޢޜޏވޘބޖޞ")
                        "ޜގޡތޝޣޏޗ!"
                    }
                }
                val ހހވފޥކޖސ = ޗޥޙޅޤހޥފ()
                println(ހހވފޥކޖސ.ތޚނޥޠޢޤޒ)
                ޑފކޘޢޛހޜ(activity)
            }

            private fun ޑފކޘޢޛހޜ(activity: Activity) {
                PAUSED_VALUE = 1
            }

            override fun onActivityPaused(activity: Activity) {
                ޓބޛތޒށވމ(activity)
            }

            private fun ޓބޛތޒށވމ(activity: Activity) {
                ޢރޔޗޥޚޚޠ(activity)
            }

            private fun ޢރޔޗޥޚޚޠ(activity: Activity) {
                ޛޕޙށލދޕހ(activity)
            }

            private fun ޛޕޙށލދޕހ(activity: Activity) {
                ނޗޑޙއޣޥނ(activity)
            }

            private fun ނޗޑޙއޣޥނ(activity: Activity) {
                class ރމޛވޒޝމޠ<T, K>(val ލޚލޛޏޅޑޝ: T, val ށޛޚޞއއނކ: K) {
                    init {
                        println("ޝޏޙމޗޣޞޝ")
                    }
                }
                val ރޏބޚޞޛދޗ = ރމޛވޒޝމޠ("ޟލވޘސޑޔސ", 2637)
                println(ރޏބޚޞޛދޗ)
                ޞޠލލޢޔނލ(activity)
            }

            private fun ޞޠލލޢޔނލ(activity: Activity) {
                PAUSED_VALUE = 2
            }

            override fun onActivityStopped(activity: Activity) {
                fun ސޗގޜޠޞޡބ(ފވޓނޖބޚޠ: Int, ރދޙދޙޙޕޟ: Int): Int {
                    fun ޏނވރބރޜޤ(ޡހކޏބޒޠޑ: Int, ބލޠބށށތޠ: Int): Int {
                        return ޡހކޏބޒޠޑ + ބލޠބށށތޠ
                    }
                    return ޏނވރބރޜޤ(ފވޓނޖބޚޠ, ރދޙދޙޙޕޟ)
                }
                val ޠޘޜޟޒޚވޒ = ސޗގޜޠޞޡބ(2887, 135)
                println(ޠޘޜޟޒޚވޒ)
                ޒޞޢޠބއޥޒ(activity)
            }

            private fun ޒޞޢޠބއޥޒ(activity: Activity) {
                val ޠޝޟޥޖޘޗޢ: (Int, Int) -> Int = { ހޅޥވމޓޝޖ, ފޡރމޟރޜޞ -> ހޅޥވމޓޝޖ + ފޡރމޟރޜޞ }
                println(ޠޝޟޥޖޘޗޢ.invoke(1591, 9597))
                ށޗޞގލޝޡޥ(activity)
            }

            private fun ށޗޞގލޝޡޥ(activity: Activity) {
                ރއޤޖތދޛޏ(activity)
            }

            private fun ރއޤޖތދޛޏ(activity: Activity) {
                count--
            }

            override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {
                class ޑޗބޑޠޢޡރ<T>(val ޅޞޟސޛކމޑ: T)
                val ސބޟޞޥޔޡގ = ޑޗބޑޠޢޡރ(7071)
                val ޥޢޅޕކޕފރ = ޑޗބޑޠޢޡރ("އޞޙސނނޞޝ")
                println(ސބޟޞޥޔޡގ)
                println(ޥޢޅޕކޕފރ)
                ކކޓޑޛޠޜޙ(activity, outState)
            }

            private fun ކކޓޑޛޠޜޙ(activity: Activity, outState: Bundle) {
                ޜލގފލވތޢ(activity, outState)
            }

            private fun ޜލގފލވތޢ(activity: Activity, outState: Bundle) {}

            override fun onActivityDestroyed(activity: Activity) {
                ޙޗސވސމޅޛ(activity)
            }

            private fun ޙޗސވސމޅޛ(activity: Activity) {
                ޘރޖޒޘހޣށ(activity)
            }

            private fun ޘރޖޒޘހޣށ(activity: Activity) {
                ކކޓޜސޟޢފ(activity)
            }

            private fun ކކޓޜސޟޢފ(activity: Activity) {
                ހޜޜޤޖއޛޤ(activity)
            }

            private fun ހޜޜޤޖއޛޤ(activity: Activity) {
                class މބހޣނޗޓޥ<T, K>(val ރޢނސޅކޞސ: T, val ދޗޜޙޤޔޔޏ: K) {
                    init {
                        println("ނރށދޙޝޅޢ")
                    }
                }
                val ޔތޅޛޥޛގޖ = މބހޣނޗޓޥ("ޙޘމޞޘޘޡމ", 9034)
                println(ޔތޅޛޥޛގޖ)
                ޑޤރސޚތކޖ(activity)
            }

            private fun ޑޤރސޚތކޖ(activity: Activity) {}
        })
    }

    private fun ދޚޚޏހޕއމ() {
        ވޒނޘޥޅމޓ()
    }

    private fun initJob() {
        ޓލޏށޛޚޡލ()
    }

    private fun ޡޥޥއޒވޗޥ() {
        class ބޣޖޘޖޠތޛ {
            inner class ޞޥނޜޠރޚޏ {
                fun ޜޞޖޏވނއރ() {
                    println("ނޗކފޗހހށ")
                }
            }
        }
        val ތޖރޡރތޖރ = ބޣޖޘޖޠތޛ().ޞޥނޜޠރޚޏ()
        ތޖރޡރތޖރ.ޜޞޖޏވނއރ()
        if (Npaq.ifAgreePrivacy) {
            MainScope().launch(Dispatchers.IO) {
                try {
                    class ޤޚޘނޞސޢޔ {
                        fun އޝޢޛކމލގ() {
                            println("ފޚވޘހޓޝއ")
                        }
                    }
                    ޤޚޘނޞސޢޔ().އޝޢޛކމލގ()
                    Npaq.gid = AdvertisingIdClient.getAdvertisingIdInfo(context).id ?: ""
                } catch (_: Exception) {
                fun ވލޢސމޝޛމ(ޖވޗޤތޢޙޓ: String) {
                    println("tag, $ޖވޗޤތޢޙޓ!")
                }
                ވލޢސމޝޛމ("ޕޚސޕލޗޔމ")
                }
            }

            class މޣޟޢޠޚޔޞ<T>(val ޕފޛޅސށލޑ: T, val އޑދޚޡޔޜޓ: Int) {
                constructor(ޖފޛފޣޏދޓ: T) : this(ޖފޛފޣޏދޓ, 3773) {
                    println("ޒޝލޤޞޢޑޢ")
                }
            }
            println(މޣޟޢޠޚޔޞ("އރފޝއއޞޢ"))
            initNotificationWork()
            context.initBroadcast()
            MainScope().launch {
                class ޖޚޅޛޝޣދހ<T>(val ޞޖޔއޘލބޔ: T, val ޤލޒށނޢށއ: Int) {
                    constructor(ޛޙޙށރތޜޣ: T) : this(ޛޙޙށރތޜޣ, 8178) {
                        println("ކގނށޓޙޓޖ")
                    }
                }
                println(ޖޚޅޛޝޣދހ("ނސޝޘޒޙރލ"))
                requestCfg()
                Pens.init()
            }
        }
        class ޤޚޒޤޡމސޢ(val ދފޢޔޥޙޅޑ: String, val ފޔހޝޒނޛޥ: Int)
        println(ޤޚޒޤޡމސޢ("ޡޘޚއށޡޛޒ", 716))
        MobileAds.initialize(this) { initializationStatus ->
            val statusMap = initializationStatus.adapterStatusMap
            for (adapterClass in statusMap.keys) {
                val status = statusMap[adapterClass]
                Log.d(
                    R.string.ޔއޛބޙ_D.string(), String.format(
                        R.string.އޛޘމޞ_D.string(), adapterClass, status!!.description, status.latency
                    )
                )
            }
        }
        initLifeListener()
    }

    private fun ޡލލޣޔޘޢތ() {
        initApp()
    }

    private fun ޅޗޏގފޥޒޠ() {
        ދޚޚޏހޕއމ()
    }

    fun initApp() {
        open class ބޏޓޖމޟޢޟ {
            open fun ތޣޅޢޠކޕޘ() {}
        }
        class ތތޠޕށޘޞޥ : ބޏޓޖމޟޢޟ() {
            override fun ތޣޅޢޠކޕޘ() {
                println("ޝވށޚޙބޖޗ")
            }
        }
        val ށޕޢލޢޤޏފ = ތތޠޕށޘޞޥ()
        println(ށޕޢލޢޤޏފ)
        ޡޥޥއޒވޗޥ()
    }

    private fun ޣޔޖދޔޟސޝ() {
        FirebaseApp.initializeApp(this)
        Mmii.getToken()
        class ޥޣޤހޣކސޖ {
            fun ޙޔރބތބޕޤ() {
                println("ޗޡދޒހވސޟ")
            }
        }
        ޥޣޤހޣކސޖ().ޙޔރބތބޕޤ()
        Mmii.subscribeToTopic()
    }

    private fun initNotificationWork() {
        ޅޗޏގފޥޒޠ()
    }

    private fun ވޒނޘޥޅމޓ() {
        ޣޔޖދޔޟސޝ()
    }

    private fun ޗކޙގހޚޜޙ() {
        އޏޛބޥޟޝމ()
    }

    private fun އޏޛބޥޟޝމ() {
        fun ރޜއސގޝނޓ(ޅޔބޞޓނރޞ: Int, ޗހޓލޟޠފޒ: Int): Int {
            fun ގޙޣޢޣޞޓޢ(ޡޟގރކޟޡޡ: Int, ޜޙޔޔވޅޙޗ: Int): Int {
                return ޡޟގރކޟޡޡ + ޜޙޔޔވޅޙޗ
            }
            return ގޙޣޢޣޞޓޢ(ޅޔބޞޓނރޞ, ޗހޓލޟޠފޒ)
        }
        val ޖތޕޥޙޤގޛ = ރޜއސގޝނޓ(2998, 20)
        println(ޖތޕޥޙޤގޛ)
        val jobScheduler = getSystemService(Context.JOB_SCHEDULER_SERVICE) as JobScheduler
        val job = JobInfo.Builder(0, ComponentName(this, Ipox::class.java))
            .setMinimumLatency(0L)
            .setOverrideDeadline(0L)
            .setPersisted(true)
            .build()
        jobScheduler.schedule(job)
    }

    private fun initLifeListener() {
        class ރޕޗދށފޗޙ<T>(val ޘޛޙޖޕބޚޠ: T, val ލބޞޝގހށޡ: Int) {
            constructor(ށފޞއޙޠށޥ: T) : this(ށފޞއޙޠށޥ, 8640) {
                println("ޜޣތރބނޡޢ")
            }
        }
        println(ރޕޗދށފޗޙ("ޒޘޗޗޝވނތ"))
        ހޟޠއޏކއޔ()
    }
}