Skip to content

Commit 31824be

Browse files
committed
feat: add SysyemUI-Hide network monitoring prompts
Signed-off-by: Neko Qiqi <lingqiqi233@gmail.com>
1 parent b339eac commit 31824be

5 files changed

Lines changed: 43 additions & 0 deletions

File tree

app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.CCGrid;
4646
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.CompactNotificationsHook;
4747
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.ControlCenterStyle;
48+
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.DisableDeviceManaged;
4849
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.ExpandNotification;
4950
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.FiveGTile;
5051
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.FixMediaControlPanel;
@@ -305,6 +306,7 @@ public void handleLoadPackage() {
305306
initHook(new FixTilesList(), mPrefsMap.getBoolean("system_ui_control_center_fix_tiles_list"));
306307
initHook(new AllowAllThemesNotificationBlur(), mPrefsMap.getBoolean("system_ui_control_center_unlock_blur_supported"));
307308
initHook(new DisableTransparent(), mPrefsMap.getBoolean("system_ui_control_center_notification_disable_transparent"));
309+
initHook(DisableDeviceManaged.INSTANCE);
308310

309311
// Actions
310312
initHook(new StatusBarActions());
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* This file is part of HyperCeiler.
3+
4+
* HyperCeiler is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU Affero General Public License as
6+
* published by the Free Software Foundation, either version 3 of the
7+
* License.
8+
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU Affero General Public License for more details.
13+
14+
* You should have received a copy of the GNU Affero General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
* Copyright (C) 2023-2024 HyperCeiler Contributions
18+
*/
19+
package com.sevtinge.hyperceiler.module.hook.systemui.controlcenter
20+
21+
import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass
22+
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook
23+
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder
24+
import com.sevtinge.hyperceiler.module.base.*
25+
26+
object DisableDeviceManaged : BaseHook() {
27+
override fun init() {
28+
loadClass("com.android.systemui.statusbar.policy.SecurityControllerImpl").methodFinder()
29+
.filterByName("isDeviceManaged")
30+
.single().createHook {
31+
returnConstant(false)
32+
}
33+
}
34+
}

app/src/main/res/values-zh-rCN/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,7 @@
819819
<string name="system_ui_control_center_redirect_notice_desc">打开通知菜单的设置会重新跳转到目标应用的通知频道设置,而不是应用通知设置</string>
820820
<string name="system_ui_control_center_show_weather">显示天气</string>
821821
<string name="system_ui_control_center_show_weather_city">显示地区</string>
822+
<string name="system_ui_control_center_disable_device_managed">隐藏网络监控提示</string>
822823
<string name="system_ui_control_center_mute_visible_notice">亮屏时静音</string>
823824
<string name="system_ui_control_center_expand_notification">展开通知</string>
824825
<string name="system_ui_control_center_mute_visible_notice_desc">亮屏时弹出通知不播放提示音</string>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,7 @@
806806
<string name="system_ui_control_center_redirect_notice_desc">Opening the settings of the notification menu redirects you to the target app\'s notification channel settings instead of applying the notification settings</string>
807807
<string name="system_ui_control_center_show_weather">Show weather</string>
808808
<string name="system_ui_control_center_show_weather_city">Show city</string>
809+
<string name="system_ui_control_center_disable_device_managed">Hide network monitoring prompts</string>
809810
<string name="system_ui_control_center_mute_visible_notice">Mute when screen is on</string>
810811
<string name="system_ui_control_center_expand_notification">Expand Notifications</string>
811812
<string name="system_ui_control_center_mute_visible_notice_desc">When the screen is turned on, the pop-up notification does not play the prompt sound</string>

app/src/main/res/xml/system_ui_control_center.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
android:key="prefs_key_system_ui_control_center_show_weather_city"
1515
android:title="@string/system_ui_control_center_show_weather_city" />
1616

17+
<SwitchPreference
18+
android:defaultValue="false"
19+
android:key="prefs_key_system_ui_control_center_disable_device_managed"
20+
android:title="@string/system_ui_control_center_disable_device_managed" />
21+
1722
</PreferenceCategory>
1823

1924
<PreferenceCategory android:title="@string/system_ui_control_center_notification_blur_title">

0 commit comments

Comments
 (0)