Skip to content

Commit

Permalink
feat: SystemUI - Remove advanced material blur restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
lingqiqi5211 committed Dec 9, 2024
1 parent 887903f commit aa306eb
Show file tree
Hide file tree
Showing 12 changed files with 148 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class DexKit {
private static final String TYPE_METHOD = "METHOD";
private static final String TYPE_CLASS = "CLASS";
private static final String TYPE_FIELD = "FIELD";
private static MMKV mMMKV = null;;
private static MMKV mMMKV = null;
private static DexKit mThis;
private static DexKitBridge mDexKitBridge;
private final String TAG;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* This file is part of HyperCeiler.
* HyperCeiler is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2023-2024 HyperCeiler Contributions
*/
package com.sevtinge.hyperceiler.module.hook.systemui

import com.github.kyuubiran.ezxhelper.*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* This file is part of HyperCeiler.
* HyperCeiler is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2023-2024 HyperCeiler Contributions
*/
package com.sevtinge.hyperceiler.module.hook.systemui.other

import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createAfterHook
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder
import com.sevtinge.hyperceiler.utils.log.XposedLogUtils.*

object DefaultPluginTheme {
fun initDefaultPluginTheme(mClassLoader: ClassLoader) {
loadClass("miui.systemui.util.ThemeUtils", mClassLoader).methodFinder()
.filterByName("getDefaultPluginTheme").single()
.createAfterHook {
it.result = true
}
logD("DefaultPluginTheme", "initDefaultPluginTheme hook success")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinde
import com.sevtinge.hyperceiler.module.base.*
import com.sevtinge.hyperceiler.module.hook.systemui.*
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.*
import com.sevtinge.hyperceiler.module.hook.systemui.other.*
import com.sevtinge.hyperceiler.module.hook.systemui.statusbar.icon.v.*
import com.sevtinge.hyperceiler.utils.api.*
import java.lang.ref.*
Expand Down Expand Up @@ -65,6 +66,8 @@ object NewPluginHelperKt : BaseHook() {
if (mPrefsMap.getBoolean("system_framework_volume_separate_control") &&
mPrefsMap.getBoolean("system_framework_volume_separate_slider"))
NotificationVolumeSeparateSlider.initHideDeviceControlEntry(classLoader)
if (mPrefsMap.getBoolean("system_ui_other_default_plugin_theme"))
DefaultPluginTheme.initDefaultPluginTheme(classLoader)
}

factory.componentNames("miui.systemui.miplay.MiPlayPluginImpl") -> {
Expand Down Expand Up @@ -92,6 +95,8 @@ object NewPluginHelperKt : BaseHook() {
) {
QSColor.pluginHook(classLoader)
}
if (mPrefsMap.getBoolean("system_ui_other_default_plugin_theme"))
DefaultPluginTheme.initDefaultPluginTheme(classLoader)
}

factory.componentNames("miui.systemui.controlcenter.MiuiControlCenter") -> {
Expand All @@ -113,6 +118,8 @@ object NewPluginHelperKt : BaseHook() {
) {
QSColor.pluginHook(classLoader)
}
if (mPrefsMap.getBoolean("system_ui_other_default_plugin_theme"))
DefaultPluginTheme.initDefaultPluginTheme(classLoader)
}

factory.componentNames("miui.systemui.notification.NotificationStatPluginImpl") -> {
Expand All @@ -121,6 +128,8 @@ object NewPluginHelperKt : BaseHook() {

if (mPrefsMap.getBoolean("system_ui_statusbar_music_switch"))
FocusNotifLyric.initLoader(classLoader);
if (mPrefsMap.getBoolean("system_ui_other_default_plugin_theme"))
DefaultPluginTheme.initDefaultPluginTheme(classLoader)
}

else -> {
Expand All @@ -136,7 +145,6 @@ object NewPluginHelperKt : BaseHook() {
ShowDeviceName.initShowDeviceName(classLoader)
if (mPrefsMap.getBoolean("system_ui_control_center_disable_device_managed"))
DisableDeviceManaged.initDisableDeviceManaged(classLoader)

// logD(TAG, lpparam.packageName, "Plugin is ${factory.mComponentName}")
// 仅备份当前可用注入 ClassLoader
// miui.systemui.volume.VolumeDialogPlugin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* This file is part of HyperCeiler.
* HyperCeiler is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2023-2024 HyperCeiler Contributions
*/
package com.sevtinge.hyperceiler.module.hook.systemui.statusbar.model

import android.content.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* This file is part of HyperCeiler.
* HyperCeiler is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2023-2024 HyperCeiler Contributions
*/
package com.sevtinge.hyperceiler.module.hook.systemui.statusbar.model

import android.telephony.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* This file is part of HyperCeiler.
* HyperCeiler is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2023-2024 HyperCeiler Contributions
*/
package com.sevtinge.hyperceiler.module.hook.systemui.statusbar.model.public

import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* This file is part of HyperCeiler.
* HyperCeiler is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2023-2024 HyperCeiler Contributions
*/
package com.sevtinge.hyperceiler.module.hook.systemui.statusbar.model.public

import com.sevtinge.hyperceiler.module.base.BaseHook.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class SystemUIOtherSettings extends DashboardFragment {
SwitchPreference mShowPct;
SwitchPreference mFuckSG;
SwitchPreference mTimer;
SwitchPreference mPluginThemeBlur;

@Override
public int getPreferenceScreenResId() {
Expand All @@ -72,6 +73,7 @@ public void initPrefs() {
mShowPct = findPreference("prefs_key_system_showpct_title");
mFuckSG = findPreference("prefs_key_system_ui_move_log_to_miui");
mTimer = findPreference("prefs_key_system_ui_volume_timer");
mPluginThemeBlur = findPreference("prefs_key_system_ui_other_default_plugin_theme");

mChargeAnimationTitle.setVisible(!isMoreHyperOSVersion(1f));
mDisableBluetoothRestrict.setVisible(isMiuiVersion(14f) && !isMoreHyperOSVersion(1f));
Expand All @@ -83,6 +85,7 @@ public void initPrefs() {
mShowPct.setVisible(!isMoreHyperOSVersion(1f));
mFuckSG.setVisible(isMoreHyperOSVersion(2f));
mTimer.setVisible(!isMoreAndroidVersion(35));
mPluginThemeBlur.setVisible(isMoreHyperOSVersion(1f));

mVolume.setOnPreferenceChangeListener(
(preference, o) -> {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,8 @@
<string name="system_ui_qs_label">快捷开关标签</string>
<string name="system_ui_notification_title">通知</string>
<string name="system_ui_other_notification_fix">禁用通知白名单</string>
<string name="system_ui_other_default_plugin_theme">解除高级材质模糊限制</string>
<string name="system_ui_other_default_plugin_theme_desc">解除系统界面组件对第三方主题默认禁用的高级材质模糊</string>
<string name="system_ui_plugin_enable_volume_blur">音量条模糊</string>
<string name="system_ui_plugin_enable_volume_blur_desc">仅供 Android 12 及以上的 MTK 机型使用,可能存在 GPU 负载较高的情况</string>

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,8 @@
<string name="system_ui_qs_label">Quick switch tab</string>
<string name="system_ui_notification_title">Notification</string>
<string name="system_ui_other_notification_fix">Disable notification whitelist</string>
<string name="system_ui_other_default_plugin_theme">Remove advanced material blur restrictions</string>
<string name="system_ui_other_default_plugin_theme_desc">Unlock the advanced material blur that is disabled by default for third-party themes in SystemUI Plugin</string>
<string name="system_ui_plugin_enable_volume_blur">Enable volume bar blur</string>
<string name="system_ui_move_log_to_miui">Move statusbar_gestures.dat to MIUI dir</string>
<string name="system_ui_plugin_enable_volume_blur_desc">Only for Android12+ MTK models. There may be high GPU load.</string>
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/xml/system_ui_other.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,18 @@
android:key="prefs_key_system_ui_volume_timer"
android:title="@string/system_ui_volume_timer" />

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_system_ui_other_default_plugin_theme"
android:summary="@string/system_ui_other_default_plugin_theme_desc"
android:title="@string/system_ui_other_default_plugin_theme" />

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_system_ui_plugin_enable_volume_blur"
android:summary="@string/system_ui_plugin_enable_volume_blur_desc"
android:title="@string/system_ui_plugin_enable_volume_blur" />


<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_system_ui_move_log_to_miui"
Expand Down

0 comments on commit aa306eb

Please sign in to comment.