Skip to content

Commit

Permalink
fix: MobileTypeTextCustom hook failed for Android 15
Browse files Browse the repository at this point in the history
  • Loading branch information
lingqiqi5211 committed Oct 7, 2024
1 parent 8ec3671 commit 55290be
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,23 @@ package com.sevtinge.hyperceiler.module.hook.systemui.statusbar.model
import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder
import com.sevtinge.hyperceiler.module.base.BaseHook
import com.sevtinge.hyperceiler.module.base.*
import com.sevtinge.hyperceiler.utils.devicesdk.*

object MobileTypeTextCustom : BaseHook() {
override fun init() {
loadClass("com.android.systemui.statusbar.connectivity.MobileSignalController").methodFinder()
if (isMoreAndroidVersion(35)) {
loadClass("com.android.systemui.statusbar.pipeline.mobile.domain.interactor.MiuiMobileIconInteractorImpl")
} else {
loadClass("com.android.systemui.statusbar.connectivity.MobileSignalController")
}.methodFinder()
.filterByName("getMobileTypeName")
.filterByParamTypes {
it[0] == Int::class.java
}.single().createHook {
after {
it.result = mPrefsMap.getString("system_ui_status_bar_mobile_type_custom", "ERR")
it.result =
mPrefsMap.getString("system_ui_status_bar_mobile_type_custom", "ERR")
}
}
}
Expand Down

0 comments on commit 55290be

Please sign in to comment.