Skip to content

Commit

Permalink
opt: isPad() & isInternational()
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed May 5, 2024
1 parent dcddb20 commit bb1fdb7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 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 (IS_INTERNATIONAL_BUILD) return
if (isInternational()) return

XposedHelpers.findAndHookConstructor(
"com.miui.home.launcher.AppFilter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ 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 @@ -32,7 +31,7 @@ import com.sevtinge.hyperceiler.utils.devicesdk.*
//from SetoHook by SetoSkins
class AllDarkMode : BaseHook() {
override fun init() {
if (IS_INTERNATIONAL_BUILD) return
if (isInternational()) return
val clazzForceDarkAppListManager =
loadClass("com.android.server.ForceDarkAppListManager")
clazzForceDarkAppListManager.methodFinder().filterByName("getDarkModeAppList").toList()
Expand All @@ -44,7 +43,7 @@ class AllDarkMode : BaseHook() {
setStaticObject(
clazzMiuiBuild,
"IS_INTERNATIONAL_BUILD",
IS_INTERNATIONAL_BUILD
isInternational()
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ val IS_INTERNATIONAL_BUILD by lazy {
*/
fun isPad(): Boolean {
return try {
getStaticObjectOrNullAs<Boolean>(clazzMiuiBuild, "IS_TABLET") ?: false
IS_TABLET
} catch(_: Throwable) {
isPadDevice()
}
Expand All @@ -29,7 +29,7 @@ fun isPad(): Boolean {
*/
fun isInternational(): Boolean {
return try {
clazzMiuiBuild.getField("IS_INTERNATIONAL_BUILD").getBoolean(null)
IS_INTERNATIONAL_BUILD
} catch(_: Throwable) {
false
}
Expand Down

0 comments on commit bb1fdb7

Please sign in to comment.