diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemSettings.java b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemSettings.java index 3a57782daa..e61ed493ec 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemSettings.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemSettings.java @@ -1,21 +1,21 @@ /* - * This file is part of HyperCeiler. + * 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. + * 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. + * 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . - * Copyright (C) 2023-2024 HyperCeiler Contributions -*/ + * Copyright (C) 2023-2024 HyperCeiler Contributions + */ package com.sevtinge.hyperceiler.module.app; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isAndroidVersion; @@ -39,6 +39,7 @@ import com.sevtinge.hyperceiler.module.hook.systemsettings.QuickManageOverlayPermission; import com.sevtinge.hyperceiler.module.hook.systemsettings.QuickManageUnknownAppSources; import com.sevtinge.hyperceiler.module.hook.systemsettings.QuickManagerAccessibilityPermission; +import com.sevtinge.hyperceiler.module.hook.systemsettings.RunningServices; import com.sevtinge.hyperceiler.module.hook.systemsettings.UnLockAreaScreenshot; import com.sevtinge.hyperceiler.module.hook.systemsettings.UnlockNeverSleepScreen; import com.sevtinge.hyperceiler.module.hook.systemsettings.UnlockTaplusForSettings; @@ -57,6 +58,7 @@ public void handleLoadPackage() { initHook(new HyperCeilerSettings(), mPrefsMap.getStringAsInt("settings_icon", 0) != 0); initHook(new LinkTurbo(), mPrefsMap.getBoolean("system_settings_linkturbo")); + initHook(new RunningServices(), true); // 显示原生内存信息 initHook(new UsbModeChoose(), mPrefsMap.getStringAsInt("system_settings_usb_mode_choose", 0) != 0 || mPrefsMap.getBoolean("system_settings_usb_mode")); initHook(new ViewWifiPasswordHook(), mPrefsMap.getBoolean("system_settings_safe_wifi")); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/RunningServices.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/RunningServices.java new file mode 100644 index 0000000000..1bf5cc0238 --- /dev/null +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemsettings/RunningServices.java @@ -0,0 +1,28 @@ +package com.sevtinge.hyperceiler.module.hook.systemsettings; + +import android.content.ComponentName; +import android.content.Intent; + +import com.sevtinge.hyperceiler.module.base.BaseHook; + +public class RunningServices extends BaseHook { + @Override + public void init() throws NoSuchMethodException { + findAndHookMethod("com.android.settings.SettingsActivity", + "getStartingFragmentClass", Intent.class, + new MethodHook() { + @Override + protected void before(MethodHookParam param) { + Intent intent = (Intent) param.args[0]; + ComponentName componentName = intent.getComponent(); + if (componentName != null) { + String className = componentName.getClassName(); + if ("com.android.settings.RunningServices".equals(className)) { + param.setResult("com.android.settings.applications.RunningServices"); + } + } + } + } + ); + } +} diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 0c7ad628ff..e5b8731c5f 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -1485,6 +1485,7 @@ 允许复制和粘贴图片至剪贴板 电池优化 + 正在运行的服务 通知设置 应用管理 语言设置 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d048421d1b..6730dbf108 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1453,6 +1453,7 @@ Allow copy files to clipboard Allow copying and pasting images to the clipboard Battery Optimization + Running services Notification Settings App Management Language Settings diff --git a/app/src/main/res/xml/various_aosp.xml b/app/src/main/res/xml/various_aosp.xml index 7578cd0aab..151b0d7c75 100644 --- a/app/src/main/res/xml/various_aosp.xml +++ b/app/src/main/res/xml/various_aosp.xml @@ -1,41 +1,42 @@ - + + android:targetClass="com.android.settings.Settings$ReduceBrightColorsSettingsActivity" + android:targetPackage="com.android.settings" /> - - + + + android:targetClass="com.android.settings.Settings$HighPowerApplicationsActivity" + android:targetPackage="com.android.settings" /> - - + + + android:targetClass="com.android.settings.RunningServices" + android:targetPackage="com.android.settings" /> - - + + + android:targetClass="com.android.settings.Settings$ConfigureNotificationSettingsActivity" + android:targetPackage="com.android.settings" /> - - + + + android:targetClass="com.android.settings.applications.ManageApplications" + android:targetPackage="com.android.settings" /> - + + + + + \ No newline at end of file