├── .gitignore ├── LICENSE ├── NOTICE ├── README.md ├── changelog.md ├── config ├── README.md └── template.json ├── magisk ├── LICENSE ├── META-INF │ └── com │ │ └── google │ │ └── android │ │ ├── update-binary │ │ └── updater-script ├── NOTICE ├── bin │ └── uperf ├── common │ └── service.sh ├── config │ ├── e1080.json │ ├── e2100.json │ ├── e2200.json │ ├── e8890.json │ ├── e8895.json │ ├── e9810.json │ ├── e9820.json │ ├── e990.json │ ├── gs101.json │ ├── mtd1000.json │ ├── mtd1200.json │ ├── mtd720.json │ ├── mtd8100.json │ ├── mtd820.json │ ├── mtd9000.json │ ├── mtd920.json │ ├── mtg80.json │ ├── mtg90t.json │ ├── perapp_powermode.txt │ ├── sdm625.json │ ├── sdm660.json │ ├── sdm665.json │ ├── sdm675.json │ ├── sdm695.json │ ├── sdm710.json │ ├── sdm730.json │ ├── sdm750.json │ ├── sdm765.json │ ├── sdm778.json │ ├── sdm780.json │ ├── sdm820.json │ ├── sdm835.json │ ├── sdm845.json │ ├── sdm855.json │ ├── sdm865.json │ ├── sdm888.json │ ├── sdm8g1+.json │ └── sdm8g1.json ├── flag │ └── fdeai ├── flags │ └── fdeai ├── install.sh ├── module.prop ├── script │ ├── initsvc.sh │ ├── libcgroup.sh │ ├── libcommon.sh │ ├── libpowercfg.sh │ ├── libsysinfo.sh │ ├── libuperf.sh │ ├── pathinfo.sh │ ├── powercfg.json │ ├── powercfg_main.sh │ ├── powercfg_once.sh │ └── setup.sh └── uninstall.sh ├── media ├── adjusted_demand_capacity_relation.png ├── alipay-qr.png ├── android_am.png ├── fingerprint.png ├── render_restart.png ├── render_stop.png ├── sflag.png └── wechat_resume.png └── version.json /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | /.vscode 3 | /build 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | Copyright 2021-2022 Matt Yang 180 | 181 | Licensed under the Apache License, Version 2.0 (the "License"); 182 | you may not use this file except in compliance with the License. 183 | You may obtain a copy of the License at 184 | 185 | http://www.apache.org/licenses/LICENSE-2.0 186 | 187 | Unless required by applicable law or agreed to in writing, software 188 | distributed under the License is distributed on an "AS IS" BASIS, 189 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 190 | See the License for the specific language governing permissions and 191 | limitations under the License. 192 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | # 更新日志 2 | 3 | ## DEV 22.07.09 4 | 5 | - 新增 sdm8g1+支持 6 | - 改进 任务放置 7 | - 改进 功耗估计准确度 8 | 9 | ## DEV 22.06.26 10 | 11 | - 新增 移除`swjunk` 12 | - 改进 功耗分配 13 | - 改进 任务放置 14 | - 修复 后台程序破音 15 | 16 | ## DEV 22.06.05 17 | 18 | - 新增 更多兼容性CPU频率写入器 19 | - 新增 兼容性生成CPU频率表 20 | - 修复 微信小程序启动缓慢 21 | - 修复 前台程序破音 22 | - 修复 部分崩溃问题 23 | - 修复 部分高通平台息屏功耗过高,感谢@NepPoseidon 24 | 25 | ## DEV 22.05.20 26 | 27 | - 新增 开放配置文件自定义 28 | - 改进 CPU重负载调频稳定性 29 | - 改进 任务放置 30 | - 改进 顶层APP获取开销,感谢@nakixii 31 | - 修复 perapp切换崩溃 32 | - 修复 部分潜在崩溃代码 33 | - 修复 CPU频率写入器失效 34 | 35 | ## DEV 22.05.09 36 | 37 | - 回退 混合CPU调频 38 | - 改进 触摸响应 39 | - 改进 CPU负载滤波器 40 | - 修复 sdm82x部分场景CPU频率无法写入 41 | - 修复 Exynos 2200支持 42 | 43 | ## DEV 22.05.04 44 | 45 | - 新增 混合CPU调频 46 | - 改进 Android 7.0兼容性 47 | - 修复 EPIC写入器自检错误 48 | - 修复 全面屏手势失效,感谢@NebulaLeep 49 | - 暂时禁用SsAnalysis模块,由于降低了过渡动画流畅度 50 | 51 | ## DEV 22.04.30 52 | 53 | - 改进 提高滑动操作跟手性 54 | - 改进 内核CPU调速器兼容性 55 | - 修复 部分设备全面屏手势失效 56 | - 修复 Pixel设备自动重启 57 | - 修复 任务调度器任务分类错误 58 | - 修复 游戏负载放置不稳定 59 | - 修复 游戏最小化破音 60 | 61 | ## DEV 22.04.23 62 | 63 | - 增加 系统动画主动探针 64 | - 增加 CPU采样器负载预测 65 | - 增加 与系统用户态性能控制器协同调度 66 | - 增加 桌面启动器自动识别 67 | - 增加 适配谷歌tensor/天玑810 68 | - 改进 提高手势操作跟手性 69 | - 改进 减少SfAnalysis误报 70 | - 修复 识别上下文的任务调度器规则匹配错误 71 | - 修复 联发科PPM接口适配 72 | - 修复 破音问题 73 | - 修复 部分平台功耗模型 74 | 75 | ## DEV 22.04.09 76 | 77 | - 增加大量平台初步适配 78 | - 改进Unity游戏和吃鸡游戏抖动 79 | - 改进弹幕2倍速视频流畅度 80 | - 更新部分平台功耗模型 81 | - 日志后缀名更换为txt 82 | 83 | ## DEV 22.04.04 84 | 85 | - 插件式软件架构 86 | - 使用C++重新开发 87 | - 功能模块解耦,易扩展 88 | - 感知能耗的CPU调频器 89 | - 用户态使能全平台统一体验 90 | - 单核高性能,多核高能效 91 | - 20-100hz基础采样率,快响应低开销 92 | - 识别上下文的任务调度器 93 | - UI放大核,非关键放小核 94 | - 全数据驱动,正则匹配 95 | - 花费50%开发时间调试的默认规则 96 | - 动态sysfs写入 97 | - 用户态性能控制器基石功能 98 | - 实现更加简约高效 99 | - SfAnalysis 100 | - 预测掉帧并在发生前拉升CPU 101 | - 改进的帧反馈以及模糊匹配 102 | - patch方式无需更改SELinux状态 103 | - 独立选装,但是强烈推荐 104 | - SsAnalysis 105 | - 跟系统线程放置器斗智斗勇 106 | - 独立选装,但是强烈推荐 107 | -------------------------------------------------------------------------------- /config/README.md: -------------------------------------------------------------------------------- 1 | # Uperf v3 配置文件说明 2 | 3 | Uperf v3 使用插件化的软件结构设计,每个功能模块均可拥有独立的配置参数空间。 4 | 5 | ## meta/元信息 6 | 7 | | 字段 | 类型 | 描述 | 8 | | ------ | ------ | ------------------ | 9 | | name | string | 配置文件的名称 | 10 | | author | string | 配置文件的作者信息 | 11 | 12 | ## modules/模块定义 13 | 14 | 功能模块的静态参数段,仅在模块实例化时读取一次,用于开关功能、定义模型参数等。 15 | 16 | ### switcher/动态配置切换器 17 | 18 | 根据关联的 native 层信号,跳转对应的 hint 状态切换,应用对应的动态参数,并持续指定时长。用户可定义多个性能配置,每个性能配置有各个 hint 的动态参数。动态参数的默认值定义在`/initials`,动态参数的动态值定义在`/presets`。如果在写入`/presets`定义了`powersave`和`balance`两个性能配置,那么`switchInode`文件允许写入`auto`、`powersave`和`balance`,其中`auto`表示启用`内置分APP性能配置切换器`。 19 | 20 | 注:由于是基础模块,此模块**不可关闭**。 21 | 22 | 内置分 APP 性能配置切换器的规则样例如下,包名按大小写敏感的全字匹配。行首为`*`表示默认规则,行首为`-`表示熄屏规则,**必须包含默认和熄屏规则**。 23 | 24 | ``` 25 | # 分应用性能模式配置 26 | # Per-app dynamic power mode rule 27 | # '-' means offscreen rule 28 | # '*' means default rule 29 | 30 | com.miHoYo.Yuanshen fast 31 | - balance 32 | * balance 33 | ``` 34 | 35 | | 字段 | 类型 | 描述 | 36 | | ------------ | ------ | ------------------------------ | 37 | | switchInode | string | 监听手动切换性能模式的文件节点 | 38 | | perapp | string | 内置分 APP 性能配置文件路径 | 39 | | hintDuration | object | 每个 hint 的最长持续时间 | 40 | 41 | #### hintDuration/hint 最长持续时间 42 | 43 | 各个 hint 使用状态机完成跳转,状态转移图如下: 44 | 45 | ```mermaid 46 | stateDiagram-v2 47 | 48 | [*] --> idle 49 | idle --> touch: pressed touch / pressed button 50 | idle --> switch: woke up screen 51 | touch --> trigger: released touch / started scrolling 52 | touch --> gesture: detected fullscreen gesture 53 | touch --> switch: detected window animation 54 | touch --> junk: detected junk 55 | gesture --> switch: detected window animation 56 | gesture --> junk: detected junk 57 | junk --> touch: timeout / finished junk 58 | trigger --> touch: timeout / not rendering 59 | gesture --> touch: timeout / not rendering 60 | switch --> touch: timeout / not rendering 61 | touch --> idle: timeout / not rendering 62 | ``` 63 | 64 | | 字段 | 类型 | 描述 | 65 | | ------- | ----- | -------------------------------------------------- | 66 | | idle | float | (单位:秒)默认 | 67 | | touch | float | (单位:秒)触摸屏幕/按下按键 | 68 | | trigger | float | (单位:秒)点击操作离开屏幕/松开按键/滑动操作起始 | 69 | | gesture | float | (单位:秒)全面屏手势 | 70 | | switch | float | (单位:秒)应用切换动画/点亮屏幕 | 71 | | junk | float | (单位:秒)touch/gesture 中 sfanalysis 检测到掉帧 | 72 | 73 | ### atrace/数据打点 74 | 75 | 用于 uperf 程序调试。 76 | 77 | | 字段 | 类型 | 描述 | 78 | | ------ | ---- | ------------ | 79 | | enable | bool | 启用数据打点 | 80 | 81 | ### log/日志级别 82 | 83 | 用于 uperf 配置文件调试。 84 | 85 | | 字段 | 类型 | 描述 | 86 | | ----- | ------ | ----------------------------------------------------- | 87 | | level | string | 日志级别,可用`err`、`warn`、`info`、`debug`、`trace` | 88 | 89 | ### input/用户输入监听 90 | 91 | 监听用户触摸屏触摸操作、按键操作、鼠标操作。支持输入设备热插拔。 92 | 93 | | 字段 | 类型 | 描述 | 94 | | ---------------- | ----- | ------------------------------------------------ | 95 | | enable | bool | 启用用户输入监听 | 96 | | swipeThd | float | 单次触摸轨迹百分比长度超过该阈值,判定为滑动操作 | 97 | | gestureThdX | float | 全面屏手势起始 X 轴百分比位置 | 98 | | gestureThdY | float | 全面屏手势起始 Y 轴百分比位置 | 99 | | gestureDelayTime | float | 暂不使用 | 100 | | holdEnterTime | float | 暂不使用 | 101 | 102 | ### sfanalysis/SurfaceFlinger 信号分析 103 | 104 | 接收 sfanalysis 模块在 SurfaceFlinger 内部的信号分析结果。检测到掉帧触发 hint,渲染结束提前结束 hint。 105 | 106 | | 字段 | 类型 | 描述 | 107 | | ------------------- | ----- | ------------------------------------------------ | 108 | | enable | bool | 启用 SurfaceFlinger 信号分析 | 109 | | renderIdleSlackTime | float | (单位:秒)渲染结束保持一段时间,判定为渲染结束 | 110 | 111 | ### cpu/用户态 CPU 调频 112 | 113 | 基于能耗模型的用户态 CPU 调频器,使能 HMP/EAS 全平台统一体验。根据功耗模型计算每个频点的每瓦性能,选择最佳的频率限制。 114 | 115 | | 字段 | 类型 | 描述 | 116 | | ---------- | ------ | ------------------- | 117 | | enable | bool | 启用用户态 CPU 调频 | 118 | | powerModel | object | CPU 能耗模型 | 119 | 120 | #### powerModel/能耗模型 121 | 122 | 仅需一组实测数据即可完成标定。经验模型结合实测数据,保持模型精度并显著减少平台适配工作量。类型为对象列表,与 CPU 集群顺序一致。 123 | 124 | 注:**典型频点并非调频最大值**,大于典型频点的功耗使用模型外插计算。 125 | 126 | | 字段 | 类型 | 描述 | 127 | | ------------ | ----- | --------------------------------------------- | 128 | | efficiency | int | 单核相对同频性能(以Cortex-A53@1.0Ghz为 100) | 129 | | nr | int | 集群内核心数量 | 130 | | typicalPower | float | (单位:瓦)单核典型功耗 | 131 | | typicalFreq | float | (单位:千兆赫)单核典型频点 | 132 | | sweetFreq | float | (单位:千兆赫)单核甜点交界频点 | 133 | | plainFreq | float | (单位:千兆赫)单核线性交界频点 | 134 | | freeFreq | float | (单位:千兆赫)单核最低功耗频点 | 135 | 136 | ### sysfs/内核节点写入器 137 | 138 | 用户态性能控制器的核心功能,为不同场景设置不同的内核参数。此模块高度优化,写入目标值开销极低。 139 | 140 | | 字段 | 类型 | 描述 | 141 | | ------ | ------ | ------------------ | 142 | | enable | bool | 启用内核节点写入器 | 143 | | knob | object | 内核节点定义 | 144 | 145 | #### knob/内核节点定义 146 | 147 | 按键值对定义: 148 | 149 | - 键:内核节点名称 150 | - 值:内核节点文件路径 151 | 152 | 例子: 153 | 154 | ```json 155 | "cpusetTa": "/dev/cpuset/top-app/cpus" 156 | ``` 157 | 158 | ### sched/识别上下文的任务调度器 159 | 160 | 在相同的能耗下,改进 QoS 提升用户感知的流畅度。正则匹配进程名和线程名,绑定到指定的 CPU 核心,并设置指定的调度优先级。此模块高度优化,进程扫描和动态规则应用开销极低。 161 | 162 | 识别上下文的任务调度器定义有如下场景: 163 | 164 | - `bg`:进程处于后台 165 | - `fg`:进程处于前台 166 | - `idle`:进程处于顶层可见,默认场景 167 | - `touch`:进程处于顶层可见,交互场景 168 | - `boost`:进程处于顶层可见,重负载场景 169 | 170 | | 字段 | 类型 | 描述 | 171 | | -------- | ------ | -------------------------- | 172 | | enable | bool | 启用识别上下文的任务调度器 | 173 | | cpumask | object | CPU 组定义 | 174 | | affinity | object | CPU 亲和性类别定义 | 175 | | prio | object | 调度优先级类别定义 | 176 | | rules | object | 进程规则 | 177 | 178 | #### cpumask/CPU 组定义 179 | 180 | 按键值对定义: 181 | 182 | - 键:CPU 组名称 183 | - 值:此 CPU 组包含的 CPU 核心 id 列表 184 | 185 | 例子: 186 | 187 | ```json 188 | "perf": [4, 5, 6, 7] 189 | ``` 190 | 191 | #### affinity/CPU 亲和性类别定义 192 | 193 | 按键值对定义: 194 | 195 | - 键:CPU 亲和性类别名称 196 | - 值:每个场景绑定到的`cpumask` 197 | 198 | 例子: 199 | 200 | ```json 201 | "coop": { 202 | "bg": "eff", 203 | "fg": "eff", 204 | "idle": "norm", 205 | "touch": "norm", 206 | "boost": "norm" 207 | } 208 | ``` 209 | 210 | #### prio/调度优先级类别定义 211 | 212 | 按键值对定义: 213 | 214 | - 键:调度优先级类别名称 215 | - 值:每个场景应用的调度优先级,值定义如下 216 | 217 | | 数值 | 描述 | 218 | | ------- | ------------------------------------------------------ | 219 | | 0 | 跳过 SCHED 类别设置 | 220 | | 1~98 | 设置线程调度类别为`SCHED_FIFO`,数值为实时静态优先级 | 221 | | 100~139 | 设置线程调度类别为`SCHED_NORMAL`,数值为实时静态优先级 | 222 | | -1 | 设置线程调度类别为`SCHED_NORMAL` | 223 | | -2 | 设置线程调度类别为`SCHED_BATCH` | 224 | | -3 | 设置线程调度类别为`SCHED_IDLE` | 225 | 226 | 例子: 227 | 228 | ```json 229 | "high": { 230 | "bg": -3, 231 | "fg": 110, 232 | "idle": 104, 233 | "touch": 102, 234 | "boost": 100 235 | } 236 | ``` 237 | 238 | #### rules/进程规则 239 | 240 | 类型为对象列表,与匹配优先级顺序一致。 241 | 242 | 注:正则匹配规则`/HOME_PACKAGE/`在内部会自动替换为当前系统启动器的包名。 243 | 244 | | 字段 | 类型 | 描述 | 245 | | ------ | ------ | -------------------------------------------- | 246 | | name | string | 进程规则名 | 247 | | regex | string | 进程名正则匹配规则,注意不要与 json 语法冲突 | 248 | | pinned | bool | 始终作为`处于顶层可见的进程`应用规则 | 249 | | rules | object | 此进程的线程规则 | 250 | 251 | ##### rules/线程规则 252 | 253 | 类型为对象列表,与匹配优先级顺序一致。 254 | 255 | 注:正则匹配规则`/MAIN_THREAD/`在内部会自动替换为主线程线程名。 256 | 257 | | 字段 | 类型 | 描述 | 258 | | ---- | ------ | ----------------------------------------------------------------------- | 259 | | k | string | 线程名正则匹配规则,注意不要与 json 语法冲突(abbr: keyword) | 260 | | ac | string | 线程的 CPU 亲和性类别,需要在`affinity`预先定义(abbr: affinity class) | 261 | | pc | string | 线程的调度优先级类别,需要在`prio`预先定义(abbr: priority class) | 262 | 263 | ## initials/初始值 264 | 265 | 功能模块的动态参数段,模块初始化完成后可动态切换,用于调整阈值、模块行为倾向性等。在此段定义的值为该模块参数的默认值。 266 | 267 | ### cpu/用户态 CPU 调频 268 | 269 | 基于能耗模型的用户态 CPU 调频器工作流程如下,提供多个可调节参数: 270 | 271 | 1. 从内核周期性采样 CPU 每个核心的负载 272 | - CPU 整体存在一定负载时,以`baseSampleTime`周期采样 CPU 频率,提高响应速度 273 | - CPU 整体进入空载时,以`baseSlackTime`周期采样 CPU 频率,减少轮询开销 274 | 2. 计算每个集群的性能负载和性能需求 275 | - 如果 CPU 集群最大负载增加量大于`predictThd`,则性能需求计算使用预测的负载值 276 | - 根据性能负载计算性能需求,`demand = load + (1 - load) * (margin + burst)` 277 | - 与`margin`不同,`burst`非零时即使当前负载较低也能计算到较大的性能需求 278 | 3. 计算性能需求对应的工作频点 279 | - CPU 整体如果存在多个集群,它们共享整个`latencyTime`,表示从性能最低的集群的最低频到性能最高的集群的最高频率的最小延迟 280 | - 由于离散采样周期的存在,实测 CPU 整体升频最小延迟一般会大于设定的`latencyTime` 281 | - 能耗代价越大的频点,升频到它的延迟也越大,且低于`sweetFreq`的频点没有额外的升频延迟 282 | 4. 限制 CPU 整体的功耗 283 | - 类似于 Intel 处理器的 PL1 和 PL2 功耗限制,兼顾短期爆发性能需求和长期能效需求 284 | - 根据能耗模型和每个核心的负载,估计当前周期 CPU 整体的能耗值 285 | - 如果当前能耗大于`slowLimitPower`,能耗缓冲池余量减少 286 | - 如果当前能耗小于`slowLimitPower`,能耗缓冲池余量增加,并按照`fastLimitRecoverScale`缩放因子恢复,总量不超过`fastLimitCapacity` 287 | - 限制 CPU 功耗根据能耗模型选择最优频率限制,在限定功耗下提供最佳整体性能 288 | - `burst`非零时忽略`fastLimitPower`和`slowLimitPower`限制 289 | 5. 引导任务调度器放置任务 290 | - 启用`guideCap`后,根据能耗模型调节集群性能容量,引导 EAS 任务调度器把任务放置到能效最佳的集群 291 | - 启用`limitEfficiency`后,低性能集群最大频点能效值不高于高性能集群当前频点的能效值 292 | 6. 写入目标 CPU 频率到内核 293 | - 高效的 CPU 频率写入器,用户态 CPU 调频整体周期运行耗时大约为 0.0005 秒 294 | 295 | | 字段 | 类型 | 描述 | 296 | | --------------------- | ----- | -------------------------------------------------------------------------------------------- | 297 | | baseSampleTime | float | (单位:秒)(0.01~0.5)基础采样周期 | 298 | | baseSlackTime | float | (单位:秒)(0.01~0.5)闲置采样周期,CPU 整体进入空载时生效 | 299 | | latencyTime | float | (单位:秒)(0.0~10.0)CPU 整体升频最小延迟 | 300 | | slowLimitPower | float | (单位:瓦)(0.05~999.0)CPU 长期功耗限制 | 301 | | fastLimitPower | float | (单位:瓦)(0.05~999.0)CPU 短期功耗限制,能耗缓冲池消耗完毕后进入长期功耗限制 | 302 | | fastLimitCapacity | float | (单位:瓦秒)(0.0~999.0)CPU 短期功耗限制容量,增加时重置余量为限制容量 | 303 | | fastLimitRecoverScale | float | (0.1~10.0)CPU 短期功耗限制容量恢复缩放因子 | 304 | | predictThd | float | (0.1~1.0)CPU 集群最大负载增加量大于该阈值,则集群调频使用预测的负载值,并忽略`latencyTime` | 305 | | margin | float | (0.0~1.0)调频提供的性能余量 | 306 | | burst | float | (0.0~1.0)调频提供的额外性能余量,非零时忽略`latencyTime`和功耗限制 | 307 | | guideCap | bool | 启用引导 EAS 任务调度负载转移 | 308 | | limitEfficiency | bool | 启用 CPU 整体能效限制 | 309 | 310 | ### sysfs/内核节点写入器 311 | 312 | 按键值对定义: 313 | 314 | - 键:内核节点名称 315 | - 值:内核节点文件写入值,支持`string`和`int`类型 316 | 317 | 例子: 318 | 319 | ```json 320 | "cpusetTa": "0-7" 321 | ``` 322 | 323 | ### sched/识别上下文的任务调度器 324 | 325 | | 字段 | 类型 | 描述 | 326 | | ----- | ------ | -------------------------------------------------------- | 327 | | scene | string | 进程处于顶层可见的场景,合法值有`idle`, `touch`, `boost` | 328 | 329 | ## presets/参数预设 330 | 331 | 功能模块的参数预设段,在这里定义不同的性能模式,如均衡模式、节能模式。 332 | 333 | 每组参数预设必须包含`*`, `idle`, `touch`, `trigger`, `gesture`, `junk`, `switch`,如下样例所示。参数预设中子配置名称定义同[动态配置切换器](#switcher/动态配置切换器),在状态跳转后应用对应模式的动态参数。其中`*`中的参数为该组参数预设的动态参数默认值。 334 | 335 | ```json 336 | "balance": { 337 | "*": { 338 | }, 339 | "idle": { 340 | }, 341 | "touch": { 342 | }, 343 | "trigger": { 344 | }, 345 | "gesture": { 346 | }, 347 | "junk": { 348 | }, 349 | "switch": { 350 | } 351 | } 352 | ``` 353 | 354 | 为了提高参数预设的可读性,参数值采用`层叠样式表`的设计方式。以下示例展示参数值`cpu.baseSampleTime`的覆盖关系: 355 | 356 | 1. 在`/initial/cpu`中定义`baseSampleTime`全局默认值为`0.01` 357 | 2. 在`/presets/balance/*`中定义`baseSampleTime`在该参数预设默认值为`0.02`,覆盖全局默认值`0.01` 358 | 3. 在`/presets/balance/idle`中定义`baseSampleTime`在`idle`场景值为`0.04`,覆盖该参数预设默认值`0.02` 359 | 360 | ``` 361 | "initials": { 362 | "cpu": { 363 | "baseSampleTime": 0.01, 364 | } 365 | }, 366 | "presets": { 367 | "balance": { 368 | "*": { 369 | "cpu.baseSampleTime": 0.02 370 | }, 371 | "idle": { 372 | "cpu.baseSampleTime": 0.04 373 | } 374 | } 375 | } 376 | ``` 377 | -------------------------------------------------------------------------------- /config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "name": "platform[yy.mm.dd]", 4 | "author": "author@community" 5 | }, 6 | "modules": { 7 | "switcher": { 8 | "switchInode": "/sdcard/Android/yc/uperf/cur_powermode.txt", 9 | "perapp": "/sdcard/Android/yc/uperf/perapp_powermode.txt", 10 | "hintDuration": { 11 | "idle": 0.0, 12 | "touch": 4.0, 13 | "trigger": 0.03, 14 | "gesture": 0.1, 15 | "switch": 0.4, 16 | "junk": 0.06 17 | } 18 | }, 19 | "atrace": { 20 | "enable": false 21 | }, 22 | "log": { 23 | "level": "info" 24 | }, 25 | "input": { 26 | "enable": true, 27 | "swipeThd": 0.01, 28 | "gestureThdX": 0.03, 29 | "gestureThdY": 0.03, 30 | "gestureDelayTime": 2.0, 31 | "holdEnterTime": 1.0 32 | }, 33 | "sfanalysis": { 34 | "enable": true, 35 | "renderIdleSlackTime": 0.2 36 | }, 37 | "cpu": { 38 | "enable": true, 39 | "powerModel": [] 40 | }, 41 | "sysfs": { 42 | "enable": true, 43 | "knob": {} 44 | }, 45 | "sched": { 46 | "enable": true, 47 | "cpumask": { 48 | "all": [0, 1, 2, 3, 4, 5, 6, 7], 49 | "c0": [0, 1, 2, 3], 50 | "c1": [4, 5, 6], 51 | "c2": [7] 52 | }, 53 | "affinity": { 54 | "auto": { "bg": "", "fg": "", "idle": "", "touch": "", "boost": "" }, 55 | "norm": { "bg": "", "fg": "all", "idle": "all", "touch": "all", "boost": "all" }, 56 | "bg": { "bg": "", "fg": "c0", "idle": "c0", "touch": "c0", "boost": "c0" }, 57 | "ui": { "bg": "", "fg": "all", "idle": "c1", "touch": "c1", "boost": "all" }, 58 | "crit": { "bg": "", "fg": "all", "idle": "all", "touch": "c1", "boost": "c1" }, 59 | "gtcoop": { "bg": "", "fg": "all", "idle": "all", "touch": "c1", "boost": "all" }, 60 | "gtmain": { "bg": "", "fg": "all", "idle": "all", "touch": "c2", "boost": "all" } 61 | }, 62 | "prio": { 63 | "auto": { "bg": 0, "fg": 0, "idle": 0, "touch": 0, "boost": 0 }, 64 | "norm": { "bg": -1, "fg": -1, "idle": -1, "touch": -1, "boost": -1 }, 65 | "bg": { "bg": -3, "fg": 139, "idle": 139, "touch": 139, "boost": 139 }, 66 | "coop": { "bg": -3, "fg": 124, "idle": 122, "touch": 122, "boost": 130 }, 67 | "ui": { "bg": -3, "fg": 120, "idle": 110, "touch": 98, "boost": 116 }, 68 | "rtusr": { "bg": 98, "fg": 98, "idle": 97, "touch": 97, "boost": 98 }, 69 | "rtsys": { "bg": 97, "fg": 97, "idle": 96, "touch": 96, "boost": 97 } 70 | }, 71 | "rules": [ 72 | { 73 | "name": "Launcher", 74 | "regex": "/HOME_PACKAGE/", 75 | "pinned": true, 76 | "rules": [ 77 | { "k": "/MAIN_THREAD/", "ac": "crit", "pc": "rtusr" }, 78 | { "k": "^(RenderThread|GLThread)", "ac": "crit", "pc": "rtusr" }, 79 | { "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", "ac": "bg", "pc": "rtusr" }, 80 | { "k": ".", "ac": "auto", "pc": "auto" } 81 | ] 82 | }, 83 | { 84 | "name": "SurfaceFlinger", 85 | "regex": "/system/bin/surfaceflinger", 86 | "pinned": true, 87 | "rules": [ 88 | { "k": "/MAIN_THREAD/", "ac": "crit", "pc": "auto" }, 89 | { "k": "^(app|RenderEngine)", "ac": "crit", "pc": "auto" }, 90 | { "k": "^Binder:", "ac": "auto", "pc": "auto" }, 91 | { "k": ".", "ac": "bg", "pc": "auto" } 92 | ] 93 | }, 94 | { 95 | "name": "SystemServer", 96 | "regex": "system_server", 97 | "pinned": true, 98 | "rules": [ 99 | { "k": "^(TaskSnapshot|Greezer|CachedApp|SystemPressure|SensorService)|[Mm]emory", "ac": "bg", "pc": "auto" }, 100 | { "k": ".", "ac": "auto", "pc": "auto" } 101 | ] 102 | }, 103 | { 104 | "name": "SystemUI", 105 | "regex": "com.android.systemui", 106 | "pinned": true, 107 | "rules": [{ "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", "ac": "bg", "pc": "auto" }] 108 | }, 109 | { 110 | "name": "MediaProvider", 111 | "regex": "^com.android.providers.media", 112 | "pinned": true, 113 | "rules": [{ "k": ".", "ac": "auto", "pc": "bg" }] 114 | }, 115 | { 116 | "name": "Memory reclaim", 117 | "regex": "swapd|compactd", 118 | "pinned": true, 119 | "rules": [{ "k": ".", "ac": "auto", "pc": "bg" }] 120 | }, 121 | { 122 | "name": "Phone", 123 | "regex": "com.android.phone", 124 | "pinned": false, 125 | "rules": [{ "k": ".", "ac": "auto", "pc": "auto" }] 126 | }, 127 | { 128 | "name": "Other system processes", 129 | "regex": "^(/system|/vendor|magiskd|zygiskd)|@|-service$", 130 | "pinned": false, 131 | "rules": [{ "k": ".", "ac": "auto", "pc": "auto" }] 132 | }, 133 | { 134 | "name": "App co-process", 135 | "regex": "[.].+:", 136 | "pinned": false, 137 | "rules": [{ "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", "ac": "bg", "pc": "auto" }] 138 | }, 139 | { 140 | "name": "Default rule", 141 | "regex": ".", 142 | "pinned": false, 143 | "rules": [ 144 | { "k": "/MAIN_THREAD/", "ac": "ui", "pc": "ui" }, 145 | { "k": "^(UnityMain|RenderThread |GameThread)", "ac": "gtmain", "pc": "auto" }, 146 | { "k": "^(Unity|Worker Thread|TaskGraph|RHIThread)", "ac": "gtcoop", "pc": "auto" }, 147 | { "k": "^(RenderThread|GLThread|JNISurfaceText|IJK_External_Re)|[Aa]nim|([.]raster|[.]ui)$", "ac": "ui", "pc": "ui" }, 148 | { "k": "^(Chrome_InProc|CrRendererMain|CrGpuMain|CompositorTile)", "ac": "norm", "pc": "norm" }, 149 | { "k": "^(Viz|Chrome_|Compositor)|[Vv]sync|mali-", "ac": "ui", "pc": "ui" }, 150 | { "k": "^(OkHttp|Ysa|Xqa|Rx|TVKDL|APM|tp-|cgi-|ODCP-|Bugly|xlog_)", "ac": "bg", "pc": "auto" }, 151 | { "k": "^(xg_vip_service|Profile|SearchDaemon|default_matrix|FrameDecoder|FrameSeq)", "ac": "bg", "pc": "auto" }, 152 | { "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", "ac": "bg", "pc": "rtusr" }, 153 | { "k": "^(JS|libweexjsb|WeexJsBridge|mqt_native|mqt_js|JavaScriptTh)", "ac": "norm", "pc": "coop" }, 154 | { "k": "^(pool-|glide-|launcher-)|[Dd]ownload|[Ss]chedule|[Ww]ork|[Pp]ool|[Dd]efau|Fresco", "ac": "norm", "pc": "coop" }, 155 | { "k": ".", "ac": "norm", "pc": "norm" } 156 | ] 157 | } 158 | ] 159 | } 160 | }, 161 | "initials": { 162 | "cpu": { 163 | "baseSampleTime": 0.01, 164 | "baseSlackTime": 0.01, 165 | "latencyTime": 0.5, 166 | "slowLimitPower": 3.0, 167 | "fastLimitPower": 6.0, 168 | "fastLimitCapacity": 10.0, 169 | "fastLimitRecoverScale": 0.3, 170 | "predictThd": 0.3, 171 | "margin": 0.25, 172 | "burst": 0.0, 173 | "guideCap": true, 174 | "limitEfficiency": false 175 | }, 176 | "sysfs": {}, 177 | "sched": { 178 | "scene": "idle" 179 | } 180 | }, 181 | "presets": { 182 | "balance": { 183 | "*": { 184 | "cpu.latencyTime": 0.2, 185 | "cpu.slowLimitPower": 2.0, 186 | "cpu.fastLimitPower": 2.0, 187 | "cpu.fastLimitCapacity": 20.0, 188 | "cpu.margin": 0.2 189 | }, 190 | "idle": { 191 | "cpu.baseSampleTime": 0.04, 192 | "cpu.baseSlackTime": 0.08, 193 | "cpu.predictThd": 0.3, 194 | "cpu.limitEfficiency": true, 195 | "sched.scene": "idle" 196 | }, 197 | "touch": { 198 | "cpu.baseSampleTime": 0.04, 199 | "sched.scene": "touch" 200 | }, 201 | "trigger": { 202 | "cpu.margin": 0.4, 203 | "sched.scene": "touch" 204 | }, 205 | "gesture": { 206 | "cpu.margin": 0.6, 207 | "sched.scene": "touch" 208 | }, 209 | "junk": { 210 | "cpu.burst": 0.6, 211 | "sched.scene": "touch" 212 | }, 213 | "switch": { 214 | "cpu.latencyTime": 0.0, 215 | "cpu.slowLimitPower": 3.0, 216 | "cpu.fastLimitPower": 6.0, 217 | "cpu.fastLimitRecoverScale": 0.1, 218 | "cpu.margin": 0.4, 219 | "sched.scene": "boost" 220 | } 221 | }, 222 | "powersave": { 223 | "*": { 224 | "cpu.latencyTime": 0.4, 225 | "cpu.slowLimitPower": 1.0, 226 | "cpu.fastLimitPower": 1.0, 227 | "cpu.fastLimitCapacity": 5.0, 228 | "cpu.margin": 0.1 229 | }, 230 | "idle": { 231 | "cpu.baseSampleTime": 0.04, 232 | "cpu.baseSlackTime": 0.08, 233 | "cpu.predictThd": 1.0, 234 | "cpu.limitEfficiency": true, 235 | "sched.scene": "idle" 236 | }, 237 | "touch": { 238 | "cpu.baseSampleTime": 0.04, 239 | "sched.scene": "touch" 240 | }, 241 | "trigger": { 242 | "cpu.margin": 0.4, 243 | "sched.scene": "touch" 244 | }, 245 | "gesture": { 246 | "cpu.margin": 0.6, 247 | "sched.scene": "touch" 248 | }, 249 | "junk": { 250 | "cpu.burst": 0.3, 251 | "sched.scene": "touch" 252 | }, 253 | "switch": { 254 | "cpu.latencyTime": 0.0, 255 | "cpu.slowLimitPower": 1.5, 256 | "cpu.fastLimitPower": 3.0, 257 | "cpu.fastLimitRecoverScale": 0.1, 258 | "cpu.margin": 0.3, 259 | "sched.scene": "boost" 260 | } 261 | }, 262 | "performance": { 263 | "*": { 264 | "cpu.latencyTime": 0.0, 265 | "cpu.slowLimitPower": 4.0, 266 | "cpu.fastLimitPower": 10.0, 267 | "cpu.fastLimitCapacity": 360.0, 268 | "cpu.margin": 0.4 269 | }, 270 | "idle": { 271 | "cpu.baseSampleTime": 0.01, 272 | "cpu.baseSlackTime": 0.04, 273 | "sched.scene": "idle" 274 | }, 275 | "touch": { 276 | "sched.scene": "touch" 277 | }, 278 | "trigger": { 279 | "cpu.margin": 0.8, 280 | "sched.scene": "touch" 281 | }, 282 | "gesture": { 283 | "cpu.margin": 0.8, 284 | "sched.scene": "touch" 285 | }, 286 | "junk": { 287 | "cpu.burst": 0.5, 288 | "sched.scene": "touch" 289 | }, 290 | "switch": { 291 | "cpu.burst": 0.2, 292 | "sched.scene": "boost" 293 | } 294 | }, 295 | "fast": { 296 | "*": { 297 | "cpu.latencyTime": 0.0, 298 | "cpu.slowLimitPower": 2.5, 299 | "cpu.fastLimitPower": 2.5, 300 | "cpu.fastLimitCapacity": 0.0, 301 | "cpu.margin": 0.4 302 | }, 303 | "idle": { 304 | "cpu.baseSampleTime": 0.01, 305 | "cpu.baseSlackTime": 0.04, 306 | "sched.scene": "idle" 307 | }, 308 | "touch": { 309 | "sched.scene": "touch" 310 | }, 311 | "trigger": { 312 | "cpu.margin": 0.8, 313 | "sched.scene": "touch" 314 | }, 315 | "gesture": { 316 | "cpu.margin": 0.8, 317 | "sched.scene": "touch" 318 | }, 319 | "junk": { 320 | "cpu.burst": 0.5, 321 | "sched.scene": "touch" 322 | }, 323 | "switch": { 324 | "cpu.burst": 0.2, 325 | "sched.scene": "boost" 326 | } 327 | } 328 | } 329 | } 330 | -------------------------------------------------------------------------------- /magisk/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | Copyright 2021-2022 Matt Yang 180 | 181 | Licensed under the Apache License, Version 2.0 (the "License"); 182 | you may not use this file except in compliance with the License. 183 | You may obtain a copy of the License at 184 | 185 | http://www.apache.org/licenses/LICENSE-2.0 186 | 187 | Unless required by applicable law or agreed to in writing, software 188 | distributed under the License is distributed on an "AS IS" BASIS, 189 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 190 | See the License for the specific language governing permissions and 191 | limitations under the License. 192 | -------------------------------------------------------------------------------- /magisk/META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | 3 | TMPDIR=/dev/tmp 4 | MOUNTPATH=/dev/magisk_img 5 | 6 | # Default permissions 7 | umask 022 8 | 9 | # Initial cleanup 10 | rm -rf $TMPDIR 2>/dev/null 11 | mkdir -p $TMPDIR 12 | 13 | # echo before loading util_functions 14 | ui_print() { echo "$1"; } 15 | 16 | require_new_magisk() { 17 | ui_print "***********************************" 18 | ui_print " Please install the latest Magisk! " 19 | ui_print "***********************************" 20 | exit 1 21 | } 22 | 23 | imageless_magisk() { 24 | [ $MAGISK_VER_CODE -gt 18100 ] 25 | return $? 26 | } 27 | 28 | ########################################################################################## 29 | # Environment 30 | ########################################################################################## 31 | 32 | OUTFD=$2 33 | ZIPFILE=$3 34 | 35 | mount /data 2>/dev/null 36 | 37 | # Load utility functions 38 | if [ -f /data/adb/magisk/util_functions.sh ]; then 39 | . /data/adb/magisk/util_functions.sh 40 | NVBASE=/data/adb 41 | else 42 | require_new_magisk 43 | fi 44 | 45 | # Preperation for flashable zips 46 | setup_flashable 47 | 48 | # Mount partitions 49 | mount_partitions 50 | 51 | # Detect version and architecture 52 | api_level_arch_detect 53 | 54 | # Setup busybox and binaries 55 | $BOOTMODE && boot_actions || recovery_actions 56 | 57 | ########################################################################################## 58 | # Preparation 59 | ########################################################################################## 60 | 61 | # Extract common files 62 | unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR >&2 63 | 64 | [ ! -f $TMPDIR/install.sh ] && abort "! Unable to extract zip file!" 65 | # Load install script 66 | . $TMPDIR/install.sh 67 | 68 | if imageless_magisk; then 69 | $BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules 70 | MODULEROOT=$NVBASE/$MODDIRNAME 71 | else 72 | $BOOTMODE && IMGNAME=magisk_merge.img || IMGNAME=magisk.img 73 | IMG=$NVBASE/$IMGNAME 74 | request_zip_size_check "$ZIPFILE" 75 | mount_magisk_img 76 | MODULEROOT=$MOUNTPATH 77 | fi 78 | 79 | MODID=`grep_prop id $TMPDIR/module.prop` 80 | MODPATH=$MODULEROOT/$MODID 81 | 82 | print_modname 83 | 84 | ui_print "******************************" 85 | ui_print "Powered by Magisk (@topjohnwu)" 86 | ui_print "******************************" 87 | 88 | ########################################################################################## 89 | # Install 90 | ########################################################################################## 91 | 92 | # Create mod paths 93 | rm -rf $MODPATH 2>/dev/null 94 | mkdir -p $MODPATH 95 | 96 | on_install 97 | 98 | # Remove placeholder 99 | rm -f $MODPATH/system/placeholder 2>/dev/null 100 | 101 | # Custom uninstaller 102 | [ -f $TMPDIR/uninstall.sh ] && cp -af $TMPDIR/uninstall.sh $MODPATH/uninstall.sh 103 | 104 | # Auto Mount 105 | if imageless_magisk; then 106 | $SKIPMOUNT && touch $MODPATH/skip_mount 107 | else 108 | $SKIPMOUNT || touch $MODPATH/auto_mount 109 | fi 110 | 111 | # prop files 112 | $PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop 113 | 114 | # Module info 115 | cp -af $TMPDIR/module.prop $MODPATH/module.prop 116 | if $BOOTMODE; then 117 | # Update info for Magisk Manager 118 | if imageless_magisk; then 119 | mktouch $NVBASE/modules/$MODID/update 120 | cp -af $TMPDIR/module.prop $NVBASE/modules/$MODID/module.prop 121 | else 122 | mktouch /sbin/.magisk/img/$MODID/update 123 | cp -af $TMPDIR/module.prop /sbin/.magisk/img/$MODID/module.prop 124 | fi 125 | fi 126 | 127 | # post-fs-data mode scripts 128 | $POSTFSDATA && cp -af $TMPDIR/post-fs-data.sh $MODPATH/post-fs-data.sh 129 | 130 | # service mode scripts 131 | $LATESTARTSERVICE && cp -af $TMPDIR/service.sh $MODPATH/service.sh 132 | 133 | # Handle replace folders 134 | for TARGET in $REPLACE; do 135 | mktouch $MODPATH$TARGET/.replace 136 | done 137 | 138 | ui_print "- Setting permissions" 139 | set_permissions 140 | 141 | ########################################################################################## 142 | # Finalizing 143 | ########################################################################################## 144 | 145 | cd / 146 | imageless_magisk || unmount_magisk_img 147 | $BOOTMODE || recovery_cleanup 148 | rm -rf $TMPDIR $MOUNTPATH 149 | 150 | ui_print "- Done" 151 | exit 0 152 | -------------------------------------------------------------------------------- /magisk/META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /magisk/bin/uperf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feravolt/uperf/314909b3b6a996afd14632a8e5afeedb2d7fbc7b/magisk/bin/uperf -------------------------------------------------------------------------------- /magisk/common/service.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # Copyright (C) 2021-2022 Matt Yang 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | BASEDIR="$(dirname $(readlink -f "$0"))" 19 | sh $BASEDIR/script/initsvc.sh 20 | -------------------------------------------------------------------------------- /magisk/config/e8890.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "name": "Exynos 8890[22.07.09] (FDE.AI Edition)", 4 | "author": "yc@coolapk" 5 | }, 6 | "modules": { 7 | "switcher": { 8 | "switchInode": "/sdcard/Android/yc/uperf/cur_powermode.txt", 9 | "perapp": "/sdcard/Android/yc/uperf/perapp_powermode.txt", 10 | "hintDuration": { 11 | "idle": 0.0, 12 | "touch": 4.0, 13 | "trigger": 0.03, 14 | "gesture": 0.1, 15 | "switch": 0.4, 16 | "junk": 0.06 17 | } 18 | }, 19 | "atrace": { 20 | "enable": false 21 | }, 22 | "log": { 23 | "level": "info" 24 | }, 25 | "input": { 26 | "enable": true, 27 | "swipeThd": 0.01, 28 | "gestureThdX": 0.03, 29 | "gestureThdY": 0.03, 30 | "gestureDelayTime": 2.0, 31 | "holdEnterTime": 1.0 32 | }, 33 | "sfanalysis": { 34 | "enable": true, 35 | "renderIdleSlackTime": 0.2 36 | }, 37 | "cpu": { 38 | "enable": true, 39 | "powerModel": [ 40 | { 41 | "efficiency": 100, 42 | "nr": 4, 43 | "typicalPower": 0.36, 44 | "typicalFreq": 1.6, 45 | "sweetFreq": 1.2, 46 | "plainFreq": 0.9, 47 | "freeFreq": 0.5 48 | }, 49 | { 50 | "efficiency": 160, 51 | "nr": 4, 52 | "typicalPower": 2.53, 53 | "typicalFreq": 2.6, 54 | "sweetFreq": 1.7, 55 | "plainFreq": 1.0, 56 | "freeFreq": 0.7 57 | } 58 | ] 59 | }, 60 | "sysfs": { 61 | "enable": false, 62 | "knob": {} 63 | }, 64 | "sched": { 65 | "enable": true, 66 | "cpumask": { 67 | "all": [ 68 | 0, 69 | 1, 70 | 2, 71 | 3, 72 | 4, 73 | 5, 74 | 6, 75 | 7 76 | ], 77 | "c0": [ 78 | 0, 79 | 1, 80 | 2, 81 | 3 82 | ], 83 | "c1": [ 84 | 4, 85 | 5, 86 | 6 87 | ], 88 | "c2": [ 89 | 7 90 | ] 91 | }, 92 | "affinity": { 93 | "auto": { 94 | "bg": "", 95 | "fg": "", 96 | "idle": "", 97 | "touch": "", 98 | "boost": "" 99 | }, 100 | "norm": { 101 | "bg": "", 102 | "fg": "all", 103 | "idle": "all", 104 | "touch": "all", 105 | "boost": "all" 106 | }, 107 | "bg": { 108 | "bg": "", 109 | "fg": "c0", 110 | "idle": "c0", 111 | "touch": "c0", 112 | "boost": "c0" 113 | }, 114 | "ui": { 115 | "bg": "", 116 | "fg": "all", 117 | "idle": "c1", 118 | "touch": "c1", 119 | "boost": "all" 120 | }, 121 | "crit": { 122 | "bg": "", 123 | "fg": "all", 124 | "idle": "all", 125 | "touch": "c1", 126 | "boost": "c1" 127 | }, 128 | "gtcoop": { 129 | "bg": "", 130 | "fg": "all", 131 | "idle": "all", 132 | "touch": "c1", 133 | "boost": "all" 134 | }, 135 | "gtmain": { 136 | "bg": "", 137 | "fg": "all", 138 | "idle": "all", 139 | "touch": "c2", 140 | "boost": "all" 141 | } 142 | }, 143 | "prio": { 144 | "auto": { 145 | "bg": 0, 146 | "fg": 0, 147 | "idle": 0, 148 | "touch": 0, 149 | "boost": 0 150 | }, 151 | "norm": { 152 | "bg": -1, 153 | "fg": -1, 154 | "idle": -1, 155 | "touch": -1, 156 | "boost": -1 157 | }, 158 | "bg": { 159 | "bg": -3, 160 | "fg": 139, 161 | "idle": 139, 162 | "touch": 139, 163 | "boost": 139 164 | }, 165 | "coop": { 166 | "bg": -3, 167 | "fg": 124, 168 | "idle": 122, 169 | "touch": 122, 170 | "boost": 130 171 | }, 172 | "ui": { 173 | "bg": -3, 174 | "fg": 120, 175 | "idle": 110, 176 | "touch": 98, 177 | "boost": 116 178 | }, 179 | "rtusr": { 180 | "bg": 98, 181 | "fg": 98, 182 | "idle": 97, 183 | "touch": 97, 184 | "boost": 98 185 | }, 186 | "rtsys": { 187 | "bg": 97, 188 | "fg": 97, 189 | "idle": 96, 190 | "touch": 96, 191 | "boost": 97 192 | } 193 | }, 194 | "rules": [ 195 | { 196 | "name": "Launcher", 197 | "regex": "/HOME_PACKAGE/", 198 | "pinned": true, 199 | "rules": [ 200 | { 201 | "k": "/MAIN_THREAD/", 202 | "ac": "crit", 203 | "pc": "rtusr" 204 | }, 205 | { 206 | "k": "^(RenderThread|GLThread)", 207 | "ac": "crit", 208 | "pc": "rtusr" 209 | }, 210 | { 211 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 212 | "ac": "bg", 213 | "pc": "rtusr" 214 | }, 215 | { 216 | "k": ".", 217 | "ac": "auto", 218 | "pc": "auto" 219 | } 220 | ] 221 | }, 222 | { 223 | "name": "SurfaceFlinger", 224 | "regex": "/system/bin/surfaceflinger", 225 | "pinned": true, 226 | "rules": [ 227 | { 228 | "k": "/MAIN_THREAD/", 229 | "ac": "crit", 230 | "pc": "auto" 231 | }, 232 | { 233 | "k": "^(app|RenderEngine)", 234 | "ac": "crit", 235 | "pc": "auto" 236 | }, 237 | { 238 | "k": "^Binder:", 239 | "ac": "auto", 240 | "pc": "auto" 241 | }, 242 | { 243 | "k": ".", 244 | "ac": "bg", 245 | "pc": "auto" 246 | } 247 | ] 248 | }, 249 | { 250 | "name": "SystemServer", 251 | "regex": "system_server", 252 | "pinned": true, 253 | "rules": [ 254 | { 255 | "k": "^(TaskSnapshot|Greezer|CachedApp|SystemPressure|SensorService)|[Mm]emory", 256 | "ac": "bg", 257 | "pc": "auto" 258 | }, 259 | { 260 | "k": ".", 261 | "ac": "auto", 262 | "pc": "auto" 263 | } 264 | ] 265 | }, 266 | { 267 | "name": "SystemUI", 268 | "regex": "com.android.systemui", 269 | "pinned": true, 270 | "rules": [ 271 | { 272 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 273 | "ac": "bg", 274 | "pc": "auto" 275 | } 276 | ] 277 | }, 278 | { 279 | "name": "MediaProvider", 280 | "regex": "^com.android.providers.media", 281 | "pinned": true, 282 | "rules": [ 283 | { 284 | "k": ".", 285 | "ac": "auto", 286 | "pc": "bg" 287 | } 288 | ] 289 | }, 290 | { 291 | "name": "Memory reclaim", 292 | "regex": "swapd|compactd", 293 | "pinned": true, 294 | "rules": [ 295 | { 296 | "k": ".", 297 | "ac": "auto", 298 | "pc": "bg" 299 | } 300 | ] 301 | }, 302 | { 303 | "name": "Phone", 304 | "regex": "com.android.phone", 305 | "pinned": false, 306 | "rules": [ 307 | { 308 | "k": ".", 309 | "ac": "auto", 310 | "pc": "auto" 311 | } 312 | ] 313 | }, 314 | { 315 | "name": "Other system processes", 316 | "regex": "^(/system|/vendor|magiskd|zygiskd)|@|-service$", 317 | "pinned": false, 318 | "rules": [ 319 | { 320 | "k": ".", 321 | "ac": "auto", 322 | "pc": "auto" 323 | } 324 | ] 325 | }, 326 | { 327 | "name": "App co-process", 328 | "regex": "[.].+:", 329 | "pinned": false, 330 | "rules": [ 331 | { 332 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 333 | "ac": "bg", 334 | "pc": "auto" 335 | } 336 | ] 337 | }, 338 | { 339 | "name": "Default rule", 340 | "regex": ".", 341 | "pinned": false, 342 | "rules": [ 343 | { 344 | "k": "/MAIN_THREAD/", 345 | "ac": "ui", 346 | "pc": "ui" 347 | }, 348 | { 349 | "k": "^(UnityMain|RenderThread |GameThread)", 350 | "ac": "gtmain", 351 | "pc": "auto" 352 | }, 353 | { 354 | "k": "^(Unity|Worker Thread|TaskGraph|RHIThread)", 355 | "ac": "gtcoop", 356 | "pc": "auto" 357 | }, 358 | { 359 | "k": "^(RenderThread|GLThread|JNISurfaceText|IJK_External_Re)|[Aa]nim|([.]raster|[.]ui)$", 360 | "ac": "ui", 361 | "pc": "ui" 362 | }, 363 | { 364 | "k": "^(Chrome_InProc|CrRendererMain|CrGpuMain|CompositorTile)", 365 | "ac": "norm", 366 | "pc": "norm" 367 | }, 368 | { 369 | "k": "^(Viz|Chrome_|Compositor)|[Vv]sync|mali-", 370 | "ac": "ui", 371 | "pc": "ui" 372 | }, 373 | { 374 | "k": "^(OkHttp|Ysa|Xqa|Rx|TVKDL|APM|tp-|cgi-|ODCP-|Bugly|xlog_)", 375 | "ac": "bg", 376 | "pc": "auto" 377 | }, 378 | { 379 | "k": "^(xg_vip_service|Profile|SearchDaemon|default_matrix|FrameDecoder|FrameSeq)", 380 | "ac": "bg", 381 | "pc": "auto" 382 | }, 383 | { 384 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 385 | "ac": "bg", 386 | "pc": "rtusr" 387 | }, 388 | { 389 | "k": "^(JS|libweexjsb|WeexJsBridge|mqt_native|mqt_js|JavaScriptTh)", 390 | "ac": "norm", 391 | "pc": "coop" 392 | }, 393 | { 394 | "k": "^(pool-|glide-|launcher-)|[Dd]ownload|[Ss]chedule|[Ww]ork|[Pp]ool|[Dd]efau|Fresco", 395 | "ac": "norm", 396 | "pc": "coop" 397 | }, 398 | { 399 | "k": ".", 400 | "ac": "norm", 401 | "pc": "norm" 402 | } 403 | ] 404 | } 405 | ] 406 | } 407 | }, 408 | "initials": { 409 | "cpu": { 410 | "baseSampleTime": 0.01, 411 | "baseSlackTime": 0.01, 412 | "latencyTime": 0.5, 413 | "slowLimitPower": 3.0, 414 | "fastLimitPower": 6.0, 415 | "fastLimitCapacity": 10.0, 416 | "fastLimitRecoverScale": 0.3, 417 | "predictThd": 0.3, 418 | "margin": 0.25, 419 | "burst": 0.0, 420 | "guideCap": true, 421 | "limitEfficiency": false 422 | }, 423 | "sysfs": {}, 424 | "sched": { 425 | "scene": "idle" 426 | } 427 | }, 428 | "presets": { 429 | "balance": { 430 | "*": { 431 | "cpu.latencyTime": 0.2, 432 | "cpu.slowLimitPower": 2.0, 433 | "cpu.fastLimitPower": 2.0, 434 | "cpu.fastLimitCapacity": 20.0, 435 | "cpu.margin": 0.2 436 | }, 437 | "idle": { 438 | "cpu.baseSampleTime": 0.04, 439 | "cpu.baseSlackTime": 0.08, 440 | "cpu.predictThd": 0.3, 441 | "cpu.limitEfficiency": true, 442 | "sched.scene": "idle" 443 | }, 444 | "touch": { 445 | "cpu.baseSampleTime": 0.04, 446 | "sched.scene": "touch" 447 | }, 448 | "trigger": { 449 | "cpu.margin": 0.4, 450 | "sched.scene": "touch" 451 | }, 452 | "gesture": { 453 | "cpu.margin": 0.6, 454 | "sched.scene": "touch" 455 | }, 456 | "junk": { 457 | "cpu.burst": 0.6, 458 | "sched.scene": "touch" 459 | }, 460 | "switch": { 461 | "cpu.latencyTime": 0.0, 462 | "cpu.slowLimitPower": 3.0, 463 | "cpu.fastLimitPower": 6.0, 464 | "cpu.fastLimitRecoverScale": 0.1, 465 | "cpu.margin": 0.4, 466 | "sched.scene": "boost" 467 | } 468 | }, 469 | "powersave": { 470 | "*": { 471 | "cpu.latencyTime": 0.4, 472 | "cpu.slowLimitPower": 1.0, 473 | "cpu.fastLimitPower": 1.0, 474 | "cpu.fastLimitCapacity": 5.0, 475 | "cpu.margin": 0.1 476 | }, 477 | "idle": { 478 | "cpu.baseSampleTime": 0.04, 479 | "cpu.baseSlackTime": 0.08, 480 | "cpu.predictThd": 1.0, 481 | "cpu.limitEfficiency": true, 482 | "sched.scene": "idle" 483 | }, 484 | "touch": { 485 | "cpu.baseSampleTime": 0.04, 486 | "sched.scene": "touch" 487 | }, 488 | "trigger": { 489 | "cpu.margin": 0.4, 490 | "sched.scene": "touch" 491 | }, 492 | "gesture": { 493 | "cpu.margin": 0.6, 494 | "sched.scene": "touch" 495 | }, 496 | "junk": { 497 | "cpu.burst": 0.3, 498 | "sched.scene": "touch" 499 | }, 500 | "switch": { 501 | "cpu.latencyTime": 0.0, 502 | "cpu.slowLimitPower": 1.5, 503 | "cpu.fastLimitPower": 3.0, 504 | "cpu.fastLimitRecoverScale": 0.1, 505 | "cpu.margin": 0.3, 506 | "sched.scene": "boost" 507 | } 508 | }, 509 | "performance": { 510 | "*": { 511 | "cpu.latencyTime": 0.0, 512 | "cpu.slowLimitPower": 4.0, 513 | "cpu.fastLimitPower": 10.0, 514 | "cpu.fastLimitCapacity": 360.0, 515 | "cpu.margin": 0.4 516 | }, 517 | "idle": { 518 | "cpu.baseSampleTime": 0.01, 519 | "cpu.baseSlackTime": 0.04, 520 | "sched.scene": "idle" 521 | }, 522 | "touch": { 523 | "sched.scene": "touch" 524 | }, 525 | "trigger": { 526 | "cpu.margin": 0.8, 527 | "sched.scene": "touch" 528 | }, 529 | "gesture": { 530 | "cpu.margin": 0.8, 531 | "sched.scene": "touch" 532 | }, 533 | "junk": { 534 | "cpu.burst": 0.5, 535 | "sched.scene": "touch" 536 | }, 537 | "switch": { 538 | "cpu.burst": 0.2, 539 | "sched.scene": "boost" 540 | } 541 | }, 542 | "fast": { 543 | "*": { 544 | "cpu.latencyTime": 0.0, 545 | "cpu.slowLimitPower": 2.5, 546 | "cpu.fastLimitPower": 2.5, 547 | "cpu.fastLimitCapacity": 0.0, 548 | "cpu.margin": 0.4 549 | }, 550 | "idle": { 551 | "cpu.baseSampleTime": 0.01, 552 | "cpu.baseSlackTime": 0.04, 553 | "sched.scene": "idle" 554 | }, 555 | "touch": { 556 | "sched.scene": "touch" 557 | }, 558 | "trigger": { 559 | "cpu.margin": 0.8, 560 | "sched.scene": "touch" 561 | }, 562 | "gesture": { 563 | "cpu.margin": 0.8, 564 | "sched.scene": "touch" 565 | }, 566 | "junk": { 567 | "cpu.burst": 0.5, 568 | "sched.scene": "touch" 569 | }, 570 | "switch": { 571 | "cpu.burst": 0.2, 572 | "sched.scene": "boost" 573 | } 574 | } 575 | } 576 | } -------------------------------------------------------------------------------- /magisk/config/e8895.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "name": "Exynos 8895[22.07.09] (FDE.AI Edition)", 4 | "author": "yc@coolapk" 5 | }, 6 | "modules": { 7 | "switcher": { 8 | "switchInode": "/sdcard/Android/yc/uperf/cur_powermode.txt", 9 | "perapp": "/sdcard/Android/yc/uperf/perapp_powermode.txt", 10 | "hintDuration": { 11 | "idle": 0.0, 12 | "touch": 4.0, 13 | "trigger": 0.03, 14 | "gesture": 0.1, 15 | "switch": 0.4, 16 | "junk": 0.06 17 | } 18 | }, 19 | "atrace": { 20 | "enable": false 21 | }, 22 | "log": { 23 | "level": "info" 24 | }, 25 | "input": { 26 | "enable": true, 27 | "swipeThd": 0.01, 28 | "gestureThdX": 0.03, 29 | "gestureThdY": 0.03, 30 | "gestureDelayTime": 2.0, 31 | "holdEnterTime": 1.0 32 | }, 33 | "sfanalysis": { 34 | "enable": true, 35 | "renderIdleSlackTime": 0.2 36 | }, 37 | "cpu": { 38 | "enable": true, 39 | "powerModel": [ 40 | { 41 | "efficiency": 100, 42 | "nr": 4, 43 | "typicalPower": 0.36, 44 | "typicalFreq": 1.7, 45 | "sweetFreq": 1.2, 46 | "plainFreq": 0.9, 47 | "freeFreq": 0.5 48 | }, 49 | { 50 | "efficiency": 170, 51 | "nr": 4, 52 | "typicalPower": 1.95, 53 | "typicalFreq": 2.5, 54 | "sweetFreq": 1.7, 55 | "plainFreq": 1.0, 56 | "freeFreq": 0.7 57 | } 58 | ] 59 | }, 60 | "sysfs": { 61 | "enable": false, 62 | "knob": {} 63 | }, 64 | "sched": { 65 | "enable": true, 66 | "cpumask": { 67 | "all": [ 68 | 0, 69 | 1, 70 | 2, 71 | 3, 72 | 4, 73 | 5, 74 | 6, 75 | 7 76 | ], 77 | "c0": [ 78 | 0, 79 | 1, 80 | 2, 81 | 3 82 | ], 83 | "c1": [ 84 | 4, 85 | 5, 86 | 6 87 | ], 88 | "c2": [ 89 | 7 90 | ] 91 | }, 92 | "affinity": { 93 | "auto": { 94 | "bg": "", 95 | "fg": "", 96 | "idle": "", 97 | "touch": "", 98 | "boost": "" 99 | }, 100 | "norm": { 101 | "bg": "", 102 | "fg": "all", 103 | "idle": "all", 104 | "touch": "all", 105 | "boost": "all" 106 | }, 107 | "bg": { 108 | "bg": "", 109 | "fg": "c0", 110 | "idle": "c0", 111 | "touch": "c0", 112 | "boost": "c0" 113 | }, 114 | "ui": { 115 | "bg": "", 116 | "fg": "all", 117 | "idle": "c1", 118 | "touch": "c1", 119 | "boost": "all" 120 | }, 121 | "crit": { 122 | "bg": "", 123 | "fg": "all", 124 | "idle": "all", 125 | "touch": "c1", 126 | "boost": "c1" 127 | }, 128 | "gtcoop": { 129 | "bg": "", 130 | "fg": "all", 131 | "idle": "all", 132 | "touch": "c1", 133 | "boost": "all" 134 | }, 135 | "gtmain": { 136 | "bg": "", 137 | "fg": "all", 138 | "idle": "all", 139 | "touch": "c2", 140 | "boost": "all" 141 | } 142 | }, 143 | "prio": { 144 | "auto": { 145 | "bg": 0, 146 | "fg": 0, 147 | "idle": 0, 148 | "touch": 0, 149 | "boost": 0 150 | }, 151 | "norm": { 152 | "bg": -1, 153 | "fg": -1, 154 | "idle": -1, 155 | "touch": -1, 156 | "boost": -1 157 | }, 158 | "bg": { 159 | "bg": -3, 160 | "fg": 139, 161 | "idle": 139, 162 | "touch": 139, 163 | "boost": 139 164 | }, 165 | "coop": { 166 | "bg": -3, 167 | "fg": 124, 168 | "idle": 122, 169 | "touch": 122, 170 | "boost": 130 171 | }, 172 | "ui": { 173 | "bg": -3, 174 | "fg": 120, 175 | "idle": 110, 176 | "touch": 98, 177 | "boost": 116 178 | }, 179 | "rtusr": { 180 | "bg": 98, 181 | "fg": 98, 182 | "idle": 97, 183 | "touch": 97, 184 | "boost": 98 185 | }, 186 | "rtsys": { 187 | "bg": 97, 188 | "fg": 97, 189 | "idle": 96, 190 | "touch": 96, 191 | "boost": 97 192 | } 193 | }, 194 | "rules": [ 195 | { 196 | "name": "Launcher", 197 | "regex": "/HOME_PACKAGE/", 198 | "pinned": true, 199 | "rules": [ 200 | { 201 | "k": "/MAIN_THREAD/", 202 | "ac": "crit", 203 | "pc": "rtusr" 204 | }, 205 | { 206 | "k": "^(RenderThread|GLThread)", 207 | "ac": "crit", 208 | "pc": "rtusr" 209 | }, 210 | { 211 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 212 | "ac": "bg", 213 | "pc": "rtusr" 214 | }, 215 | { 216 | "k": ".", 217 | "ac": "auto", 218 | "pc": "auto" 219 | } 220 | ] 221 | }, 222 | { 223 | "name": "SurfaceFlinger", 224 | "regex": "/system/bin/surfaceflinger", 225 | "pinned": true, 226 | "rules": [ 227 | { 228 | "k": "/MAIN_THREAD/", 229 | "ac": "crit", 230 | "pc": "auto" 231 | }, 232 | { 233 | "k": "^(app|RenderEngine)", 234 | "ac": "crit", 235 | "pc": "auto" 236 | }, 237 | { 238 | "k": "^Binder:", 239 | "ac": "auto", 240 | "pc": "auto" 241 | }, 242 | { 243 | "k": ".", 244 | "ac": "bg", 245 | "pc": "auto" 246 | } 247 | ] 248 | }, 249 | { 250 | "name": "SystemServer", 251 | "regex": "system_server", 252 | "pinned": true, 253 | "rules": [ 254 | { 255 | "k": "^(TaskSnapshot|Greezer|CachedApp|SystemPressure|SensorService)|[Mm]emory", 256 | "ac": "bg", 257 | "pc": "auto" 258 | }, 259 | { 260 | "k": ".", 261 | "ac": "auto", 262 | "pc": "auto" 263 | } 264 | ] 265 | }, 266 | { 267 | "name": "SystemUI", 268 | "regex": "com.android.systemui", 269 | "pinned": true, 270 | "rules": [ 271 | { 272 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 273 | "ac": "bg", 274 | "pc": "auto" 275 | } 276 | ] 277 | }, 278 | { 279 | "name": "MediaProvider", 280 | "regex": "^com.android.providers.media", 281 | "pinned": true, 282 | "rules": [ 283 | { 284 | "k": ".", 285 | "ac": "auto", 286 | "pc": "bg" 287 | } 288 | ] 289 | }, 290 | { 291 | "name": "Memory reclaim", 292 | "regex": "swapd|compactd", 293 | "pinned": true, 294 | "rules": [ 295 | { 296 | "k": ".", 297 | "ac": "auto", 298 | "pc": "bg" 299 | } 300 | ] 301 | }, 302 | { 303 | "name": "Phone", 304 | "regex": "com.android.phone", 305 | "pinned": false, 306 | "rules": [ 307 | { 308 | "k": ".", 309 | "ac": "auto", 310 | "pc": "auto" 311 | } 312 | ] 313 | }, 314 | { 315 | "name": "Other system processes", 316 | "regex": "^(/system|/vendor|magiskd|zygiskd)|@|-service$", 317 | "pinned": false, 318 | "rules": [ 319 | { 320 | "k": ".", 321 | "ac": "auto", 322 | "pc": "auto" 323 | } 324 | ] 325 | }, 326 | { 327 | "name": "App co-process", 328 | "regex": "[.].+:", 329 | "pinned": false, 330 | "rules": [ 331 | { 332 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 333 | "ac": "bg", 334 | "pc": "auto" 335 | } 336 | ] 337 | }, 338 | { 339 | "name": "Default rule", 340 | "regex": ".", 341 | "pinned": false, 342 | "rules": [ 343 | { 344 | "k": "/MAIN_THREAD/", 345 | "ac": "ui", 346 | "pc": "ui" 347 | }, 348 | { 349 | "k": "^(UnityMain|RenderThread |GameThread)", 350 | "ac": "gtmain", 351 | "pc": "auto" 352 | }, 353 | { 354 | "k": "^(Unity|Worker Thread|TaskGraph|RHIThread)", 355 | "ac": "gtcoop", 356 | "pc": "auto" 357 | }, 358 | { 359 | "k": "^(RenderThread|GLThread|JNISurfaceText|IJK_External_Re)|[Aa]nim|([.]raster|[.]ui)$", 360 | "ac": "ui", 361 | "pc": "ui" 362 | }, 363 | { 364 | "k": "^(Chrome_InProc|CrRendererMain|CrGpuMain|CompositorTile)", 365 | "ac": "norm", 366 | "pc": "norm" 367 | }, 368 | { 369 | "k": "^(Viz|Chrome_|Compositor)|[Vv]sync|mali-", 370 | "ac": "ui", 371 | "pc": "ui" 372 | }, 373 | { 374 | "k": "^(OkHttp|Ysa|Xqa|Rx|TVKDL|APM|tp-|cgi-|ODCP-|Bugly|xlog_)", 375 | "ac": "bg", 376 | "pc": "auto" 377 | }, 378 | { 379 | "k": "^(xg_vip_service|Profile|SearchDaemon|default_matrix|FrameDecoder|FrameSeq)", 380 | "ac": "bg", 381 | "pc": "auto" 382 | }, 383 | { 384 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 385 | "ac": "bg", 386 | "pc": "rtusr" 387 | }, 388 | { 389 | "k": "^(JS|libweexjsb|WeexJsBridge|mqt_native|mqt_js|JavaScriptTh)", 390 | "ac": "norm", 391 | "pc": "coop" 392 | }, 393 | { 394 | "k": "^(pool-|glide-|launcher-)|[Dd]ownload|[Ss]chedule|[Ww]ork|[Pp]ool|[Dd]efau|Fresco", 395 | "ac": "norm", 396 | "pc": "coop" 397 | }, 398 | { 399 | "k": ".", 400 | "ac": "norm", 401 | "pc": "norm" 402 | } 403 | ] 404 | } 405 | ] 406 | } 407 | }, 408 | "initials": { 409 | "cpu": { 410 | "baseSampleTime": 0.01, 411 | "baseSlackTime": 0.01, 412 | "latencyTime": 0.5, 413 | "slowLimitPower": 3.0, 414 | "fastLimitPower": 6.0, 415 | "fastLimitCapacity": 10.0, 416 | "fastLimitRecoverScale": 0.3, 417 | "predictThd": 0.3, 418 | "margin": 0.25, 419 | "burst": 0.0, 420 | "guideCap": true, 421 | "limitEfficiency": false 422 | }, 423 | "sysfs": {}, 424 | "sched": { 425 | "scene": "idle" 426 | } 427 | }, 428 | "presets": { 429 | "balance": { 430 | "*": { 431 | "cpu.latencyTime": 0.2, 432 | "cpu.slowLimitPower": 2.0, 433 | "cpu.fastLimitPower": 2.0, 434 | "cpu.fastLimitCapacity": 20.0, 435 | "cpu.margin": 0.2 436 | }, 437 | "idle": { 438 | "cpu.baseSampleTime": 0.04, 439 | "cpu.baseSlackTime": 0.08, 440 | "cpu.predictThd": 0.3, 441 | "cpu.limitEfficiency": true, 442 | "sched.scene": "idle" 443 | }, 444 | "touch": { 445 | "cpu.baseSampleTime": 0.04, 446 | "sched.scene": "touch" 447 | }, 448 | "trigger": { 449 | "cpu.margin": 0.4, 450 | "sched.scene": "touch" 451 | }, 452 | "gesture": { 453 | "cpu.margin": 0.6, 454 | "sched.scene": "touch" 455 | }, 456 | "junk": { 457 | "cpu.burst": 0.6, 458 | "sched.scene": "touch" 459 | }, 460 | "switch": { 461 | "cpu.latencyTime": 0.0, 462 | "cpu.slowLimitPower": 3.0, 463 | "cpu.fastLimitPower": 6.0, 464 | "cpu.fastLimitRecoverScale": 0.1, 465 | "cpu.margin": 0.4, 466 | "sched.scene": "boost" 467 | } 468 | }, 469 | "powersave": { 470 | "*": { 471 | "cpu.latencyTime": 0.4, 472 | "cpu.slowLimitPower": 1.0, 473 | "cpu.fastLimitPower": 1.0, 474 | "cpu.fastLimitCapacity": 5.0, 475 | "cpu.margin": 0.1 476 | }, 477 | "idle": { 478 | "cpu.baseSampleTime": 0.04, 479 | "cpu.baseSlackTime": 0.08, 480 | "cpu.predictThd": 1.0, 481 | "cpu.limitEfficiency": true, 482 | "sched.scene": "idle" 483 | }, 484 | "touch": { 485 | "cpu.baseSampleTime": 0.04, 486 | "sched.scene": "touch" 487 | }, 488 | "trigger": { 489 | "cpu.margin": 0.4, 490 | "sched.scene": "touch" 491 | }, 492 | "gesture": { 493 | "cpu.margin": 0.6, 494 | "sched.scene": "touch" 495 | }, 496 | "junk": { 497 | "cpu.burst": 0.3, 498 | "sched.scene": "touch" 499 | }, 500 | "switch": { 501 | "cpu.latencyTime": 0.0, 502 | "cpu.slowLimitPower": 1.5, 503 | "cpu.fastLimitPower": 3.0, 504 | "cpu.fastLimitRecoverScale": 0.1, 505 | "cpu.margin": 0.3, 506 | "sched.scene": "boost" 507 | } 508 | }, 509 | "performance": { 510 | "*": { 511 | "cpu.latencyTime": 0.0, 512 | "cpu.slowLimitPower": 4.0, 513 | "cpu.fastLimitPower": 10.0, 514 | "cpu.fastLimitCapacity": 360.0, 515 | "cpu.margin": 0.4 516 | }, 517 | "idle": { 518 | "cpu.baseSampleTime": 0.01, 519 | "cpu.baseSlackTime": 0.04, 520 | "sched.scene": "idle" 521 | }, 522 | "touch": { 523 | "sched.scene": "touch" 524 | }, 525 | "trigger": { 526 | "cpu.margin": 0.8, 527 | "sched.scene": "touch" 528 | }, 529 | "gesture": { 530 | "cpu.margin": 0.8, 531 | "sched.scene": "touch" 532 | }, 533 | "junk": { 534 | "cpu.burst": 0.5, 535 | "sched.scene": "touch" 536 | }, 537 | "switch": { 538 | "cpu.burst": 0.2, 539 | "sched.scene": "boost" 540 | } 541 | }, 542 | "fast": { 543 | "*": { 544 | "cpu.latencyTime": 0.0, 545 | "cpu.slowLimitPower": 2.5, 546 | "cpu.fastLimitPower": 2.5, 547 | "cpu.fastLimitCapacity": 0.0, 548 | "cpu.margin": 0.4 549 | }, 550 | "idle": { 551 | "cpu.baseSampleTime": 0.01, 552 | "cpu.baseSlackTime": 0.04, 553 | "sched.scene": "idle" 554 | }, 555 | "touch": { 556 | "sched.scene": "touch" 557 | }, 558 | "trigger": { 559 | "cpu.margin": 0.8, 560 | "sched.scene": "touch" 561 | }, 562 | "gesture": { 563 | "cpu.margin": 0.8, 564 | "sched.scene": "touch" 565 | }, 566 | "junk": { 567 | "cpu.burst": 0.5, 568 | "sched.scene": "touch" 569 | }, 570 | "switch": { 571 | "cpu.burst": 0.2, 572 | "sched.scene": "boost" 573 | } 574 | } 575 | } 576 | } -------------------------------------------------------------------------------- /magisk/config/e9810.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "name": "Exynos 9810[22.07.09] (FDE.AI Edition)", 4 | "author": "yc@coolapk" 5 | }, 6 | "modules": { 7 | "switcher": { 8 | "switchInode": "/sdcard/Android/yc/uperf/cur_powermode.txt", 9 | "perapp": "/sdcard/Android/yc/uperf/perapp_powermode.txt", 10 | "hintDuration": { 11 | "idle": 0.0, 12 | "touch": 4.0, 13 | "trigger": 0.03, 14 | "gesture": 0.1, 15 | "switch": 0.4, 16 | "junk": 0.06 17 | } 18 | }, 19 | "atrace": { 20 | "enable": false 21 | }, 22 | "log": { 23 | "level": "info" 24 | }, 25 | "input": { 26 | "enable": true, 27 | "swipeThd": 0.01, 28 | "gestureThdX": 0.03, 29 | "gestureThdY": 0.03, 30 | "gestureDelayTime": 2.0, 31 | "holdEnterTime": 1.0 32 | }, 33 | "sfanalysis": { 34 | "enable": true, 35 | "renderIdleSlackTime": 0.2 36 | }, 37 | "cpu": { 38 | "enable": true, 39 | "powerModel": [ 40 | { 41 | "efficiency": 100, 42 | "nr": 4, 43 | "typicalPower": 0.36, 44 | "typicalFreq": 1.8, 45 | "sweetFreq": 1.4, 46 | "plainFreq": 1.0, 47 | "freeFreq": 0.6 48 | }, 49 | { 50 | "efficiency": 250, 51 | "nr": 4, 52 | "typicalPower": 3.83, 53 | "typicalFreq": 2.7, 54 | "sweetFreq": 1.8, 55 | "plainFreq": 1.0, 56 | "freeFreq": 0.7 57 | } 58 | ] 59 | }, 60 | "sysfs": { 61 | "enable": false, 62 | "knob": {} 63 | }, 64 | "sched": { 65 | "enable": true, 66 | "cpumask": { 67 | "all": [ 68 | 0, 69 | 1, 70 | 2, 71 | 3, 72 | 4, 73 | 5, 74 | 6, 75 | 7 76 | ], 77 | "c0": [ 78 | 0, 79 | 1, 80 | 2, 81 | 3 82 | ], 83 | "c1": [ 84 | 4, 85 | 5, 86 | 6 87 | ], 88 | "c2": [ 89 | 7 90 | ] 91 | }, 92 | "affinity": { 93 | "auto": { 94 | "bg": "", 95 | "fg": "", 96 | "idle": "", 97 | "touch": "", 98 | "boost": "" 99 | }, 100 | "norm": { 101 | "bg": "", 102 | "fg": "all", 103 | "idle": "all", 104 | "touch": "all", 105 | "boost": "all" 106 | }, 107 | "bg": { 108 | "bg": "", 109 | "fg": "c0", 110 | "idle": "c0", 111 | "touch": "c0", 112 | "boost": "c0" 113 | }, 114 | "ui": { 115 | "bg": "", 116 | "fg": "all", 117 | "idle": "c1", 118 | "touch": "c1", 119 | "boost": "all" 120 | }, 121 | "crit": { 122 | "bg": "", 123 | "fg": "all", 124 | "idle": "all", 125 | "touch": "c1", 126 | "boost": "c1" 127 | }, 128 | "gtcoop": { 129 | "bg": "", 130 | "fg": "all", 131 | "idle": "all", 132 | "touch": "c1", 133 | "boost": "all" 134 | }, 135 | "gtmain": { 136 | "bg": "", 137 | "fg": "all", 138 | "idle": "all", 139 | "touch": "c2", 140 | "boost": "all" 141 | } 142 | }, 143 | "prio": { 144 | "auto": { 145 | "bg": 0, 146 | "fg": 0, 147 | "idle": 0, 148 | "touch": 0, 149 | "boost": 0 150 | }, 151 | "norm": { 152 | "bg": -1, 153 | "fg": -1, 154 | "idle": -1, 155 | "touch": -1, 156 | "boost": -1 157 | }, 158 | "bg": { 159 | "bg": -3, 160 | "fg": 139, 161 | "idle": 139, 162 | "touch": 139, 163 | "boost": 139 164 | }, 165 | "coop": { 166 | "bg": -3, 167 | "fg": 124, 168 | "idle": 122, 169 | "touch": 122, 170 | "boost": 130 171 | }, 172 | "ui": { 173 | "bg": -3, 174 | "fg": 120, 175 | "idle": 110, 176 | "touch": 98, 177 | "boost": 116 178 | }, 179 | "rtusr": { 180 | "bg": 98, 181 | "fg": 98, 182 | "idle": 97, 183 | "touch": 97, 184 | "boost": 98 185 | }, 186 | "rtsys": { 187 | "bg": 97, 188 | "fg": 97, 189 | "idle": 96, 190 | "touch": 96, 191 | "boost": 97 192 | } 193 | }, 194 | "rules": [ 195 | { 196 | "name": "Launcher", 197 | "regex": "/HOME_PACKAGE/", 198 | "pinned": true, 199 | "rules": [ 200 | { 201 | "k": "/MAIN_THREAD/", 202 | "ac": "crit", 203 | "pc": "rtusr" 204 | }, 205 | { 206 | "k": "^(RenderThread|GLThread)", 207 | "ac": "crit", 208 | "pc": "rtusr" 209 | }, 210 | { 211 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 212 | "ac": "bg", 213 | "pc": "rtusr" 214 | }, 215 | { 216 | "k": ".", 217 | "ac": "auto", 218 | "pc": "auto" 219 | } 220 | ] 221 | }, 222 | { 223 | "name": "SurfaceFlinger", 224 | "regex": "/system/bin/surfaceflinger", 225 | "pinned": true, 226 | "rules": [ 227 | { 228 | "k": "/MAIN_THREAD/", 229 | "ac": "crit", 230 | "pc": "auto" 231 | }, 232 | { 233 | "k": "^(app|RenderEngine)", 234 | "ac": "crit", 235 | "pc": "auto" 236 | }, 237 | { 238 | "k": "^Binder:", 239 | "ac": "auto", 240 | "pc": "auto" 241 | }, 242 | { 243 | "k": ".", 244 | "ac": "bg", 245 | "pc": "auto" 246 | } 247 | ] 248 | }, 249 | { 250 | "name": "SystemServer", 251 | "regex": "system_server", 252 | "pinned": true, 253 | "rules": [ 254 | { 255 | "k": "^(TaskSnapshot|Greezer|CachedApp|SystemPressure|SensorService)|[Mm]emory", 256 | "ac": "bg", 257 | "pc": "auto" 258 | }, 259 | { 260 | "k": ".", 261 | "ac": "auto", 262 | "pc": "auto" 263 | } 264 | ] 265 | }, 266 | { 267 | "name": "SystemUI", 268 | "regex": "com.android.systemui", 269 | "pinned": true, 270 | "rules": [ 271 | { 272 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 273 | "ac": "bg", 274 | "pc": "auto" 275 | } 276 | ] 277 | }, 278 | { 279 | "name": "MediaProvider", 280 | "regex": "^com.android.providers.media", 281 | "pinned": true, 282 | "rules": [ 283 | { 284 | "k": ".", 285 | "ac": "auto", 286 | "pc": "bg" 287 | } 288 | ] 289 | }, 290 | { 291 | "name": "Memory reclaim", 292 | "regex": "swapd|compactd", 293 | "pinned": true, 294 | "rules": [ 295 | { 296 | "k": ".", 297 | "ac": "auto", 298 | "pc": "bg" 299 | } 300 | ] 301 | }, 302 | { 303 | "name": "Phone", 304 | "regex": "com.android.phone", 305 | "pinned": false, 306 | "rules": [ 307 | { 308 | "k": ".", 309 | "ac": "auto", 310 | "pc": "auto" 311 | } 312 | ] 313 | }, 314 | { 315 | "name": "Other system processes", 316 | "regex": "^(/system|/vendor|magiskd|zygiskd)|@|-service$", 317 | "pinned": false, 318 | "rules": [ 319 | { 320 | "k": ".", 321 | "ac": "auto", 322 | "pc": "auto" 323 | } 324 | ] 325 | }, 326 | { 327 | "name": "App co-process", 328 | "regex": "[.].+:", 329 | "pinned": false, 330 | "rules": [ 331 | { 332 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 333 | "ac": "bg", 334 | "pc": "auto" 335 | } 336 | ] 337 | }, 338 | { 339 | "name": "Default rule", 340 | "regex": ".", 341 | "pinned": false, 342 | "rules": [ 343 | { 344 | "k": "/MAIN_THREAD/", 345 | "ac": "ui", 346 | "pc": "ui" 347 | }, 348 | { 349 | "k": "^(UnityMain|RenderThread |GameThread)", 350 | "ac": "gtmain", 351 | "pc": "auto" 352 | }, 353 | { 354 | "k": "^(Unity|Worker Thread|TaskGraph|RHIThread)", 355 | "ac": "gtcoop", 356 | "pc": "auto" 357 | }, 358 | { 359 | "k": "^(RenderThread|GLThread|JNISurfaceText|IJK_External_Re)|[Aa]nim|([.]raster|[.]ui)$", 360 | "ac": "ui", 361 | "pc": "ui" 362 | }, 363 | { 364 | "k": "^(Chrome_InProc|CrRendererMain|CrGpuMain|CompositorTile)", 365 | "ac": "norm", 366 | "pc": "norm" 367 | }, 368 | { 369 | "k": "^(Viz|Chrome_|Compositor)|[Vv]sync|mali-", 370 | "ac": "ui", 371 | "pc": "ui" 372 | }, 373 | { 374 | "k": "^(OkHttp|Ysa|Xqa|Rx|TVKDL|APM|tp-|cgi-|ODCP-|Bugly|xlog_)", 375 | "ac": "bg", 376 | "pc": "auto" 377 | }, 378 | { 379 | "k": "^(xg_vip_service|Profile|SearchDaemon|default_matrix|FrameDecoder|FrameSeq)", 380 | "ac": "bg", 381 | "pc": "auto" 382 | }, 383 | { 384 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 385 | "ac": "bg", 386 | "pc": "rtusr" 387 | }, 388 | { 389 | "k": "^(JS|libweexjsb|WeexJsBridge|mqt_native|mqt_js|JavaScriptTh)", 390 | "ac": "norm", 391 | "pc": "coop" 392 | }, 393 | { 394 | "k": "^(pool-|glide-|launcher-)|[Dd]ownload|[Ss]chedule|[Ww]ork|[Pp]ool|[Dd]efau|Fresco", 395 | "ac": "norm", 396 | "pc": "coop" 397 | }, 398 | { 399 | "k": ".", 400 | "ac": "norm", 401 | "pc": "norm" 402 | } 403 | ] 404 | } 405 | ] 406 | } 407 | }, 408 | "initials": { 409 | "cpu": { 410 | "baseSampleTime": 0.01, 411 | "baseSlackTime": 0.01, 412 | "latencyTime": 0.5, 413 | "slowLimitPower": 3.0, 414 | "fastLimitPower": 6.0, 415 | "fastLimitCapacity": 10.0, 416 | "fastLimitRecoverScale": 0.3, 417 | "predictThd": 0.3, 418 | "margin": 0.25, 419 | "burst": 0.0, 420 | "guideCap": true, 421 | "limitEfficiency": false 422 | }, 423 | "sysfs": {}, 424 | "sched": { 425 | "scene": "idle" 426 | } 427 | }, 428 | "presets": { 429 | "balance": { 430 | "*": { 431 | "cpu.latencyTime": 0.2, 432 | "cpu.slowLimitPower": 2.0, 433 | "cpu.fastLimitPower": 2.0, 434 | "cpu.fastLimitCapacity": 20.0, 435 | "cpu.margin": 0.2 436 | }, 437 | "idle": { 438 | "cpu.baseSampleTime": 0.04, 439 | "cpu.baseSlackTime": 0.08, 440 | "cpu.predictThd": 0.3, 441 | "cpu.limitEfficiency": true, 442 | "sched.scene": "idle" 443 | }, 444 | "touch": { 445 | "cpu.baseSampleTime": 0.04, 446 | "sched.scene": "touch" 447 | }, 448 | "trigger": { 449 | "cpu.margin": 0.4, 450 | "sched.scene": "touch" 451 | }, 452 | "gesture": { 453 | "cpu.margin": 0.6, 454 | "sched.scene": "touch" 455 | }, 456 | "junk": { 457 | "cpu.burst": 0.6, 458 | "sched.scene": "touch" 459 | }, 460 | "switch": { 461 | "cpu.latencyTime": 0.0, 462 | "cpu.slowLimitPower": 3.0, 463 | "cpu.fastLimitPower": 6.0, 464 | "cpu.fastLimitRecoverScale": 0.1, 465 | "cpu.margin": 0.4, 466 | "sched.scene": "boost" 467 | } 468 | }, 469 | "powersave": { 470 | "*": { 471 | "cpu.latencyTime": 0.4, 472 | "cpu.slowLimitPower": 1.0, 473 | "cpu.fastLimitPower": 1.0, 474 | "cpu.fastLimitCapacity": 5.0, 475 | "cpu.margin": 0.1 476 | }, 477 | "idle": { 478 | "cpu.baseSampleTime": 0.04, 479 | "cpu.baseSlackTime": 0.08, 480 | "cpu.predictThd": 1.0, 481 | "cpu.limitEfficiency": true, 482 | "sched.scene": "idle" 483 | }, 484 | "touch": { 485 | "cpu.baseSampleTime": 0.04, 486 | "sched.scene": "touch" 487 | }, 488 | "trigger": { 489 | "cpu.margin": 0.4, 490 | "sched.scene": "touch" 491 | }, 492 | "gesture": { 493 | "cpu.margin": 0.6, 494 | "sched.scene": "touch" 495 | }, 496 | "junk": { 497 | "cpu.burst": 0.3, 498 | "sched.scene": "touch" 499 | }, 500 | "switch": { 501 | "cpu.latencyTime": 0.0, 502 | "cpu.slowLimitPower": 1.5, 503 | "cpu.fastLimitPower": 3.0, 504 | "cpu.fastLimitRecoverScale": 0.1, 505 | "cpu.margin": 0.3, 506 | "sched.scene": "boost" 507 | } 508 | }, 509 | "performance": { 510 | "*": { 511 | "cpu.latencyTime": 0.0, 512 | "cpu.slowLimitPower": 4.0, 513 | "cpu.fastLimitPower": 10.0, 514 | "cpu.fastLimitCapacity": 360.0, 515 | "cpu.margin": 0.4 516 | }, 517 | "idle": { 518 | "cpu.baseSampleTime": 0.01, 519 | "cpu.baseSlackTime": 0.04, 520 | "sched.scene": "idle" 521 | }, 522 | "touch": { 523 | "sched.scene": "touch" 524 | }, 525 | "trigger": { 526 | "cpu.margin": 0.8, 527 | "sched.scene": "touch" 528 | }, 529 | "gesture": { 530 | "cpu.margin": 0.8, 531 | "sched.scene": "touch" 532 | }, 533 | "junk": { 534 | "cpu.burst": 0.5, 535 | "sched.scene": "touch" 536 | }, 537 | "switch": { 538 | "cpu.burst": 0.2, 539 | "sched.scene": "boost" 540 | } 541 | }, 542 | "fast": { 543 | "*": { 544 | "cpu.latencyTime": 0.0, 545 | "cpu.slowLimitPower": 2.5, 546 | "cpu.fastLimitPower": 2.5, 547 | "cpu.fastLimitCapacity": 0.0, 548 | "cpu.margin": 0.4 549 | }, 550 | "idle": { 551 | "cpu.baseSampleTime": 0.01, 552 | "cpu.baseSlackTime": 0.04, 553 | "sched.scene": "idle" 554 | }, 555 | "touch": { 556 | "sched.scene": "touch" 557 | }, 558 | "trigger": { 559 | "cpu.margin": 0.8, 560 | "sched.scene": "touch" 561 | }, 562 | "gesture": { 563 | "cpu.margin": 0.8, 564 | "sched.scene": "touch" 565 | }, 566 | "junk": { 567 | "cpu.burst": 0.5, 568 | "sched.scene": "touch" 569 | }, 570 | "switch": { 571 | "cpu.burst": 0.2, 572 | "sched.scene": "boost" 573 | } 574 | } 575 | } 576 | } -------------------------------------------------------------------------------- /magisk/config/perapp_powermode.txt: -------------------------------------------------------------------------------- 1 | # 分应用性能模式配置 2 | # Per-app dynamic power mode rule 3 | # '-' means offscreen rule 4 | # '*' means default rule 5 | 6 | - balance 7 | * balance 8 | -------------------------------------------------------------------------------- /magisk/config/sdm625.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "name": "sdm625/sdm626[22.07.09] (FDE.AI Edition)", 4 | "author": "yc@coolapk" 5 | }, 6 | "modules": { 7 | "switcher": { 8 | "switchInode": "/sdcard/Android/yc/uperf/cur_powermode.txt", 9 | "perapp": "/sdcard/Android/yc/uperf/perapp_powermode.txt", 10 | "hintDuration": { 11 | "idle": 0.0, 12 | "touch": 4.0, 13 | "trigger": 0.03, 14 | "gesture": 0.1, 15 | "switch": 0.4, 16 | "junk": 0.06 17 | } 18 | }, 19 | "atrace": { 20 | "enable": false 21 | }, 22 | "log": { 23 | "level": "info" 24 | }, 25 | "input": { 26 | "enable": true, 27 | "swipeThd": 0.01, 28 | "gestureThdX": 0.03, 29 | "gestureThdY": 0.03, 30 | "gestureDelayTime": 2.0, 31 | "holdEnterTime": 1.0 32 | }, 33 | "sfanalysis": { 34 | "enable": true, 35 | "renderIdleSlackTime": 0.2 36 | }, 37 | "cpu": { 38 | "enable": true, 39 | "powerModel": [ 40 | { 41 | "efficiency": 100, 42 | "nr": 4, 43 | "typicalPower": 0.4, 44 | "typicalFreq": 2.0, 45 | "sweetFreq": 1.4, 46 | "plainFreq": 1.0, 47 | "freeFreq": 0.6 48 | }, 49 | { 50 | "efficiency": 100, 51 | "nr": 4, 52 | "typicalPower": 0.4, 53 | "typicalFreq": 2.0, 54 | "sweetFreq": 1.9, 55 | "plainFreq": 1.4, 56 | "freeFreq": 0.6 57 | } 58 | ] 59 | }, 60 | "sysfs": { 61 | "enable": false, 62 | "knob": {} 63 | }, 64 | "sched": { 65 | "enable": true, 66 | "cpumask": { 67 | "all": [ 68 | 0, 69 | 1, 70 | 2, 71 | 3, 72 | 4, 73 | 5, 74 | 6, 75 | 7 76 | ], 77 | "c0": [ 78 | 0, 79 | 1, 80 | 2, 81 | 3 82 | ], 83 | "c1": [ 84 | 4, 85 | 5, 86 | 6 87 | ], 88 | "c2": [ 89 | 7 90 | ] 91 | }, 92 | "affinity": { 93 | "auto": { 94 | "bg": "", 95 | "fg": "", 96 | "idle": "", 97 | "touch": "", 98 | "boost": "" 99 | }, 100 | "norm": { 101 | "bg": "", 102 | "fg": "all", 103 | "idle": "all", 104 | "touch": "all", 105 | "boost": "all" 106 | }, 107 | "bg": { 108 | "bg": "", 109 | "fg": "c0", 110 | "idle": "c0", 111 | "touch": "c0", 112 | "boost": "c0" 113 | }, 114 | "ui": { 115 | "bg": "", 116 | "fg": "all", 117 | "idle": "c1", 118 | "touch": "c1", 119 | "boost": "all" 120 | }, 121 | "crit": { 122 | "bg": "", 123 | "fg": "all", 124 | "idle": "all", 125 | "touch": "c1", 126 | "boost": "c1" 127 | }, 128 | "gtcoop": { 129 | "bg": "", 130 | "fg": "all", 131 | "idle": "all", 132 | "touch": "c1", 133 | "boost": "all" 134 | }, 135 | "gtmain": { 136 | "bg": "", 137 | "fg": "all", 138 | "idle": "all", 139 | "touch": "c2", 140 | "boost": "all" 141 | } 142 | }, 143 | "prio": { 144 | "auto": { 145 | "bg": 0, 146 | "fg": 0, 147 | "idle": 0, 148 | "touch": 0, 149 | "boost": 0 150 | }, 151 | "norm": { 152 | "bg": -1, 153 | "fg": -1, 154 | "idle": -1, 155 | "touch": -1, 156 | "boost": -1 157 | }, 158 | "bg": { 159 | "bg": -3, 160 | "fg": 139, 161 | "idle": 139, 162 | "touch": 139, 163 | "boost": 139 164 | }, 165 | "coop": { 166 | "bg": -3, 167 | "fg": 124, 168 | "idle": 122, 169 | "touch": 122, 170 | "boost": 130 171 | }, 172 | "ui": { 173 | "bg": -3, 174 | "fg": 120, 175 | "idle": 110, 176 | "touch": 98, 177 | "boost": 116 178 | }, 179 | "rtusr": { 180 | "bg": 98, 181 | "fg": 98, 182 | "idle": 97, 183 | "touch": 97, 184 | "boost": 98 185 | }, 186 | "rtsys": { 187 | "bg": 97, 188 | "fg": 97, 189 | "idle": 96, 190 | "touch": 96, 191 | "boost": 97 192 | } 193 | }, 194 | "rules": [ 195 | { 196 | "name": "Launcher", 197 | "regex": "/HOME_PACKAGE/", 198 | "pinned": true, 199 | "rules": [ 200 | { 201 | "k": "/MAIN_THREAD/", 202 | "ac": "crit", 203 | "pc": "rtusr" 204 | }, 205 | { 206 | "k": "^(RenderThread|GLThread)", 207 | "ac": "crit", 208 | "pc": "rtusr" 209 | }, 210 | { 211 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 212 | "ac": "bg", 213 | "pc": "rtusr" 214 | }, 215 | { 216 | "k": ".", 217 | "ac": "auto", 218 | "pc": "auto" 219 | } 220 | ] 221 | }, 222 | { 223 | "name": "SurfaceFlinger", 224 | "regex": "/system/bin/surfaceflinger", 225 | "pinned": true, 226 | "rules": [ 227 | { 228 | "k": "/MAIN_THREAD/", 229 | "ac": "crit", 230 | "pc": "auto" 231 | }, 232 | { 233 | "k": "^(app|RenderEngine)", 234 | "ac": "crit", 235 | "pc": "auto" 236 | }, 237 | { 238 | "k": "^Binder:", 239 | "ac": "auto", 240 | "pc": "auto" 241 | }, 242 | { 243 | "k": ".", 244 | "ac": "bg", 245 | "pc": "auto" 246 | } 247 | ] 248 | }, 249 | { 250 | "name": "SystemServer", 251 | "regex": "system_server", 252 | "pinned": true, 253 | "rules": [ 254 | { 255 | "k": "^(TaskSnapshot|Greezer|CachedApp|SystemPressure|SensorService)|[Mm]emory", 256 | "ac": "bg", 257 | "pc": "auto" 258 | }, 259 | { 260 | "k": ".", 261 | "ac": "auto", 262 | "pc": "auto" 263 | } 264 | ] 265 | }, 266 | { 267 | "name": "SystemUI", 268 | "regex": "com.android.systemui", 269 | "pinned": true, 270 | "rules": [ 271 | { 272 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 273 | "ac": "bg", 274 | "pc": "auto" 275 | } 276 | ] 277 | }, 278 | { 279 | "name": "MediaProvider", 280 | "regex": "^com.android.providers.media", 281 | "pinned": true, 282 | "rules": [ 283 | { 284 | "k": ".", 285 | "ac": "auto", 286 | "pc": "bg" 287 | } 288 | ] 289 | }, 290 | { 291 | "name": "Memory reclaim", 292 | "regex": "swapd|compactd", 293 | "pinned": true, 294 | "rules": [ 295 | { 296 | "k": ".", 297 | "ac": "auto", 298 | "pc": "bg" 299 | } 300 | ] 301 | }, 302 | { 303 | "name": "Phone", 304 | "regex": "com.android.phone", 305 | "pinned": false, 306 | "rules": [ 307 | { 308 | "k": ".", 309 | "ac": "auto", 310 | "pc": "auto" 311 | } 312 | ] 313 | }, 314 | { 315 | "name": "Other system processes", 316 | "regex": "^(/system|/vendor|magiskd|zygiskd)|@|-service$", 317 | "pinned": false, 318 | "rules": [ 319 | { 320 | "k": ".", 321 | "ac": "auto", 322 | "pc": "auto" 323 | } 324 | ] 325 | }, 326 | { 327 | "name": "App co-process", 328 | "regex": "[.].+:", 329 | "pinned": false, 330 | "rules": [ 331 | { 332 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 333 | "ac": "bg", 334 | "pc": "auto" 335 | } 336 | ] 337 | }, 338 | { 339 | "name": "Default rule", 340 | "regex": ".", 341 | "pinned": false, 342 | "rules": [ 343 | { 344 | "k": "/MAIN_THREAD/", 345 | "ac": "ui", 346 | "pc": "ui" 347 | }, 348 | { 349 | "k": "^(UnityMain|RenderThread |GameThread)", 350 | "ac": "gtmain", 351 | "pc": "auto" 352 | }, 353 | { 354 | "k": "^(Unity|Worker Thread|TaskGraph|RHIThread)", 355 | "ac": "gtcoop", 356 | "pc": "auto" 357 | }, 358 | { 359 | "k": "^(RenderThread|GLThread|JNISurfaceText|IJK_External_Re)|[Aa]nim|([.]raster|[.]ui)$", 360 | "ac": "ui", 361 | "pc": "ui" 362 | }, 363 | { 364 | "k": "^(Chrome_InProc|CrRendererMain|CrGpuMain|CompositorTile)", 365 | "ac": "norm", 366 | "pc": "norm" 367 | }, 368 | { 369 | "k": "^(Viz|Chrome_|Compositor)|[Vv]sync|mali-", 370 | "ac": "ui", 371 | "pc": "ui" 372 | }, 373 | { 374 | "k": "^(OkHttp|Ysa|Xqa|Rx|TVKDL|APM|tp-|cgi-|ODCP-|Bugly|xlog_)", 375 | "ac": "bg", 376 | "pc": "auto" 377 | }, 378 | { 379 | "k": "^(xg_vip_service|Profile|SearchDaemon|default_matrix|FrameDecoder|FrameSeq)", 380 | "ac": "bg", 381 | "pc": "auto" 382 | }, 383 | { 384 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 385 | "ac": "bg", 386 | "pc": "rtusr" 387 | }, 388 | { 389 | "k": "^(JS|libweexjsb|WeexJsBridge|mqt_native|mqt_js|JavaScriptTh)", 390 | "ac": "norm", 391 | "pc": "coop" 392 | }, 393 | { 394 | "k": "^(pool-|glide-|launcher-)|[Dd]ownload|[Ss]chedule|[Ww]ork|[Pp]ool|[Dd]efau|Fresco", 395 | "ac": "norm", 396 | "pc": "coop" 397 | }, 398 | { 399 | "k": ".", 400 | "ac": "norm", 401 | "pc": "norm" 402 | } 403 | ] 404 | } 405 | ] 406 | } 407 | }, 408 | "initials": { 409 | "cpu": { 410 | "baseSampleTime": 0.01, 411 | "baseSlackTime": 0.01, 412 | "latencyTime": 0.5, 413 | "slowLimitPower": 3.0, 414 | "fastLimitPower": 6.0, 415 | "fastLimitCapacity": 10.0, 416 | "fastLimitRecoverScale": 0.3, 417 | "predictThd": 0.3, 418 | "margin": 0.25, 419 | "burst": 0.0, 420 | "guideCap": true, 421 | "limitEfficiency": false 422 | }, 423 | "sysfs": {}, 424 | "sched": { 425 | "scene": "idle" 426 | } 427 | }, 428 | "presets": { 429 | "balance": { 430 | "*": { 431 | "cpu.latencyTime": 0.2, 432 | "cpu.slowLimitPower": 2.0, 433 | "cpu.fastLimitPower": 2.0, 434 | "cpu.fastLimitCapacity": 20.0, 435 | "cpu.margin": 0.2 436 | }, 437 | "idle": { 438 | "cpu.baseSampleTime": 0.04, 439 | "cpu.baseSlackTime": 0.08, 440 | "cpu.predictThd": 0.3, 441 | "cpu.limitEfficiency": true, 442 | "sched.scene": "idle" 443 | }, 444 | "touch": { 445 | "cpu.baseSampleTime": 0.04, 446 | "sched.scene": "touch" 447 | }, 448 | "trigger": { 449 | "cpu.margin": 0.4, 450 | "sched.scene": "touch" 451 | }, 452 | "gesture": { 453 | "cpu.margin": 0.6, 454 | "sched.scene": "touch" 455 | }, 456 | "junk": { 457 | "cpu.burst": 0.7, 458 | "sched.scene": "touch" 459 | }, 460 | "switch": { 461 | "cpu.latencyTime": 0.0, 462 | "cpu.slowLimitPower": 3.0, 463 | "cpu.fastLimitPower": 6.0, 464 | "cpu.fastLimitRecoverScale": 0.1, 465 | "cpu.margin": 0.4, 466 | "sched.scene": "boost" 467 | } 468 | }, 469 | "powersave": { 470 | "*": { 471 | "cpu.latencyTime": 0.4, 472 | "cpu.slowLimitPower": 1.0, 473 | "cpu.fastLimitPower": 1.0, 474 | "cpu.fastLimitCapacity": 5.0, 475 | "cpu.margin": 0.1 476 | }, 477 | "idle": { 478 | "cpu.baseSampleTime": 0.04, 479 | "cpu.baseSlackTime": 0.08, 480 | "cpu.predictThd": 1.0, 481 | "cpu.limitEfficiency": true, 482 | "sched.scene": "idle" 483 | }, 484 | "touch": { 485 | "cpu.baseSampleTime": 0.04, 486 | "sched.scene": "touch" 487 | }, 488 | "trigger": { 489 | "cpu.margin": 0.4, 490 | "sched.scene": "touch" 491 | }, 492 | "gesture": { 493 | "cpu.margin": 0.6, 494 | "sched.scene": "touch" 495 | }, 496 | "junk": { 497 | "cpu.burst": 0.6, 498 | "sched.scene": "touch" 499 | }, 500 | "switch": { 501 | "cpu.latencyTime": 0.0, 502 | "cpu.slowLimitPower": 1.5, 503 | "cpu.fastLimitPower": 3.0, 504 | "cpu.fastLimitRecoverScale": 0.1, 505 | "cpu.margin": 0.3, 506 | "sched.scene": "boost" 507 | } 508 | }, 509 | "performance": { 510 | "*": { 511 | "cpu.latencyTime": 0.0, 512 | "cpu.slowLimitPower": 4.0, 513 | "cpu.fastLimitPower": 10.0, 514 | "cpu.fastLimitCapacity": 360.0, 515 | "cpu.margin": 0.4 516 | }, 517 | "idle": { 518 | "cpu.baseSampleTime": 0.01, 519 | "cpu.baseSlackTime": 0.04, 520 | "sched.scene": "idle" 521 | }, 522 | "touch": { 523 | "sched.scene": "touch" 524 | }, 525 | "trigger": { 526 | "cpu.margin": 0.8, 527 | "sched.scene": "touch" 528 | }, 529 | "gesture": { 530 | "cpu.margin": 0.8, 531 | "sched.scene": "touch" 532 | }, 533 | "junk": { 534 | "cpu.burst": 0.7, 535 | "sched.scene": "touch" 536 | }, 537 | "switch": { 538 | "cpu.burst": 0.2, 539 | "sched.scene": "boost" 540 | } 541 | }, 542 | "fast": { 543 | "*": { 544 | "cpu.latencyTime": 0.0, 545 | "cpu.slowLimitPower": 2.5, 546 | "cpu.fastLimitPower": 2.5, 547 | "cpu.fastLimitCapacity": 0.0, 548 | "cpu.margin": 0.4 549 | }, 550 | "idle": { 551 | "cpu.baseSampleTime": 0.01, 552 | "cpu.baseSlackTime": 0.04, 553 | "sched.scene": "idle" 554 | }, 555 | "touch": { 556 | "sched.scene": "touch" 557 | }, 558 | "trigger": { 559 | "cpu.margin": 0.8, 560 | "sched.scene": "touch" 561 | }, 562 | "gesture": { 563 | "cpu.margin": 0.8, 564 | "sched.scene": "touch" 565 | }, 566 | "junk": { 567 | "cpu.burst": 0.7, 568 | "sched.scene": "touch" 569 | }, 570 | "switch": { 571 | "cpu.burst": 0.2, 572 | "sched.scene": "boost" 573 | } 574 | } 575 | } 576 | } -------------------------------------------------------------------------------- /magisk/config/sdm660.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "name": "sdm660/sdm636[22.07.09] (FDE.AI Edition)", 4 | "author": "yc@coolapk" 5 | }, 6 | "modules": { 7 | "switcher": { 8 | "switchInode": "/sdcard/Android/yc/uperf/cur_powermode.txt", 9 | "perapp": "/sdcard/Android/yc/uperf/perapp_powermode.txt", 10 | "hintDuration": { 11 | "idle": 0.0, 12 | "touch": 4.0, 13 | "trigger": 0.03, 14 | "gesture": 0.1, 15 | "switch": 0.4, 16 | "junk": 0.06 17 | } 18 | }, 19 | "atrace": { 20 | "enable": false 21 | }, 22 | "log": { 23 | "level": "info" 24 | }, 25 | "input": { 26 | "enable": true, 27 | "swipeThd": 0.01, 28 | "gestureThdX": 0.03, 29 | "gestureThdY": 0.03, 30 | "gestureDelayTime": 2.0, 31 | "holdEnterTime": 1.0 32 | }, 33 | "sfanalysis": { 34 | "enable": true, 35 | "renderIdleSlackTime": 0.2 36 | }, 37 | "cpu": { 38 | "enable": true, 39 | "powerModel": [ 40 | { 41 | "efficiency": 100, 42 | "nr": 4, 43 | "typicalPower": 0.36, 44 | "typicalFreq": 1.8, 45 | "sweetFreq": 1.4, 46 | "plainFreq": 1.0, 47 | "freeFreq": 0.6 48 | }, 49 | { 50 | "efficiency": 170, 51 | "nr": 4, 52 | "typicalPower": 1.5, 53 | "typicalFreq": 2.2, 54 | "sweetFreq": 1.7, 55 | "plainFreq": 1.1, 56 | "freeFreq": 1.1 57 | } 58 | ] 59 | }, 60 | "sysfs": { 61 | "enable": false, 62 | "knob": {} 63 | }, 64 | "sched": { 65 | "enable": true, 66 | "cpumask": { 67 | "all": [ 68 | 0, 69 | 1, 70 | 2, 71 | 3, 72 | 4, 73 | 5, 74 | 6, 75 | 7 76 | ], 77 | "c0": [ 78 | 0, 79 | 1, 80 | 2, 81 | 3 82 | ], 83 | "c1": [ 84 | 4, 85 | 5, 86 | 6 87 | ], 88 | "c2": [ 89 | 7 90 | ] 91 | }, 92 | "affinity": { 93 | "auto": { 94 | "bg": "", 95 | "fg": "", 96 | "idle": "", 97 | "touch": "", 98 | "boost": "" 99 | }, 100 | "norm": { 101 | "bg": "", 102 | "fg": "all", 103 | "idle": "all", 104 | "touch": "all", 105 | "boost": "all" 106 | }, 107 | "bg": { 108 | "bg": "", 109 | "fg": "c0", 110 | "idle": "c0", 111 | "touch": "c0", 112 | "boost": "c0" 113 | }, 114 | "ui": { 115 | "bg": "", 116 | "fg": "all", 117 | "idle": "c1", 118 | "touch": "c1", 119 | "boost": "all" 120 | }, 121 | "crit": { 122 | "bg": "", 123 | "fg": "all", 124 | "idle": "all", 125 | "touch": "c1", 126 | "boost": "c1" 127 | }, 128 | "gtcoop": { 129 | "bg": "", 130 | "fg": "all", 131 | "idle": "all", 132 | "touch": "c1", 133 | "boost": "all" 134 | }, 135 | "gtmain": { 136 | "bg": "", 137 | "fg": "all", 138 | "idle": "all", 139 | "touch": "c2", 140 | "boost": "all" 141 | } 142 | }, 143 | "prio": { 144 | "auto": { 145 | "bg": 0, 146 | "fg": 0, 147 | "idle": 0, 148 | "touch": 0, 149 | "boost": 0 150 | }, 151 | "norm": { 152 | "bg": -1, 153 | "fg": -1, 154 | "idle": -1, 155 | "touch": -1, 156 | "boost": -1 157 | }, 158 | "bg": { 159 | "bg": -3, 160 | "fg": 139, 161 | "idle": 139, 162 | "touch": 139, 163 | "boost": 139 164 | }, 165 | "coop": { 166 | "bg": -3, 167 | "fg": 124, 168 | "idle": 122, 169 | "touch": 122, 170 | "boost": 130 171 | }, 172 | "ui": { 173 | "bg": -3, 174 | "fg": 120, 175 | "idle": 110, 176 | "touch": 98, 177 | "boost": 116 178 | }, 179 | "rtusr": { 180 | "bg": 98, 181 | "fg": 98, 182 | "idle": 97, 183 | "touch": 97, 184 | "boost": 98 185 | }, 186 | "rtsys": { 187 | "bg": 97, 188 | "fg": 97, 189 | "idle": 96, 190 | "touch": 96, 191 | "boost": 97 192 | } 193 | }, 194 | "rules": [ 195 | { 196 | "name": "Launcher", 197 | "regex": "/HOME_PACKAGE/", 198 | "pinned": true, 199 | "rules": [ 200 | { 201 | "k": "/MAIN_THREAD/", 202 | "ac": "crit", 203 | "pc": "rtusr" 204 | }, 205 | { 206 | "k": "^(RenderThread|GLThread)", 207 | "ac": "crit", 208 | "pc": "rtusr" 209 | }, 210 | { 211 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 212 | "ac": "bg", 213 | "pc": "rtusr" 214 | }, 215 | { 216 | "k": ".", 217 | "ac": "auto", 218 | "pc": "auto" 219 | } 220 | ] 221 | }, 222 | { 223 | "name": "SurfaceFlinger", 224 | "regex": "/system/bin/surfaceflinger", 225 | "pinned": true, 226 | "rules": [ 227 | { 228 | "k": "/MAIN_THREAD/", 229 | "ac": "crit", 230 | "pc": "auto" 231 | }, 232 | { 233 | "k": "^(app|RenderEngine)", 234 | "ac": "crit", 235 | "pc": "auto" 236 | }, 237 | { 238 | "k": "^Binder:", 239 | "ac": "auto", 240 | "pc": "auto" 241 | }, 242 | { 243 | "k": ".", 244 | "ac": "bg", 245 | "pc": "auto" 246 | } 247 | ] 248 | }, 249 | { 250 | "name": "SystemServer", 251 | "regex": "system_server", 252 | "pinned": true, 253 | "rules": [ 254 | { 255 | "k": "^(TaskSnapshot|Greezer|CachedApp|SystemPressure|SensorService)|[Mm]emory", 256 | "ac": "bg", 257 | "pc": "auto" 258 | }, 259 | { 260 | "k": ".", 261 | "ac": "auto", 262 | "pc": "auto" 263 | } 264 | ] 265 | }, 266 | { 267 | "name": "SystemUI", 268 | "regex": "com.android.systemui", 269 | "pinned": true, 270 | "rules": [ 271 | { 272 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 273 | "ac": "bg", 274 | "pc": "auto" 275 | } 276 | ] 277 | }, 278 | { 279 | "name": "MediaProvider", 280 | "regex": "^com.android.providers.media", 281 | "pinned": true, 282 | "rules": [ 283 | { 284 | "k": ".", 285 | "ac": "auto", 286 | "pc": "bg" 287 | } 288 | ] 289 | }, 290 | { 291 | "name": "Memory reclaim", 292 | "regex": "swapd|compactd", 293 | "pinned": true, 294 | "rules": [ 295 | { 296 | "k": ".", 297 | "ac": "auto", 298 | "pc": "bg" 299 | } 300 | ] 301 | }, 302 | { 303 | "name": "Phone", 304 | "regex": "com.android.phone", 305 | "pinned": false, 306 | "rules": [ 307 | { 308 | "k": ".", 309 | "ac": "auto", 310 | "pc": "auto" 311 | } 312 | ] 313 | }, 314 | { 315 | "name": "Other system processes", 316 | "regex": "^(/system|/vendor|magiskd|zygiskd)|@|-service$", 317 | "pinned": false, 318 | "rules": [ 319 | { 320 | "k": ".", 321 | "ac": "auto", 322 | "pc": "auto" 323 | } 324 | ] 325 | }, 326 | { 327 | "name": "App co-process", 328 | "regex": "[.].+:", 329 | "pinned": false, 330 | "rules": [ 331 | { 332 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 333 | "ac": "bg", 334 | "pc": "auto" 335 | } 336 | ] 337 | }, 338 | { 339 | "name": "Default rule", 340 | "regex": ".", 341 | "pinned": false, 342 | "rules": [ 343 | { 344 | "k": "/MAIN_THREAD/", 345 | "ac": "ui", 346 | "pc": "ui" 347 | }, 348 | { 349 | "k": "^(UnityMain|RenderThread |GameThread)", 350 | "ac": "gtmain", 351 | "pc": "auto" 352 | }, 353 | { 354 | "k": "^(Unity|Worker Thread|TaskGraph|RHIThread)", 355 | "ac": "gtcoop", 356 | "pc": "auto" 357 | }, 358 | { 359 | "k": "^(RenderThread|GLThread|JNISurfaceText|IJK_External_Re)|[Aa]nim|([.]raster|[.]ui)$", 360 | "ac": "ui", 361 | "pc": "ui" 362 | }, 363 | { 364 | "k": "^(Chrome_InProc|CrRendererMain|CrGpuMain|CompositorTile)", 365 | "ac": "norm", 366 | "pc": "norm" 367 | }, 368 | { 369 | "k": "^(Viz|Chrome_|Compositor)|[Vv]sync|mali-", 370 | "ac": "ui", 371 | "pc": "ui" 372 | }, 373 | { 374 | "k": "^(OkHttp|Ysa|Xqa|Rx|TVKDL|APM|tp-|cgi-|ODCP-|Bugly|xlog_)", 375 | "ac": "bg", 376 | "pc": "auto" 377 | }, 378 | { 379 | "k": "^(xg_vip_service|Profile|SearchDaemon|default_matrix|FrameDecoder|FrameSeq)", 380 | "ac": "bg", 381 | "pc": "auto" 382 | }, 383 | { 384 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 385 | "ac": "bg", 386 | "pc": "rtusr" 387 | }, 388 | { 389 | "k": "^(JS|libweexjsb|WeexJsBridge|mqt_native|mqt_js|JavaScriptTh)", 390 | "ac": "norm", 391 | "pc": "coop" 392 | }, 393 | { 394 | "k": "^(pool-|glide-|launcher-)|[Dd]ownload|[Ss]chedule|[Ww]ork|[Pp]ool|[Dd]efau|Fresco", 395 | "ac": "norm", 396 | "pc": "coop" 397 | }, 398 | { 399 | "k": ".", 400 | "ac": "norm", 401 | "pc": "norm" 402 | } 403 | ] 404 | } 405 | ] 406 | } 407 | }, 408 | "initials": { 409 | "cpu": { 410 | "baseSampleTime": 0.01, 411 | "baseSlackTime": 0.01, 412 | "latencyTime": 0.5, 413 | "slowLimitPower": 3.0, 414 | "fastLimitPower": 6.0, 415 | "fastLimitCapacity": 10.0, 416 | "fastLimitRecoverScale": 0.3, 417 | "predictThd": 0.3, 418 | "margin": 0.25, 419 | "burst": 0.0, 420 | "guideCap": true, 421 | "limitEfficiency": false 422 | }, 423 | "sysfs": {}, 424 | "sched": { 425 | "scene": "idle" 426 | } 427 | }, 428 | "presets": { 429 | "balance": { 430 | "*": { 431 | "cpu.latencyTime": 0.2, 432 | "cpu.slowLimitPower": 2.0, 433 | "cpu.fastLimitPower": 2.0, 434 | "cpu.fastLimitCapacity": 20.0, 435 | "cpu.margin": 0.2 436 | }, 437 | "idle": { 438 | "cpu.baseSampleTime": 0.04, 439 | "cpu.baseSlackTime": 0.08, 440 | "cpu.predictThd": 0.3, 441 | "cpu.limitEfficiency": true, 442 | "sched.scene": "idle" 443 | }, 444 | "touch": { 445 | "cpu.baseSampleTime": 0.04, 446 | "sched.scene": "touch" 447 | }, 448 | "trigger": { 449 | "cpu.margin": 0.4, 450 | "sched.scene": "touch" 451 | }, 452 | "gesture": { 453 | "cpu.margin": 0.6, 454 | "sched.scene": "touch" 455 | }, 456 | "junk": { 457 | "cpu.burst": 0.7, 458 | "sched.scene": "touch" 459 | }, 460 | "switch": { 461 | "cpu.latencyTime": 0.0, 462 | "cpu.slowLimitPower": 3.0, 463 | "cpu.fastLimitPower": 6.0, 464 | "cpu.fastLimitRecoverScale": 0.1, 465 | "cpu.margin": 0.4, 466 | "sched.scene": "boost" 467 | } 468 | }, 469 | "powersave": { 470 | "*": { 471 | "cpu.latencyTime": 0.4, 472 | "cpu.slowLimitPower": 1.0, 473 | "cpu.fastLimitPower": 1.0, 474 | "cpu.fastLimitCapacity": 5.0, 475 | "cpu.margin": 0.1 476 | }, 477 | "idle": { 478 | "cpu.baseSampleTime": 0.04, 479 | "cpu.baseSlackTime": 0.08, 480 | "cpu.predictThd": 1.0, 481 | "cpu.limitEfficiency": true, 482 | "sched.scene": "idle" 483 | }, 484 | "touch": { 485 | "cpu.baseSampleTime": 0.04, 486 | "sched.scene": "touch" 487 | }, 488 | "trigger": { 489 | "cpu.margin": 0.4, 490 | "sched.scene": "touch" 491 | }, 492 | "gesture": { 493 | "cpu.margin": 0.6, 494 | "sched.scene": "touch" 495 | }, 496 | "junk": { 497 | "cpu.burst": 0.6, 498 | "sched.scene": "touch" 499 | }, 500 | "switch": { 501 | "cpu.latencyTime": 0.0, 502 | "cpu.slowLimitPower": 1.5, 503 | "cpu.fastLimitPower": 3.0, 504 | "cpu.fastLimitRecoverScale": 0.1, 505 | "cpu.margin": 0.3, 506 | "sched.scene": "boost" 507 | } 508 | }, 509 | "performance": { 510 | "*": { 511 | "cpu.latencyTime": 0.0, 512 | "cpu.slowLimitPower": 4.0, 513 | "cpu.fastLimitPower": 10.0, 514 | "cpu.fastLimitCapacity": 360.0, 515 | "cpu.margin": 0.4 516 | }, 517 | "idle": { 518 | "cpu.baseSampleTime": 0.01, 519 | "cpu.baseSlackTime": 0.04, 520 | "sched.scene": "idle" 521 | }, 522 | "touch": { 523 | "sched.scene": "touch" 524 | }, 525 | "trigger": { 526 | "cpu.margin": 0.8, 527 | "sched.scene": "touch" 528 | }, 529 | "gesture": { 530 | "cpu.margin": 0.8, 531 | "sched.scene": "touch" 532 | }, 533 | "junk": { 534 | "cpu.burst": 0.7, 535 | "sched.scene": "touch" 536 | }, 537 | "switch": { 538 | "cpu.burst": 0.2, 539 | "sched.scene": "boost" 540 | } 541 | }, 542 | "fast": { 543 | "*": { 544 | "cpu.latencyTime": 0.0, 545 | "cpu.slowLimitPower": 2.5, 546 | "cpu.fastLimitPower": 2.5, 547 | "cpu.fastLimitCapacity": 0.0, 548 | "cpu.margin": 0.4 549 | }, 550 | "idle": { 551 | "cpu.baseSampleTime": 0.01, 552 | "cpu.baseSlackTime": 0.04, 553 | "sched.scene": "idle" 554 | }, 555 | "touch": { 556 | "sched.scene": "touch" 557 | }, 558 | "trigger": { 559 | "cpu.margin": 0.8, 560 | "sched.scene": "touch" 561 | }, 562 | "gesture": { 563 | "cpu.margin": 0.8, 564 | "sched.scene": "touch" 565 | }, 566 | "junk": { 567 | "cpu.burst": 0.7, 568 | "sched.scene": "touch" 569 | }, 570 | "switch": { 571 | "cpu.burst": 0.2, 572 | "sched.scene": "boost" 573 | } 574 | } 575 | } 576 | } -------------------------------------------------------------------------------- /magisk/config/sdm820.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "name": "sdm820/sdm821[22.07.09] (FDE.AI Edition)", 4 | "author": "yc@coolapk" 5 | }, 6 | "modules": { 7 | "switcher": { 8 | "switchInode": "/sdcard/Android/yc/uperf/cur_powermode.txt", 9 | "perapp": "/sdcard/Android/yc/uperf/perapp_powermode.txt", 10 | "hintDuration": { 11 | "idle": 0.0, 12 | "touch": 4.0, 13 | "trigger": 0.03, 14 | "gesture": 0.1, 15 | "switch": 0.4, 16 | "junk": 0.06 17 | } 18 | }, 19 | "atrace": { 20 | "enable": false 21 | }, 22 | "log": { 23 | "level": "info" 24 | }, 25 | "input": { 26 | "enable": true, 27 | "swipeThd": 0.01, 28 | "gestureThdX": 0.03, 29 | "gestureThdY": 0.03, 30 | "gestureDelayTime": 2.0, 31 | "holdEnterTime": 1.0 32 | }, 33 | "sfanalysis": { 34 | "enable": true, 35 | "renderIdleSlackTime": 0.2 36 | }, 37 | "cpu": { 38 | "enable": true, 39 | "powerModel": [ 40 | { 41 | "efficiency": 160, 42 | "nr": 2, 43 | "typicalPower": 1.1, 44 | "typicalFreq": 1.6, 45 | "sweetFreq": 1.1, 46 | "plainFreq": 0.8, 47 | "freeFreq": 0.5 48 | }, 49 | { 50 | "efficiency": 160, 51 | "nr": 2, 52 | "typicalPower": 1.89, 53 | "typicalFreq": 2.1, 54 | "sweetFreq": 1.4, 55 | "plainFreq": 1.0, 56 | "freeFreq": 0.6 57 | } 58 | ] 59 | }, 60 | "sysfs": { 61 | "enable": false, 62 | "knob": {} 63 | }, 64 | "sched": { 65 | "enable": true, 66 | "cpumask": { 67 | "all": [ 68 | 0, 69 | 1, 70 | 2, 71 | 3 72 | ], 73 | "c0": [ 74 | 0, 75 | 1 76 | ], 77 | "c1": [ 78 | 2, 79 | 3 80 | ], 81 | "c2": [ 82 | 2, 83 | 3 84 | ] 85 | }, 86 | "affinity": { 87 | "auto": { 88 | "bg": "", 89 | "fg": "", 90 | "idle": "", 91 | "touch": "", 92 | "boost": "" 93 | }, 94 | "norm": { 95 | "bg": "", 96 | "fg": "all", 97 | "idle": "all", 98 | "touch": "all", 99 | "boost": "all" 100 | }, 101 | "bg": { 102 | "bg": "", 103 | "fg": "c0", 104 | "idle": "c0", 105 | "touch": "c0", 106 | "boost": "c0" 107 | }, 108 | "ui": { 109 | "bg": "", 110 | "fg": "all", 111 | "idle": "c1", 112 | "touch": "c1", 113 | "boost": "all" 114 | }, 115 | "crit": { 116 | "bg": "", 117 | "fg": "all", 118 | "idle": "all", 119 | "touch": "c1", 120 | "boost": "c1" 121 | }, 122 | "gtcoop": { 123 | "bg": "", 124 | "fg": "all", 125 | "idle": "all", 126 | "touch": "c1", 127 | "boost": "all" 128 | }, 129 | "gtmain": { 130 | "bg": "", 131 | "fg": "all", 132 | "idle": "all", 133 | "touch": "c2", 134 | "boost": "all" 135 | } 136 | }, 137 | "prio": { 138 | "auto": { 139 | "bg": 0, 140 | "fg": 0, 141 | "idle": 0, 142 | "touch": 0, 143 | "boost": 0 144 | }, 145 | "norm": { 146 | "bg": -1, 147 | "fg": -1, 148 | "idle": -1, 149 | "touch": -1, 150 | "boost": -1 151 | }, 152 | "bg": { 153 | "bg": -3, 154 | "fg": 139, 155 | "idle": 139, 156 | "touch": 139, 157 | "boost": 139 158 | }, 159 | "coop": { 160 | "bg": -3, 161 | "fg": 124, 162 | "idle": 122, 163 | "touch": 122, 164 | "boost": 130 165 | }, 166 | "ui": { 167 | "bg": -3, 168 | "fg": 120, 169 | "idle": 110, 170 | "touch": 98, 171 | "boost": 116 172 | }, 173 | "rtusr": { 174 | "bg": 98, 175 | "fg": 98, 176 | "idle": 97, 177 | "touch": 97, 178 | "boost": 98 179 | }, 180 | "rtsys": { 181 | "bg": 97, 182 | "fg": 97, 183 | "idle": 96, 184 | "touch": 96, 185 | "boost": 97 186 | } 187 | }, 188 | "rules": [ 189 | { 190 | "name": "Launcher", 191 | "regex": "/HOME_PACKAGE/", 192 | "pinned": true, 193 | "rules": [ 194 | { 195 | "k": "/MAIN_THREAD/", 196 | "ac": "crit", 197 | "pc": "rtusr" 198 | }, 199 | { 200 | "k": "^(RenderThread|GLThread)", 201 | "ac": "crit", 202 | "pc": "rtusr" 203 | }, 204 | { 205 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 206 | "ac": "bg", 207 | "pc": "rtusr" 208 | }, 209 | { 210 | "k": ".", 211 | "ac": "auto", 212 | "pc": "auto" 213 | } 214 | ] 215 | }, 216 | { 217 | "name": "SurfaceFlinger", 218 | "regex": "/system/bin/surfaceflinger", 219 | "pinned": true, 220 | "rules": [ 221 | { 222 | "k": "/MAIN_THREAD/", 223 | "ac": "crit", 224 | "pc": "auto" 225 | }, 226 | { 227 | "k": "^(app|RenderEngine)", 228 | "ac": "crit", 229 | "pc": "auto" 230 | }, 231 | { 232 | "k": "^Binder:", 233 | "ac": "auto", 234 | "pc": "auto" 235 | }, 236 | { 237 | "k": ".", 238 | "ac": "bg", 239 | "pc": "auto" 240 | } 241 | ] 242 | }, 243 | { 244 | "name": "SystemServer", 245 | "regex": "system_server", 246 | "pinned": true, 247 | "rules": [ 248 | { 249 | "k": "^(TaskSnapshot|Greezer|CachedApp|SystemPressure|SensorService)|[Mm]emory", 250 | "ac": "bg", 251 | "pc": "auto" 252 | }, 253 | { 254 | "k": ".", 255 | "ac": "auto", 256 | "pc": "auto" 257 | } 258 | ] 259 | }, 260 | { 261 | "name": "SystemUI", 262 | "regex": "com.android.systemui", 263 | "pinned": true, 264 | "rules": [ 265 | { 266 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 267 | "ac": "bg", 268 | "pc": "auto" 269 | } 270 | ] 271 | }, 272 | { 273 | "name": "MediaProvider", 274 | "regex": "^com.android.providers.media", 275 | "pinned": true, 276 | "rules": [ 277 | { 278 | "k": ".", 279 | "ac": "auto", 280 | "pc": "bg" 281 | } 282 | ] 283 | }, 284 | { 285 | "name": "Memory reclaim", 286 | "regex": "swapd|compactd", 287 | "pinned": true, 288 | "rules": [ 289 | { 290 | "k": ".", 291 | "ac": "auto", 292 | "pc": "bg" 293 | } 294 | ] 295 | }, 296 | { 297 | "name": "Phone", 298 | "regex": "com.android.phone", 299 | "pinned": false, 300 | "rules": [ 301 | { 302 | "k": ".", 303 | "ac": "auto", 304 | "pc": "auto" 305 | } 306 | ] 307 | }, 308 | { 309 | "name": "Other system processes", 310 | "regex": "^(/system|/vendor|magiskd|zygiskd)|@|-service$", 311 | "pinned": false, 312 | "rules": [ 313 | { 314 | "k": ".", 315 | "ac": "auto", 316 | "pc": "auto" 317 | } 318 | ] 319 | }, 320 | { 321 | "name": "App co-process", 322 | "regex": "[.].+:", 323 | "pinned": false, 324 | "rules": [ 325 | { 326 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 327 | "ac": "bg", 328 | "pc": "auto" 329 | } 330 | ] 331 | }, 332 | { 333 | "name": "Default rule", 334 | "regex": ".", 335 | "pinned": false, 336 | "rules": [ 337 | { 338 | "k": "/MAIN_THREAD/", 339 | "ac": "ui", 340 | "pc": "ui" 341 | }, 342 | { 343 | "k": "^(UnityMain|RenderThread |GameThread)", 344 | "ac": "gtmain", 345 | "pc": "auto" 346 | }, 347 | { 348 | "k": "^(Unity|Worker Thread|TaskGraph|RHIThread)", 349 | "ac": "gtcoop", 350 | "pc": "auto" 351 | }, 352 | { 353 | "k": "^(RenderThread|GLThread|JNISurfaceText|IJK_External_Re)|[Aa]nim|([.]raster|[.]ui)$", 354 | "ac": "ui", 355 | "pc": "ui" 356 | }, 357 | { 358 | "k": "^(Chrome_InProc|CrRendererMain|CrGpuMain|CompositorTile)", 359 | "ac": "norm", 360 | "pc": "norm" 361 | }, 362 | { 363 | "k": "^(Viz|Chrome_|Compositor)|[Vv]sync|mali-", 364 | "ac": "ui", 365 | "pc": "ui" 366 | }, 367 | { 368 | "k": "^(OkHttp|Ysa|Xqa|Rx|TVKDL|APM|tp-|cgi-|ODCP-|Bugly|xlog_)", 369 | "ac": "bg", 370 | "pc": "auto" 371 | }, 372 | { 373 | "k": "^(xg_vip_service|Profile|SearchDaemon|default_matrix|FrameDecoder|FrameSeq)", 374 | "ac": "bg", 375 | "pc": "auto" 376 | }, 377 | { 378 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 379 | "ac": "bg", 380 | "pc": "rtusr" 381 | }, 382 | { 383 | "k": "^(JS|libweexjsb|WeexJsBridge|mqt_native|mqt_js|JavaScriptTh)", 384 | "ac": "norm", 385 | "pc": "coop" 386 | }, 387 | { 388 | "k": "^(pool-|glide-|launcher-)|[Dd]ownload|[Ss]chedule|[Ww]ork|[Pp]ool|[Dd]efau|Fresco", 389 | "ac": "norm", 390 | "pc": "coop" 391 | }, 392 | { 393 | "k": ".", 394 | "ac": "norm", 395 | "pc": "norm" 396 | } 397 | ] 398 | } 399 | ] 400 | } 401 | }, 402 | "initials": { 403 | "cpu": { 404 | "baseSampleTime": 0.01, 405 | "baseSlackTime": 0.01, 406 | "latencyTime": 0.5, 407 | "slowLimitPower": 3.0, 408 | "fastLimitPower": 6.0, 409 | "fastLimitCapacity": 10.0, 410 | "fastLimitRecoverScale": 0.3, 411 | "predictThd": 0.3, 412 | "margin": 0.25, 413 | "burst": 0.0, 414 | "guideCap": true, 415 | "limitEfficiency": false 416 | }, 417 | "sysfs": {}, 418 | "sched": { 419 | "scene": "idle" 420 | } 421 | }, 422 | "presets": { 423 | "balance": { 424 | "*": { 425 | "cpu.latencyTime": 0.2, 426 | "cpu.slowLimitPower": 2.0, 427 | "cpu.fastLimitPower": 2.0, 428 | "cpu.fastLimitCapacity": 20.0, 429 | "cpu.margin": 0.2 430 | }, 431 | "idle": { 432 | "cpu.baseSampleTime": 0.04, 433 | "cpu.baseSlackTime": 0.08, 434 | "cpu.predictThd": 0.3, 435 | "cpu.limitEfficiency": true, 436 | "sched.scene": "idle" 437 | }, 438 | "touch": { 439 | "cpu.baseSampleTime": 0.04, 440 | "sched.scene": "touch" 441 | }, 442 | "trigger": { 443 | "cpu.margin": 0.4, 444 | "sched.scene": "touch" 445 | }, 446 | "gesture": { 447 | "cpu.margin": 0.6, 448 | "sched.scene": "touch" 449 | }, 450 | "junk": { 451 | "cpu.burst": 0.6, 452 | "sched.scene": "touch" 453 | }, 454 | "switch": { 455 | "cpu.latencyTime": 0.0, 456 | "cpu.slowLimitPower": 3.0, 457 | "cpu.fastLimitPower": 6.0, 458 | "cpu.fastLimitRecoverScale": 0.1, 459 | "cpu.margin": 0.4, 460 | "sched.scene": "boost" 461 | } 462 | }, 463 | "powersave": { 464 | "*": { 465 | "cpu.latencyTime": 0.4, 466 | "cpu.slowLimitPower": 1.0, 467 | "cpu.fastLimitPower": 1.0, 468 | "cpu.fastLimitCapacity": 5.0, 469 | "cpu.margin": 0.1 470 | }, 471 | "idle": { 472 | "cpu.baseSampleTime": 0.04, 473 | "cpu.baseSlackTime": 0.08, 474 | "cpu.predictThd": 1.0, 475 | "cpu.limitEfficiency": true, 476 | "sched.scene": "idle" 477 | }, 478 | "touch": { 479 | "cpu.baseSampleTime": 0.04, 480 | "sched.scene": "touch" 481 | }, 482 | "trigger": { 483 | "cpu.margin": 0.4, 484 | "sched.scene": "touch" 485 | }, 486 | "gesture": { 487 | "cpu.margin": 0.6, 488 | "sched.scene": "touch" 489 | }, 490 | "junk": { 491 | "cpu.burst": 0.3, 492 | "sched.scene": "touch" 493 | }, 494 | "switch": { 495 | "cpu.latencyTime": 0.0, 496 | "cpu.slowLimitPower": 1.5, 497 | "cpu.fastLimitPower": 3.0, 498 | "cpu.fastLimitRecoverScale": 0.1, 499 | "cpu.margin": 0.3, 500 | "sched.scene": "boost" 501 | } 502 | }, 503 | "performance": { 504 | "*": { 505 | "cpu.latencyTime": 0.0, 506 | "cpu.slowLimitPower": 4.0, 507 | "cpu.fastLimitPower": 10.0, 508 | "cpu.fastLimitCapacity": 360.0, 509 | "cpu.margin": 0.4 510 | }, 511 | "idle": { 512 | "cpu.baseSampleTime": 0.01, 513 | "cpu.baseSlackTime": 0.04, 514 | "sched.scene": "idle" 515 | }, 516 | "touch": { 517 | "sched.scene": "touch" 518 | }, 519 | "trigger": { 520 | "cpu.margin": 0.8, 521 | "sched.scene": "touch" 522 | }, 523 | "gesture": { 524 | "cpu.margin": 0.8, 525 | "sched.scene": "touch" 526 | }, 527 | "junk": { 528 | "cpu.burst": 0.5, 529 | "sched.scene": "touch" 530 | }, 531 | "switch": { 532 | "cpu.burst": 0.2, 533 | "sched.scene": "boost" 534 | } 535 | }, 536 | "fast": { 537 | "*": { 538 | "cpu.latencyTime": 0.0, 539 | "cpu.slowLimitPower": 2.5, 540 | "cpu.fastLimitPower": 2.5, 541 | "cpu.fastLimitCapacity": 0.0, 542 | "cpu.margin": 0.4 543 | }, 544 | "idle": { 545 | "cpu.baseSampleTime": 0.01, 546 | "cpu.baseSlackTime": 0.04, 547 | "sched.scene": "idle" 548 | }, 549 | "touch": { 550 | "sched.scene": "touch" 551 | }, 552 | "trigger": { 553 | "cpu.margin": 0.8, 554 | "sched.scene": "touch" 555 | }, 556 | "gesture": { 557 | "cpu.margin": 0.8, 558 | "sched.scene": "touch" 559 | }, 560 | "junk": { 561 | "cpu.burst": 0.5, 562 | "sched.scene": "touch" 563 | }, 564 | "switch": { 565 | "cpu.burst": 0.2, 566 | "sched.scene": "boost" 567 | } 568 | } 569 | } 570 | } -------------------------------------------------------------------------------- /magisk/config/sdm835.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "name": "sdm835[22.07.09] (FDE.AI Edition)", 4 | "author": "yc@coolapk" 5 | }, 6 | "modules": { 7 | "switcher": { 8 | "switchInode": "/sdcard/Android/yc/uperf/cur_powermode.txt", 9 | "perapp": "/sdcard/Android/yc/uperf/perapp_powermode.txt", 10 | "hintDuration": { 11 | "idle": 0.0, 12 | "touch": 4.0, 13 | "trigger": 0.03, 14 | "gesture": 0.1, 15 | "switch": 0.4, 16 | "junk": 0.06 17 | } 18 | }, 19 | "atrace": { 20 | "enable": false 21 | }, 22 | "log": { 23 | "level": "info" 24 | }, 25 | "input": { 26 | "enable": true, 27 | "swipeThd": 0.01, 28 | "gestureThdX": 0.03, 29 | "gestureThdY": 0.03, 30 | "gestureDelayTime": 2.0, 31 | "holdEnterTime": 1.0 32 | }, 33 | "sfanalysis": { 34 | "enable": true, 35 | "renderIdleSlackTime": 0.2 36 | }, 37 | "cpu": { 38 | "enable": true, 39 | "powerModel": [ 40 | { 41 | "efficiency": 100, 42 | "nr": 4, 43 | "typicalPower": 0.32, 44 | "typicalFreq": 1.9, 45 | "sweetFreq": 1.5, 46 | "plainFreq": 1.0, 47 | "freeFreq": 0.5 48 | }, 49 | { 50 | "efficiency": 170, 51 | "nr": 4, 52 | "typicalPower": 1.46, 53 | "typicalFreq": 2.5, 54 | "sweetFreq": 1.8, 55 | "plainFreq": 1.0, 56 | "freeFreq": 0.7 57 | } 58 | ] 59 | }, 60 | "sysfs": { 61 | "enable": false, 62 | "knob": {} 63 | }, 64 | "sched": { 65 | "enable": true, 66 | "cpumask": { 67 | "all": [ 68 | 0, 69 | 1, 70 | 2, 71 | 3, 72 | 4, 73 | 5, 74 | 6, 75 | 7 76 | ], 77 | "c0": [ 78 | 0, 79 | 1, 80 | 2, 81 | 3 82 | ], 83 | "c1": [ 84 | 4, 85 | 5, 86 | 6 87 | ], 88 | "c2": [ 89 | 7 90 | ] 91 | }, 92 | "affinity": { 93 | "auto": { 94 | "bg": "", 95 | "fg": "", 96 | "idle": "", 97 | "touch": "", 98 | "boost": "" 99 | }, 100 | "norm": { 101 | "bg": "", 102 | "fg": "all", 103 | "idle": "all", 104 | "touch": "all", 105 | "boost": "all" 106 | }, 107 | "bg": { 108 | "bg": "", 109 | "fg": "c0", 110 | "idle": "c0", 111 | "touch": "c0", 112 | "boost": "c0" 113 | }, 114 | "ui": { 115 | "bg": "", 116 | "fg": "all", 117 | "idle": "c1", 118 | "touch": "c1", 119 | "boost": "all" 120 | }, 121 | "crit": { 122 | "bg": "", 123 | "fg": "all", 124 | "idle": "all", 125 | "touch": "c1", 126 | "boost": "c1" 127 | }, 128 | "gtcoop": { 129 | "bg": "", 130 | "fg": "all", 131 | "idle": "all", 132 | "touch": "c1", 133 | "boost": "all" 134 | }, 135 | "gtmain": { 136 | "bg": "", 137 | "fg": "all", 138 | "idle": "all", 139 | "touch": "c2", 140 | "boost": "all" 141 | } 142 | }, 143 | "prio": { 144 | "auto": { 145 | "bg": 0, 146 | "fg": 0, 147 | "idle": 0, 148 | "touch": 0, 149 | "boost": 0 150 | }, 151 | "norm": { 152 | "bg": -1, 153 | "fg": -1, 154 | "idle": -1, 155 | "touch": -1, 156 | "boost": -1 157 | }, 158 | "bg": { 159 | "bg": -3, 160 | "fg": 139, 161 | "idle": 139, 162 | "touch": 139, 163 | "boost": 139 164 | }, 165 | "coop": { 166 | "bg": -3, 167 | "fg": 124, 168 | "idle": 122, 169 | "touch": 122, 170 | "boost": 130 171 | }, 172 | "ui": { 173 | "bg": -3, 174 | "fg": 120, 175 | "idle": 110, 176 | "touch": 98, 177 | "boost": 116 178 | }, 179 | "rtusr": { 180 | "bg": 98, 181 | "fg": 98, 182 | "idle": 97, 183 | "touch": 97, 184 | "boost": 98 185 | }, 186 | "rtsys": { 187 | "bg": 97, 188 | "fg": 97, 189 | "idle": 96, 190 | "touch": 96, 191 | "boost": 97 192 | } 193 | }, 194 | "rules": [ 195 | { 196 | "name": "Launcher", 197 | "regex": "/HOME_PACKAGE/", 198 | "pinned": true, 199 | "rules": [ 200 | { 201 | "k": "/MAIN_THREAD/", 202 | "ac": "crit", 203 | "pc": "rtusr" 204 | }, 205 | { 206 | "k": "^(RenderThread|GLThread)", 207 | "ac": "crit", 208 | "pc": "rtusr" 209 | }, 210 | { 211 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 212 | "ac": "bg", 213 | "pc": "rtusr" 214 | }, 215 | { 216 | "k": ".", 217 | "ac": "auto", 218 | "pc": "auto" 219 | } 220 | ] 221 | }, 222 | { 223 | "name": "SurfaceFlinger", 224 | "regex": "/system/bin/surfaceflinger", 225 | "pinned": true, 226 | "rules": [ 227 | { 228 | "k": "/MAIN_THREAD/", 229 | "ac": "crit", 230 | "pc": "auto" 231 | }, 232 | { 233 | "k": "^(app|RenderEngine)", 234 | "ac": "crit", 235 | "pc": "auto" 236 | }, 237 | { 238 | "k": "^Binder:", 239 | "ac": "auto", 240 | "pc": "auto" 241 | }, 242 | { 243 | "k": ".", 244 | "ac": "bg", 245 | "pc": "auto" 246 | } 247 | ] 248 | }, 249 | { 250 | "name": "SystemServer", 251 | "regex": "system_server", 252 | "pinned": true, 253 | "rules": [ 254 | { 255 | "k": "^(TaskSnapshot|Greezer|CachedApp|SystemPressure|SensorService)|[Mm]emory", 256 | "ac": "bg", 257 | "pc": "auto" 258 | }, 259 | { 260 | "k": ".", 261 | "ac": "auto", 262 | "pc": "auto" 263 | } 264 | ] 265 | }, 266 | { 267 | "name": "SystemUI", 268 | "regex": "com.android.systemui", 269 | "pinned": true, 270 | "rules": [ 271 | { 272 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 273 | "ac": "bg", 274 | "pc": "auto" 275 | } 276 | ] 277 | }, 278 | { 279 | "name": "MediaProvider", 280 | "regex": "^com.android.providers.media", 281 | "pinned": true, 282 | "rules": [ 283 | { 284 | "k": ".", 285 | "ac": "auto", 286 | "pc": "bg" 287 | } 288 | ] 289 | }, 290 | { 291 | "name": "Memory reclaim", 292 | "regex": "swapd|compactd", 293 | "pinned": true, 294 | "rules": [ 295 | { 296 | "k": ".", 297 | "ac": "auto", 298 | "pc": "bg" 299 | } 300 | ] 301 | }, 302 | { 303 | "name": "Phone", 304 | "regex": "com.android.phone", 305 | "pinned": false, 306 | "rules": [ 307 | { 308 | "k": ".", 309 | "ac": "auto", 310 | "pc": "auto" 311 | } 312 | ] 313 | }, 314 | { 315 | "name": "Other system processes", 316 | "regex": "^(/system|/vendor|magiskd|zygiskd)|@|-service$", 317 | "pinned": false, 318 | "rules": [ 319 | { 320 | "k": ".", 321 | "ac": "auto", 322 | "pc": "auto" 323 | } 324 | ] 325 | }, 326 | { 327 | "name": "App co-process", 328 | "regex": "[.].+:", 329 | "pinned": false, 330 | "rules": [ 331 | { 332 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 333 | "ac": "bg", 334 | "pc": "auto" 335 | } 336 | ] 337 | }, 338 | { 339 | "name": "Default rule", 340 | "regex": ".", 341 | "pinned": false, 342 | "rules": [ 343 | { 344 | "k": "/MAIN_THREAD/", 345 | "ac": "ui", 346 | "pc": "ui" 347 | }, 348 | { 349 | "k": "^(UnityMain|RenderThread |GameThread)", 350 | "ac": "gtmain", 351 | "pc": "auto" 352 | }, 353 | { 354 | "k": "^(Unity|Worker Thread|TaskGraph|RHIThread)", 355 | "ac": "gtcoop", 356 | "pc": "auto" 357 | }, 358 | { 359 | "k": "^(RenderThread|GLThread|JNISurfaceText|IJK_External_Re)|[Aa]nim|([.]raster|[.]ui)$", 360 | "ac": "ui", 361 | "pc": "ui" 362 | }, 363 | { 364 | "k": "^(Chrome_InProc|CrRendererMain|CrGpuMain|CompositorTile)", 365 | "ac": "norm", 366 | "pc": "norm" 367 | }, 368 | { 369 | "k": "^(Viz|Chrome_|Compositor)|[Vv]sync|mali-", 370 | "ac": "ui", 371 | "pc": "ui" 372 | }, 373 | { 374 | "k": "^(OkHttp|Ysa|Xqa|Rx|TVKDL|APM|tp-|cgi-|ODCP-|Bugly|xlog_)", 375 | "ac": "bg", 376 | "pc": "auto" 377 | }, 378 | { 379 | "k": "^(xg_vip_service|Profile|SearchDaemon|default_matrix|FrameDecoder|FrameSeq)", 380 | "ac": "bg", 381 | "pc": "auto" 382 | }, 383 | { 384 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 385 | "ac": "bg", 386 | "pc": "rtusr" 387 | }, 388 | { 389 | "k": "^(JS|libweexjsb|WeexJsBridge|mqt_native|mqt_js|JavaScriptTh)", 390 | "ac": "norm", 391 | "pc": "coop" 392 | }, 393 | { 394 | "k": "^(pool-|glide-|launcher-)|[Dd]ownload|[Ss]chedule|[Ww]ork|[Pp]ool|[Dd]efau|Fresco", 395 | "ac": "norm", 396 | "pc": "coop" 397 | }, 398 | { 399 | "k": ".", 400 | "ac": "norm", 401 | "pc": "norm" 402 | } 403 | ] 404 | } 405 | ] 406 | } 407 | }, 408 | "initials": { 409 | "cpu": { 410 | "baseSampleTime": 0.01, 411 | "baseSlackTime": 0.01, 412 | "latencyTime": 0.5, 413 | "slowLimitPower": 3.0, 414 | "fastLimitPower": 6.0, 415 | "fastLimitCapacity": 10.0, 416 | "fastLimitRecoverScale": 0.3, 417 | "predictThd": 0.3, 418 | "margin": 0.25, 419 | "burst": 0.0, 420 | "guideCap": true, 421 | "limitEfficiency": false 422 | }, 423 | "sysfs": {}, 424 | "sched": { 425 | "scene": "idle" 426 | } 427 | }, 428 | "presets": { 429 | "balance": { 430 | "*": { 431 | "cpu.latencyTime": 0.2, 432 | "cpu.slowLimitPower": 2.0, 433 | "cpu.fastLimitPower": 2.0, 434 | "cpu.fastLimitCapacity": 20.0, 435 | "cpu.margin": 0.2 436 | }, 437 | "idle": { 438 | "cpu.baseSampleTime": 0.04, 439 | "cpu.baseSlackTime": 0.08, 440 | "cpu.predictThd": 0.3, 441 | "cpu.limitEfficiency": true, 442 | "sched.scene": "idle" 443 | }, 444 | "touch": { 445 | "cpu.baseSampleTime": 0.04, 446 | "sched.scene": "touch" 447 | }, 448 | "trigger": { 449 | "cpu.margin": 0.4, 450 | "sched.scene": "touch" 451 | }, 452 | "gesture": { 453 | "cpu.margin": 0.6, 454 | "sched.scene": "touch" 455 | }, 456 | "junk": { 457 | "cpu.burst": 0.6, 458 | "sched.scene": "touch" 459 | }, 460 | "switch": { 461 | "cpu.latencyTime": 0.0, 462 | "cpu.slowLimitPower": 3.0, 463 | "cpu.fastLimitPower": 6.0, 464 | "cpu.fastLimitRecoverScale": 0.1, 465 | "cpu.margin": 0.4, 466 | "sched.scene": "boost" 467 | } 468 | }, 469 | "powersave": { 470 | "*": { 471 | "cpu.latencyTime": 0.4, 472 | "cpu.slowLimitPower": 1.0, 473 | "cpu.fastLimitPower": 1.0, 474 | "cpu.fastLimitCapacity": 5.0, 475 | "cpu.margin": 0.1 476 | }, 477 | "idle": { 478 | "cpu.baseSampleTime": 0.04, 479 | "cpu.baseSlackTime": 0.08, 480 | "cpu.predictThd": 1.0, 481 | "cpu.limitEfficiency": true, 482 | "sched.scene": "idle" 483 | }, 484 | "touch": { 485 | "cpu.baseSampleTime": 0.04, 486 | "sched.scene": "touch" 487 | }, 488 | "trigger": { 489 | "cpu.margin": 0.4, 490 | "sched.scene": "touch" 491 | }, 492 | "gesture": { 493 | "cpu.margin": 0.6, 494 | "sched.scene": "touch" 495 | }, 496 | "junk": { 497 | "cpu.burst": 0.3, 498 | "sched.scene": "touch" 499 | }, 500 | "switch": { 501 | "cpu.latencyTime": 0.0, 502 | "cpu.slowLimitPower": 1.5, 503 | "cpu.fastLimitPower": 3.0, 504 | "cpu.fastLimitRecoverScale": 0.1, 505 | "cpu.margin": 0.3, 506 | "sched.scene": "boost" 507 | } 508 | }, 509 | "performance": { 510 | "*": { 511 | "cpu.latencyTime": 0.0, 512 | "cpu.slowLimitPower": 4.0, 513 | "cpu.fastLimitPower": 10.0, 514 | "cpu.fastLimitCapacity": 360.0, 515 | "cpu.margin": 0.4 516 | }, 517 | "idle": { 518 | "cpu.baseSampleTime": 0.01, 519 | "cpu.baseSlackTime": 0.04, 520 | "sched.scene": "idle" 521 | }, 522 | "touch": { 523 | "sched.scene": "touch" 524 | }, 525 | "trigger": { 526 | "cpu.margin": 0.8, 527 | "sched.scene": "touch" 528 | }, 529 | "gesture": { 530 | "cpu.margin": 0.8, 531 | "sched.scene": "touch" 532 | }, 533 | "junk": { 534 | "cpu.burst": 0.5, 535 | "sched.scene": "touch" 536 | }, 537 | "switch": { 538 | "cpu.burst": 0.2, 539 | "sched.scene": "boost" 540 | } 541 | }, 542 | "fast": { 543 | "*": { 544 | "cpu.latencyTime": 0.0, 545 | "cpu.slowLimitPower": 2.5, 546 | "cpu.fastLimitPower": 2.5, 547 | "cpu.fastLimitCapacity": 0.0, 548 | "cpu.margin": 0.4 549 | }, 550 | "idle": { 551 | "cpu.baseSampleTime": 0.01, 552 | "cpu.baseSlackTime": 0.04, 553 | "sched.scene": "idle" 554 | }, 555 | "touch": { 556 | "sched.scene": "touch" 557 | }, 558 | "trigger": { 559 | "cpu.margin": 0.8, 560 | "sched.scene": "touch" 561 | }, 562 | "gesture": { 563 | "cpu.margin": 0.8, 564 | "sched.scene": "touch" 565 | }, 566 | "junk": { 567 | "cpu.burst": 0.5, 568 | "sched.scene": "touch" 569 | }, 570 | "switch": { 571 | "cpu.burst": 0.2, 572 | "sched.scene": "boost" 573 | } 574 | } 575 | } 576 | } -------------------------------------------------------------------------------- /magisk/config/sdm845.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "name": "sdm845[22.07.09] (FDE.AI Edition)", 4 | "author": "yc@coolapk" 5 | }, 6 | "modules": { 7 | "switcher": { 8 | "switchInode": "/sdcard/Android/yc/uperf/cur_powermode.txt", 9 | "perapp": "/sdcard/Android/yc/uperf/perapp_powermode.txt", 10 | "hintDuration": { 11 | "idle": 0.0, 12 | "touch": 4.0, 13 | "trigger": 0.03, 14 | "gesture": 0.1, 15 | "switch": 0.4, 16 | "junk": 0.06 17 | } 18 | }, 19 | "atrace": { 20 | "enable": false 21 | }, 22 | "log": { 23 | "level": "info" 24 | }, 25 | "input": { 26 | "enable": true, 27 | "swipeThd": 0.01, 28 | "gestureThdX": 0.03, 29 | "gestureThdY": 0.03, 30 | "gestureDelayTime": 2.0, 31 | "holdEnterTime": 1.0 32 | }, 33 | "sfanalysis": { 34 | "enable": true, 35 | "renderIdleSlackTime": 0.2 36 | }, 37 | "cpu": { 38 | "enable": true, 39 | "powerModel": [ 40 | { 41 | "efficiency": 115, 42 | "nr": 4, 43 | "typicalPower": 0.4, 44 | "typicalFreq": 1.8, 45 | "sweetFreq": 1.4, 46 | "plainFreq": 0.9, 47 | "freeFreq": 0.6 48 | }, 49 | { 50 | "efficiency": 200, 51 | "nr": 4, 52 | "typicalPower": 1.76, 53 | "typicalFreq": 2.8, 54 | "sweetFreq": 1.8, 55 | "plainFreq": 1.0, 56 | "freeFreq": 0.8 57 | } 58 | ] 59 | }, 60 | "sysfs": { 61 | "enable": false, 62 | "knob": {} 63 | }, 64 | "sched": { 65 | "enable": true, 66 | "cpumask": { 67 | "all": [ 68 | 0, 69 | 1, 70 | 2, 71 | 3, 72 | 4, 73 | 5, 74 | 6, 75 | 7 76 | ], 77 | "c0": [ 78 | 0, 79 | 1, 80 | 2, 81 | 3 82 | ], 83 | "c1": [ 84 | 4, 85 | 5, 86 | 6 87 | ], 88 | "c2": [ 89 | 7 90 | ] 91 | }, 92 | "affinity": { 93 | "auto": { 94 | "bg": "", 95 | "fg": "", 96 | "idle": "", 97 | "touch": "", 98 | "boost": "" 99 | }, 100 | "norm": { 101 | "bg": "", 102 | "fg": "all", 103 | "idle": "all", 104 | "touch": "all", 105 | "boost": "all" 106 | }, 107 | "bg": { 108 | "bg": "", 109 | "fg": "c0", 110 | "idle": "c0", 111 | "touch": "c0", 112 | "boost": "c0" 113 | }, 114 | "ui": { 115 | "bg": "", 116 | "fg": "all", 117 | "idle": "c1", 118 | "touch": "c1", 119 | "boost": "all" 120 | }, 121 | "crit": { 122 | "bg": "", 123 | "fg": "all", 124 | "idle": "all", 125 | "touch": "c1", 126 | "boost": "c1" 127 | }, 128 | "gtcoop": { 129 | "bg": "", 130 | "fg": "all", 131 | "idle": "all", 132 | "touch": "c1", 133 | "boost": "all" 134 | }, 135 | "gtmain": { 136 | "bg": "", 137 | "fg": "all", 138 | "idle": "all", 139 | "touch": "c2", 140 | "boost": "all" 141 | } 142 | }, 143 | "prio": { 144 | "auto": { 145 | "bg": 0, 146 | "fg": 0, 147 | "idle": 0, 148 | "touch": 0, 149 | "boost": 0 150 | }, 151 | "norm": { 152 | "bg": -1, 153 | "fg": -1, 154 | "idle": -1, 155 | "touch": -1, 156 | "boost": -1 157 | }, 158 | "bg": { 159 | "bg": -3, 160 | "fg": 139, 161 | "idle": 139, 162 | "touch": 139, 163 | "boost": 139 164 | }, 165 | "coop": { 166 | "bg": -3, 167 | "fg": 124, 168 | "idle": 122, 169 | "touch": 122, 170 | "boost": 130 171 | }, 172 | "ui": { 173 | "bg": -3, 174 | "fg": 120, 175 | "idle": 110, 176 | "touch": 98, 177 | "boost": 116 178 | }, 179 | "rtusr": { 180 | "bg": 98, 181 | "fg": 98, 182 | "idle": 97, 183 | "touch": 97, 184 | "boost": 98 185 | }, 186 | "rtsys": { 187 | "bg": 97, 188 | "fg": 97, 189 | "idle": 96, 190 | "touch": 96, 191 | "boost": 97 192 | } 193 | }, 194 | "rules": [ 195 | { 196 | "name": "Launcher", 197 | "regex": "/HOME_PACKAGE/", 198 | "pinned": true, 199 | "rules": [ 200 | { 201 | "k": "/MAIN_THREAD/", 202 | "ac": "crit", 203 | "pc": "rtusr" 204 | }, 205 | { 206 | "k": "^(RenderThread|GLThread)", 207 | "ac": "crit", 208 | "pc": "rtusr" 209 | }, 210 | { 211 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 212 | "ac": "bg", 213 | "pc": "rtusr" 214 | }, 215 | { 216 | "k": ".", 217 | "ac": "auto", 218 | "pc": "auto" 219 | } 220 | ] 221 | }, 222 | { 223 | "name": "SurfaceFlinger", 224 | "regex": "/system/bin/surfaceflinger", 225 | "pinned": true, 226 | "rules": [ 227 | { 228 | "k": "/MAIN_THREAD/", 229 | "ac": "crit", 230 | "pc": "auto" 231 | }, 232 | { 233 | "k": "^(app|RenderEngine)", 234 | "ac": "crit", 235 | "pc": "auto" 236 | }, 237 | { 238 | "k": "^Binder:", 239 | "ac": "auto", 240 | "pc": "auto" 241 | }, 242 | { 243 | "k": ".", 244 | "ac": "bg", 245 | "pc": "auto" 246 | } 247 | ] 248 | }, 249 | { 250 | "name": "SystemServer", 251 | "regex": "system_server", 252 | "pinned": true, 253 | "rules": [ 254 | { 255 | "k": "^(TaskSnapshot|Greezer|CachedApp|SystemPressure|SensorService)|[Mm]emory", 256 | "ac": "bg", 257 | "pc": "auto" 258 | }, 259 | { 260 | "k": ".", 261 | "ac": "auto", 262 | "pc": "auto" 263 | } 264 | ] 265 | }, 266 | { 267 | "name": "SystemUI", 268 | "regex": "com.android.systemui", 269 | "pinned": true, 270 | "rules": [ 271 | { 272 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 273 | "ac": "bg", 274 | "pc": "auto" 275 | } 276 | ] 277 | }, 278 | { 279 | "name": "MediaProvider", 280 | "regex": "^com.android.providers.media", 281 | "pinned": true, 282 | "rules": [ 283 | { 284 | "k": ".", 285 | "ac": "auto", 286 | "pc": "bg" 287 | } 288 | ] 289 | }, 290 | { 291 | "name": "Memory reclaim", 292 | "regex": "swapd|compactd", 293 | "pinned": true, 294 | "rules": [ 295 | { 296 | "k": ".", 297 | "ac": "auto", 298 | "pc": "bg" 299 | } 300 | ] 301 | }, 302 | { 303 | "name": "Phone", 304 | "regex": "com.android.phone", 305 | "pinned": false, 306 | "rules": [ 307 | { 308 | "k": ".", 309 | "ac": "auto", 310 | "pc": "auto" 311 | } 312 | ] 313 | }, 314 | { 315 | "name": "Other system processes", 316 | "regex": "^(/system|/vendor|magiskd|zygiskd)|@|-service$", 317 | "pinned": false, 318 | "rules": [ 319 | { 320 | "k": ".", 321 | "ac": "auto", 322 | "pc": "auto" 323 | } 324 | ] 325 | }, 326 | { 327 | "name": "App co-process", 328 | "regex": "[.].+:", 329 | "pinned": false, 330 | "rules": [ 331 | { 332 | "k": "^(Jit thread pool|HeapTaskDaemon|FinalizerDaemon|ReferenceQueueD)", 333 | "ac": "bg", 334 | "pc": "auto" 335 | } 336 | ] 337 | }, 338 | { 339 | "name": "Default rule", 340 | "regex": ".", 341 | "pinned": false, 342 | "rules": [ 343 | { 344 | "k": "/MAIN_THREAD/", 345 | "ac": "ui", 346 | "pc": "ui" 347 | }, 348 | { 349 | "k": "^(UnityMain|RenderThread |GameThread)", 350 | "ac": "gtmain", 351 | "pc": "auto" 352 | }, 353 | { 354 | "k": "^(Unity|Worker Thread|TaskGraph|RHIThread)", 355 | "ac": "gtcoop", 356 | "pc": "auto" 357 | }, 358 | { 359 | "k": "^(RenderThread|GLThread|JNISurfaceText|IJK_External_Re)|[Aa]nim|([.]raster|[.]ui)$", 360 | "ac": "ui", 361 | "pc": "ui" 362 | }, 363 | { 364 | "k": "^(Chrome_InProc|CrRendererMain|CrGpuMain|CompositorTile)", 365 | "ac": "norm", 366 | "pc": "norm" 367 | }, 368 | { 369 | "k": "^(Viz|Chrome_|Compositor)|[Vv]sync|mali-", 370 | "ac": "ui", 371 | "pc": "ui" 372 | }, 373 | { 374 | "k": "^(OkHttp|Ysa|Xqa|Rx|TVKDL|APM|tp-|cgi-|ODCP-|Bugly|xlog_)", 375 | "ac": "bg", 376 | "pc": "auto" 377 | }, 378 | { 379 | "k": "^(xg_vip_service|Profile|SearchDaemon|default_matrix|FrameDecoder|FrameSeq)", 380 | "ac": "bg", 381 | "pc": "auto" 382 | }, 383 | { 384 | "k": "^(GPU completion|HWC release|hwui|FramePolicy|ScrollPolicy|ged-swd)", 385 | "ac": "bg", 386 | "pc": "rtusr" 387 | }, 388 | { 389 | "k": "^(JS|libweexjsb|WeexJsBridge|mqt_native|mqt_js|JavaScriptTh)", 390 | "ac": "norm", 391 | "pc": "coop" 392 | }, 393 | { 394 | "k": "^(pool-|glide-|launcher-)|[Dd]ownload|[Ss]chedule|[Ww]ork|[Pp]ool|[Dd]efau|Fresco", 395 | "ac": "norm", 396 | "pc": "coop" 397 | }, 398 | { 399 | "k": ".", 400 | "ac": "norm", 401 | "pc": "norm" 402 | } 403 | ] 404 | } 405 | ] 406 | } 407 | }, 408 | "initials": { 409 | "cpu": { 410 | "baseSampleTime": 0.01, 411 | "baseSlackTime": 0.01, 412 | "latencyTime": 0.5, 413 | "slowLimitPower": 3.0, 414 | "fastLimitPower": 6.0, 415 | "fastLimitCapacity": 10.0, 416 | "fastLimitRecoverScale": 0.3, 417 | "predictThd": 0.3, 418 | "margin": 0.25, 419 | "burst": 0.0, 420 | "guideCap": true, 421 | "limitEfficiency": false 422 | }, 423 | "sysfs": {}, 424 | "sched": { 425 | "scene": "idle" 426 | } 427 | }, 428 | "presets": { 429 | "balance": { 430 | "*": { 431 | "cpu.latencyTime": 0.2, 432 | "cpu.slowLimitPower": 2.0, 433 | "cpu.fastLimitPower": 2.0, 434 | "cpu.fastLimitCapacity": 20.0, 435 | "cpu.margin": 0.2 436 | }, 437 | "idle": { 438 | "cpu.baseSampleTime": 0.04, 439 | "cpu.baseSlackTime": 0.08, 440 | "cpu.predictThd": 0.3, 441 | "cpu.limitEfficiency": true, 442 | "sched.scene": "idle" 443 | }, 444 | "touch": { 445 | "cpu.baseSampleTime": 0.04, 446 | "sched.scene": "touch" 447 | }, 448 | "trigger": { 449 | "cpu.margin": 0.4, 450 | "sched.scene": "touch" 451 | }, 452 | "gesture": { 453 | "cpu.margin": 0.6, 454 | "sched.scene": "touch" 455 | }, 456 | "junk": { 457 | "cpu.burst": 0.6, 458 | "sched.scene": "touch" 459 | }, 460 | "switch": { 461 | "cpu.latencyTime": 0.0, 462 | "cpu.slowLimitPower": 3.0, 463 | "cpu.fastLimitPower": 6.0, 464 | "cpu.fastLimitRecoverScale": 0.1, 465 | "cpu.margin": 0.4, 466 | "sched.scene": "boost" 467 | } 468 | }, 469 | "powersave": { 470 | "*": { 471 | "cpu.latencyTime": 0.4, 472 | "cpu.slowLimitPower": 1.0, 473 | "cpu.fastLimitPower": 1.0, 474 | "cpu.fastLimitCapacity": 5.0, 475 | "cpu.margin": 0.1 476 | }, 477 | "idle": { 478 | "cpu.baseSampleTime": 0.04, 479 | "cpu.baseSlackTime": 0.08, 480 | "cpu.predictThd": 1.0, 481 | "cpu.limitEfficiency": true, 482 | "sched.scene": "idle" 483 | }, 484 | "touch": { 485 | "cpu.baseSampleTime": 0.04, 486 | "sched.scene": "touch" 487 | }, 488 | "trigger": { 489 | "cpu.margin": 0.4, 490 | "sched.scene": "touch" 491 | }, 492 | "gesture": { 493 | "cpu.margin": 0.6, 494 | "sched.scene": "touch" 495 | }, 496 | "junk": { 497 | "cpu.burst": 0.3, 498 | "sched.scene": "touch" 499 | }, 500 | "switch": { 501 | "cpu.latencyTime": 0.0, 502 | "cpu.slowLimitPower": 1.5, 503 | "cpu.fastLimitPower": 3.0, 504 | "cpu.fastLimitRecoverScale": 0.1, 505 | "cpu.margin": 0.3, 506 | "sched.scene": "boost" 507 | } 508 | }, 509 | "performance": { 510 | "*": { 511 | "cpu.latencyTime": 0.0, 512 | "cpu.slowLimitPower": 4.0, 513 | "cpu.fastLimitPower": 10.0, 514 | "cpu.fastLimitCapacity": 360.0, 515 | "cpu.margin": 0.4 516 | }, 517 | "idle": { 518 | "cpu.baseSampleTime": 0.01, 519 | "cpu.baseSlackTime": 0.04, 520 | "sched.scene": "idle" 521 | }, 522 | "touch": { 523 | "sched.scene": "touch" 524 | }, 525 | "trigger": { 526 | "cpu.margin": 0.8, 527 | "sched.scene": "touch" 528 | }, 529 | "gesture": { 530 | "cpu.margin": 0.8, 531 | "sched.scene": "touch" 532 | }, 533 | "junk": { 534 | "cpu.burst": 0.5, 535 | "sched.scene": "touch" 536 | }, 537 | "switch": { 538 | "cpu.burst": 0.2, 539 | "sched.scene": "boost" 540 | } 541 | }, 542 | "fast": { 543 | "*": { 544 | "cpu.latencyTime": 0.0, 545 | "cpu.slowLimitPower": 2.5, 546 | "cpu.fastLimitPower": 2.5, 547 | "cpu.fastLimitCapacity": 0.0, 548 | "cpu.margin": 0.4 549 | }, 550 | "idle": { 551 | "cpu.baseSampleTime": 0.01, 552 | "cpu.baseSlackTime": 0.04, 553 | "sched.scene": "idle" 554 | }, 555 | "touch": { 556 | "sched.scene": "touch" 557 | }, 558 | "trigger": { 559 | "cpu.margin": 0.8, 560 | "sched.scene": "touch" 561 | }, 562 | "gesture": { 563 | "cpu.margin": 0.8, 564 | "sched.scene": "touch" 565 | }, 566 | "junk": { 567 | "cpu.burst": 0.5, 568 | "sched.scene": "touch" 569 | }, 570 | "switch": { 571 | "cpu.burst": 0.2, 572 | "sched.scene": "boost" 573 | } 574 | } 575 | } 576 | } -------------------------------------------------------------------------------- /magisk/flag/fdeai: -------------------------------------------------------------------------------- 1 | 12 -------------------------------------------------------------------------------- /magisk/flags/fdeai: -------------------------------------------------------------------------------- 1 | 12 -------------------------------------------------------------------------------- /magisk/install.sh: -------------------------------------------------------------------------------- 1 | ########################################################################################## 2 | # Config Flags 3 | ########################################################################################## 4 | 5 | # Set to true if you do *NOT* want Magisk to mount 6 | # any files for you. Most modules would NOT want 7 | # to set this flag to true 8 | SKIPMOUNT=false 9 | 10 | # Set to true if you need to load system.prop 11 | PROPFILE=true 12 | 13 | # Set to true if you need post-fs-data script 14 | POSTFSDATA=true 15 | 16 | # Set to true if you need late_start service script 17 | LATESTARTSERVICE=true 18 | 19 | ########################################################################################## 20 | # Replace list 21 | ########################################################################################## 22 | 23 | # List all directories you want to directly replace in the system 24 | # Check the documentations for more info why you would need this 25 | 26 | # Construct your list in the following format 27 | # This is an example 28 | # REPLACE_EXAMPLE=" 29 | # /system/app/Youtube 30 | # /system/priv-app/SystemUI 31 | # /system/priv-app/Settings 32 | # /system/framework 33 | # " 34 | 35 | # Construct your own list here 36 | REPLACE="" 37 | 38 | ########################################################################################## 39 | # 40 | # Function Callbacks 41 | # 42 | # The following functions will be called by the installation framework. 43 | # You do not have the ability to modify update-binary, the only way you can customize 44 | # installation is through implementing these functions. 45 | # 46 | # When running your callbacks, the installation framework will make sure the Magisk 47 | # internal busybox path is *PREPENDED* to PATH, so all common commands shall exist. 48 | # Also, it will make sure /data, /system, and /vendor is properly mounted. 49 | # 50 | ########################################################################################## 51 | ########################################################################################## 52 | # 53 | # The installation framework will export some variables and functions. 54 | # You should use these variables and functions for installation. 55 | # 56 | # ! DO NOT use any Magisk internal paths as those are NOT public API. 57 | # ! DO NOT use other functions in util_functions.sh as they are NOT public API. 58 | # ! Non public APIs are not guranteed to maintain compatibility between releases. 59 | # 60 | # Available variables: 61 | # 62 | # MAGISK_VER (string): the version string of current installed Magisk 63 | # MAGISK_VER_CODE (int): the version code of current installed Magisk 64 | # BOOTMODE (bool): true if the module is currently installing in Magisk Manager 65 | # MODPATH (path): the path where your module files should be installed 66 | # TMPDIR (path): a place where you can temporarily store files 67 | # ZIPFILE (path): your module's installation zip 68 | # ARCH (string): the architecture of the device. Value is either arm, arm64, x86, or x64 69 | # IS64BIT (bool): true if $ARCH is either arm64 or x64 70 | # API (int): the API level (Android version) of the device 71 | # 72 | # Availible functions: 73 | # 74 | # ui_print 75 | # print to console 76 | # Avoid using 'echo' as it will not display in custom recovery's console 77 | # 78 | # abort 79 | # print error message to console and terminate installation 80 | # Avoid using 'exit' as it will skip the termination cleanup steps 81 | # 82 | # set_perm [context] 83 | # if [context] is empty, it will default to "u:object_r:system_file:s0" 84 | # this function is a shorthand for the following commands 85 | # chown owner.group target 86 | # chmod permission target 87 | # chcon context target 88 | # 89 | # set_perm_recursive [context] 90 | # if [context] is empty, it will default to "u:object_r:system_file:s0" 91 | # for all files in , it will call: 92 | # set_perm file owner group filepermission context 93 | # for all directories in (including itself), it will call: 94 | # set_perm dir owner group dirpermission context 95 | # 96 | ##########################################################################################x 97 | 98 | # Set what you want to display when installing your module 99 | print_modname() { 100 | return 101 | } 102 | 103 | # Copy/extract your module files into $MODPATH in on_install. 104 | on_install() { 105 | $BOOTMODE || abort "! Uperf cannot be installed in recovery." 106 | [ $ARCH == "arm64" ] || abort "! Uperf ONLY support arm64 platform." 107 | 108 | ui_print "- Extracting module files" 109 | unzip -o "$ZIPFILE" -x 'META-INF/*' -d $MODPATH >/dev/null 110 | 111 | # use universal setup.sh 112 | sh $MODPATH/script/setup.sh 113 | [ "$?" != "0" ] && abort 114 | } 115 | 116 | # Only some special files require specific permissions 117 | # This function will be called after on_install is done 118 | # The default permissions should be good enough for most cases 119 | set_permissions() { 120 | return 121 | } 122 | 123 | # You can add more functions to assist your custom script code 124 | -------------------------------------------------------------------------------- /magisk/module.prop: -------------------------------------------------------------------------------- 1 | id=uperf 2 | name=Uperf (FDE.AI edition) 3 | version=v3.01 (22.07.09) 4 | versionCode=320709 5 | author=Matt Yang 6 | description=Userspace performance controller for android. Modified by FeraVolt for FDE.AI v22.x+. 7 | -------------------------------------------------------------------------------- /magisk/script/initsvc.sh: -------------------------------------------------------------------------------- 1 | #!/vendor/bin/sh 2 | # 3 | # Copyright (C) 2021-2022 Matt Yang 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | BASEDIR="$(dirname $(readlink -f "$0"))" 19 | . $BASEDIR/pathinfo.sh 20 | . $BASEDIR/libcommon.sh 21 | . $BASEDIR/libuperf.sh 22 | 23 | wait_until_login 24 | 25 | sh $SCRIPT_PATH/powercfg_once.sh 26 | uperf_start 27 | -------------------------------------------------------------------------------- /magisk/script/libcgroup.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # Copyright (C) 2021-2022 Matt Yang 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # process scan cache 19 | ps_ret="" 20 | 21 | # launcher&home usually in foreground cpuset group 22 | # reserve one LITTLE for hwservicemanager which will block composer 23 | # thread priority settings not working on hwservicemanager 24 | # okay, disabling perf-hal resulting hwservicemanager frequently wakeup 25 | # CPUMASK_LOW="0e" 26 | # CPUMASK_MID="73" 27 | # CPUMASK_HIGH="f0" 28 | # CPUID_LOW="1-3" 29 | # CPUID_MID="0-1,4-7" # uperf set 0-1/0-6 for foreground, cpu7 reserved for launcher 30 | # CPUID_HIGH="4-7" 31 | 32 | # $1:task_name $2:cgroup_name $3:"cpuset"/"stune" 33 | change_task_cgroup() { 34 | local comm 35 | for temp_pid in $(echo "$ps_ret" | grep -i -E "$1" | awk '{print $1}'); do 36 | for temp_tid in $(ls "/proc/$temp_pid/task/"); do 37 | comm="$(cat /proc/$temp_pid/task/$temp_tid/comm)" 38 | echo "$temp_tid" >"/dev/$3/$2/tasks" 39 | done 40 | done 41 | } 42 | 43 | # $1:process_name $2:cgroup_name $3:"cpuset"/"stune" 44 | change_proc_cgroup() { 45 | local comm 46 | for temp_pid in $(echo "$ps_ret" | grep -i -E "$1" | awk '{print $1}'); do 47 | comm="$(cat /proc/$temp_pid/comm)" 48 | echo $temp_pid >"/dev/$3/$2/cgroup.procs" 49 | done 50 | } 51 | 52 | # $1:task_name $2:thread_name $3:cgroup_name $4:"cpuset"/"stune" 53 | change_thread_cgroup() { 54 | local comm 55 | for temp_pid in $(echo "$ps_ret" | grep -i -E "$1" | awk '{print $1}'); do 56 | for temp_tid in $(ls "/proc/$temp_pid/task/"); do 57 | comm="$(cat /proc/$temp_pid/task/$temp_tid/comm)" 58 | if [ "$(echo $comm | grep -i -E "$2")" != "" ]; then 59 | echo "$temp_tid" >"/dev/$4/$3/tasks" 60 | fi 61 | done 62 | done 63 | } 64 | 65 | # $1:task_name $2:cgroup_name $3:"cpuset"/"stune" 66 | change_main_thread_cgroup() { 67 | local comm 68 | for temp_pid in $(echo "$ps_ret" | grep -i -E "$1" | awk '{print $1}'); do 69 | comm="$(cat /proc/$temp_pid/comm)" 70 | echo $temp_pid >"/dev/$3/$2/tasks" 71 | done 72 | } 73 | 74 | # $1:task_name $2:hex_mask(0x00000003 is CPU0 and CPU1) 75 | change_task_affinity() { 76 | local comm 77 | for temp_pid in $(echo "$ps_ret" | grep -i -E "$1" | awk '{print $1}'); do 78 | for temp_tid in $(ls "/proc/$temp_pid/task/"); do 79 | comm="$(cat /proc/$temp_pid/task/$temp_tid/comm)" 80 | taskset -p "$2" "$temp_tid" >>$LOG_FILE 81 | done 82 | done 83 | } 84 | 85 | # $1:task_name $2:thread_name $3:hex_mask(0x00000003 is CPU0 and CPU1) 86 | change_thread_affinity() { 87 | local comm 88 | for temp_pid in $(echo "$ps_ret" | grep -i -E "$1" | awk '{print $1}'); do 89 | for temp_tid in $(ls "/proc/$temp_pid/task/"); do 90 | comm="$(cat /proc/$temp_pid/task/$temp_tid/comm)" 91 | if [ "$(echo $comm | grep -i -E "$2")" != "" ]; then 92 | taskset -p "$3" "$temp_tid" >>$LOG_FILE 93 | fi 94 | done 95 | done 96 | } 97 | 98 | # $1:task_name $2:nice(relative to 120) 99 | change_task_nice() { 100 | for temp_pid in $(echo "$ps_ret" | grep -i -E "$1" | awk '{print $1}'); do 101 | for temp_tid in $(ls "/proc/$temp_pid/task/"); do 102 | renice -n +40 -p "$temp_tid" 103 | renice -n -19 -p "$temp_tid" 104 | renice -n "$2" -p "$temp_tid" 105 | done 106 | done 107 | } 108 | 109 | # $1:task_name $2:thread_name $3:nice(relative to 120) 110 | change_thread_nice() { 111 | local comm 112 | for temp_pid in $(echo "$ps_ret" | grep -i -E "$1" | awk '{print $1}'); do 113 | for temp_tid in $(ls "/proc/$temp_pid/task/"); do 114 | comm="$(cat /proc/$temp_pid/task/$temp_tid/comm)" 115 | if [ "$(echo $comm | grep -i -E "$2")" != "" ]; then 116 | renice -n +40 -p "$temp_tid" 117 | renice -n -19 -p "$temp_tid" 118 | renice -n "$3" -p "$temp_tid" 119 | fi 120 | done 121 | done 122 | } 123 | 124 | # $1:task_name $2:priority(99-x, 1<=x<=99) 125 | change_task_rt() { 126 | for temp_pid in $(echo "$ps_ret" | grep -i -E "$1" | awk '{print $1}'); do 127 | for temp_tid in $(ls "/proc/$temp_pid/task/"); do 128 | comm="$(cat /proc/$temp_pid/task/$temp_tid/comm)" 129 | chrt -f -p "$2" "$temp_tid" >>$LOG_FILE 130 | done 131 | done 132 | } 133 | 134 | # $1:task_name $2:thread_name $3:priority(99-x, 1<=x<=99) 135 | change_thread_rt() { 136 | local comm 137 | for temp_pid in $(echo "$ps_ret" | grep -i -E "$1" | awk '{print $1}'); do 138 | for temp_tid in $(ls "/proc/$temp_pid/task/"); do 139 | comm="$(cat /proc/$temp_pid/task/$temp_tid/comm)" 140 | if [ "$(echo $comm | grep -i -E "$2")" != "" ]; then 141 | chrt -f -p "$3" "$temp_tid" >>$LOG_FILE 142 | fi 143 | done 144 | done 145 | } 146 | 147 | # $1:task_name 148 | change_task_high_prio() { 149 | # audio thread nice <= -16 150 | change_task_nice "$1" "-15" 151 | } 152 | 153 | # $1:task_name $2:thread_name 154 | change_thread_high_prio() { 155 | # audio thread nice <= -16 156 | change_thread_nice "$1" "$2" "-15" 157 | } 158 | 159 | # $1:task_name $2:thread_name 160 | unpin_thread() { 161 | change_thread_cgroup "$1" "$2" "" "cpuset" 162 | } 163 | 164 | # $1:task_name $2:thread_name 165 | pin_thread_on_pwr() { 166 | change_thread_cgroup "$1" "$2" "background" "cpuset" 167 | } 168 | 169 | # $1:task_name $2:thread_name 170 | pin_thread_on_mid() { 171 | unpin_thread "$1" "$2" 172 | change_thread_affinity "$1" "$2" "7f" 173 | } 174 | 175 | # $1:task_name $2:thread_name 176 | pin_thread_on_perf() { 177 | unpin_thread "$1" "$2" 178 | change_thread_affinity "$1" "$2" "f0" 179 | } 180 | 181 | # $1:task_name 182 | unpin_proc() { 183 | change_task_cgroup "$1" "" "cpuset" 184 | } 185 | 186 | # $1:task_name 187 | pin_proc_on_pwr() { 188 | change_task_cgroup "$1" "background" "cpuset" 189 | } 190 | 191 | # $1:task_name 192 | pin_proc_on_mid() { 193 | unpin_proc "$1" 194 | change_task_affinity "$1" "7f" 195 | } 196 | 197 | # $1:task_name 198 | pin_proc_on_perf() { 199 | unpin_proc "$1" 200 | change_task_affinity "$1" "f0" 201 | } 202 | 203 | rebuild_process_scan_cache() { 204 | # avoid matching grep itself 205 | # ps -Ao pid,args | grep kswapd 206 | # 150 [kswapd0] 207 | # 16490 grep kswapd 208 | ps_ret="$(ps -Ao pid,args)" 209 | } 210 | -------------------------------------------------------------------------------- /magisk/script/libcommon.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # Copyright (C) 2021-2022 Matt Yang 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | ############################### 19 | # Basic tool functions 20 | ############################### 21 | 22 | # $1:value $2:filepaths 23 | lock_val() { 24 | for p in $2; do 25 | if [ -f "$p" ]; then 26 | chown root:root "$p" 27 | chmod 0666 "$p" 28 | echo "$1" >"$p" 29 | fi 30 | done 31 | } 32 | 33 | # $1:value $2:filepaths 34 | mask_val() { 35 | touch /data/local/tmp/mount_mask 36 | for p in $2; do 37 | if [ -f "$p" ]; then 38 | umount "$p" 39 | chmod 0666 "$p" 40 | echo "$1" >"$p" 41 | mount --bind /data/local/tmp/mount_mask "$p" 42 | fi 43 | done 44 | } 45 | 46 | # $1:value $2:filepaths 47 | mutate() { 48 | for p in $2; do 49 | if [ -f "$p" ]; then 50 | chmod 0666 "$p" 51 | echo "$1" >"$p" 52 | fi 53 | done 54 | } 55 | 56 | # $1:file path 57 | lock() { 58 | if [ -f "$1" ]; then 59 | chown root:root "$p" 60 | fi 61 | } 62 | 63 | # $1:value $2:list 64 | has_val_in_list() { 65 | for item in $2; do 66 | if [ "$1" == "$item" ]; then 67 | echo "true" 68 | return 69 | fi 70 | done 71 | echo "false" 72 | } 73 | 74 | ############################### 75 | # Config File Operator 76 | ############################### 77 | 78 | # $1:key $return:value(string) 79 | read_cfg_value() { 80 | local value="" 81 | if [ -f "$PANEL_FILE" ]; then 82 | value="$(grep -i "^$1=" "$PANEL_FILE" | head -n 1 | tr -d ' ' | cut -d= -f2)" 83 | fi 84 | echo "$value" 85 | } 86 | 87 | # $1:content 88 | write_panel() { 89 | echo "$1" >>"$PANEL_FILE" 90 | } 91 | 92 | clear_panel() { 93 | true >"$PANEL_FILE" 94 | } 95 | 96 | wait_until_login() { 97 | # in case of /data encryption is disabled 98 | while [ "$(getprop sys.boot_completed)" != "1" ]; do 99 | sleep 2 100 | done 101 | 102 | # we doesn't have the permission to rw "/sdcard" before the user unlocks the screen 103 | local test_file="/sdcard/Android/.PERMISSION_TEST" 104 | true >"$test_file" 105 | while [ ! -f "$test_file" ]; do 106 | true >"$test_file" 107 | sleep 2 108 | done 109 | rm "$test_file" 110 | } 111 | 112 | ############################### 113 | # Log 114 | ############################### 115 | 116 | # $1:content 117 | log() { 118 | echo "$1" 119 | } 120 | 121 | clear_log() { 122 | echo true 123 | } 124 | -------------------------------------------------------------------------------- /magisk/script/libpowercfg.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # Copyright (C) 2021-2022 Matt Yang 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | ############################### 19 | # Powermodes helper functions 20 | ############################### 21 | 22 | # $1:keyword $2:nr_max_matched 23 | get_package_name_by_keyword() { 24 | echo "$(pm list package | grep "$1" | head -n "$2" | cut -d: -f2)" 25 | } 26 | 27 | # $1:"0:576000 4:710400 7:825600" 28 | set_cpufreq_min() { 29 | lock_val "$1" /sys/module/msm_performance/parameters/cpu_min_freq 30 | local key 31 | local val 32 | for kv in $1; do 33 | key=${kv%:*} 34 | val=${kv#*:} 35 | lock_val "$val" /sys/devices/system/cpu/cpu$key/cpufreq/scaling_min_freq 36 | done 37 | } 38 | 39 | # $1:"0:576000 4:710400 7:825600" 40 | set_cpufreq_max() { 41 | lock_val "$1" /sys/module/msm_performance/parameters/cpu_max_freq 42 | local key 43 | local val 44 | for kv in $1; do 45 | key=${kv%:*} 46 | val=${kv#*:} 47 | lock_val "$val" /sys/devices/system/cpu/cpu$key/cpufreq/scaling_max_freq 48 | done 49 | } 50 | 51 | # $1:"schedutil/pl" $2:"0:4 4:3 7:1" 52 | set_governor_param() { 53 | local key 54 | local val 55 | for kv in $2; do 56 | key=${kv%:*} 57 | val=${kv#*:} 58 | lock_val "$val" /sys/devices/system/cpu/cpu$key/cpufreq/$1 59 | # sdm625 hmp 60 | lock_val "$val" /sys/devices/system/cpu/cpufreq/$1 61 | done 62 | } 63 | 64 | # $1:"min_cpus" $2:"0:4 4:3 7:1" 65 | set_corectl_param() { 66 | local key 67 | local val 68 | for kv in $2; do 69 | key=${kv%:*} 70 | val=${kv#*:} 71 | lock_val "$val" /sys/devices/system/cpu/cpu$key/core_ctl/$1 72 | done 73 | } 74 | 75 | # stop before updating cfg 76 | perfhal_stop() { 77 | for i in 0 1 2 3 4; do 78 | for j in 0 1 2 3 4; do 79 | stop "perf-hal-$i-$j" 2>/dev/null 80 | done 81 | done 82 | usleep 500 83 | } 84 | 85 | # start after updating cfg 86 | perfhal_start() { 87 | for i in 0 1 2 3 4; do 88 | for j in 0 1 2 3 4; do 89 | start "perf-hal-$i-$j" 2>/dev/null 90 | done 91 | done 92 | } 93 | -------------------------------------------------------------------------------- /magisk/script/libsysinfo.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # Copyright (C) 2021-2022 Matt Yang 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | ############################### 19 | # Platform info functions 20 | ############################### 21 | 22 | # $1:"4.14" return:string_in_version 23 | match_linux_version() { 24 | echo "$(cat /proc/version | grep -i "$1")" 25 | } 26 | 27 | get_socid() { 28 | if [ -f /sys/devices/soc0/soc_id ]; then 29 | echo "$(cat /sys/devices/soc0/soc_id)" 30 | else 31 | echo "$(cat /sys/devices/system/soc/soc0/id)" 32 | fi 33 | } 34 | 35 | get_nr_core() { 36 | echo "$(cat /proc/stat | grep cpu[0-9] | wc -l)" 37 | } 38 | 39 | # $1:cpuid 40 | get_maxfreq() { 41 | echo "$(cat "/sys/devices/system/cpu/cpu$1/cpufreq/cpuinfo_max_freq")" 42 | } 43 | 44 | is_aarch64() { 45 | if [ "$(getprop ro.product.cpu.abi)" == "arm64-v8a" ]; then 46 | echo "true" 47 | else 48 | echo "false" 49 | fi 50 | } 51 | 52 | is_eas() { 53 | if [ "$(grep sched /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors)" != "" ]; then 54 | echo "true" 55 | else 56 | echo "false" 57 | fi 58 | } 59 | 60 | is_mtk() { 61 | if [ "$(getprop | grep ro.mtk)" != "" ]; then 62 | echo "true" 63 | else 64 | echo "false" 65 | fi 66 | } 67 | 68 | _get_sm6150_type() { 69 | case "$(get_socid)" in 70 | 365 | 366) echo "sdm730" ;; 71 | 355 | 369) echo "sdm675" ;; 72 | esac 73 | } 74 | 75 | _get_sdm76x_type() { 76 | if [ "$(get_maxfreq 7)" -gt 2300000 ]; then 77 | echo "sdm765" 78 | else 79 | echo "sdm750" 80 | fi 81 | } 82 | 83 | _get_msm8916_type() { 84 | case "$(get_socid)" in 85 | "206" | "247" | "248" | "249" | "250") echo "msm8916" ;; 86 | "233" | "240" | "242") echo "sdm610" ;; 87 | "239" | "241" | "263" | "268" | "269" | "270" | "271") echo "sdm616" ;; 88 | *) echo "msm8916" ;; 89 | esac 90 | } 91 | 92 | _get_lahaina_type() { 93 | if [ "$(get_maxfreq 7)" -gt 2600000 ]; then 94 | echo "sdm888" 95 | else 96 | if [ "$(get_maxfreq 4)" -gt 2300000 ]; then 97 | echo "sdm778" 98 | else 99 | echo "sdm780" 100 | fi 101 | fi 102 | } 103 | 104 | _get_taro_type() { 105 | if [ "$(get_maxfreq 4)" -gt 2700000 ]; then 106 | echo "sdm8g1+" 107 | else 108 | echo "sdm8g1" 109 | fi 110 | } 111 | 112 | # $1:board_name 113 | get_config_name() { 114 | case "$1" in 115 | "taro") echo "$(_get_taro_type)" ;; 116 | "lahaina") echo "$(_get_lahaina_type)" ;; 117 | "shima") echo "$(_get_lahaina_type)" ;; 118 | "yupik") echo "$(_get_lahaina_type)" ;; 119 | "kona") echo "sdm865" ;; # 865, 870 120 | "msmnile") echo "sdm855" ;; # 855, 860 121 | "sdm845") echo "sdm845" ;; 122 | "lito") echo "$(_get_sdm76x_type)" ;; 123 | "sm6150") echo "$(_get_sm6150_type)" ;; 124 | "sdm710") echo "sdm710" ;; 125 | "msm8916") echo "$(_get_msm8916_type)" ;; 126 | "msm8939") echo "sdm616" ;; 127 | "msm8953") echo "sdm625" ;; # 625 128 | "msm8953pro") echo "sdm625" ;; # 626 129 | "sdm660") echo "sdm660" ;; 130 | "sdm636") echo "sdm660" ;; 131 | "trinket") echo "sdm665" ;; # sdm665 132 | "bengal") echo "sdm665" ;; # sdm662 133 | "msm8976") echo "sdm652" ;; 134 | "msm8956") echo "sdm650" ;; 135 | "msm8998") echo "sdm835" ;; 136 | "msm8996") echo "sdm820" ;; 137 | "msm8996pro") echo "sdm820" ;; 138 | "s5e9925") echo "e2200" ;; 139 | "exynos2100") echo "e2100" ;; 140 | "exynos1080") echo "e1080" ;; 141 | "exynos990") echo "e990" ;; 142 | "universal9925") echo "e2200" ;; 143 | "universal2100") echo "e2100" ;; 144 | "universal1080") echo "e1080" ;; 145 | "universal990") echo "e990" ;; 146 | "universal9825") echo "e9820" ;; 147 | "universal9820") echo "e9820" ;; 148 | "universal9810") echo "e9810" ;; 149 | "universal8895") echo "e8895" ;; 150 | "universal8890") echo "e8890" ;; 151 | "universal7420") echo "e7420" ;; 152 | "mt6768") echo "mtg80" ;; # Helio P65(mt6768)/G70(mt6769v)/G80(mt6769t)/G85(mt6769z) 153 | "mt6785") echo "mtg90t" ;; 154 | "mt6833") echo "mtd720" ;; 155 | "mt6833p") echo "mtd720" ;; # Dimensity 810 156 | "mt6833v") echo "mtd720" ;; # Dimensity 810 157 | "mt6853") echo "mtd720" ;; 158 | "mt6873") echo "mtd820" ;; 159 | "mt6875") echo "mtd820" ;; 160 | "mt6877") echo "mtd920" ;; 161 | "mt6885") echo "mtd1000" ;; 162 | "mt6889") echo "mtd1000" ;; 163 | "mt6891") echo "mtd1100" ;; 164 | "mt6893") echo "mtd1200" ;; 165 | "mt6895") echo "mtd8100" ;; 166 | "mt6983") echo "mtd9000" ;; 167 | "gs101") echo "gs101" ;; 168 | *) echo "unsupported" ;; 169 | esac 170 | } 171 | -------------------------------------------------------------------------------- /magisk/script/libuperf.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # Copyright (C) 2021-2022 Matt Yang 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | BASEDIR="$(dirname "$0")" 19 | . $BASEDIR/pathinfo.sh 20 | . $BASEDIR/libcommon.sh 21 | . $BASEDIR/libcgroup.sh 22 | 23 | uperf_stop() { 24 | killall uperf 25 | } 26 | 27 | uperf_start() { 28 | # raise inotify limit in case file sync existed 29 | lock_val "1048576" /proc/sys/fs/inotify/max_queued_events 30 | lock_val "1048576" /proc/sys/fs/inotify/max_user_watches 31 | lock_val "1024" /proc/sys/fs/inotify/max_user_instances 32 | 33 | rm -f $USER_PATH/uperf_log.txt 34 | if [ -f $BIN_PATH/libc++_shared.so ]; then 35 | ASAN_LIB="$(ls $BIN_PATH/libclang_rt.asan-*-android.so)" 36 | export LD_PRELOAD="$ASAN_LIB $BIN_PATH/libc++_shared.so" 37 | fi 38 | $BIN_PATH/uperf $USER_PATH/uperf.json -o $USER_PATH/uperf_log.txt 39 | 40 | # waiting for uperf initialization 41 | sleep 2 42 | # uperf shouldn't preempt foreground tasks 43 | echo "schedutil" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 44 | echo "schedutil" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor 45 | rebuild_process_scan_cache 46 | change_task_cgroup "uperf" "background" "cpuset" 47 | } 48 | -------------------------------------------------------------------------------- /magisk/script/pathinfo.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # Copyright (C) 2021-2022 Matt Yang 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | MODULE_PATH="$(dirname $(readlink -f "$0"))" 19 | MODULE_PATH="${MODULE_PATH%\/script}" 20 | SCRIPT_PATH="$MODULE_PATH/script" 21 | BIN_PATH="$MODULE_PATH/bin" 22 | FLAG_PATH="$MODULE_PATH/flag" 23 | USER_PATH="/sdcard/Android/yc/uperf" 24 | 25 | PATH="/sbin:/system/sbin:/system/xbin:/system/bin:/vendor/xbin:/vendor/bin" 26 | -------------------------------------------------------------------------------- /magisk/script/powercfg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Uperf", 3 | "author": "Matt Yang", 4 | "version": "22.07.09", 5 | "versionCode": 3, 6 | "features": { 7 | "strict": true, 8 | "pedestal": true 9 | }, 10 | "module": "uperf,sfanalysis", 11 | "state": "/sdcard/Android/yc/uperf/cur_powermode.txt", 12 | "entry": "/data/powercfg.sh", 13 | "projectUrl": "https://github.com/yc9559/uperf" 14 | } -------------------------------------------------------------------------------- /magisk/script/powercfg_main.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # Copyright (C) 2021-2022 Matt Yang 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | BASEDIR="$(dirname $(readlink -f "$0"))" 19 | . $BASEDIR/pathinfo.sh 20 | 21 | action="$1" 22 | case "$1" in 23 | "powersave" | "balance" | "performance" | "fast" | "auto") echo "$1" >"$USER_PATH/cur_powermode.txt" ;; 24 | "pedestal") echo "performance" >"$USER_PATH/cur_powermode.txt" ;; 25 | "init") echo "balance" >"$USER_PATH/cur_powermode.txt" ;; 26 | *) echo "Failed to apply unknown action '$1'." ;; 27 | esac 28 | -------------------------------------------------------------------------------- /magisk/script/powercfg_once.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # Copyright (C) 2021-2022 Matt Yang 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # Runonce after boot, to speed up the transition of power modes in powercfg 19 | 20 | BASEDIR="$(dirname $(readlink -f "$0"))" 21 | . $BASEDIR/pathinfo.sh 22 | . $BASEDIR/libcommon.sh 23 | . $BASEDIR/libpowercfg.sh 24 | . $BASEDIR/libcgroup.sh 25 | 26 | unify_cgroup() { 27 | # clear top-app 28 | for p in $(cat /dev/cpuset/top-app/tasks); do 29 | echo $p >/dev/cpuset/foreground/tasks 30 | done 31 | 32 | # work with uperf/ContextScheduler 33 | change_task_cgroup "surfaceflinger|system_server" "foreground" "cpuset" 34 | change_task_cgroup "netd|allocator" "foreground" "cpuset" 35 | change_task_cgroup "hardware.media.c2|vendor.mediatek.hardware" "background" "cpuset" 36 | change_task_cgroup "aal_sof|kfps|dsp_send_thread|vdec_ipi_recv|mtk_drm_disp_id|disp_feature|hif_thread|main_thread|rx_thread|ged_" "background" "cpuset" 37 | change_task_cgroup "pp_event|crtc_" "background" "cpuset" 38 | } 39 | 40 | unify_sched() { 41 | # clear stune & uclamp 42 | for d in /dev/stune/*/; do 43 | lock_val "0" $d/schedtune.boost 44 | lock_val "0" $d/schedtune.prefer_idle 45 | done 46 | for d in /dev/cpuctl/*/; do 47 | lock_val "0" $d/cpu.uclamp.min 48 | lock_val "0" $d/cpu.uclamp.latency_sensitive 49 | done 50 | 51 | for d in kernel walt; do 52 | mask_val "0" /proc/sys/$d/sched_force_lb_enable 53 | done 54 | } 55 | 56 | unify_devfreq() { 57 | for df in /sys/class/devfreq; do 58 | for d in $df/*cpubw $df/*llccbw $df/*cpu-cpu-llcc-bw $df/*cpu-llcc-ddr-bw; do 59 | lock_val "9999000000" "$d/max_freq" 60 | done 61 | done 62 | for d in DDR LLCC L3; do 63 | lock_val "9999000000" "/sys/devices/system/cpu/bus_dcvs/$d/*/max_freq" 64 | done 65 | } 66 | 67 | unify_lpm() { 68 | # Qualcomm enter C-state level 3 took ~500us 69 | lock_val "0" /sys/module/lpm_levels/parameters/lpm_ipi_prediction 70 | lock_val "0" /sys/module/lpm_levels/parameters/lpm_prediction 71 | lock_val "2" /sys/module/lpm_levels/parameters/bias_hyst 72 | for d in kernel walt; do 73 | mask_val "255" /proc/sys/$d/sched_busy_hysteresis_enable_cpus 74 | mask_val "2000000" /proc/sys/$d/sched_busy_hyst_ns 75 | done 76 | } 77 | 78 | disable_hotplug() { 79 | # Exynos hotplug 80 | mutate "0" /sys/power/cpuhotplug/enabled 81 | mutate "0" /sys/devices/system/cpu/cpuhotplug/enabled 82 | 83 | # turn off msm_thermal 84 | lock_val "0" /sys/module/msm_thermal/core_control/enabled 85 | lock_val "N" /sys/module/msm_thermal/parameters/enabled 86 | 87 | # 3rd 88 | lock_val "0" /sys/kernel/intelli_plug/intelli_plug_active 89 | lock_val "0" /sys/module/blu_plug/parameters/enabled 90 | lock_val "0" /sys/devices/virtual/misc/mako_hotplug_control/enabled 91 | lock_val "0" /sys/module/autosmp/parameters/enabled 92 | lock_val "0" /sys/kernel/zen_decision/enabled 93 | 94 | # stop sched core_ctl 95 | set_corectl_param "enable" "0:0 2:0 4:0 6:0 7:0" 96 | 97 | # bring all cores online 98 | for i in 0 1 2 3 4 5 6 7 8 9; do 99 | lock_val "1" /sys/devices/system/cpu/cpu$i/online 100 | done 101 | } 102 | 103 | disable_kernel_boost() { 104 | # Qualcomm 105 | lock_val "0" "/sys/devices/system/cpu/cpu_boost/*" 106 | lock_val "0" "/sys/devices/system/cpu/cpu_boost/parameters/*" 107 | lock_val "0" "/sys/module/cpu_boost/parameters/*" 108 | lock_val "0" "/sys/module/msm_performance/parameters/*" 109 | lock_val "0" "/sys/kernel/msm_performance/parameters/*" 110 | lock_val "0" "/proc/sys/walt/input_boost/*" 111 | 112 | # no msm_performance limit 113 | set_cpufreq_min "0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0" 114 | set_cpufreq_max "0:9999000 1:9999000 2:9999000 3:9999000 4:9999000 5:9999000 6:9999000 7:9999000" 115 | 116 | # MediaTek 117 | # policy_status 118 | # [0] PPM_POLICY_PTPOD: Meature PMIC buck currents 119 | # [1] PPM_POLICY_UT: Unit test 120 | # [2] PPM_POLICY_FORCE_LIMIT: enabled 121 | # [3] PPM_POLICY_PWR_THRO: enabled 122 | # [4] PPM_POLICY_THERMAL: enabled 123 | # [5] PPM_POLICY_DLPT: Power measurment and power budget managing 124 | # [6] PPM_POLICY_HARD_USER_LIMIT: enabled 125 | # [7] PPM_POLICY_USER_LIMIT: enabled 126 | # [8] PPM_POLICY_LCM_OFF: disabled 127 | # [9] PPM_POLICY_SYS_BOOST: disabled 128 | # [10] PPM_POLICY_HICA: ? 129 | # Usage: echo <1(enable)/0(disable)> > /proc/ppm/policy_status 130 | # use cpufreq interface with PPM_POLICY_HARD_USER_LIMIT enabled, thanks to helloklf@github 131 | lock_val "1" /proc/ppm/enabled 132 | for i in 0 1 2 3 4 5 6 7 8 9 10; do 133 | lock_val "$i 0" /proc/ppm/policy_status 134 | done 135 | lock_val "6 1" /proc/ppm/policy_status 136 | lock_val "enable 0" /proc/perfmgr/tchbst/user/usrtch 137 | lock "/proc/ppm/policy/*" 138 | lock "/proc/ppm/*" 139 | 140 | # Samsung 141 | mutate "0" "/sys/class/input_booster/*" 142 | 143 | # Oneplus 144 | lock_val "N" "/sys/module/control_center/parameters/*" 145 | lock_val "0" /sys/module/aigov/parameters/enable 146 | lock_val "0" "/sys/module/houston/parameters/*" 147 | # OnePlus opchain always pins UX threads on the big cluster 148 | lock_val "0" /sys/module/opchain/parameters/chain_on 149 | 150 | # 3rd 151 | lock_val "0" "/sys/kernel/cpu_input_boost/*" 152 | lock_val "0" "/sys/module/cpu_input_boost/parameters/*" 153 | lock_val "0" "/sys/module/dsboost/parameters/*" 154 | lock_val "0" "/sys/module/devfreq_boost/parameters/*" 155 | } 156 | 157 | disable_userspace_boost() { 158 | # xiaomi vip-task scheduler override 159 | chmod 0000 /dev/migt 160 | for f in /sys/module/migt/parameters/*; do 161 | chmod 0000 $f 162 | done 163 | 164 | # xiaomi perfservice 165 | stop vendor.perfservice 166 | stop miuibooster 167 | # stop vendor.miperf 168 | 169 | # brain service maybe not smart 170 | stop oneplus_brain_service 2>/dev/null 171 | 172 | # Qualcomm perfd 173 | stop perfd 2>/dev/null 174 | 175 | # work with uperf/ContextScheduler 176 | lock_val "0" "/sys/module/mtk_fpsgo/parameters/boost_affinity*" 177 | lock_val "0" "/sys/module/fbt_cpu/parameters/boost_affinity*" 178 | lock_val "9999000" "/sys/kernel/fpsgo/fbt/limit_*" 179 | lock_val "0" /sys/kernel/fpsgo/fbt/switch_idleprefer 180 | lock_val "1" /proc/perfmgr/syslimiter/syslimiter_force_disable 181 | lock_val "1" /sys/module/mtk_core_ctl/parameters/policy_enable 182 | lock_val "90" /sys/kernel/fpsgo/fbt/thrm_temp_th 183 | lock_val "-1" /sys/kernel/fpsgo/fbt/thrm_limit_cpu 184 | lock_val "-1" /sys/kernel/fpsgo/fbt/thrm_sub_cpu 185 | 186 | # Qualcomm&MTK perfhal 187 | perfhal_stop 188 | 189 | # libperfmgr 190 | stop vendor.power-hal-1-0 191 | stop vendor.power-hal-1-1 192 | stop vendor.power-hal-1-2 193 | stop vendor.power-hal-1-3 194 | stop vendor.power-hal-aidl 195 | } 196 | 197 | restart_userspace_boost() { 198 | # Qualcomm&MTK perfhal 199 | perfhal_start 200 | 201 | # libperfmgr 202 | start vendor.power-hal-1-0 203 | start vendor.power-hal-1-1 204 | start vendor.power-hal-1-2 205 | start vendor.power-hal-1-3 206 | start vendor.power-hal-aidl 207 | } 208 | 209 | disable_userspace_thermal() { 210 | # yes, let it respawn 211 | killall mi_thermald 212 | # prohibit mi_thermald use cpu thermal interface 213 | for i in 0 2 4 6 7; do 214 | local maxfreq="$(cat /sys/devices/system/cpu/cpu$i/cpufreq/cpuinfo_max_freq)" 215 | [ "$maxfreq" -gt "0" ] && lock_val "cpu$i $maxfreq" /sys/devices/virtual/thermal/thermal_message/cpu_limits 216 | done 217 | } 218 | 219 | restart_userspace_thermal() { 220 | # yes, let it respawn 221 | killall mi_thermald 222 | } 223 | 224 | clear_log 225 | exec 1>$LOG_FILE 226 | # exec 2>&1 227 | echo "PATH=$PATH" 228 | echo "sh=$(which sh)" 229 | 230 | # set permission 231 | disable_kernel_boost 232 | disable_hotplug 233 | unify_sched 234 | unify_devfreq 235 | unify_lpm 236 | 237 | disable_userspace_thermal 238 | restart_userspace_thermal 239 | disable_userspace_boost 240 | restart_userspace_boost 241 | 242 | # unify value 243 | disable_kernel_boost 244 | disable_hotplug 245 | unify_sched 246 | unify_devfreq 247 | unify_lpm 248 | 249 | # make sure that all the related cpu is online 250 | rebuild_process_scan_cache 251 | unify_cgroup 252 | -------------------------------------------------------------------------------- /magisk/script/setup.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # Copyright (C) 2021-2022 Matt Yang 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | BASEDIR="$(dirname $(readlink -f "$0"))" 19 | . $BASEDIR/pathinfo.sh 20 | . $BASEDIR/libsysinfo.sh 21 | 22 | # $1:error_message 23 | abort() { 24 | echo "$1" 25 | echo "! Uperf installation failed." 26 | exit 1 27 | } 28 | 29 | # $1:file_node $2:owner $3:group $4:permission $5:secontext 30 | set_perm() { 31 | chown $2:$3 $1 32 | chmod $4 $1 33 | chcon $5 $1 34 | } 35 | 36 | # $1:directory $2:owner $3:group $4:dir_permission $5:file_permission $6:secontext 37 | set_perm_recursive() { 38 | find $1 -type d 2>/dev/null | while read dir; do 39 | set_perm $dir $2 $3 $4 $6 40 | done 41 | find $1 -type f -o -type l 2>/dev/null | while read file; do 42 | set_perm $file $2 $3 $5 $6 43 | done 44 | } 45 | 46 | install_uperf() { 47 | echo "- Finding platform specified config" 48 | echo "- ro.board.platform=$(getprop ro.board.platform)" 49 | echo "- ro.product.board=$(getprop ro.product.board)" 50 | 51 | local target 52 | local cfgname 53 | target="$(getprop ro.board.platform)" 54 | cfgname="$(get_config_name $target)" 55 | if [ "$cfgname" == "unsupported" ]; then 56 | target="$(getprop ro.product.board)" 57 | cfgname="$(get_config_name $target)" 58 | fi 59 | 60 | if [ "$cfgname" == "unsupported" ] || [ ! -f $MODULE_PATH/config/$cfgname.json ]; then 61 | abort "! Target [$target] not supported." 62 | fi 63 | 64 | echo "- Uperf config is located at $USER_PATH" 65 | mkdir -p $USER_PATH 66 | mv -f $USER_PATH/uperf.json $USER_PATH/uperf.json.bak 67 | cp -f $MODULE_PATH/config/$cfgname.json $USER_PATH/uperf.json 68 | [ ! -e "$USER_PATH/perapp_powermode.txt" ] && cp $MODULE_PATH/config/perapp_powermode.txt $USER_PATH/perapp_powermode.txt 69 | rm -rf $MODULE_PATH/config 70 | 71 | set_perm_recursive $BIN_PATH 0 0 0755 0755 u:object_r:system_file:s0 72 | } 73 | 74 | echo "" 75 | echo "* Uperf https://github.com/yc9559/uperf/" 76 | echo "* Author: Matt Yang" 77 | echo "* Version: v3.01(22.07.09)" 78 | echo "" 79 | 80 | echo "- Installing uperf (FDE.AI edition)" 81 | install_uperf 82 | -------------------------------------------------------------------------------- /magisk/uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # Copyright (C) 2021-2022 Matt Yang 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # MR author: railjty 19 | USER_PATH=/sdcard/Android/yc/uperf 20 | 21 | wait_until_login() { 22 | # in case of /data encryption is disabled 23 | while [ "$(getprop sys.boot_completed)" != "1" ]; do 24 | sleep 1 25 | done 26 | 27 | # we doesn't have the permission to rw "/sdcard" before the user unlocks the screen 28 | local test_file="/sdcard/Android/.PERMISSION_TEST" 29 | true >"$test_file" 30 | while [ ! -f "$test_file" ]; do 31 | true >"$test_file" 32 | sleep 1 33 | done 34 | rm "$test_file" 35 | } 36 | 37 | on_remove() { 38 | wait_until_login 39 | rm -Rf $USER_PATH 40 | rm -f /data/powercfg* 41 | } 42 | 43 | (on_remove &) 44 | -------------------------------------------------------------------------------- /media/adjusted_demand_capacity_relation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feravolt/uperf/314909b3b6a996afd14632a8e5afeedb2d7fbc7b/media/adjusted_demand_capacity_relation.png -------------------------------------------------------------------------------- /media/alipay-qr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feravolt/uperf/314909b3b6a996afd14632a8e5afeedb2d7fbc7b/media/alipay-qr.png -------------------------------------------------------------------------------- /media/android_am.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feravolt/uperf/314909b3b6a996afd14632a8e5afeedb2d7fbc7b/media/android_am.png -------------------------------------------------------------------------------- /media/fingerprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feravolt/uperf/314909b3b6a996afd14632a8e5afeedb2d7fbc7b/media/fingerprint.png -------------------------------------------------------------------------------- /media/render_restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feravolt/uperf/314909b3b6a996afd14632a8e5afeedb2d7fbc7b/media/render_restart.png -------------------------------------------------------------------------------- /media/render_stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feravolt/uperf/314909b3b6a996afd14632a8e5afeedb2d7fbc7b/media/render_stop.png -------------------------------------------------------------------------------- /media/sflag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feravolt/uperf/314909b3b6a996afd14632a8e5afeedb2d7fbc7b/media/sflag.png -------------------------------------------------------------------------------- /media/wechat_resume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feravolt/uperf/314909b3b6a996afd14632a8e5afeedb2d7fbc7b/media/wechat_resume.png -------------------------------------------------------------------------------- /version.json: -------------------------------------------------------------------------------- 1 | { 2 | "versionCode": 220709, 3 | "version": "v3", 4 | "zipUrl": "https://github.com/yc9559/uperf/releases/download/dev-22.07.09/uperf-dev-22.07.09.zip", 5 | "changelog": "https://github.com/yc9559/uperf/raw/master/changelog.md" 6 | } 7 | --------------------------------------------------------------------------------