Skip to content

Commit

Permalink
fix: gpu driver (maybe font loader) load failed cause of framework-Al…
Browse files Browse the repository at this point in the history
…lDarkMode international build type got failed
  • Loading branch information
Sevtinge committed May 3, 2024
1 parent 5dacc93 commit 8d2e21c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import de.robv.android.xposed.*

object DisableHideFile : BaseHook() {
override fun init() {
if (isInternational()) return
if (IS_INTERNATIONAL_BUILD) return

XposedHelpers.findAndHookConstructor(
"com.miui.home.launcher.AppFilter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import android.content.pm.*
import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass
import com.github.kyuubiran.ezxhelper.ClassUtils.setStaticObject
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHooks

import com.github.kyuubiran.ezxhelper.ObjectUtils.invokeMethodBestMatch
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder
import com.sevtinge.hyperceiler.module.base.*
Expand All @@ -31,7 +32,7 @@ import com.sevtinge.hyperceiler.utils.devicesdk.*
//from SetoHook by SetoSkins
class AllDarkMode : BaseHook() {
override fun init() {
if (isInternational()) return
if (IS_INTERNATIONAL_BUILD) return
val clazzForceDarkAppListManager =
loadClass("com.android.server.ForceDarkAppListManager")
clazzForceDarkAppListManager.methodFinder().filterByName("getDarkModeAppList").toList()
Expand All @@ -43,7 +44,7 @@ class AllDarkMode : BaseHook() {
setStaticObject(
clazzMiuiBuild,
"IS_INTERNATIONAL_BUILD",
isInternational()
IS_INTERNATIONAL_BUILD
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
package com.sevtinge.hyperceiler.utils.devicesdk

import com.github.kyuubiran.ezxhelper.ClassUtils.getStaticObjectOrNullAs
import com.sevtinge.hyperceiler.utils.api.LazyClass.clazzMiuiBuild

val IS_TABLET by lazy {
getStaticObjectOrNullAs<Boolean>(clazzMiuiBuild, "IS_TABLET") ?: false
}
val IS_INTERNATIONAL_BUILD by lazy {
getStaticObjectOrNullAs<Boolean>(clazzMiuiBuild, "IS_INTERNATIONAL_BUILD") ?: false
}

/**
* 函数调用,适用于其他一些需要判断的情况,仅支持小米设备的判断
* 2024-04-20 更新对非小米设备的判断方式,仅防止闪退
Expand Down

0 comments on commit 8d2e21c

Please sign in to comment.