Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions library/core/src/main/res/values-zh-rCN/strings_app.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,7 @@
<string name="powerkeeper">电量与性能</string>
<string name="powerkeeper_custom_refresh_rate">自定义高刷新率应用</string>
<string name="powerkeeper_lock_max_fps">锁定当前刷新率上限</string>
<string name="powerkeeper_lock_thermal_max_fps">锁定当前温控刷新率上限</string>
<string name="powerkeeper_do_not_kill_apps">尝试不要杀死后台应用</string>
<string name="powerkeeper_do_not_kill_apps_desc">可能使耗电量增加</string>
<string name="powerkeeper_prevent_recovery_of_battery_optimization_whitelist">禁止恢复电池优化白名单</string>
Expand Down
1 change: 1 addition & 0 deletions library/core/src/main/res/values/strings_app.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,7 @@
<string name="powerkeeper">Battery and performance</string>
<string name="powerkeeper_custom_refresh_rate">Custom high refresh rate apps</string>
<string name="powerkeeper_lock_max_fps">Lock max FPS</string>
<string name="powerkeeper_lock_thermal_max_fps">Lock thermal max FPS</string>
<string name="powerkeeper_do_not_kill_apps">Try don\'t kill apps</string>
<string name="powerkeeper_do_not_kill_apps_desc">May increase power consumption</string>
<string name="powerkeeper_prevent_recovery_of_battery_optimization_whitelist">Prevent recovery of battery optimization whitelist</string>
Expand Down
5 changes: 5 additions & 0 deletions library/core/src/main/res/xml/powerkeeper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
android:key="prefs_key_powerkeeper_lock_max_fps"
android:defaultValue="false" />

<SwitchPreference
android:title="@string/powerkeeper_lock_thermal_max_fps"
android:key="prefs_key_powerkeeper_lock_thermal_max_fps"
android:defaultValue="false" />

<SwitchPreference
android:title="@string/powerkeeper_disable_get_display_ctrl_code"
android:key="prefs_key_powerkeeper_disable_get_display_ctrl_code"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.sevtinge.hyperceiler.libhook.rules.powerkeeper.DontKillApps;
import com.sevtinge.hyperceiler.libhook.rules.powerkeeper.GmsDozeFix;
import com.sevtinge.hyperceiler.libhook.rules.powerkeeper.LockMaxFps;
import com.sevtinge.hyperceiler.libhook.rules.powerkeeper.LockThermalMaxFps;
import com.sevtinge.hyperceiler.libhook.rules.powerkeeper.PreventBatteryWitelist;

@HookBase(targetPackage = "com.miui.powerkeeper")
Expand All @@ -38,6 +39,7 @@ public void onPackageLoaded() {
initHook(new CustomRefreshRate(), PrefsBridge.getBoolean("various_custom_refresh_rate"));
initHook(new DisableGetDisplayCtrlCode(), PrefsBridge.getBoolean("powerkeeper_disable_get_display_ctrl_code"));
initHook(LockMaxFps.INSTANCE, PrefsBridge.getBoolean("powerkeeper_lock_max_fps"));
initHook(LockThermalMaxFps.INSTANCE, PrefsBridge.getBoolean("powerkeeper_lock_thermal_max_fps"));
initHook(DontKillApps.INSTANCE, PrefsBridge.getBoolean("powerkeeper_do_not_kill_apps"));
initHook(new PreventBatteryWitelist(), PrefsBridge.getBoolean("powerkeeper_prevent_recovery_of_battery_optimization_whitelist"));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* 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-2026 HyperCeiler Contributions
*/
package com.sevtinge.hyperceiler.libhook.rules.powerkeeper

import com.sevtinge.hyperceiler.libhook.base.BaseHook
import io.github.lingqiqi5211.ezhooktool.core.findAllMethods
import io.github.lingqiqi5211.ezhooktool.xposed.dsl.createHook

object LockThermalMaxFps : BaseHook() {

Check notice on line 25 in library/libhook/src/main/java/com/sevtinge/hyperceiler/libhook/rules/powerkeeper/LockThermalMaxFps.kt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

library/libhook/src/main/java/com/sevtinge/hyperceiler/libhook/rules/powerkeeper/LockThermalMaxFps.kt#L25

LockThermalMaxFps is missing required documentation.
override fun init() {
findClass("com.miui.powerkeeper.feedbackcontrol.ThermalManager").findAllMethods { name("displayControl"); paramCount(1) }.single().createHook {
returnConstant(null)
}
}
}
Loading