diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/StatusBarClockNew.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/StatusBarClockNew.kt index 4452dcd7d2..7dd0fb6ed6 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/StatusBarClockNew.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/StatusBarClockNew.kt @@ -110,7 +110,9 @@ object StatusBarClockNew : BaseHook() { override fun init() { statusBarClass.constructorFinder() .filterByParamCount(3) - .first().createAfterHook { + .filterByParamTypes { + it[0] == Context::class.java + }.first().createAfterHook { try { val miuiClock = it.thisObject as TextView val miuiClockName = miuiClock.resources.getResourceEntryName(miuiClock.id) diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/TimeCustomization.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/TimeCustomization.kt index ce2e3c8c6b..b37ba028ae 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/TimeCustomization.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/TimeCustomization.kt @@ -70,7 +70,9 @@ object TimeCustomization : BaseHook() { var c: Context? = null mClockClass.constructorFinder() .filterByParamCount(3) - .first().createHook { + .filterByParamTypes { + it[0] == Context::class.java + }.first().createHook { after { try { c = it.args[0] as Context @@ -137,7 +139,9 @@ object TimeCustomization : BaseHook() { mClockClass.constructorFinder() .filterByParamCount(3) - .first().createHook { + .filterByParamTypes { + it[0] == Context::class.java + }.first().createHook { after { try { c = it.args[0] as Context @@ -190,7 +194,7 @@ object TimeCustomization : BaseHook() { val mMiuiStatusBarClockController = textV.getObjectField("mMiuiStatusBarClockController") val mCalendar = - if (isAndroidVersion(34)) { + if (isMoreAndroidVersion(34)) { mMiuiStatusBarClockController?.getObjectField("mCalendar") } else { mMiuiStatusBarClockController?.callMethod("getCalendar") diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/network/news/NewNetworkSpeedStyle.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/network/news/NewNetworkSpeedStyle.kt index 32283749c4..1cb31f7f67 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/network/news/NewNetworkSpeedStyle.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/network/news/NewNetworkSpeedStyle.kt @@ -56,7 +56,7 @@ object NewNetworkSpeedStyle : BaseHook() { } else { lp.width = viewWidth } - meter.setLayoutParams(lp) + meter.layoutParams = lp } meter.postDelayed({ val number = meter.getObjectField("mNetworkSpeedNumberText") as TextView