Skip to content

Commit

Permalink
Update LockPremiumFeatures.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Keeperorowner authored Nov 10, 2024
1 parent f98215a commit beab36e
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions app/src/main/java/cc/ioctl/tmoe/hook/func/LockPremiumFeatures.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,30 @@ import de.robv.android.xposed.XposedHelpers
@FunctionHookEntry
class LockPremiumFeatures : CommonDynamicHook() {

companion object {
companion object : BaseDynamicHook {
private val instance { LockPremiumFeatures() }
private var initialized = false

@JvmStatic
override fun getInstance(): BaseDynamicHook = instance

@JvmStatic
val INSTANCE: BaseDynamicHook by lazy {
LockPremiumFeatures().apply {
initialize()
override fun initialize(): Boolean {
if (!initialized) {
initialized = instance.initOnce()
}
return initialized
}

@JvmStatic
override fun isInitialized(): Boolean = initialized

@JvmStatic
override fun isEnabledByUser(): Boolean = instance.isEnabledByUser

@JvmStatic
override fun setEnabledByUser(enabled: Boolean) {
instance.setEnabledByUser(enabled)
}
}

Expand Down

0 comments on commit beab36e

Please sign in to comment.