package pxds.iqiv.ioih.gxph

import android.content.Context
import android.telephony.TelephonyManager
import com.blankj.utilcode.util.SPUtils
import com.test.basd.supercleanermax.R
import pxds.lmmd.zmwf.Khko.string
import pxds.lmmd.zmwf.Lwfm

object Lzer {

     fun isOrganicUser(): Boolean {
        val source: String = SPUtils.getInstance().getString(R.string.ށފގފޏ_D.string(),"")
        return !(source.contains(R.string.ރށޛނޠ_D.string()) || source.contains(R.string.ޟޚމޞވ_D.string()))
    }

    fun k(i2: Int, i3: Int): Boolean {
        return i2 shr i3 and 1 == 1
    }

    fun getUserChancelSwitch(int: Int): Boolean {
        val isOrganic = isOrganicUser()
        val isHasSim = isSimCardAvailable()
        return l(int, isHasSim, isOrganic)
    }

    fun l(i2: Int, isHasSim: Boolean, isOrganic: Boolean): Boolean {
        return if (!isOrganic && !k(i2, 3)) {
            false
        } else if (isOrganic && !k(i2, 2)) {
            false
        } else if (!isHasSim && !k(i2, 1)) {
            false
        } else if (isHasSim && !k(i2, 0)) {
            false
        } else k(i2, 4)
    }

     fun isSimCardAvailable(): Boolean {
        val telephonyManager = Lwfm.context.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
        return telephonyManager.simState != TelephonyManager.SIM_STATE_ABSENT
    }
}