Skip to content

Commit

Permalink
Fake non-disabled icon
Browse files Browse the repository at this point in the history
  • Loading branch information
YifePlayte committed Aug 14, 2024
1 parent ddf7bfb commit a22d457
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ class MainPage : BasePage() {
textId = R.string.fake_non_default_icon
), SwitchV("fake_non_default_icon", false)
)
TextSummaryWithSwitch(
TextSummaryV(
textId = R.string.fake_non_disabled_icon
), SwitchV("fake_non_disabled_icon", false)
)
TextSummaryWithSwitch(
TextSummaryV(
textId = R.string.enable_blur_for_home
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.yifeplayte.wommo.hook.hooks.singlepackage.home

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.yifeplayte.wommo.hook.hooks.BaseHook

@Suppress("unused")
object FakeNonDisabledIcon : BaseHook() {
override val key = "fake_non_disabled_icon"
override fun hook() {
loadClass("com.miui.home.launcher.ItemInfoWithIconAndMessage").methodFinder()
.filterByName("isDisabled").filterNonAbstract().single().createHook {
before { param ->
if (Thread.currentThread().stackTrace.any { it.methodName == "getColorFilter" }) {
param.result = false
}
}
}
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<string name="exposure_refresh_for_non_miui_widget">为非 MIUI 小部件提供曝光刷新</string>
<string name="exposure_refresh_for_non_miui_widget_tips">系统框架,智能助理(负一屏)</string>
<string name="fake_non_default_icon">伪装为非默认图标</string>
<string name="fake_non_disabled_icon">伪装为非不可用图标</string>
<string name="finished">运行完成</string>
<string name="force_dark_mode_for_all_apps">允许所有应用使用强制深色模式</string>
<string name="force_dark_mode_for_all_apps_tips">可以在系统设置里管理应用的强制深色设置</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string name="exposure_refresh_for_non_miui_widget">Exposure refresh for non-MIUI-widgets</string>
<string name="exposure_refresh_for_non_miui_widget_tips">System Framework, App Vault</string>
<string name="fake_non_default_icon">Fake non-default icon</string>
<string name="fake_non_disabled_icon">Fake non-disabled icon</string>
<string name="finished">Finished</string>
<string name="force_dark_mode_for_all_apps">Force dark mode for all apps</string>
<string name="force_dark_mode_for_all_apps_tips">You can configure this in system settings</string>
Expand Down

0 comments on commit a22d457

Please sign in to comment.