Last active
January 4, 2025 05:07
-
-
Save pexcn/af2eaeac4ec0bf57724e4af5015fbfef to your computer and use it in GitHub Desktop.
Some hacks for Oxygen OS 11 via Thanox.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Battery health", | |
"description": "当充电状态变化时,显示电池健康度", | |
"priority": 1, | |
"delay": 250, | |
"condition": "powerConnected || powerDisconnected", | |
"actions": [ | |
"ui.showLongToast(\"电池健康度 \" + su.exe(\"cat /sys/class/power_supply/bms/battery_h\").out[0] + \"\n循环次数 \" + su.exe(\"cat /sys/class/power_supply/battery/cycle_count\").out[0]);" | |
] | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "De-underclocking", | |
"description": "通过快捷方式恢复 CPU 和 GPU 的频率", | |
"priority": 1, | |
"delay": 250, | |
"condition": "shortcutLaunched && shortcutValue == \"de-underclocking\"", | |
"actions": [ | |
"su.exe(\"chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq; echo 691200 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq\");", | |
"su.exe(\"chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq; echo 1804800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq\");", | |
"su.exe(\"chmod 644 /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq; echo 710400 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq\");", | |
"su.exe(\"chmod 644 /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq; echo 2419200 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq\");", | |
"su.exe(\"chmod 644 /sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq; echo 844800 > /sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq\");", | |
"su.exe(\"chmod 644 /sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq; echo 2841600 > /sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq\");", | |
"su.exe(\"echo 587000000 > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq\");", | |
"ui.showLongToast(\"频率恢复完成\");" | |
] | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Resume charging", | |
"description": "当电量到达 65% 时恢复充电", | |
"priority": 1, | |
"delay": 250, | |
"condition": "batteryChanged && batteryLevel == 65", | |
"actions": [ | |
"su.exe(\"chmod 664 /sys/class/power_supply/battery/constant_charge_current_max; echo 2000000 > /sys/class/power_supply/battery/constant_charge_current_max\");", | |
"su.exe(\"chmod 664 /sys/class/power_supply/battery/op_disable_charge; echo 0 > /sys/class/power_supply/battery/op_disable_charge\");", | |
"ui.showLongToast(\"恢复充电完成\");" | |
] | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Stop charging", | |
"description": "当电量到达 90% 时停止充电", | |
"priority": 1, | |
"delay": 250, | |
"condition": "batteryChanged && batteryLevel == 90", | |
"actions": [ | |
"su.exe(\"chmod 664 /sys/class/power_supply/battery/constant_charge_current_max; echo 2000000 > /sys/class/power_supply/battery/constant_charge_current_max\");", | |
"su.exe(\"chmod 664 /sys/class/power_supply/battery/op_disable_charge; echo 1 > /sys/class/power_supply/battery/op_disable_charge\");", | |
"ui.showLongToast(\"停止充电完成\");" | |
] | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "UFS health", | |
"description": "通过快捷方式显示 UFS 健康度", | |
"priority": 1, | |
"delay": 250, | |
"condition": "shortcutLaunched && shortcutValue == \"ufs-health\"", | |
"actions": [ | |
"ui.showLongToast(su.exe('case $(cat /sys/devices/platform/soc/*.ufshc/health_descriptor/life_time_estimation_a) in \"0x00\"|\"0x00\") echo \"UFS 已使用寿命 未知\"; ;; \"0x01\"|\"0x1\") echo \"UFS 已使用寿命 0% ~ 10%\"; ;; \"0x02\"|\"0x2\") echo \"UFS 已使用寿命 10% ~ 20%\"; ;; \"0x03\"|\"0x3\") echo \"UFS 已使用寿命 20% ~ 30%\"; ;; \"0x04\"|\"0x4\") echo \"UFS 已使用寿命 30% ~ 40%\"; ;; \"0x05\"|\"0x5\") echo \"UFS 已使用寿命 40% ~ 50%\"; ;; \"0x06\"|\"0x6\") echo \"UFS 已使用寿命 50% ~ 60%\"; ;; \"0x07\"|\"0x7\") echo \"UFS 已使用寿命 60% ~ 70%\"; ;; \"0x08\"|\"0x8\") echo \"UFS 已使用寿命 70% ~ 80%\"; ;; \"0x09\"|\"0x9\") echo \"UFS 已使用寿命 80% ~ 90%\"; ;; \"0x0A\"|\"0xA\") echo \"UFS 已使用寿命 90% ~ 100%\"; ;; \"0x0B\"|\"0xB\") echo \"UFS 已超过预估寿命\"; ;; *) echo \"UFS 已使用寿命 未知\"; ;; esac').out[0] + \"\n\" + su.exe('case $(cat /sys/devices/platform/soc/*.ufshc/health_descriptor/eol_info) in \"0x00\"|\"0x00\") echo \"UFS 保留区块磨损 未知\"; ;; \"0x01\"|\"0x1\") echo \"UFS 保留区块磨损 < 80%\"; ;; \"0x02\"|\"0x2\") echo \"UFS 保留区块磨损 ≈ 80%\"; ;; \"0x03\"|\"0x3\") echo \"UFS 保留区块磨损 > 90%\"; ;; *) echo \"UFS 保留区块磨损 未知\"; ;; esac').out[0]);" | |
] | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Underclocking", | |
"description": "开机后或通过快捷方式降低 CPU 和 GPU 的频率", | |
"priority": 1, | |
"delay": 1000, | |
"condition": "systemReady || (shortcutLaunched && shortcutValue == \"underclocking\")", | |
"actions": [ | |
"su.exe(\"chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq; echo 691200 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq\");", | |
"su.exe(\"chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq; echo 1708800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq\");", | |
"su.exe(\"chmod 644 /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq; echo 710400 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq\");", | |
"su.exe(\"chmod 644 /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq; echo 2150400 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq\");", | |
"su.exe(\"chmod 644 /sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq; echo 844800 > /sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq\");", | |
"su.exe(\"chmod 644 /sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq; echo 2841600 > /sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq\");", | |
"su.exe(\"echo 525000000 > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq\");", | |
"ui.showLongToast(\"降频完成\");" | |
] | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Unlimited charging", | |
"description": "通过快捷方式解除充电限制", | |
"priority": 1, | |
"delay": 250, | |
"condition": "shortcutLaunched && shortcutValue == \"unlimited-charging\"", | |
"actions": [ | |
"su.exe(\"echo 0 > /sys/class/power_supply/battery/op_disable_charge\");", | |
"su.exe(\"echo 3000000 > /sys/class/power_supply/battery/constant_charge_current_max\");", | |
"ui.showLongToast(\"解除充电限制完成\");" | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment