├── .gitattributes ├── .github └── FUNDING.yml ├── LICENSE ├── META-INF └── com │ └── google │ └── android │ ├── update-binary │ └── updater-script ├── README.md ├── app └── LSpeed-v1.7.apk ├── changelog.txt ├── customize.sh ├── module.prop ├── screenshots ├── 1.png ├── 2.png ├── 3.png └── 4.png ├── service.sh └── system └── etc └── lspeed ├── binary ├── governor_tuner └── main_function └── governor_tuner_presets ├── balanced ├── interactive ├── ondemand ├── optdemand ├── schedutil └── schedutilX ├── battery ├── interactive ├── ondemand ├── optdemand ├── schedutil └── schedutilX └── performance ├── interactive ├── ondemand ├── optdemand ├── schedutil └── schedutilX /.gitattributes: -------------------------------------------------------------------------------- 1 | # Declare files that will always have LF line endings on checkout. 2 | META-INF/** text eol=lf 3 | *.prop text eol=lf 4 | *.sh text eol=lf 5 | *.md text eol=lf 6 | 7 | # Denote all files that are truly binary and should not be modified. 8 | system/** binary 9 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: https://paypal.me/Paget96 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | 3 | ################# 4 | # Initialization 5 | ################# 6 | 7 | umask 022 8 | 9 | # Global vars 10 | TMPDIR=/dev/tmp 11 | PERSISTDIR=/sbin/.magisk/mirror/persist 12 | 13 | rm -rf $TMPDIR 2>/dev/null 14 | mkdir -p $TMPDIR 15 | 16 | # echo before loading util_functions 17 | ui_print() { echo "$1"; } 18 | 19 | require_new_magisk() { 20 | ui_print "*******************************" 21 | ui_print " Please install Magisk v19.0+! " 22 | ui_print "*******************************" 23 | exit 1 24 | } 25 | 26 | is_legacy_script() { 27 | unzip -l "$ZIPFILE" install.sh | grep -q install.sh 28 | return $? 29 | } 30 | 31 | print_modname() { 32 | local len 33 | len=`echo -n $MODNAME | wc -c` 34 | len=$((len + 2)) 35 | local pounds=`printf "%${len}s" | tr ' ' '*'` 36 | ui_print "$pounds" 37 | ui_print " $MODNAME " 38 | ui_print "$pounds" 39 | ui_print "*******************" 40 | ui_print " Powered by Magisk " 41 | ui_print "*******************" 42 | } 43 | 44 | ############## 45 | # Environment 46 | ############## 47 | 48 | OUTFD=$2 49 | ZIPFILE=$3 50 | 51 | mount /data 2>/dev/null 52 | 53 | # Load utility functions 54 | [ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk 55 | . /data/adb/magisk/util_functions.sh 56 | [ $MAGISK_VER_CODE -gt 18100 ] || require_new_magisk 57 | 58 | # Preperation for flashable zips 59 | setup_flashable 60 | 61 | # Mount partitions 62 | mount_partitions 63 | 64 | # Detect version and architecture 65 | api_level_arch_detect 66 | 67 | # Setup busybox and binaries 68 | $BOOTMODE && boot_actions || recovery_actions 69 | 70 | ############## 71 | # Preparation 72 | ############## 73 | 74 | # Extract prop file 75 | unzip -o "$ZIPFILE" module.prop -d $TMPDIR >&2 76 | [ ! -f $TMPDIR/module.prop ] && abort "! Unable to extract zip file!" 77 | 78 | $BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules 79 | MODULEROOT=$NVBASE/$MODDIRNAME 80 | MODID=`grep_prop id $TMPDIR/module.prop` 81 | MODPATH=$MODULEROOT/$MODID 82 | MODNAME=`grep_prop name $TMPDIR/module.prop` 83 | 84 | # Create mod paths 85 | rm -rf $MODPATH 2>/dev/null 86 | mkdir -p $MODPATH 87 | 88 | ########## 89 | # Install 90 | ########## 91 | 92 | if is_legacy_script; then 93 | unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR >&2 94 | 95 | # Load install script 96 | . $TMPDIR/install.sh 97 | 98 | # Callbacks 99 | print_modname 100 | on_install 101 | 102 | # Custom uninstaller 103 | [ -f $TMPDIR/uninstall.sh ] && cp -af $TMPDIR/uninstall.sh $MODPATH/uninstall.sh 104 | 105 | # Skip mount 106 | $SKIPMOUNT && touch $MODPATH/skip_mount 107 | 108 | # prop file 109 | $PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop 110 | 111 | # Module info 112 | cp -af $TMPDIR/module.prop $MODPATH/module.prop 113 | 114 | # post-fs-data scripts 115 | $POSTFSDATA && cp -af $TMPDIR/post-fs-data.sh $MODPATH/post-fs-data.sh 116 | 117 | # service scripts 118 | $LATESTARTSERVICE && cp -af $TMPDIR/service.sh $MODPATH/service.sh 119 | 120 | ui_print "- Setting permissions" 121 | set_permissions 122 | else 123 | print_modname 124 | 125 | unzip -o "$ZIPFILE" customize.sh -d $MODPATH >&2 126 | 127 | if ! grep -q '^SKIPUNZIP=1$' $MODPATH/customize.sh 2>/dev/null; then 128 | ui_print "- Extracting module files" 129 | unzip -o "$ZIPFILE" -x 'META-INF/*' -d $MODPATH >&2 130 | 131 | # Default permissions 132 | set_perm_recursive $MODPATH 0 0 0755 0644 133 | fi 134 | 135 | # Load customization script 136 | [ -f $MODPATH/customize.sh ] && . $MODPATH/customize.sh 137 | fi 138 | 139 | # Handle replace folders 140 | for TARGET in $REPLACE; do 141 | ui_print "- Replace target: $TARGET" 142 | mktouch $MODPATH$TARGET/.replace 143 | done 144 | 145 | if $BOOTMODE; then 146 | # Update info for Magisk Manager 147 | mktouch $NVBASE/modules/$MODID/update 148 | cp -af $MODPATH/module.prop $NVBASE/modules/$MODID/module.prop 149 | fi 150 | 151 | # Copy over custom sepolicy rules 152 | if [ -f $MODPATH/sepolicy.rule -a -e $PERSISTDIR ]; then 153 | ui_print "- Installing custom sepolicy patch" 154 | PERSISTMOD=$PERSISTDIR/magisk/$MODID 155 | mkdir -p $PERSISTMOD 156 | cp -af $MODPATH/sepolicy.rule $PERSISTMOD/sepolicy.rule 157 | fi 158 | 159 | # Remove stuffs that don't belong to modules 160 | rm -rf \ 161 | $MODPATH/system/placeholder $MODPATH/customize.sh \ 162 | $MODPATH/README.md $MODPATH/.git* 2>/dev/null 163 | 164 | ############## 165 | # Finalizing 166 | ############## 167 | 168 | cd / 169 | $BOOTMODE || recovery_cleanup 170 | rm -rf $TMPDIR 171 | 172 | ui_print "- Done" 173 | exit 0 -------------------------------------------------------------------------------- /META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 

L Speed magisk

2 | 3 |

4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

13 | 14 |

The most advanced Android tweaker.

15 | 16 |
17 |

18 | 19 | Changelog 20 | 21 | | 22 | 23 | XDA 24 | 25 |

26 |
27 | 28 | ## Introduction 29 | L Speed is a modification that combines tweaks inside an intuitive module who aims to improve kernel with optimal parameter changes for the widest range of devices. 30 | It's goal is to improve overall performance, reduce significant lags, extend battery life and improve your experience on Android. Fully customizable module with prebuit manager. 31 | It's very simple to use, everything is well explained in the manager it self, every option have a info button beside it. 32 | The mod will and should work on any device that meets its minimum requirement. 33 | You need a rooted Android device with Magisk 19.x+ version for other root solutions such as (SuperSU, Kingo Root, One click root), just get the apk file... 34 | 35 |
36 | **Module with prebuilt manager** 37 | 38 | 39 |
40 | 41 | ## Downloads 42 | * For stable and beta versions, download link is below 43 | - https://github.com/Magisk-Modules-Repo/lspeed 44 | 45 | * For canary builds, download link is below 46 | - https://github.com/Magisk-Modules-Repo/lspeed/archive/master.zip 47 | - Canary builds are bleeding edge builds and can contain bugs. Be aware of it, you flash this on your own. Those builds contains the changes till the latest commit on GitHub. 48 | 49 | After downloading canary build you just have to repack zip, extract, go into master folder and zip all the files inside. 50 | Uninstalling current version is necessary. 51 | After everything is done, flash the zip. 52 | 53 | Please provide L Speed logs located in: 54 | /data/lspeed/logs 55 | 56 | And magisk logs, located in: 57 | /data/cache/magisk.log 58 | 59 | ## Bug report 60 | - If you are one of the users with the issues on your device (such as bootloop, device freeze) please get Magisk canary (because of logs), 61 | test the problematic build and pass me L Speed and Magisk log, logcat will be also welcomed. 62 | You can pass them on any links from below (Telegram is recommended) 63 | 64 | 65 | **Links:** 66 | - [xda-thread](https://forum.xda-developers.com/apps/l-speed) 67 | - [Reddit](https://www.reddit.com/r/LSpeedOptimizer/) 68 | - [Facebook page](https://www.facebook.com/LSpeedAndroidOptimizer) 69 | - [Facebook group](https://www.facebook.com/groups/169281933668021/?source_id=1503157226676471) 70 | - [Blog](https://lspeed2016.wordpress.com) 71 | - [Instagram](https://instagram.com/p/BxUcz0zlVUj/?igshid=1ib59rrsrjffl) 72 | - [Telegram group](https://t.me/LSpeedDiscussion) 73 | - [Telegram channel](https://t.me/LSpeedChannel) 74 | - [Translate](https://forum.xda-developers.com/apps/l-speed/translating-help-translating-l-speed-t3587252) 75 | - [Telegram **My projects** channel](https://t.me/paget96_projects_channel) 76 | 77 | - [Check my developer account and other apps](https://play.google.com/store/apps/dev?id=6924549437581780390&hl=en) 78 | 79 | If you want, you can support me over [Paypal donate](https://paypal.me/Paget96), to support my work. 80 | 81 | ## Changelog 82 | Click here! 83 | -------------------------------------------------------------------------------- /app/LSpeed-v1.7.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Paget96/lspeed_magisk/fb69e0e95d3a52304e9f4317c181fe951ae6a409/app/LSpeed-v1.7.apk -------------------------------------------------------------------------------- /changelog.txt: -------------------------------------------------------------------------------- 1 | **v1.7** 2 | - Updated dependencies 3 | - Updated tweaks 4 | 5 | **v1.6.6** 6 | - Added backup and restore function 7 | - Added ability to remove and save log to sdcard 8 | - Log view should show bottom of the log when showing it 9 | - Improved applying scripts 10 | - Updated CPU optimization, removed some things 11 | - Updated VM tweaks 12 | - Fixed previously mentioned issues 13 | - Improved design 14 | - Optimized app code 15 | 16 | **v1.6.5-beta3** 17 | - Updated IO Optimization 18 | - Changes list of applying options on profile change 19 | - Updated busybox path 20 | - Fixed running issues 21 | - Removed exit dialog 22 | - Improved execution time (not much but it is) 23 | - Updated dependencies 24 | - Updated execution mechanism 25 | - Updated CPU optimization 26 | - Updated I/O optiomization 27 | - Updated VM tweaks 28 | - Fixed issues with executing on boot 29 | - Fixed issue with a not deleting log on a boot 30 | - Fixed heating issues on some devices 31 | - Fixed executing of Governor tuner 32 | - Updated and optimized app code 33 | - Added backup and restore function 34 | - Added ability to remove and save log to sdcard 35 | - Log view should show bottom of the log when showing it 36 | - Improved applying scripts 37 | - Fixed previously mentioned issues 38 | - Improved design 39 | - Optimized app code 40 | 41 | **v1.6.4** 42 | - Changed name of DNS optimization to DNS manager 43 | - Added Open DNS 44 | - Changed applying of other DNS 45 | - Added closing Shell on app closing 46 | - Updated toggling options per profile 47 | - Light entropy tweak enabled on all profiles by default 48 | - Fixed double executing on boot 49 | - Updated CPU sets 50 | - Updated I/O block optimization 51 | - Increased pre-read caches of ext4 mounted blocks for performance profile 52 | - Reduced nr_requests to 128 for performance profile 53 | - Added check for path (inode_readahead_blks) 54 | - SD tweak removed and some stuff of it will be merged with IO optimization 55 | - Updated GPU Optimizer, according to qualcomm docs 56 | - Updated app paths to functions 57 | - Reconfigured stune, some tasks shouldn't prefer running on idle CPUs 58 | - Updated scheduler tuner 59 | - Added little wait after getting CPU cores list 60 | - Simplified and updated virtual memory tweaks 61 | - Updated prefer.idle for rt 62 | - Updated adreno idler parameters. Enabled on all profiles 63 | - Fixed issue with no executing 64 | - Fixed issue with not detecting CPU cores list 65 | - Updated kernel thread freeze time 66 | - Added support for ondemand and optdemand 67 | - Reduced code size 68 | 69 | **v1.6.3** 70 | - Improved UI flow 71 | - Updated cpusets 72 | - Updated cleaner 73 | - Updated disable debugging 74 | - App optimized and fixed issues 75 | 76 | **V1.6.2** 77 | - Fixed issues with freezing on some devices 78 | 79 | **v1.6.1** 80 | - Added junk and app cache cleaner 81 | - Updated cpusets 82 | - Improved CPU detection for the devices with tweaked frequencies 83 | - Improved detection of inverted clusters 84 | - Added cpuset tweaks for 0-3 4-5 6-7 cpu configuration 85 | - Fixed problem on devices with incompatible commands 86 | - Removed ads from dialogs 87 | - Improved L button optimization 88 | - Slightly updated I/O optimization profiles 89 | - Updated aggressive doze 90 | - Code optimization and overall improvements 91 | 92 | **v1.6** 93 | - Updated magisk template (Starting with this version L Speed works just with Magisk 19.x+ versions) 94 | - Updated CFQ and BFQ scheduler parameters (Set CFQ and BFQ schedulers to gorup tasks this will slightly improve it's effectivness. It's better than threat every as separated IO queue Disable low_latency on both, so we can get a bit bigger r/w speeds) 95 | - Updated virtual memory tweaks, reduced diry pages flush time 96 | - Improved manager installation 97 | - Fixed issue with no busybox file 98 | - Fixed issue with execution 99 | - Added cpu_detect function 100 | - Improved CPU detection on some devices(for one with no reguler scaling_avalilable_freqs file such as Exynos) 101 | - Return just 0 to logical core if affected_cpu file don't exists 102 | - Updated manger app, added code to remove old one and replace with new 103 | - Separated cpuset from main script 104 | - Fixed output for triple cluster devices 105 | - Updated doze optimization 106 | - Fixed some root issues 107 | - Fixed hanging manager on splash logo 108 | - Fixed issue with chosing animation duration 109 | - Fixed adding L Speed app to doze ignore 110 | - Fixed issue with Secure settings fatal exception 111 | - Fixed issues with aggressive doze 112 | - Fixed issue with not sticking or not working disable when charging and disable motion detection 113 | - Improved script code 114 | 115 | **v1.5** 116 | - Added force GPU rendering with brief explanation 117 | - Added force 4x msaa with brief explanation 118 | - Added GPU info 119 | - Added advanced reboot menu 120 | - Added selinux toggle 121 | - min_free_kbytes reduced 122 | - Disabled merges for all blocks 123 | - Fixed typo in log output for fiops scheduler 124 | - Improved compatibility of governor tuner 125 | - Improved governor tuner detection of PRIME and BIG cpu cores 126 | - Swapped governor parameters for BIG and PRIME cores 127 | - Fixed detection of triple clustered devices 128 | - Added governor tuner execution interval 129 | - Added support for schedutilX 130 | - Fixed some syntax errors 131 | - Fixed issues with loading back a setup 132 | - Main tweaks section renamed to misc 133 | - Optimized app code 134 | 135 | **v1.4** 136 | - Improved Governor tuner (supported interactive and schedutil for now) 137 | - Fixed some code related issues 138 | - Fixed problem with no sticking options 139 | - Updated Manager 140 | - Improved mod installing and extracting of the files 141 | 142 | **v1.3** 143 | - Improved arch detection 144 | - Updated virtual memory profiles 145 | - Improved calculations 146 | - Switched from unity to magisk template 147 | - Improved L button optimization 148 | - Fixed fstriming 149 | - Fixed ram cleaning 150 | - Fixed issues with applying some tweaks 151 | - Fixed problem with root stuck after script execution 152 | - Improved getting free ram before and after optimization 153 | - Fixed some weird logging issues 154 | - Improved agressive doze 155 | - Added start aggressive doze on boot if enabled 156 | - Fixed checking disable doze while chargin and disable device sensors 157 | - Added some bootloop preventers 158 | - Fixed issue with reverting settings 159 | - Fixed issue with not sticking a profile 160 | - Added custom busybox support 161 | - Added busybox support for some options 162 | - Fixed issue with detecting memTotal 163 | - Improved code for faster applying settings 164 | - Improved speed 165 | - Overall code fixes and improvements 166 | 167 | **v1.2.4** 168 | - Added window animation scale, transition animation scale, animator duration scale 169 | - Fixed files permissions 170 | - Updated IO Blocks profiles 171 | - Improved calculations for Ram Manager (all profiles) (less aggressive) 172 | - Disable I/O stats disabled by default on all profiles 173 | - Updated explanation of disable I/O stats 174 | - Updated heap optimization 175 | - Updated Virtual memory tweaks (all profiles) 176 | - Set rq_affinity only to 0 and 1, some kernels don't support aggressive 177 | - Fixed up some mess for dirty caches, fixed up expire time and how often to flush 178 | - Reduced percentage for max cache size before force to flush 179 | - Updated logging 180 | 181 | **v1.2.3** 182 | - L Speed manager removed from /system, zip should install it as user app 183 | - Established Scheduler tuner, support for deadline, anxiety, cfq, bfq, row, fiops, sio, sioplus, zen 184 | - Fixed SD tweak 185 | - Fixed syntax 186 | - Code improvements 187 | 188 | **v1.2.2** 189 | - Prevent issues when $memTotal return weird output (including non-integer values, empty strings...), 190 | in this case device acts like a 4GB RAM device 191 | - Improved IO block optimization profiles, fixed some mess 192 | - Updated min_free_kbytes and extra_free_kbytes calculation 193 | - Fixed text print when installing module 194 | - Removed some useless stuff from code 195 | - Fixed some syntax errors 196 | - Improved overall device performances and battery life 197 | 198 | **v1.2.1** 199 | - This version have everything disabled by default (if clean install) 200 | - Run script in background when executing on boot 201 | - Added boot completed check 202 | - Wait 1min 30secs after boot to set up parameters 203 | - Enabled adreno idler on balanced profile 204 | - Updated read_aheads for blocks 205 | - Updated net speed+ 206 | - Improved disable debugging 207 | - Added ms to log timing 208 | - Fixed issues with Optimize button in manager 209 | - Updated busybox check 210 | - Updated code with POSIX syntax fixes 211 | - Improved code 212 | - Enabled full debug for this build 213 | 214 | **v1.1** 215 | - Increased optimize time to a bit more than 24h 216 | - Improved device optimization 217 | - Added user defined indicator 218 | - Improved chanigng profiles 219 | - Updated virtual memory tweaks 220 | - Updated IO block optimization 221 | - Updated logging 222 | -------------------------------------------------------------------------------- /customize.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Function to install a manager app 3 | installApk() { 4 | 5 | filelist=$(ls $1) 6 | 7 | for file in $filelist; do 8 | 9 | extension="${file##*.}" 10 | 11 | if [ "$extension" = "apk" ]; then 12 | echo "- Installing ""$file""..." 13 | pm install -r "$1/$file" 14 | 15 | ui_print "- Successfully installed $file" 16 | else 17 | ui_print "- Error: ""$file" "is not an apk file." 18 | fi 19 | done 20 | 21 | } 22 | 23 | # 24 | # Installing manager and extracting busybox 25 | # 26 | performInstall() { 27 | # Perform manager installation 28 | unzip -o "$ZIPFILE" 'app/*' -d /data/local/tmp >&2 29 | 30 | apkDir="/data/local/tmp/app" 31 | installApk $apkDir 32 | 33 | # Remove app dir from $MODPATH and tmp dir 34 | rm -rf $apkDir 35 | rm -rf $MODPATH/app 36 | } 37 | 38 | setPermissions() { 39 | # The following is the default rule, DO NOT remove 40 | set_perm $MODPATH/system/etc/lspeed/binary/busybox 0 0 0777 41 | set_perm $MODPATH/system/etc/lspeed/binary/main_function 0 0 0777 42 | set_perm $MODPATH/system/etc/lspeed/binary/governor_tuner 0 0 0777 43 | 44 | # Here are some examples: 45 | # set_perm_recursive $MODPATH/system/lib 0 0 0755 0644 46 | # set_perm $MODPATH/system/bin/app_process32 0 2000 0755 u:object_r:zygote_exec:s0 47 | # set_perm $MODPATH/system/bin/dex2oat 0 2000 0755 u:object_r:dex2oat_exec:s0 48 | # set_perm $MODPATH/system/lib/libart.so 0 0 0644 49 | } 50 | 51 | performInstall 52 | setPermissions 53 | -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=l_speed 2 | name=L Speed @LSpeedDiscussion 3 | version=v1.7 4 | versionCode=137 5 | author=Paget96 6 | description=The most advanced and fully customizable Android tweaker. Join https://t.me/LSpeedDiscussion for testing builds and help us building L Speed. 7 | support=https://forum.xda-developers.com/apps/l-speed 8 | -------------------------------------------------------------------------------- /screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Paget96/lspeed_magisk/fb69e0e95d3a52304e9f4317c181fe951ae6a409/screenshots/1.png -------------------------------------------------------------------------------- /screenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Paget96/lspeed_magisk/fb69e0e95d3a52304e9f4317c181fe951ae6a409/screenshots/2.png -------------------------------------------------------------------------------- /screenshots/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Paget96/lspeed_magisk/fb69e0e95d3a52304e9f4317c181fe951ae6a409/screenshots/3.png -------------------------------------------------------------------------------- /screenshots/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Paget96/lspeed_magisk/fb69e0e95d3a52304e9f4317c181fe951ae6a409/screenshots/4.png -------------------------------------------------------------------------------- /service.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # Do NOT assume where your module will be located. 3 | # ALWAYS use $MODDIR if you need to know where this script 4 | # and module is placed. 5 | # This will make sure your module will still work 6 | # if Magisk change its mount point in the future 7 | MODDIR=${0%/*} 8 | 9 | exit 0 10 | -------------------------------------------------------------------------------- /system/etc/lspeed/binary/governor_tuner: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # This is a part of L Speed 3 | # Governor tuner 4 | 5 | ######## 6 | #PATHS # 7 | ######## 8 | # Path where logs and setup is stored (/data) 9 | LSPEED_DATA_DIR="$1" 10 | LOG_DIR=$LSPEED_DATA_DIR/log 11 | LOG=$LOG_DIR/main_log.log 12 | 13 | SETUP_DIR=$LSPEED_DATA_DIR/setup 14 | USER_PROFILE=$SETUP_DIR/user_profile 15 | 16 | # governor_tuner config files 17 | GOVERNOR_TUNER_DATA_DIR=$SETUP_DIR/governor_tuner 18 | INTERVAL=$GOVERNOR_TUNER_DATA_DIR/interval 19 | 20 | # cpu_detect output files 21 | CPU_DETECT_DATA_DIR=$SETUP_DIR/cpu_detect 22 | MIN_MAX_FREQ=$CPU_DETECT_DATA_DIR/min_max_freq 23 | MIN_FREQ_LIST=$CPU_DETECT_DATA_DIR/min_freq_list 24 | MAX_FREQ_LIST=$CPU_DETECT_DATA_DIR/max_freq_list 25 | LOGICAL_CORE=$CPU_DETECT_DATA_DIR/logical_core 26 | UNIQUE_FREQ=$CPU_DETECT_DATA_DIR/unique_freq 27 | CORE_GETTER=$CPU_DETECT_DATA_DIR/core_getter 28 | 29 | # Binaries 30 | BINARY_DIR=$LSPEED_DATA_DIR/binary 31 | BUSYBOX=$BINARY_DIR/busybox 32 | MAIN_FUNCTION=$BINARY_DIR/main_function 33 | 34 | # Governor tuner presets 35 | GOVERNOR_TUNER_PRESETS=$LSPEED_DATA_DIR/governor_tuner_presets 36 | 37 | divider="===============================================" 38 | 39 | # Functions 40 | createFile() { 41 | touch "$1" 42 | chmod 0666 "$1" 43 | } 44 | 45 | sendToLog() { 46 | timeZone=$(getprop persist.sys.timezone) 47 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 48 | 49 | echo "[$printDate] $1" >> $LOG 50 | } 51 | 52 | write() { 53 | #chmod 0644 "$1" 54 | echo "$2" > "$1" 55 | } 56 | 57 | lockFile() { 58 | chmod 0644 "$1" 59 | echo "$2" > "$1" 60 | chmod 0444 "$1" 61 | } 62 | 63 | # Create governor_tuner dir if not exists 64 | if [ ! -d $GOVERNOR_TUNER_DATA_DIR ]; then 65 | mkdir -p $GOVERNOR_TUNER_DATA_DIR 66 | fi; 67 | 68 | # Wait for main process to finish, we don't want logs overlaping 69 | waitMainProcess() { 70 | if [ -s $LSPEED_DATA_DIR/main_function_PID ]; then 71 | proc1=$($BUSYBOX cat $LSPEED_DATA_DIR/main_function_PID) 72 | proc2=$(ps | $BUSYBOX grep "$proc1" | $BUSYBOX head -n 1 | $BUSYBOX tr -s ' ' | $BUSYBOX cut -d ' ' -f2) 73 | 74 | while [ "$proc1" -eq "$proc2" ]; do 75 | 76 | proc2=$(ps | $BUSYBOX grep "$proc1" | $BUSYBOX head -n 1 | $BUSYBOX tr -s ' ' | $BUSYBOX cut -d ' ' -f2) 77 | 78 | if [ "$proc1" -eq "$proc2" ]; then 79 | sendToLog "$divider" 80 | sendToLog "governor_tuner waiting for main_function($proc1) to finish the job" 81 | sendToLog "$divider" 82 | sleep 5; 83 | else 84 | sendToLog "$divider" 85 | sendToLog "main_function doesn't have a running process, governor_tuner proceeding..." 86 | sendToLog "$divider" 87 | sleep 2; 88 | fi 89 | done 90 | fi 91 | 92 | unset proc1; unset proc2; 93 | } 94 | waitMainProcess 95 | 96 | # End governor_tuner process if already started. 97 | endProc() { 98 | if [ -s $GOVERNOR_TUNER_DATA_DIR/governor_tuner_PID ]; then 99 | proc1=$($BUSYBOX cat $GOVERNOR_TUNER_DATA_DIR/governor_tuner_PID) 100 | proc2=$(ps | $BUSYBOX grep "$proc1" | $BUSYBOX head -n 1 | $BUSYBOX tr -s ' ' | $BUSYBOX cut -d ' ' -f2) 101 | if [ "$proc1" -eq "$proc2" ]; then 102 | kill "$proc1" 103 | sendToLog "$divider" 104 | sendToLog "Killing previous governor_tuner process($proc1)" 105 | sendToLog "$divider" 106 | fi 107 | fi 108 | 109 | unset proc1; unset proc2; 110 | } 111 | endProc 112 | 113 | real_cpu_cores=$($BUSYBOX ls /sys/devices/system/cpu | $BUSYBOX grep -c ^cpu[0-9]); 114 | cpu_cores=$((real_cpu_cores-1)); 115 | 116 | 117 | # Starting cpu_detect 118 | sh $MAIN_FUNCTION $1 cpuDetect 119 | 120 | applyParameters() { 121 | 122 | if [ "$#" -gt 1 ]; then 123 | coreGetterListSize=$($BUSYBOX cat $CORE_GETTER | $BUSYBOX tr '\n' ' ' | $BUSYBOX wc -w) 124 | 125 | sendToLog "Applying $2 profile" 126 | sendToLog "Governor tuner found $coreGetterListSize main CPU cores" 127 | 128 | if [ "$coreGetterListSize" -eq 3 ]; then 129 | 130 | # 131 | # PRIME Cluster 132 | # 133 | getCore=$($BUSYBOX cat $CORE_GETTER | $BUSYBOX tr '\n' ' ' | $BUSYBOX awk '{print $1}') 134 | getCurrentGovernor=$($BUSYBOX cat /sys/devices/system/cpu/cpu"$getCore"/cpufreq/scaling_governor) 135 | clusterGovernorPath="/sys/devices/system/cpu/cpu$getCore/cpufreq/$getCurrentGovernor" 136 | regularGovernorPath="/sys/devices/system/cpu/cpufreq/$getCurrentGovernor" 137 | 138 | sendToLog "First one is PRIME located on cpu$getCore" 139 | sendToLog "Current governor on PRIME: $getCurrentGovernor" 140 | 141 | if [ -e $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" ]; then 142 | if [ -e "$clusterGovernorPath" ]; then 143 | sendToLog "Changing governor parameters" 144 | sh $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" "$1" "prime" "$clusterGovernorPath" 145 | sendToLog "Governor parameters successfully changed" 146 | 147 | elif [ -e "$regularGovernorPath" ]; then 148 | sendToLog "Changing governor parameters" 149 | sh $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" "$1" "regular" "$regularGovernorPath" 150 | sendToLog "Governor parameters successfully changed" 151 | 152 | else 153 | sendToLog "Cannot find governor path" 154 | fi 155 | 156 | else 157 | sendToLog "Governor $getCurrentGovernor is not supported" 158 | fi 159 | 160 | sendToLog "$divider" 161 | unset getCore; unset getCurrentGovernor; unset clusterGovernorPath; unset regularGovernorPath; 162 | 163 | # 164 | # BIG Cluster 165 | # 166 | getCore=$($BUSYBOX cat $CORE_GETTER | $BUSYBOX tr '\n' ' ' | $BUSYBOX awk '{print $2}') 167 | getCurrentGovernor=$($BUSYBOX cat /sys/devices/system/cpu/cpu"$getCore"/cpufreq/scaling_governor) 168 | clusterGovernorPath="/sys/devices/system/cpu/cpu$getCore/cpufreq/$getCurrentGovernor" 169 | regularGovernorPath="/sys/devices/system/cpu/cpufreq/$getCurrentGovernor" 170 | 171 | sendToLog "Second one is BIG located on cpu$getCore" 172 | sendToLog "Current governor on BIG: $getCurrentGovernor" 173 | 174 | if [ -e $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" ]; then 175 | if [ -e "$clusterGovernorPath" ]; then 176 | sendToLog "Changing governor parameters" 177 | sh $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" "$1" "big" "$clusterGovernorPath" 178 | sendToLog "Governor parameters successfully changed" 179 | 180 | elif [ -e "$regularGovernorPath" ]; then 181 | sendToLog "Changing governor parameters" 182 | sh $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" "$1" "regular" "$regularGovernorPath" 183 | sendToLog "Governor parameters successfully changed" 184 | else 185 | sendToLog "Cannot find governor path" 186 | fi 187 | 188 | else 189 | sendToLog "Governor $getCurrentGovernor is not supported" 190 | fi 191 | 192 | sendToLog "$divider" 193 | unset getCore; unset getCurrentGovernor; unset clusterGovernorPath; unset regularGovernorPath; 194 | 195 | # 196 | # LITTLE Cluster 197 | # 198 | getCore=$($BUSYBOX cat $CORE_GETTER | $BUSYBOX tr '\n' ' ' | $BUSYBOX awk '{print $3}') 199 | getCurrentGovernor=$($BUSYBOX cat /sys/devices/system/cpu/cpu"$getCore"/cpufreq/scaling_governor) 200 | clusterGovernorPath="/sys/devices/system/cpu/cpu$getCore/cpufreq/$getCurrentGovernor" 201 | regularGovernorPath="/sys/devices/system/cpu/cpufreq/$getCurrentGovernor" 202 | 203 | sendToLog "Third one is LITTLE located on cpu$getCore" 204 | sendToLog "Current governor on LITTLE: $getCurrentGovernor" 205 | 206 | if [ -e $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" ]; then 207 | if [ -e "$clusterGovernorPath" ]; then 208 | sendToLog "Changing governor parameters" 209 | sh $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" "$1" "little" "$clusterGovernorPath" 210 | sendToLog "Governor parameters successfully changed" 211 | 212 | elif [ -e "$regularGovernorPath" ]; then 213 | sendToLog "Changing governor parameters" 214 | sh $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" "$1" "regular" "$regularGovernorPath" 215 | sendToLog "Governor parameters successfully changed" 216 | else 217 | sendToLog "Cannot find governor path" 218 | fi 219 | 220 | else 221 | sendToLog "Governor $getCurrentGovernor is not supported" 222 | fi 223 | 224 | sendToLog "$divider" 225 | unset getCore; unset getCurrentGovernor; unset clusterGovernorPath; unset regularGovernorPath; 226 | 227 | elif [ "$coreGetterListSize" -eq 2 ]; then 228 | 229 | # 230 | # BIG Cluster 231 | # 232 | getCore=$($BUSYBOX cat $CORE_GETTER | $BUSYBOX tr '\n' ' ' | $BUSYBOX awk '{print $1}') 233 | getCurrentGovernor=$($BUSYBOX cat /sys/devices/system/cpu/cpu"$getCore"/cpufreq/scaling_governor) 234 | clusterGovernorPath="/sys/devices/system/cpu/cpu$getCore/cpufreq/$getCurrentGovernor" 235 | regularGovernorPath="/sys/devices/system/cpu/cpufreq/$getCurrentGovernor" 236 | 237 | sendToLog "First one is BIG located on cpu$getCore" 238 | sendToLog "Current governor on BIG: $getCurrentGovernor" 239 | 240 | if [ -e $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" ]; then 241 | if [ -e "$clusterGovernorPath" ]; then 242 | sendToLog "Changing governor parameters" 243 | sh $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" "$1" "big" "$clusterGovernorPath" 244 | sendToLog "Governor parameters successfully changed" 245 | 246 | elif [ -e "$regularGovernorPath" ]; then 247 | sendToLog "Changing governor parameters" 248 | sh $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" "$1" "regular" "$regularGovernorPath" 249 | sendToLog "Governor parameters successfully changed" 250 | 251 | else 252 | sendToLog "Cannot find governor path" 253 | fi 254 | 255 | else 256 | sendToLog "Governor $getCurrentGovernor is not supported" 257 | fi 258 | 259 | sendToLog "$divider" 260 | unset getCore; unset getCurrentGovernor; unset clusterGovernorPath; unset regularGovernorPath; 261 | 262 | # 263 | # LITTLE Cluster 264 | # 265 | getCore=$($BUSYBOX cat $CORE_GETTER | $BUSYBOX tr '\n' ' ' | $BUSYBOX awk '{print $2}') 266 | getCurrentGovernor=$($BUSYBOX cat /sys/devices/system/cpu/cpu"$getCore"/cpufreq/scaling_governor) 267 | clusterGovernorPath="/sys/devices/system/cpu/cpu$getCore/cpufreq/$getCurrentGovernor" 268 | regularGovernorPath="/sys/devices/system/cpu/cpufreq/$getCurrentGovernor" 269 | 270 | sendToLog "Second one is LITTLE located on cpu$getCore" 271 | sendToLog "Current governor on LITTLE: $getCurrentGovernor" 272 | 273 | if [ -e $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" ]; then 274 | if [ -e "$clusterGovernorPath" ]; then 275 | sendToLog "Changing governor parameters" 276 | sh $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" "$1" "little" "$clusterGovernorPath" 277 | sendToLog "Governor parameters successfully changed" 278 | 279 | elif [ -e "$regularGovernorPath" ]; then 280 | sendToLog "Changing governor parameters" 281 | sh $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" "$1" "regular" "$regularGovernorPath" 282 | sendToLog "Governor parameters successfully changed" 283 | else 284 | sendToLog "Cannot find governor path" 285 | fi 286 | 287 | else 288 | sendToLog "Governor $getCurrentGovernor is not supported" 289 | fi 290 | 291 | sendToLog "$divider" 292 | unset getCore; unset getCurrentGovernor; unset clusterGovernorPath; unset regularGovernorPath; 293 | else 294 | # 295 | # REGULAR CPU 296 | # 297 | getCurrentGovernor=$($BUSYBOX cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) 298 | regularGovernorPath1="/sys/devices/system/cpu/cpufreq/$getCurrentGovernor" 299 | regularGovernorPath2="/sys/devices/system/cpu/cpu0/cpufreq/$getCurrentGovernor" 300 | 301 | sendToLog "REGULAR CPU located on cpu0" 302 | sendToLog "Current governor on REGULAR: $getCurrentGovernor" 303 | 304 | if [ -e $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" ]; then 305 | if [ -e "$regularGovernorPath1" ]; then 306 | sendToLog "Changing governor parameters" 307 | sh $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" "$1" "regular" "$regularGovernorPath1" 308 | sendToLog "Governor parameters successfully changed" 309 | 310 | elif [ -e "$regularGovernorPath2" ]; then 311 | sendToLog "Changing governor parameters" 312 | sh $GOVERNOR_TUNER_PRESETS/"$2"/"$getCurrentGovernor" "$1" "regular" "$regularGovernorPath2" 313 | sendToLog "Governor parameters successfully changed" 314 | fi 315 | else 316 | sendToLog "Governor $getCurrentGovernor is not supported" 317 | fi 318 | 319 | sendToLog "$divider" 320 | unset getCurrentGovernor; unset regularGovernorPath1; unset regularGovernorPath2; 321 | fi 322 | fi 323 | sendToLog "Applying $2 successful" 324 | 325 | } 326 | 327 | while true; do 328 | 329 | # Always wait for main_function process to finish 330 | waitMainProcess 331 | 332 | # Get current governor tuner profile 333 | getProfile=$($BUSYBOX cat $USER_PROFILE/governor_tuner) 2>/dev/null 334 | 335 | if [ "$getProfile" -eq 1 ] || [ "$getProfile" -eq 2 ] || [ "$getProfile" -eq 3 ]; then 336 | write $GOVERNOR_TUNER_DATA_DIR/governor_tuner_PID $$ 337 | elif [ "$getProfile" -eq 0 ]; then 338 | sendToLog "Governor tuner is disabled, killing process." 339 | exit 0 340 | else 341 | sendToLog "Cannot reteive current profile" 342 | exit 0 343 | fi 344 | 345 | # Execute profiles for selected profile 346 | if [ "$getProfile" -eq 1 ]; then 347 | profile="battery"; 348 | 349 | elif [ "$getProfile" -eq 2 ]; then 350 | profile="balanced"; 351 | 352 | elif [ "$getProfile" -eq 3 ]; then 353 | profile="performance"; 354 | 355 | else 356 | profile="" 357 | fi 358 | 359 | applyParameters "$1" "$profile" 360 | 361 | # This is a little part of the code which tells how often to run governor_tuner 362 | # If $INTERVAL file doesn't exists it'll be executed every 5mins, otherwise it'll get 363 | # the interval inside, if it's 0 governor_tuner will be one shoot script, so executed just once 364 | # If the value is above 0 that will set sleep to seconds, 1 means 1min. 10 means 10 mins and so on. 365 | if [ -s $INTERVAL ]; then 366 | exec_interval=$($BUSYBOX cat $INTERVAL) 367 | 368 | if [ "$exec_interval" -eq 0 ]; then 369 | exit 0 370 | else 371 | sendToLog "governor_tuner will be executed in $((exec_interval))mins" 372 | sendToLog "$divider" 373 | sleep $((exec_interval*60)); 374 | fi 375 | else 376 | sendToLog "governor_tuner will be executed in 5mins" 377 | sendToLog "$divider" 378 | sleep 300; 379 | fi 380 | 381 | done -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/balanced/interactive: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR="$1" 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/boost ]; then 36 | lockFile $3/boost "0" 37 | sendToLog "boost=0" 38 | fi 39 | 40 | if [ -e $3/boostpulse_duration ]; then 41 | lockFile $3/boostpulse_duration "0" 42 | sendToLog "boostpulse_duration=0" 43 | fi 44 | 45 | if [ -e $3/fastlane ]; then 46 | lockFile $3/fastlane "1" 47 | sendToLog "fastlane=1" 48 | fi 49 | 50 | if [ -e $3/align_windows ]; then 51 | lockFile $3/align_windows "0" 52 | sendToLog "align_windows=0" 53 | fi 54 | 55 | if [ -e $3/use_migration_notif ]; then 56 | lockFile $3/use_migration_notif "1" 57 | sendToLog "use_migration_notif=1" 58 | fi 59 | 60 | if [ -e $3/use_sched_load ]; then 61 | lockFile $3/use_sched_load "1" 62 | sendToLog "use_sched_load=1" 63 | fi 64 | 65 | if [ -e $3/enable_prediction ]; then 66 | lockFile $3/enable_prediction "0" 67 | sendToLog "enable_prediction=0" 68 | fi 69 | 70 | if [ -e $3/fast_ramp_down ]; then 71 | lockFile $3/fast_ramp_down "1" 72 | sendToLog "fast_ramp_down=1" 73 | fi 74 | 75 | if [ -e $3/go_hispeed_load ]; then 76 | lockFile $3/go_hispeed_load "90" 77 | sendToLog "go_hispeed_load=90" 78 | fi 79 | 80 | if [ -e $3/timer_rate ]; then 81 | lockFile $3/timer_rate "12000" 82 | sendToLog "timer_rate=12000" 83 | fi 84 | 85 | if [ -e $3/io_is_busy ]; then 86 | lockFile $3/io_is_busy "0" 87 | sendToLog "io_is_busy=0" 88 | fi 89 | 90 | if [ -e $3/min_sample_time ]; then 91 | lockFile $3/min_sample_time "60000" 92 | sendToLog "min_sample_time=60000" 93 | fi 94 | fi 95 | 96 | elif [ $2 = "big" ]; then 97 | if [ -e $3 ]; then 98 | if [ -e $3/boost ]; then 99 | lockFile $3/boost "0" 100 | sendToLog "boost=0" 101 | fi 102 | 103 | if [ -e $3/boostpulse_duration ]; then 104 | lockFile $3/boostpulse_duration "0" 105 | sendToLog "boostpulse_duration=0" 106 | fi 107 | 108 | if [ -e $3/fastlane ]; then 109 | lockFile $3/fastlane "1" 110 | sendToLog "fastlane=1" 111 | fi 112 | 113 | if [ -e $3/align_windows ]; then 114 | lockFile $3/align_windows "0" 115 | sendToLog "align_windows=0" 116 | fi 117 | 118 | if [ -e $3/use_migration_notif ]; then 119 | lockFile $3/use_migration_notif "1" 120 | sendToLog "use_migration_notif=1" 121 | fi 122 | 123 | if [ -e $3/use_sched_load ]; then 124 | lockFile $3/use_sched_load "1" 125 | sendToLog "use_sched_load=1" 126 | fi 127 | 128 | if [ -e $3/enable_prediction ]; then 129 | lockFile $3/enable_prediction "0" 130 | sendToLog "enable_prediction=0" 131 | fi 132 | 133 | if [ -e $3/fast_ramp_down ]; then 134 | lockFile $3/fast_ramp_down "1" 135 | sendToLog "fast_ramp_down=1" 136 | fi 137 | 138 | if [ -e $3/go_hispeed_load ]; then 139 | lockFile $3/go_hispeed_load "99" 140 | sendToLog "go_hispeed_load=99" 141 | fi 142 | 143 | if [ -e $3/timer_rate ]; then 144 | lockFile $3/timer_rate "10000" 145 | sendToLog "timer_rate=10000" 146 | fi 147 | 148 | if [ -e $3/io_is_busy ]; then 149 | lockFile $3/io_is_busy "0" 150 | sendToLog "io_is_busy=0" 151 | fi 152 | 153 | if [ -e $3/min_sample_time ]; then 154 | lockFile $3/min_sample_time "40000" 155 | sendToLog "min_sample_time=40000" 156 | fi 157 | fi 158 | 159 | elif [ $2 = "little" ]; then 160 | if [ -e $3 ]; then 161 | if [ -e $3/boost ]; then 162 | lockFile $3/boost "0" 163 | sendToLog "boost=0" 164 | fi 165 | 166 | if [ -e $3/boostpulse_duration ]; then 167 | lockFile $3/boostpulse_duration "0" 168 | sendToLog "boostpulse_duration=0" 169 | fi 170 | 171 | if [ -e $3/fastlane ]; then 172 | lockFile $3/fastlane "1" 173 | sendToLog "fastlane=1" 174 | fi 175 | 176 | if [ -e $3/align_windows ]; then 177 | lockFile $3/align_windows "0" 178 | sendToLog "align_windows=0" 179 | fi 180 | 181 | if [ -e $3/use_migration_notif ]; then 182 | lockFile $3/use_migration_notif "1" 183 | sendToLog "use_migration_notif=1" 184 | fi 185 | 186 | if [ -e $3/use_sched_load ]; then 187 | lockFile $3/use_sched_load "1" 188 | sendToLog "use_sched_load=1" 189 | fi 190 | 191 | if [ -e $3/enable_prediction ]; then 192 | lockFile $3/enable_prediction "0" 193 | sendToLog "enable_prediction=0" 194 | fi 195 | 196 | if [ -e $3/fast_ramp_down ]; then 197 | lockFile $3/fast_ramp_down "1" 198 | sendToLog "fast_ramp_down=1" 199 | fi 200 | 201 | if [ -e $3/go_hispeed_load ]; then 202 | lockFile $3/go_hispeed_load "95" 203 | sendToLog "go_hispeed_load=95" 204 | fi 205 | 206 | if [ -e $3/timer_rate ]; then 207 | lockFile $3/timer_rate "10000" 208 | sendToLog "timer_rate=10000" 209 | fi 210 | 211 | if [ -e $3/io_is_busy ]; then 212 | lockFile $3/io_is_busy "0" 213 | sendToLog "io_is_busy=0" 214 | fi 215 | 216 | if [ -e $3/min_sample_time ]; then 217 | lockFile $3/min_sample_time "40000" 218 | sendToLog "min_sample_time=40000" 219 | fi 220 | fi 221 | 222 | elif [ $2 = "regular" ]; then 223 | if [ -e $3 ]; then 224 | if [ -e $3/boost ]; then 225 | lockFile $3/boost "0" 226 | sendToLog "boost=0" 227 | fi 228 | 229 | if [ -e $3/boostpulse_duration ]; then 230 | lockFile $3/boostpulse_duration "0" 231 | sendToLog "boostpulse_duration=0" 232 | fi 233 | 234 | if [ -e $3/fastlane ]; then 235 | lockFile $3/fastlane "1" 236 | sendToLog "fastlane=1" 237 | fi 238 | 239 | if [ -e $3/align_windows ]; then 240 | lockFile $3/align_windows "0" 241 | sendToLog "align_windows=0" 242 | fi 243 | 244 | if [ -e $3/use_migration_notif ]; then 245 | lockFile $3/use_migration_notif "1" 246 | sendToLog "use_migration_notif=1" 247 | fi 248 | 249 | if [ -e $3/use_sched_load ]; then 250 | lockFile $3/use_sched_load "1" 251 | sendToLog "use_sched_load=1" 252 | fi 253 | 254 | if [ -e $3/enable_prediction ]; then 255 | lockFile $3/enable_prediction "0" 256 | sendToLog "enable_prediction=0" 257 | fi 258 | 259 | if [ -e $3/fast_ramp_down ]; then 260 | lockFile $3/fast_ramp_down "1" 261 | sendToLog "fast_ramp_down=1" 262 | fi 263 | 264 | if [ -e $3/go_hispeed_load ]; then 265 | lockFile $3/go_hispeed_load "95" 266 | sendToLog "go_hispeed_load=95" 267 | fi 268 | 269 | if [ -e $3/timer_rate ]; then 270 | lockFile $3/timer_rate "10000" 271 | sendToLog "timer_rate=10000" 272 | fi 273 | 274 | if [ -e $3/io_is_busy ]; then 275 | lockFile $3/io_is_busy "0" 276 | sendToLog "io_is_busy=0" 277 | fi 278 | 279 | if [ -e $3/min_sample_time ]; then 280 | lockFile $3/min_sample_time "40000" 281 | sendToLog "min_sample_time=40000" 282 | fi 283 | fi 284 | 285 | fi -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/balanced/ondemand: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR=$1 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/up_threshold ]; then 36 | lockFile $3/up_threshold "90" 37 | sendToLog "up_threshold=90" 38 | fi 39 | 40 | if [ -e $3/up_threshold_any_cpu_load ]; then 41 | lockFile $3/up_threshold_any_cpu_load "85" 42 | sendToLog "up_threshold_any_cpu_load=85" 43 | fi 44 | 45 | if [ -e $3/up_threshold_multi_core ]; then 46 | lockFile $3/up_threshold_multi_core "85" 47 | sendToLog "up_threshold_multi_core=85" 48 | fi 49 | 50 | if [ -e $3/sampling_rate ]; then 51 | lockFile $3/sampling_rate "75000" 52 | sendToLog "sampling_rate=75000" 53 | fi 54 | 55 | if [ -e $3/sampling_down_factor ]; then 56 | lockFile $3/sampling_down_factor "2" 57 | sendToLog "sampling_down_factor=2" 58 | fi 59 | 60 | if [ -e $3/down_differential ]; then 61 | lockFile $3/down_differential "10" 62 | sendToLog "down_differential=10" 63 | fi 64 | 65 | if [ -e $3/freq_step ]; then 66 | lockFile $3/freq_step "35" 67 | sendToLog "freq_step=35" 68 | fi 69 | 70 | fi 71 | 72 | elif [ $2 = "big" ]; then 73 | if [ -e $3 ]; then 74 | if [ -e $3/up_threshold ]; then 75 | lockFile $3/up_threshold "90" 76 | sendToLog "up_threshold=90" 77 | fi 78 | 79 | if [ -e $3/up_threshold_any_cpu_load ]; then 80 | lockFile $3/up_threshold_any_cpu_load "85" 81 | sendToLog "up_threshold_any_cpu_load=85" 82 | fi 83 | 84 | if [ -e $3/up_threshold_multi_core ]; then 85 | lockFile $3/up_threshold_multi_core "85" 86 | sendToLog "up_threshold_multi_core=85" 87 | fi 88 | 89 | if [ -e $3/sampling_rate ]; then 90 | lockFile $3/sampling_rate "75000" 91 | sendToLog "sampling_rate=75000" 92 | fi 93 | 94 | if [ -e $3/sampling_down_factor ]; then 95 | lockFile $3/sampling_down_factor "2" 96 | sendToLog "sampling_down_factor=2" 97 | fi 98 | 99 | if [ -e $3/down_differential ]; then 100 | lockFile $3/down_differential "10" 101 | sendToLog "down_differential=10" 102 | fi 103 | 104 | if [ -e $3/freq_step ]; then 105 | lockFile $3/freq_step "35" 106 | sendToLog "freq_step=35" 107 | fi 108 | 109 | fi 110 | 111 | elif [ $2 = "little" ]; then 112 | if [ -e $3 ]; then 113 | if [ -e $3/up_threshold ]; then 114 | lockFile $3/up_threshold "90" 115 | sendToLog "up_threshold=90" 116 | fi 117 | 118 | if [ -e $3/up_threshold_any_cpu_load ]; then 119 | lockFile $3/up_threshold_any_cpu_load "85" 120 | sendToLog "up_threshold_any_cpu_load=85" 121 | fi 122 | 123 | if [ -e $3/up_threshold_multi_core ]; then 124 | lockFile $3/up_threshold_multi_core "85" 125 | sendToLog "up_threshold_multi_core=85" 126 | fi 127 | 128 | if [ -e $3/sampling_rate ]; then 129 | lockFile $3/sampling_rate "75000" 130 | sendToLog "sampling_rate=75000" 131 | fi 132 | 133 | if [ -e $3/sampling_down_factor ]; then 134 | lockFile $3/sampling_down_factor "2" 135 | sendToLog "sampling_down_factor=2" 136 | fi 137 | 138 | if [ -e $3/down_differential ]; then 139 | lockFile $3/down_differential "10" 140 | sendToLog "down_differential=10" 141 | fi 142 | 143 | if [ -e $3/freq_step ]; then 144 | lockFile $3/freq_step "35" 145 | sendToLog "freq_step=35" 146 | fi 147 | 148 | fi 149 | 150 | elif [ $2 = "regular" ]; then 151 | if [ -e $3 ]; then 152 | if [ -e $3/up_threshold ]; then 153 | lockFile $3/up_threshold "90" 154 | sendToLog "up_threshold=90" 155 | fi 156 | 157 | if [ -e $3/up_threshold_any_cpu_load ]; then 158 | lockFile $3/up_threshold_any_cpu_load "85" 159 | sendToLog "up_threshold_any_cpu_load=85" 160 | fi 161 | 162 | if [ -e $3/up_threshold_multi_core ]; then 163 | lockFile $3/up_threshold_multi_core "85" 164 | sendToLog "up_threshold_multi_core=85" 165 | fi 166 | 167 | if [ -e $3/sampling_rate ]; then 168 | lockFile $3/sampling_rate "75000" 169 | sendToLog "sampling_rate=75000" 170 | fi 171 | 172 | if [ -e $3/sampling_down_factor ]; then 173 | lockFile $3/sampling_down_factor "2" 174 | sendToLog "sampling_down_factor=2" 175 | fi 176 | 177 | if [ -e $3/down_differential ]; then 178 | lockFile $3/down_differential "10" 179 | sendToLog "down_differential=10" 180 | fi 181 | 182 | if [ -e $3/freq_step ]; then 183 | lockFile $3/freq_step "35" 184 | sendToLog "freq_step=35" 185 | fi 186 | 187 | fi 188 | 189 | fi 190 | -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/balanced/optdemand: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR=$1 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/up_threshold ]; then 36 | lockFile $3/up_threshold "90" 37 | sendToLog "up_threshold=90" 38 | fi 39 | 40 | if [ -e $3/up_threshold_any_cpu_load ]; then 41 | lockFile $3/up_threshold_any_cpu_load "85" 42 | sendToLog "up_threshold_any_cpu_load=85" 43 | fi 44 | 45 | if [ -e $3/up_threshold_multi_core ]; then 46 | lockFile $3/up_threshold_multi_core "85" 47 | sendToLog "up_threshold_multi_core=85" 48 | fi 49 | 50 | if [ -e $3/sampling_rate ]; then 51 | lockFile $3/sampling_rate "75000" 52 | sendToLog "sampling_rate=75000" 53 | fi 54 | 55 | if [ -e $3/sampling_down_factor ]; then 56 | lockFile $3/sampling_down_factor "2" 57 | sendToLog "sampling_down_factor=2" 58 | fi 59 | 60 | if [ -e $3/down_differential ]; then 61 | lockFile $3/down_differential "10" 62 | sendToLog "down_differential=10" 63 | fi 64 | 65 | if [ -e $3/freq_step ]; then 66 | lockFile $3/freq_step "35" 67 | sendToLog "freq_step=35" 68 | fi 69 | 70 | fi 71 | 72 | elif [ $2 = "big" ]; then 73 | if [ -e $3 ]; then 74 | if [ -e $3/up_threshold ]; then 75 | lockFile $3/up_threshold "90" 76 | sendToLog "up_threshold=90" 77 | fi 78 | 79 | if [ -e $3/up_threshold_any_cpu_load ]; then 80 | lockFile $3/up_threshold_any_cpu_load "85" 81 | sendToLog "up_threshold_any_cpu_load=85" 82 | fi 83 | 84 | if [ -e $3/up_threshold_multi_core ]; then 85 | lockFile $3/up_threshold_multi_core "85" 86 | sendToLog "up_threshold_multi_core=85" 87 | fi 88 | 89 | if [ -e $3/sampling_rate ]; then 90 | lockFile $3/sampling_rate "75000" 91 | sendToLog "sampling_rate=75000" 92 | fi 93 | 94 | if [ -e $3/sampling_down_factor ]; then 95 | lockFile $3/sampling_down_factor "2" 96 | sendToLog "sampling_down_factor=2" 97 | fi 98 | 99 | if [ -e $3/down_differential ]; then 100 | lockFile $3/down_differential "10" 101 | sendToLog "down_differential=10" 102 | fi 103 | 104 | if [ -e $3/freq_step ]; then 105 | lockFile $3/freq_step "35" 106 | sendToLog "freq_step=35" 107 | fi 108 | 109 | fi 110 | 111 | elif [ $2 = "little" ]; then 112 | if [ -e $3 ]; then 113 | if [ -e $3/up_threshold ]; then 114 | lockFile $3/up_threshold "90" 115 | sendToLog "up_threshold=90" 116 | fi 117 | 118 | if [ -e $3/up_threshold_any_cpu_load ]; then 119 | lockFile $3/up_threshold_any_cpu_load "85" 120 | sendToLog "up_threshold_any_cpu_load=85" 121 | fi 122 | 123 | if [ -e $3/up_threshold_multi_core ]; then 124 | lockFile $3/up_threshold_multi_core "85" 125 | sendToLog "up_threshold_multi_core=85" 126 | fi 127 | 128 | if [ -e $3/sampling_rate ]; then 129 | lockFile $3/sampling_rate "75000" 130 | sendToLog "sampling_rate=75000" 131 | fi 132 | 133 | if [ -e $3/sampling_down_factor ]; then 134 | lockFile $3/sampling_down_factor "2" 135 | sendToLog "sampling_down_factor=2" 136 | fi 137 | 138 | if [ -e $3/down_differential ]; then 139 | lockFile $3/down_differential "10" 140 | sendToLog "down_differential=10" 141 | fi 142 | 143 | if [ -e $3/freq_step ]; then 144 | lockFile $3/freq_step "35" 145 | sendToLog "freq_step=35" 146 | fi 147 | 148 | fi 149 | 150 | elif [ $2 = "regular" ]; then 151 | if [ -e $3 ]; then 152 | if [ -e $3/up_threshold ]; then 153 | lockFile $3/up_threshold "90" 154 | sendToLog "up_threshold=90" 155 | fi 156 | 157 | if [ -e $3/up_threshold_any_cpu_load ]; then 158 | lockFile $3/up_threshold_any_cpu_load "85" 159 | sendToLog "up_threshold_any_cpu_load=85" 160 | fi 161 | 162 | if [ -e $3/up_threshold_multi_core ]; then 163 | lockFile $3/up_threshold_multi_core "85" 164 | sendToLog "up_threshold_multi_core=85" 165 | fi 166 | 167 | if [ -e $3/sampling_rate ]; then 168 | lockFile $3/sampling_rate "75000" 169 | sendToLog "sampling_rate=75000" 170 | fi 171 | 172 | if [ -e $3/sampling_down_factor ]; then 173 | lockFile $3/sampling_down_factor "2" 174 | sendToLog "sampling_down_factor=2" 175 | fi 176 | 177 | if [ -e $3/down_differential ]; then 178 | lockFile $3/down_differential "10" 179 | sendToLog "down_differential=10" 180 | fi 181 | 182 | if [ -e $3/freq_step ]; then 183 | lockFile $3/freq_step "35" 184 | sendToLog "freq_step=35" 185 | fi 186 | 187 | fi 188 | 189 | fi 190 | -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/balanced/schedutil: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR=$1 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/up_rate_limit_us ]; then 36 | lockFile $3/up_rate_limit_us "2000" 37 | sendToLog "up_rate_limit_us=2000" 38 | fi 39 | 40 | if [ -e $3/down_rate_limit_us ]; then 41 | lockFile $3/down_rate_limit_us "3000" 42 | sendToLog "down_rate_limit_us=3000" 43 | fi 44 | 45 | if [ -e $3/hispeed_load ]; then 46 | lockFile $3/hispeed_load "90" 47 | sendToLog "hispeed_load=90" 48 | fi 49 | 50 | if [ -e $3/rate_limit_us ]; then 51 | lockFile $3/rate_limit_us "0" 52 | sendToLog "rate_limit_us=0" 53 | fi 54 | 55 | fi 56 | 57 | elif [ $2 = "big" ]; then 58 | if [ -e $3 ]; then 59 | if [ -e $3/up_rate_limit_us ]; then 60 | lockFile $3/up_rate_limit_us "1000" 61 | sendToLog "up_rate_limit_us=1000" 62 | fi 63 | 64 | if [ -e $3/down_rate_limit_us ]; then 65 | lockFile $3/down_rate_limit_us "3000" 66 | sendToLog "down_rate_limit_us=3000" 67 | fi 68 | 69 | if [ -e $3/hispeed_load ]; then 70 | lockFile $3/hispeed_load "90" 71 | sendToLog "hispeed_load=90" 72 | fi 73 | 74 | if [ -e $3/rate_limit_us ]; then 75 | lockFile $3/rate_limit_us "0" 76 | sendToLog "rate_limit_us=0" 77 | fi 78 | fi 79 | 80 | elif [ $2 = "little" ]; then 81 | if [ -e $3 ]; then 82 | if [ -e $3/up_rate_limit_us ]; then 83 | lockFile $3/up_rate_limit_us "1000" 84 | sendToLog "up_rate_limit_us=1000" 85 | fi 86 | 87 | if [ -e $3/down_rate_limit_us ]; then 88 | lockFile $3/down_rate_limit_us "2000" 89 | sendToLog "down_rate_limit_us=2000" 90 | fi 91 | 92 | if [ -e $3/hispeed_load ]; then 93 | lockFile $3/hispeed_load "90" 94 | sendToLog "hispeed_load=90" 95 | fi 96 | 97 | if [ -e $3/rate_limit_us ]; then 98 | lockFile $3/rate_limit_us "0" 99 | sendToLog "rate_limit_us=0" 100 | fi 101 | 102 | fi 103 | 104 | elif [ $2 = "regular" ]; then 105 | if [ -e $3 ]; then 106 | if [ -e $3/up_rate_limit_us ]; then 107 | lockFile $3/up_rate_limit_us "1000" 108 | sendToLog "up_rate_limit_us=1000" 109 | fi 110 | 111 | if [ -e $3/down_rate_limit_us ]; then 112 | lockFile $3/down_rate_limit_us "2000" 113 | sendToLog "down_rate_limit_us=2000" 114 | fi 115 | 116 | if [ -e $3/hispeed_load ]; then 117 | lockFile $3/hispeed_load "90" 118 | sendToLog "hispeed_load=90" 119 | fi 120 | 121 | if [ -e $3/rate_limit_us ]; then 122 | lockFile $3/rate_limit_us "0" 123 | sendToLog "rate_limit_us=0" 124 | fi 125 | 126 | fi 127 | fi 128 | -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/balanced/schedutilX: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR=$1 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/up_rate_limit_us ]; then 36 | lockFile $3/up_rate_limit_us "2000" 37 | sendToLog "up_rate_limit_us=2000" 38 | fi 39 | 40 | if [ -e $3/down_rate_limit_us ]; then 41 | lockFile $3/down_rate_limit_us "3000" 42 | sendToLog "down_rate_limit_us=3000" 43 | fi 44 | 45 | if [ -e $3/hispeed_load ]; then 46 | lockFile $3/hispeed_load "90" 47 | sendToLog "hispeed_load=90" 48 | fi 49 | 50 | if [ -e $3/rate_limit_us ]; then 51 | lockFile $3/rate_limit_us "0" 52 | sendToLog "rate_limit_us=0" 53 | fi 54 | 55 | fi 56 | 57 | elif [ $2 = "big" ]; then 58 | if [ -e $3 ]; then 59 | if [ -e $3/up_rate_limit_us ]; then 60 | lockFile $3/up_rate_limit_us "1000" 61 | sendToLog "up_rate_limit_us=1000" 62 | fi 63 | 64 | if [ -e $3/down_rate_limit_us ]; then 65 | lockFile $3/down_rate_limit_us "3000" 66 | sendToLog "down_rate_limit_us=3000" 67 | fi 68 | 69 | if [ -e $3/hispeed_load ]; then 70 | lockFile $3/hispeed_load "90" 71 | sendToLog "hispeed_load=90" 72 | fi 73 | 74 | if [ -e $3/rate_limit_us ]; then 75 | lockFile $3/rate_limit_us "0" 76 | sendToLog "rate_limit_us=0" 77 | fi 78 | fi 79 | 80 | elif [ $2 = "little" ]; then 81 | if [ -e $3 ]; then 82 | if [ -e $3/up_rate_limit_us ]; then 83 | lockFile $3/up_rate_limit_us "1000" 84 | sendToLog "up_rate_limit_us=1000" 85 | fi 86 | 87 | if [ -e $3/down_rate_limit_us ]; then 88 | lockFile $3/down_rate_limit_us "2000" 89 | sendToLog "down_rate_limit_us=2000" 90 | fi 91 | 92 | if [ -e $3/hispeed_load ]; then 93 | lockFile $3/hispeed_load "90" 94 | sendToLog "hispeed_load=90" 95 | fi 96 | 97 | if [ -e $3/rate_limit_us ]; then 98 | lockFile $3/rate_limit_us "0" 99 | sendToLog "rate_limit_us=0" 100 | fi 101 | 102 | fi 103 | 104 | elif [ $2 = "regular" ]; then 105 | if [ -e $3 ]; then 106 | if [ -e $3/up_rate_limit_us ]; then 107 | lockFile $3/up_rate_limit_us "1000" 108 | sendToLog "up_rate_limit_us=1000" 109 | fi 110 | 111 | if [ -e $3/down_rate_limit_us ]; then 112 | lockFile $3/down_rate_limit_us "2000" 113 | sendToLog "down_rate_limit_us=2000" 114 | fi 115 | 116 | if [ -e $3/hispeed_load ]; then 117 | lockFile $3/hispeed_load "90" 118 | sendToLog "hispeed_load=90" 119 | fi 120 | 121 | if [ -e $3/rate_limit_us ]; then 122 | lockFile $3/rate_limit_us "0" 123 | sendToLog "rate_limit_us=0" 124 | fi 125 | 126 | fi 127 | fi 128 | -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/battery/interactive: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR="$1" 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/boost ]; then 36 | lockFile $3/boost "0" 37 | sendToLog "boost=0" 38 | fi 39 | 40 | if [ -e $3/boostpulse_duration ]; then 41 | lockFile $3/boostpulse_duration "0" 42 | sendToLog "boostpulse_duration=0" 43 | fi 44 | 45 | if [ -e $3/fastlane ]; then 46 | lockFile $3/fastlane "1" 47 | sendToLog "fastlane=1" 48 | fi 49 | 50 | if [ -e $3/align_windows ]; then 51 | lockFile $3/align_windows "0" 52 | sendToLog "align_windows=0" 53 | fi 54 | 55 | if [ -e $3/use_migration_notif ]; then 56 | lockFile $3/use_migration_notif "1" 57 | sendToLog "use_migration_notif=1" 58 | fi 59 | 60 | if [ -e $3/use_sched_load ]; then 61 | lockFile $3/use_sched_load "1" 62 | sendToLog "use_sched_load=1" 63 | fi 64 | 65 | if [ -e $3/enable_prediction ]; then 66 | lockFile $3/enable_prediction "0" 67 | sendToLog "enable_prediction=0" 68 | fi 69 | 70 | if [ -e $3/fast_ramp_down ]; then 71 | lockFile $3/fast_ramp_down "1" 72 | sendToLog "fast_ramp_down=1" 73 | fi 74 | 75 | if [ -e $3/go_hispeed_load ]; then 76 | lockFile $3/go_hispeed_load "99" 77 | sendToLog "go_hispeed_load=99" 78 | fi 79 | 80 | if [ -e $3/timer_rate ]; then 81 | lockFile $3/timer_rate "12000" 82 | sendToLog "timer_rate=12000" 83 | fi 84 | 85 | if [ -e $3/io_is_busy ]; then 86 | lockFile $3/io_is_busy "0" 87 | sendToLog "io_is_busy=0" 88 | fi 89 | 90 | if [ -e $3/min_sample_time ]; then 91 | lockFile $3/min_sample_time "60000" 92 | sendToLog "min_sample_time=60000" 93 | fi 94 | fi 95 | 96 | elif [ $2 = "big" ]; then 97 | if [ -e $3 ]; then 98 | if [ -e $3/boost ]; then 99 | lockFile $3/boost "0" 100 | sendToLog "boost=0" 101 | fi 102 | 103 | if [ -e $3/boostpulse_duration ]; then 104 | lockFile $3/boostpulse_duration "0" 105 | sendToLog "boostpulse_duration=0" 106 | fi 107 | 108 | if [ -e $3/fastlane ]; then 109 | lockFile $3/fastlane "1" 110 | sendToLog "fastlane=1" 111 | fi 112 | 113 | if [ -e $3/align_windows ]; then 114 | lockFile $3/align_windows "0" 115 | sendToLog "align_windows=0" 116 | fi 117 | 118 | if [ -e $3/use_migration_notif ]; then 119 | lockFile $3/use_migration_notif "1" 120 | sendToLog "use_migration_notif=1" 121 | fi 122 | 123 | if [ -e $3/use_sched_load ]; then 124 | lockFile $3/use_sched_load "1" 125 | sendToLog "use_sched_load=1" 126 | fi 127 | 128 | if [ -e $3/enable_prediction ]; then 129 | lockFile $3/enable_prediction "0" 130 | sendToLog "enable_prediction=0" 131 | fi 132 | 133 | if [ -e $3/fast_ramp_down ]; then 134 | lockFile $3/fast_ramp_down "1" 135 | sendToLog "fast_ramp_down=1" 136 | fi 137 | 138 | if [ -e $3/go_hispeed_load ]; then 139 | lockFile $3/go_hispeed_load "99" 140 | sendToLog "go_hispeed_load=99" 141 | fi 142 | 143 | if [ -e $3/timer_rate ]; then 144 | lockFile $3/timer_rate "10000" 145 | sendToLog "timer_rate=10000" 146 | fi 147 | 148 | if [ -e $3/io_is_busy ]; then 149 | lockFile $3/io_is_busy "0" 150 | sendToLog "io_is_busy=0" 151 | fi 152 | 153 | if [ -e $3/min_sample_time ]; then 154 | lockFile $3/min_sample_time "40000" 155 | sendToLog "min_sample_time=40000" 156 | fi 157 | fi 158 | 159 | elif [ $2 = "little" ]; then 160 | if [ -e $3 ]; then 161 | if [ -e $3/boost ]; then 162 | lockFile $3/boost "0" 163 | sendToLog "boost=0" 164 | fi 165 | 166 | if [ -e $3/boostpulse_duration ]; then 167 | lockFile $3/boostpulse_duration "0" 168 | sendToLog "boostpulse_duration=0" 169 | fi 170 | 171 | if [ -e $3/fastlane ]; then 172 | lockFile $3/fastlane "1" 173 | sendToLog "fastlane=1" 174 | fi 175 | 176 | if [ -e $3/align_windows ]; then 177 | lockFile $3/align_windows "0" 178 | sendToLog "align_windows=0" 179 | fi 180 | 181 | if [ -e $3/use_migration_notif ]; then 182 | lockFile $3/use_migration_notif "1" 183 | sendToLog "use_migration_notif=1" 184 | fi 185 | 186 | if [ -e $3/use_sched_load ]; then 187 | lockFile $3/use_sched_load "1" 188 | sendToLog "use_sched_load=1" 189 | fi 190 | 191 | if [ -e $3/enable_prediction ]; then 192 | lockFile $3/enable_prediction "0" 193 | sendToLog "enable_prediction=0" 194 | fi 195 | 196 | if [ -e $3/fast_ramp_down ]; then 197 | lockFile $3/fast_ramp_down "1" 198 | sendToLog "fast_ramp_down=1" 199 | fi 200 | 201 | if [ -e $3/go_hispeed_load ]; then 202 | lockFile $3/go_hispeed_load "95" 203 | sendToLog "go_hispeed_load=95" 204 | fi 205 | 206 | if [ -e $3/timer_rate ]; then 207 | lockFile $3/timer_rate "10000" 208 | sendToLog "timer_rate=10000" 209 | fi 210 | 211 | if [ -e $3/io_is_busy ]; then 212 | lockFile $3/io_is_busy "0" 213 | sendToLog "io_is_busy=0" 214 | fi 215 | 216 | if [ -e $3/min_sample_time ]; then 217 | lockFile $3/min_sample_time "40000" 218 | sendToLog "min_sample_time=40000" 219 | fi 220 | fi 221 | 222 | elif [ $2 = "regular" ]; then 223 | if [ -e $3 ]; then 224 | if [ -e $3/boost ]; then 225 | lockFile $3/boost "0" 226 | sendToLog "boost=0" 227 | fi 228 | 229 | if [ -e $3/boostpulse_duration ]; then 230 | lockFile $3/boostpulse_duration "0" 231 | sendToLog "boostpulse_duration=0" 232 | fi 233 | 234 | if [ -e $3/fastlane ]; then 235 | lockFile $3/fastlane "1" 236 | sendToLog "fastlane=1" 237 | fi 238 | 239 | if [ -e $3/align_windows ]; then 240 | lockFile $3/align_windows "0" 241 | sendToLog "align_windows=0" 242 | fi 243 | 244 | if [ -e $3/use_migration_notif ]; then 245 | lockFile $3/use_migration_notif "1" 246 | sendToLog "use_migration_notif=1" 247 | fi 248 | 249 | if [ -e $3/use_sched_load ]; then 250 | lockFile $3/use_sched_load "1" 251 | sendToLog "use_sched_load=1" 252 | fi 253 | 254 | if [ -e $3/enable_prediction ]; then 255 | lockFile $3/enable_prediction "0" 256 | sendToLog "enable_prediction=0" 257 | fi 258 | 259 | if [ -e $3/fast_ramp_down ]; then 260 | lockFile $3/fast_ramp_down "1" 261 | sendToLog "fast_ramp_down=1" 262 | fi 263 | 264 | if [ -e $3/go_hispeed_load ]; then 265 | lockFile $3/go_hispeed_load "99" 266 | sendToLog "go_hispeed_load=99" 267 | fi 268 | 269 | if [ -e $3/timer_rate ]; then 270 | lockFile $3/timer_rate "10000" 271 | sendToLog "timer_rate=10000" 272 | fi 273 | 274 | if [ -e $3/io_is_busy ]; then 275 | lockFile $3/io_is_busy "0" 276 | sendToLog "io_is_busy=0" 277 | fi 278 | 279 | if [ -e $3/min_sample_time ]; then 280 | lockFile $3/min_sample_time "40000" 281 | sendToLog "min_sample_time=40000" 282 | fi 283 | fi 284 | 285 | fi 286 | -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/battery/ondemand: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR="$1" 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/up_threshold ]; then 36 | lockFile $3/up_threshold "90" 37 | sendToLog "up_threshold=90" 38 | fi 39 | 40 | if [ -e $3/up_threshold_any_cpu_load ]; then 41 | lockFile $3/up_threshold_any_cpu_load "85" 42 | sendToLog "up_threshold_any_cpu_load=85" 43 | fi 44 | 45 | if [ -e $3/up_threshold_multi_core ]; then 46 | lockFile $3/up_threshold_multi_core "85" 47 | sendToLog "up_threshold_multi_core=85" 48 | fi 49 | 50 | if [ -e $3/sampling_rate ]; then 51 | lockFile $3/sampling_rate "75000" 52 | sendToLog "sampling_rate=75000" 53 | fi 54 | 55 | if [ -e $3/sampling_down_factor ]; then 56 | lockFile $3/sampling_down_factor "2" 57 | sendToLog "sampling_down_factor=2" 58 | fi 59 | 60 | if [ -e $3/down_differential ]; then 61 | lockFile $3/down_differential "10" 62 | sendToLog "down_differential=10" 63 | fi 64 | 65 | if [ -e $3/freq_step ]; then 66 | lockFile $3/freq_step "35" 67 | sendToLog "freq_step=35" 68 | fi 69 | 70 | fi 71 | 72 | elif [ $2 = "big" ]; then 73 | if [ -e $3 ]; then 74 | if [ -e $3/up_threshold ]; then 75 | lockFile $3/up_threshold "90" 76 | sendToLog "up_threshold=90" 77 | fi 78 | 79 | if [ -e $3/up_threshold_any_cpu_load ]; then 80 | lockFile $3/up_threshold_any_cpu_load "85" 81 | sendToLog "up_threshold_any_cpu_load=85" 82 | fi 83 | 84 | if [ -e $3/up_threshold_multi_core ]; then 85 | lockFile $3/up_threshold_multi_core "85" 86 | sendToLog "up_threshold_multi_core=85" 87 | fi 88 | 89 | if [ -e $3/sampling_rate ]; then 90 | lockFile $3/sampling_rate "75000" 91 | sendToLog "sampling_rate=75000" 92 | fi 93 | 94 | if [ -e $3/sampling_down_factor ]; then 95 | lockFile $3/sampling_down_factor "2" 96 | sendToLog "sampling_down_factor=2" 97 | fi 98 | 99 | if [ -e $3/down_differential ]; then 100 | lockFile $3/down_differential "10" 101 | sendToLog "down_differential=10" 102 | fi 103 | 104 | if [ -e $3/freq_step ]; then 105 | lockFile $3/freq_step "35" 106 | sendToLog "freq_step=35" 107 | fi 108 | 109 | fi 110 | 111 | elif [ $2 = "little" ]; then 112 | if [ -e $3 ]; then 113 | if [ -e $3/up_threshold ]; then 114 | lockFile $3/up_threshold "90" 115 | sendToLog "up_threshold=90" 116 | fi 117 | 118 | if [ -e $3/up_threshold_any_cpu_load ]; then 119 | lockFile $3/up_threshold_any_cpu_load "85" 120 | sendToLog "up_threshold_any_cpu_load=85" 121 | fi 122 | 123 | if [ -e $3/up_threshold_multi_core ]; then 124 | lockFile $3/up_threshold_multi_core "85" 125 | sendToLog "up_threshold_multi_core=85" 126 | fi 127 | 128 | if [ -e $3/sampling_rate ]; then 129 | lockFile $3/sampling_rate "75000" 130 | sendToLog "sampling_rate=75000" 131 | fi 132 | 133 | if [ -e $3/sampling_down_factor ]; then 134 | lockFile $3/sampling_down_factor "2" 135 | sendToLog "sampling_down_factor=2" 136 | fi 137 | 138 | if [ -e $3/down_differential ]; then 139 | lockFile $3/down_differential "10" 140 | sendToLog "down_differential=10" 141 | fi 142 | 143 | if [ -e $3/freq_step ]; then 144 | lockFile $3/freq_step "35" 145 | sendToLog "freq_step=35" 146 | fi 147 | 148 | fi 149 | 150 | elif [ $2 = "regular" ]; then 151 | if [ -e $3 ]; then 152 | if [ -e $3/up_threshold ]; then 153 | lockFile $3/up_threshold "90" 154 | sendToLog "up_threshold=90" 155 | fi 156 | 157 | if [ -e $3/up_threshold_any_cpu_load ]; then 158 | lockFile $3/up_threshold_any_cpu_load "85" 159 | sendToLog "up_threshold_any_cpu_load=85" 160 | fi 161 | 162 | if [ -e $3/up_threshold_multi_core ]; then 163 | lockFile $3/up_threshold_multi_core "85" 164 | sendToLog "up_threshold_multi_core=85" 165 | fi 166 | 167 | if [ -e $3/sampling_rate ]; then 168 | lockFile $3/sampling_rate "75000" 169 | sendToLog "sampling_rate=75000" 170 | fi 171 | 172 | if [ -e $3/sampling_down_factor ]; then 173 | lockFile $3/sampling_down_factor "2" 174 | sendToLog "sampling_down_factor=2" 175 | fi 176 | 177 | if [ -e $3/down_differential ]; then 178 | lockFile $3/down_differential "10" 179 | sendToLog "down_differential=10" 180 | fi 181 | 182 | if [ -e $3/freq_step ]; then 183 | lockFile $3/freq_step "35" 184 | sendToLog "freq_step=35" 185 | fi 186 | 187 | fi 188 | 189 | fi 190 | -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/battery/optdemand: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR="$1" 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/up_threshold ]; then 36 | lockFile $3/up_threshold "90" 37 | sendToLog "up_threshold=90" 38 | fi 39 | 40 | if [ -e $3/up_threshold_any_cpu_load ]; then 41 | lockFile $3/up_threshold_any_cpu_load "85" 42 | sendToLog "up_threshold_any_cpu_load=85" 43 | fi 44 | 45 | if [ -e $3/up_threshold_multi_core ]; then 46 | lockFile $3/up_threshold_multi_core "85" 47 | sendToLog "up_threshold_multi_core=85" 48 | fi 49 | 50 | if [ -e $3/sampling_rate ]; then 51 | lockFile $3/sampling_rate "75000" 52 | sendToLog "sampling_rate=75000" 53 | fi 54 | 55 | if [ -e $3/sampling_down_factor ]; then 56 | lockFile $3/sampling_down_factor "2" 57 | sendToLog "sampling_down_factor=2" 58 | fi 59 | 60 | if [ -e $3/down_differential ]; then 61 | lockFile $3/down_differential "10" 62 | sendToLog "down_differential=10" 63 | fi 64 | 65 | if [ -e $3/freq_step ]; then 66 | lockFile $3/freq_step "35" 67 | sendToLog "freq_step=35" 68 | fi 69 | 70 | fi 71 | 72 | elif [ $2 = "big" ]; then 73 | if [ -e $3 ]; then 74 | if [ -e $3/up_threshold ]; then 75 | lockFile $3/up_threshold "90" 76 | sendToLog "up_threshold=90" 77 | fi 78 | 79 | if [ -e $3/up_threshold_any_cpu_load ]; then 80 | lockFile $3/up_threshold_any_cpu_load "85" 81 | sendToLog "up_threshold_any_cpu_load=85" 82 | fi 83 | 84 | if [ -e $3/up_threshold_multi_core ]; then 85 | lockFile $3/up_threshold_multi_core "85" 86 | sendToLog "up_threshold_multi_core=85" 87 | fi 88 | 89 | if [ -e $3/sampling_rate ]; then 90 | lockFile $3/sampling_rate "75000" 91 | sendToLog "sampling_rate=75000" 92 | fi 93 | 94 | if [ -e $3/sampling_down_factor ]; then 95 | lockFile $3/sampling_down_factor "2" 96 | sendToLog "sampling_down_factor=2" 97 | fi 98 | 99 | if [ -e $3/down_differential ]; then 100 | lockFile $3/down_differential "10" 101 | sendToLog "down_differential=10" 102 | fi 103 | 104 | if [ -e $3/freq_step ]; then 105 | lockFile $3/freq_step "35" 106 | sendToLog "freq_step=35" 107 | fi 108 | 109 | fi 110 | 111 | elif [ $2 = "little" ]; then 112 | if [ -e $3 ]; then 113 | if [ -e $3/up_threshold ]; then 114 | lockFile $3/up_threshold "90" 115 | sendToLog "up_threshold=90" 116 | fi 117 | 118 | if [ -e $3/up_threshold_any_cpu_load ]; then 119 | lockFile $3/up_threshold_any_cpu_load "85" 120 | sendToLog "up_threshold_any_cpu_load=85" 121 | fi 122 | 123 | if [ -e $3/up_threshold_multi_core ]; then 124 | lockFile $3/up_threshold_multi_core "85" 125 | sendToLog "up_threshold_multi_core=85" 126 | fi 127 | 128 | if [ -e $3/sampling_rate ]; then 129 | lockFile $3/sampling_rate "75000" 130 | sendToLog "sampling_rate=75000" 131 | fi 132 | 133 | if [ -e $3/sampling_down_factor ]; then 134 | lockFile $3/sampling_down_factor "2" 135 | sendToLog "sampling_down_factor=2" 136 | fi 137 | 138 | if [ -e $3/down_differential ]; then 139 | lockFile $3/down_differential "10" 140 | sendToLog "down_differential=10" 141 | fi 142 | 143 | if [ -e $3/freq_step ]; then 144 | lockFile $3/freq_step "35" 145 | sendToLog "freq_step=35" 146 | fi 147 | 148 | fi 149 | 150 | elif [ $2 = "regular" ]; then 151 | if [ -e $3 ]; then 152 | if [ -e $3/up_threshold ]; then 153 | lockFile $3/up_threshold "90" 154 | sendToLog "up_threshold=90" 155 | fi 156 | 157 | if [ -e $3/up_threshold_any_cpu_load ]; then 158 | lockFile $3/up_threshold_any_cpu_load "85" 159 | sendToLog "up_threshold_any_cpu_load=85" 160 | fi 161 | 162 | if [ -e $3/up_threshold_multi_core ]; then 163 | lockFile $3/up_threshold_multi_core "85" 164 | sendToLog "up_threshold_multi_core=85" 165 | fi 166 | 167 | if [ -e $3/sampling_rate ]; then 168 | lockFile $3/sampling_rate "75000" 169 | sendToLog "sampling_rate=75000" 170 | fi 171 | 172 | if [ -e $3/sampling_down_factor ]; then 173 | lockFile $3/sampling_down_factor "2" 174 | sendToLog "sampling_down_factor=2" 175 | fi 176 | 177 | if [ -e $3/down_differential ]; then 178 | lockFile $3/down_differential "10" 179 | sendToLog "down_differential=10" 180 | fi 181 | 182 | if [ -e $3/freq_step ]; then 183 | lockFile $3/freq_step "35" 184 | sendToLog "freq_step=35" 185 | fi 186 | 187 | fi 188 | 189 | fi 190 | -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/battery/schedutil: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR="$1" 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/up_rate_limit_us ]; then 36 | lockFile $3/up_rate_limit_us "10000" 37 | sendToLog "up_rate_limit_us=10000" 38 | fi 39 | 40 | if [ -e $3/down_rate_limit_us ]; then 41 | lockFile $3/down_rate_limit_us "1000" 42 | sendToLog "down_rate_limit_us=1000" 43 | fi 44 | 45 | if [ -e $3/hispeed_load ]; then 46 | lockFile $3/hispeed_load "95" 47 | sendToLog "hispeed_load=95" 48 | fi 49 | 50 | if [ -e $3/rate_limit_us ]; then 51 | lockFile $3/rate_limit_us "0" 52 | sendToLog "rate_limit_us=0" 53 | fi 54 | 55 | fi 56 | 57 | elif [ $2 = "big" ]; then 58 | if [ -e $3 ]; then 59 | if [ -e $3/up_rate_limit_us ]; then 60 | lockFile $3/up_rate_limit_us "6000" 61 | sendToLog "up_rate_limit_us=6000" 62 | fi 63 | 64 | if [ -e $3/down_rate_limit_us ]; then 65 | lockFile $3/down_rate_limit_us "1000" 66 | sendToLog "down_rate_limit_us=1000" 67 | fi 68 | 69 | if [ -e $3/hispeed_load ]; then 70 | lockFile $3/hispeed_load "95" 71 | sendToLog "hispeed_load=95" 72 | fi 73 | 74 | if [ -e $3/rate_limit_us ]; then 75 | lockFile $3/rate_limit_us "0" 76 | sendToLog "rate_limit_us=0" 77 | fi 78 | 79 | fi 80 | 81 | elif [ $2 = "little" ]; then 82 | if [ -e $3 ]; then 83 | if [ -e $3/up_rate_limit_us ]; then 84 | lockFile $3/up_rate_limit_us "3000" 85 | sendToLog "up_rate_limit_us=3000" 86 | fi 87 | 88 | if [ -e $3/down_rate_limit_us ]; then 89 | lockFile $3/down_rate_limit_us "1000" 90 | sendToLog "down_rate_limit_us=1000" 91 | fi 92 | 93 | if [ -e $3/hispeed_load ]; then 94 | lockFile $3/hispeed_load "95" 95 | sendToLog "hispeed_load=95" 96 | fi 97 | 98 | if [ -e $3/rate_limit_us ]; then 99 | lockFile $3/rate_limit_us "0" 100 | sendToLog "rate_limit_us=0" 101 | fi 102 | 103 | fi 104 | 105 | elif [ $2 = "regular" ]; then 106 | if [ -e $3 ]; then 107 | if [ -e $3/up_rate_limit_us ]; then 108 | lockFile $3/up_rate_limit_us "3000" 109 | sendToLog "up_rate_limit_us=3000" 110 | fi 111 | 112 | if [ -e $3/down_rate_limit_us ]; then 113 | lockFile $3/down_rate_limit_us "1000" 114 | sendToLog "down_rate_limit_us=1000" 115 | fi 116 | 117 | if [ -e $3/hispeed_load ]; then 118 | lockFile $3/hispeed_load "95" 119 | sendToLog "hispeed_load=95" 120 | fi 121 | 122 | if [ -e $3/rate_limit_us ]; then 123 | lockFile $3/rate_limit_us "0" 124 | sendToLog "rate_limit_us=0" 125 | fi 126 | 127 | fi 128 | 129 | fi 130 | -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/battery/schedutilX: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR="$1" 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/up_rate_limit_us ]; then 36 | lockFile $3/up_rate_limit_us "10000" 37 | sendToLog "up_rate_limit_us=10000" 38 | fi 39 | 40 | if [ -e $3/down_rate_limit_us ]; then 41 | lockFile $3/down_rate_limit_us "1000" 42 | sendToLog "down_rate_limit_us=1000" 43 | fi 44 | 45 | if [ -e $3/hispeed_load ]; then 46 | lockFile $3/hispeed_load "95" 47 | sendToLog "hispeed_load=95" 48 | fi 49 | 50 | if [ -e $3/rate_limit_us ]; then 51 | lockFile $3/rate_limit_us "0" 52 | sendToLog "rate_limit_us=0" 53 | fi 54 | 55 | fi 56 | 57 | elif [ $2 = "big" ]; then 58 | if [ -e $3 ]; then 59 | if [ -e $3/up_rate_limit_us ]; then 60 | lockFile $3/up_rate_limit_us "6000" 61 | sendToLog "up_rate_limit_us=6000" 62 | fi 63 | 64 | if [ -e $3/down_rate_limit_us ]; then 65 | lockFile $3/down_rate_limit_us "1000" 66 | sendToLog "down_rate_limit_us=1000" 67 | fi 68 | 69 | if [ -e $3/hispeed_load ]; then 70 | lockFile $3/hispeed_load "95" 71 | sendToLog "hispeed_load=95" 72 | fi 73 | 74 | if [ -e $3/rate_limit_us ]; then 75 | lockFile $3/rate_limit_us "0" 76 | sendToLog "rate_limit_us=0" 77 | fi 78 | 79 | fi 80 | 81 | elif [ $2 = "little" ]; then 82 | if [ -e $3 ]; then 83 | if [ -e $3/up_rate_limit_us ]; then 84 | lockFile $3/up_rate_limit_us "3000" 85 | sendToLog "up_rate_limit_us=3000" 86 | fi 87 | 88 | if [ -e $3/down_rate_limit_us ]; then 89 | lockFile $3/down_rate_limit_us "1000" 90 | sendToLog "down_rate_limit_us=1000" 91 | fi 92 | 93 | if [ -e $3/hispeed_load ]; then 94 | lockFile $3/hispeed_load "95" 95 | sendToLog "hispeed_load=95" 96 | fi 97 | 98 | if [ -e $3/rate_limit_us ]; then 99 | lockFile $3/rate_limit_us "0" 100 | sendToLog "rate_limit_us=0" 101 | fi 102 | 103 | fi 104 | 105 | elif [ $2 = "regular" ]; then 106 | if [ -e $3 ]; then 107 | if [ -e $3/up_rate_limit_us ]; then 108 | lockFile $3/up_rate_limit_us "3000" 109 | sendToLog "up_rate_limit_us=3000" 110 | fi 111 | 112 | if [ -e $3/down_rate_limit_us ]; then 113 | lockFile $3/down_rate_limit_us "1000" 114 | sendToLog "down_rate_limit_us=1000" 115 | fi 116 | 117 | if [ -e $3/hispeed_load ]; then 118 | lockFile $3/hispeed_load "95" 119 | sendToLog "hispeed_load=95" 120 | fi 121 | 122 | if [ -e $3/rate_limit_us ]; then 123 | lockFile $3/rate_limit_us "0" 124 | sendToLog "rate_limit_us=0" 125 | fi 126 | 127 | fi 128 | 129 | fi 130 | -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/performance/interactive: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR="$1" 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/boost ]; then 36 | lockFile $3/boost "0" 37 | sendToLog "boost=0" 38 | fi 39 | 40 | if [ -e $3/boostpulse_duration ]; then 41 | lockFile $3/boostpulse_duration "0" 42 | sendToLog "boostpulse_duration=0" 43 | fi 44 | 45 | if [ -e $3/fastlane ]; then 46 | lockFile $3/fastlane "1" 47 | sendToLog "fastlane=1" 48 | fi 49 | 50 | if [ -e $3/align_windows ]; then 51 | lockFile $3/align_windows "0" 52 | sendToLog "align_windows=0" 53 | fi 54 | 55 | if [ -e $3/use_migration_notif ]; then 56 | lockFile $3/use_migration_notif "1" 57 | sendToLog "use_migration_notif=1" 58 | fi 59 | 60 | if [ -e $3/use_sched_load ]; then 61 | lockFile $3/use_sched_load "1" 62 | sendToLog "use_sched_load=1" 63 | fi 64 | 65 | if [ -e $3/enable_prediction ]; then 66 | lockFile $3/enable_prediction "0" 67 | sendToLog "enable_prediction=0" 68 | fi 69 | 70 | if [ -e $3/fast_ramp_down ]; then 71 | lockFile $3/fast_ramp_down "1" 72 | sendToLog "fast_ramp_down=1" 73 | fi 74 | 75 | if [ -e $3/go_hispeed_load ]; then 76 | lockFile $3/go_hispeed_load "85" 77 | sendToLog "go_hispeed_load=85" 78 | fi 79 | 80 | if [ -e $3/timer_rate ]; then 81 | lockFile $3/timer_rate "12000" 82 | sendToLog "timer_rate=12000" 83 | fi 84 | 85 | if [ -e $3/io_is_busy ]; then 86 | lockFile $3/io_is_busy "0" 87 | sendToLog "io_is_busy=0" 88 | fi 89 | 90 | if [ -e $3/min_sample_time ]; then 91 | lockFile $3/min_sample_time "60000" 92 | sendToLog "min_sample_time=60000" 93 | fi 94 | fi 95 | 96 | elif [ $2 = "big" ]; then 97 | if [ -e $3 ]; then 98 | if [ -e $3/boost ]; then 99 | lockFile $3/boost "0" 100 | sendToLog "boost=0" 101 | fi 102 | 103 | if [ -e $3/boostpulse_duration ]; then 104 | lockFile $3/boostpulse_duration "0" 105 | sendToLog "boostpulse_duration=0" 106 | fi 107 | 108 | if [ -e $3/fastlane ]; then 109 | lockFile $3/fastlane "1" 110 | sendToLog "fastlane=1" 111 | fi 112 | 113 | if [ -e $3/align_windows ]; then 114 | lockFile $3/align_windows "0" 115 | sendToLog "align_windows=0" 116 | fi 117 | 118 | if [ -e $3/use_migration_notif ]; then 119 | lockFile $3/use_migration_notif "1" 120 | sendToLog "use_migration_notif=1" 121 | fi 122 | 123 | if [ -e $3/use_sched_load ]; then 124 | lockFile $3/use_sched_load "1" 125 | sendToLog "use_sched_load=1" 126 | fi 127 | 128 | if [ -e $3/enable_prediction ]; then 129 | lockFile $3/enable_prediction "0" 130 | sendToLog "enable_prediction=0" 131 | fi 132 | 133 | if [ -e $3/fast_ramp_down ]; then 134 | lockFile $3/fast_ramp_down "1" 135 | sendToLog "fast_ramp_down=1" 136 | fi 137 | 138 | if [ -e $3/go_hispeed_load ]; then 139 | lockFile $3/go_hispeed_load "90" 140 | sendToLog "go_hispeed_load=90" 141 | fi 142 | 143 | if [ -e $3/timer_rate ]; then 144 | lockFile $3/timer_rate "10000" 145 | sendToLog "timer_rate=10000" 146 | fi 147 | 148 | if [ -e $3/io_is_busy ]; then 149 | lockFile $3/io_is_busy "0" 150 | sendToLog "io_is_busy=0" 151 | fi 152 | 153 | if [ -e $3/min_sample_time ]; then 154 | lockFile $3/min_sample_time "40000" 155 | sendToLog "min_sample_time=40000" 156 | fi 157 | fi 158 | 159 | elif [ $2 = "little" ]; then 160 | if [ -e $3 ]; then 161 | if [ -e $3/boost ]; then 162 | lockFile $3/boost "0" 163 | sendToLog "boost=0" 164 | fi 165 | 166 | if [ -e $3/boostpulse_duration ]; then 167 | lockFile $3/boostpulse_duration "0" 168 | sendToLog "boostpulse_duration=0" 169 | fi 170 | 171 | if [ -e $3/fastlane ]; then 172 | lockFile $3/fastlane "1" 173 | sendToLog "fastlane=1" 174 | fi 175 | 176 | if [ -e $3/align_windows ]; then 177 | lockFile $3/align_windows "0" 178 | sendToLog "align_windows=0" 179 | fi 180 | 181 | if [ -e $3/use_migration_notif ]; then 182 | lockFile $3/use_migration_notif "1" 183 | sendToLog "use_migration_notif=1" 184 | fi 185 | 186 | if [ -e $3/use_sched_load ]; then 187 | lockFile $3/use_sched_load "1" 188 | sendToLog "use_sched_load=1" 189 | fi 190 | 191 | if [ -e $3/enable_prediction ]; then 192 | lockFile $3/enable_prediction "0" 193 | sendToLog "enable_prediction=0" 194 | fi 195 | 196 | if [ -e $3/fast_ramp_down ]; then 197 | lockFile $3/fast_ramp_down "1" 198 | sendToLog "fast_ramp_down=1" 199 | fi 200 | 201 | if [ -e $3/go_hispeed_load ]; then 202 | lockFile $3/go_hispeed_load "90" 203 | sendToLog "go_hispeed_load=90" 204 | fi 205 | 206 | if [ -e $3/timer_rate ]; then 207 | lockFile $3/timer_rate "10000" 208 | sendToLog "timer_rate=10000" 209 | fi 210 | 211 | if [ -e $3/io_is_busy ]; then 212 | lockFile $3/io_is_busy "0" 213 | sendToLog "io_is_busy=0" 214 | fi 215 | 216 | if [ -e $3/min_sample_time ]; then 217 | lockFile $3/min_sample_time "40000" 218 | sendToLog "min_sample_time=40000" 219 | fi 220 | fi 221 | 222 | elif [ $2 = "regular" ]; then 223 | if [ -e $3 ]; then 224 | if [ -e $3/boost ]; then 225 | lockFile $3/boost "0" 226 | sendToLog "boost=0" 227 | fi 228 | 229 | if [ -e $3/boostpulse_duration ]; then 230 | lockFile $3/boostpulse_duration "0" 231 | sendToLog "boostpulse_duration=0" 232 | fi 233 | 234 | if [ -e $3/fastlane ]; then 235 | lockFile $3/fastlane "1" 236 | sendToLog "fastlane=1" 237 | fi 238 | 239 | if [ -e $3/align_windows ]; then 240 | lockFile $3/align_windows "0" 241 | sendToLog "align_windows=0" 242 | fi 243 | 244 | if [ -e $3/use_migration_notif ]; then 245 | lockFile $3/use_migration_notif "1" 246 | sendToLog "use_migration_notif=1" 247 | fi 248 | 249 | if [ -e $3/use_sched_load ]; then 250 | lockFile $3/use_sched_load "1" 251 | sendToLog "use_sched_load=1" 252 | fi 253 | 254 | if [ -e $3/enable_prediction ]; then 255 | lockFile $3/enable_prediction "0" 256 | sendToLog "enable_prediction=0" 257 | fi 258 | 259 | if [ -e $3/fast_ramp_down ]; then 260 | lockFile $3/fast_ramp_down "1" 261 | sendToLog "fast_ramp_down=1" 262 | fi 263 | 264 | if [ -e $3/go_hispeed_load ]; then 265 | lockFile $3/go_hispeed_load "90" 266 | sendToLog "go_hispeed_load=90" 267 | fi 268 | 269 | if [ -e $3/timer_rate ]; then 270 | lockFile $3/timer_rate "10000" 271 | sendToLog "timer_rate=10000" 272 | fi 273 | 274 | if [ -e $3/io_is_busy ]; then 275 | lockFile $3/io_is_busy "0" 276 | sendToLog "io_is_busy=0" 277 | fi 278 | 279 | if [ -e $3/min_sample_time ]; then 280 | lockFile $3/min_sample_time "40000" 281 | sendToLog "min_sample_time=40000" 282 | fi 283 | fi 284 | 285 | fi 286 | -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/performance/ondemand: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR="$1" 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/up_threshold ]; then 36 | lockFile $3/up_threshold "90" 37 | sendToLog "up_threshold=90" 38 | fi 39 | 40 | if [ -e $3/up_threshold_any_cpu_load ]; then 41 | lockFile $3/up_threshold_any_cpu_load "85" 42 | sendToLog "up_threshold_any_cpu_load=85" 43 | fi 44 | 45 | if [ -e $3/up_threshold_multi_core ]; then 46 | lockFile $3/up_threshold_multi_core "85" 47 | sendToLog "up_threshold_multi_core=85" 48 | fi 49 | 50 | if [ -e $3/sampling_rate ]; then 51 | lockFile $3/sampling_rate "75000" 52 | sendToLog "sampling_rate=75000" 53 | fi 54 | 55 | if [ -e $3/sampling_down_factor ]; then 56 | lockFile $3/sampling_down_factor "2" 57 | sendToLog "sampling_down_factor=2" 58 | fi 59 | 60 | if [ -e $3/down_differential ]; then 61 | lockFile $3/down_differential "10" 62 | sendToLog "down_differential=10" 63 | fi 64 | 65 | if [ -e $3/freq_step ]; then 66 | lockFile $3/freq_step "35" 67 | sendToLog "freq_step=35" 68 | fi 69 | 70 | fi 71 | 72 | elif [ $2 = "big" ]; then 73 | if [ -e $3 ]; then 74 | if [ -e $3/up_threshold ]; then 75 | lockFile $3/up_threshold "90" 76 | sendToLog "up_threshold=90" 77 | fi 78 | 79 | if [ -e $3/up_threshold_any_cpu_load ]; then 80 | lockFile $3/up_threshold_any_cpu_load "85" 81 | sendToLog "up_threshold_any_cpu_load=85" 82 | fi 83 | 84 | if [ -e $3/up_threshold_multi_core ]; then 85 | lockFile $3/up_threshold_multi_core "85" 86 | sendToLog "up_threshold_multi_core=85" 87 | fi 88 | 89 | if [ -e $3/sampling_rate ]; then 90 | lockFile $3/sampling_rate "75000" 91 | sendToLog "sampling_rate=75000" 92 | fi 93 | 94 | if [ -e $3/sampling_down_factor ]; then 95 | lockFile $3/sampling_down_factor "2" 96 | sendToLog "sampling_down_factor=2" 97 | fi 98 | 99 | if [ -e $3/down_differential ]; then 100 | lockFile $3/down_differential "10" 101 | sendToLog "down_differential=10" 102 | fi 103 | 104 | if [ -e $3/freq_step ]; then 105 | lockFile $3/freq_step "35" 106 | sendToLog "freq_step=35" 107 | fi 108 | 109 | fi 110 | 111 | elif [ $2 = "little" ]; then 112 | if [ -e $3 ]; then 113 | if [ -e $3/up_threshold ]; then 114 | lockFile $3/up_threshold "90" 115 | sendToLog "up_threshold=90" 116 | fi 117 | 118 | if [ -e $3/up_threshold_any_cpu_load ]; then 119 | lockFile $3/up_threshold_any_cpu_load "85" 120 | sendToLog "up_threshold_any_cpu_load=85" 121 | fi 122 | 123 | if [ -e $3/up_threshold_multi_core ]; then 124 | lockFile $3/up_threshold_multi_core "85" 125 | sendToLog "up_threshold_multi_core=85" 126 | fi 127 | 128 | if [ -e $3/sampling_rate ]; then 129 | lockFile $3/sampling_rate "75000" 130 | sendToLog "sampling_rate=75000" 131 | fi 132 | 133 | if [ -e $3/sampling_down_factor ]; then 134 | lockFile $3/sampling_down_factor "2" 135 | sendToLog "sampling_down_factor=2" 136 | fi 137 | 138 | if [ -e $3/down_differential ]; then 139 | lockFile $3/down_differential "10" 140 | sendToLog "down_differential=10" 141 | fi 142 | 143 | if [ -e $3/freq_step ]; then 144 | lockFile $3/freq_step "35" 145 | sendToLog "freq_step=35" 146 | fi 147 | 148 | fi 149 | 150 | elif [ $2 = "regular" ]; then 151 | if [ -e $3 ]; then 152 | if [ -e $3/up_threshold ]; then 153 | lockFile $3/up_threshold "90" 154 | sendToLog "up_threshold=90" 155 | fi 156 | 157 | if [ -e $3/up_threshold_any_cpu_load ]; then 158 | lockFile $3/up_threshold_any_cpu_load "85" 159 | sendToLog "up_threshold_any_cpu_load=85" 160 | fi 161 | 162 | if [ -e $3/up_threshold_multi_core ]; then 163 | lockFile $3/up_threshold_multi_core "85" 164 | sendToLog "up_threshold_multi_core=85" 165 | fi 166 | 167 | if [ -e $3/sampling_rate ]; then 168 | lockFile $3/sampling_rate "75000" 169 | sendToLog "sampling_rate=75000" 170 | fi 171 | 172 | if [ -e $3/sampling_down_factor ]; then 173 | lockFile $3/sampling_down_factor "2" 174 | sendToLog "sampling_down_factor=2" 175 | fi 176 | 177 | if [ -e $3/down_differential ]; then 178 | lockFile $3/down_differential "10" 179 | sendToLog "down_differential=10" 180 | fi 181 | 182 | if [ -e $3/freq_step ]; then 183 | lockFile $3/freq_step "35" 184 | sendToLog "freq_step=35" 185 | fi 186 | 187 | fi 188 | 189 | fi 190 | -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/performance/optdemand: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR="$1" 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/up_threshold ]; then 36 | lockFile $3/up_threshold "90" 37 | sendToLog "up_threshold=90" 38 | fi 39 | 40 | if [ -e $3/up_threshold_any_cpu_load ]; then 41 | lockFile $3/up_threshold_any_cpu_load "85" 42 | sendToLog "up_threshold_any_cpu_load=85" 43 | fi 44 | 45 | if [ -e $3/up_threshold_multi_core ]; then 46 | lockFile $3/up_threshold_multi_core "85" 47 | sendToLog "up_threshold_multi_core=85" 48 | fi 49 | 50 | if [ -e $3/sampling_rate ]; then 51 | lockFile $3/sampling_rate "75000" 52 | sendToLog "sampling_rate=75000" 53 | fi 54 | 55 | if [ -e $3/sampling_down_factor ]; then 56 | lockFile $3/sampling_down_factor "2" 57 | sendToLog "sampling_down_factor=2" 58 | fi 59 | 60 | if [ -e $3/down_differential ]; then 61 | lockFile $3/down_differential "10" 62 | sendToLog "down_differential=10" 63 | fi 64 | 65 | if [ -e $3/freq_step ]; then 66 | lockFile $3/freq_step "35" 67 | sendToLog "freq_step=35" 68 | fi 69 | 70 | fi 71 | 72 | elif [ $2 = "big" ]; then 73 | if [ -e $3 ]; then 74 | if [ -e $3/up_threshold ]; then 75 | lockFile $3/up_threshold "90" 76 | sendToLog "up_threshold=90" 77 | fi 78 | 79 | if [ -e $3/up_threshold_any_cpu_load ]; then 80 | lockFile $3/up_threshold_any_cpu_load "85" 81 | sendToLog "up_threshold_any_cpu_load=85" 82 | fi 83 | 84 | if [ -e $3/up_threshold_multi_core ]; then 85 | lockFile $3/up_threshold_multi_core "85" 86 | sendToLog "up_threshold_multi_core=85" 87 | fi 88 | 89 | if [ -e $3/sampling_rate ]; then 90 | lockFile $3/sampling_rate "75000" 91 | sendToLog "sampling_rate=75000" 92 | fi 93 | 94 | if [ -e $3/sampling_down_factor ]; then 95 | lockFile $3/sampling_down_factor "2" 96 | sendToLog "sampling_down_factor=2" 97 | fi 98 | 99 | if [ -e $3/down_differential ]; then 100 | lockFile $3/down_differential "10" 101 | sendToLog "down_differential=10" 102 | fi 103 | 104 | if [ -e $3/freq_step ]; then 105 | lockFile $3/freq_step "35" 106 | sendToLog "freq_step=35" 107 | fi 108 | 109 | fi 110 | 111 | elif [ $2 = "little" ]; then 112 | if [ -e $3 ]; then 113 | if [ -e $3/up_threshold ]; then 114 | lockFile $3/up_threshold "90" 115 | sendToLog "up_threshold=90" 116 | fi 117 | 118 | if [ -e $3/up_threshold_any_cpu_load ]; then 119 | lockFile $3/up_threshold_any_cpu_load "85" 120 | sendToLog "up_threshold_any_cpu_load=85" 121 | fi 122 | 123 | if [ -e $3/up_threshold_multi_core ]; then 124 | lockFile $3/up_threshold_multi_core "85" 125 | sendToLog "up_threshold_multi_core=85" 126 | fi 127 | 128 | if [ -e $3/sampling_rate ]; then 129 | lockFile $3/sampling_rate "75000" 130 | sendToLog "sampling_rate=75000" 131 | fi 132 | 133 | if [ -e $3/sampling_down_factor ]; then 134 | lockFile $3/sampling_down_factor "2" 135 | sendToLog "sampling_down_factor=2" 136 | fi 137 | 138 | if [ -e $3/down_differential ]; then 139 | lockFile $3/down_differential "10" 140 | sendToLog "down_differential=10" 141 | fi 142 | 143 | if [ -e $3/freq_step ]; then 144 | lockFile $3/freq_step "35" 145 | sendToLog "freq_step=35" 146 | fi 147 | 148 | fi 149 | 150 | elif [ $2 = "regular" ]; then 151 | if [ -e $3 ]; then 152 | if [ -e $3/up_threshold ]; then 153 | lockFile $3/up_threshold "90" 154 | sendToLog "up_threshold=90" 155 | fi 156 | 157 | if [ -e $3/up_threshold_any_cpu_load ]; then 158 | lockFile $3/up_threshold_any_cpu_load "85" 159 | sendToLog "up_threshold_any_cpu_load=85" 160 | fi 161 | 162 | if [ -e $3/up_threshold_multi_core ]; then 163 | lockFile $3/up_threshold_multi_core "85" 164 | sendToLog "up_threshold_multi_core=85" 165 | fi 166 | 167 | if [ -e $3/sampling_rate ]; then 168 | lockFile $3/sampling_rate "75000" 169 | sendToLog "sampling_rate=75000" 170 | fi 171 | 172 | if [ -e $3/sampling_down_factor ]; then 173 | lockFile $3/sampling_down_factor "2" 174 | sendToLog "sampling_down_factor=2" 175 | fi 176 | 177 | if [ -e $3/down_differential ]; then 178 | lockFile $3/down_differential "10" 179 | sendToLog "down_differential=10" 180 | fi 181 | 182 | if [ -e $3/freq_step ]; then 183 | lockFile $3/freq_step "35" 184 | sendToLog "freq_step=35" 185 | fi 186 | 187 | fi 188 | 189 | fi 190 | -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/performance/schedutil: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR="$1" 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/up_rate_limit_us ]; then 36 | lockFile $3/up_rate_limit_us "1000" 37 | sendToLog "up_rate_limit_us=1000" 38 | fi 39 | 40 | if [ -e $3/down_rate_limit_us ]; then 41 | lockFile $3/down_rate_limit_us "5000" 42 | sendToLog "down_rate_limit_us=5000" 43 | fi 44 | 45 | if [ -e $3/hispeed_load ]; then 46 | lockFile $3/hispeed_load "90" 47 | sendToLog "hispeed_load=90" 48 | fi 49 | 50 | if [ -e $3/rate_limit_us ]; then 51 | lockFile $3/rate_limit_us "0" 52 | sendToLog "rate_limit_us=0" 53 | fi 54 | 55 | fi 56 | 57 | elif [ $2 = "big" ]; then 58 | if [ -e $3 ]; then 59 | if [ -e $3/up_rate_limit_us ]; then 60 | lockFile $3/up_rate_limit_us "1000" 61 | sendToLog "up_rate_limit_us=1000" 62 | fi 63 | 64 | if [ -e $3/down_rate_limit_us ]; then 65 | lockFile $3/down_rate_limit_us "5000" 66 | sendToLog "down_rate_limit_us=5000" 67 | fi 68 | 69 | if [ -e $3/hispeed_load ]; then 70 | lockFile $3/hispeed_load "90" 71 | sendToLog "hispeed_load=90" 72 | fi 73 | 74 | if [ -e $3/rate_limit_us ]; then 75 | lockFile $3/rate_limit_us "0" 76 | sendToLog "rate_limit_us=0" 77 | fi 78 | 79 | fi 80 | 81 | elif [ $2 = "little" ]; then 82 | if [ -e $3 ]; then 83 | if [ -e $3/up_rate_limit_us ]; then 84 | lockFile $3/up_rate_limit_us "1000" 85 | sendToLog "up_rate_limit_us=1000" 86 | fi 87 | 88 | if [ -e $3/down_rate_limit_us ]; then 89 | lockFile $3/down_rate_limit_us "3000" 90 | sendToLog "down_rate_limit_us=3000" 91 | fi 92 | 93 | if [ -e $3/hispeed_load ]; then 94 | lockFile $3/hispeed_load "85" 95 | sendToLog "hispeed_load=85" 96 | fi 97 | 98 | if [ -e $3/rate_limit_us ]; then 99 | lockFile $3/rate_limit_us "0" 100 | sendToLog "rate_limit_us=0" 101 | fi 102 | 103 | fi 104 | 105 | elif [ $2 = "regular" ]; then 106 | if [ -e $3 ]; then 107 | if [ -e $3/up_rate_limit_us ]; then 108 | lockFile $3/up_rate_limit_us "1000" 109 | sendToLog "up_rate_limit_us=1000" 110 | fi 111 | 112 | if [ -e $3/down_rate_limit_us ]; then 113 | lockFile $3/down_rate_limit_us "3000" 114 | sendToLog "down_rate_limit_us=3000" 115 | fi 116 | 117 | if [ -e $3/hispeed_load ]; then 118 | lockFile $3/hispeed_load "85" 119 | sendToLog "hispeed_load=85" 120 | fi 121 | 122 | if [ -e $3/rate_limit_us ]; then 123 | lockFile $3/rate_limit_us "0" 124 | sendToLog "rate_limit_us=0" 125 | fi 126 | fi 127 | fi 128 | -------------------------------------------------------------------------------- /system/etc/lspeed/governor_tuner_presets/performance/schedutilX: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | ######## 4 | #PATHS # 5 | ######## 6 | # Path where logs and setup is stored 7 | LSPEED_DATA_DIR="$1" 8 | LOG_DIR=$LSPEED_DATA_DIR/log 9 | LOG=$LOG_DIR/main_log.log 10 | 11 | # Path for executables and busybox 12 | BINARY_DIR=$LSPEED_DATA_DIR/binary 13 | BUSYBOX=$BINARY_DIR/busybox 14 | 15 | sendToLog() { 16 | timeZone=$(getprop persist.sys.timezone) 17 | printDate=$(TZ="$timeZone" $BUSYBOX date +"%H:%M:%S:%3N %d-%m-%Y") 18 | 19 | echo "[$printDate] $1" >> $LOG 20 | } 21 | 22 | write() { 23 | #chmod 0644 "$1" 24 | echo "$2" > "$1" 25 | } 26 | 27 | lockFile() { 28 | chmod 0644 "$1" 29 | echo "$2" > "$1" 30 | chmod 0444 "$1" 31 | } 32 | 33 | if [ $2 = "prime" ]; then 34 | if [ -e $3 ]; then 35 | if [ -e $3/up_rate_limit_us ]; then 36 | lockFile $3/up_rate_limit_us "1000" 37 | sendToLog "up_rate_limit_us=1000" 38 | fi 39 | 40 | if [ -e $3/down_rate_limit_us ]; then 41 | lockFile $3/down_rate_limit_us "5000" 42 | sendToLog "down_rate_limit_us=5000" 43 | fi 44 | 45 | if [ -e $3/hispeed_load ]; then 46 | lockFile $3/hispeed_load "90" 47 | sendToLog "hispeed_load=90" 48 | fi 49 | 50 | if [ -e $3/rate_limit_us ]; then 51 | lockFile $3/rate_limit_us "0" 52 | sendToLog "rate_limit_us=0" 53 | fi 54 | 55 | fi 56 | 57 | elif [ $2 = "big" ]; then 58 | if [ -e $3 ]; then 59 | if [ -e $3/up_rate_limit_us ]; then 60 | lockFile $3/up_rate_limit_us "1000" 61 | sendToLog "up_rate_limit_us=1000" 62 | fi 63 | 64 | if [ -e $3/down_rate_limit_us ]; then 65 | lockFile $3/down_rate_limit_us "5000" 66 | sendToLog "down_rate_limit_us=5000" 67 | fi 68 | 69 | if [ -e $3/hispeed_load ]; then 70 | lockFile $3/hispeed_load "90" 71 | sendToLog "hispeed_load=90" 72 | fi 73 | 74 | if [ -e $3/rate_limit_us ]; then 75 | lockFile $3/rate_limit_us "0" 76 | sendToLog "rate_limit_us=0" 77 | fi 78 | 79 | fi 80 | 81 | elif [ $2 = "little" ]; then 82 | if [ -e $3 ]; then 83 | if [ -e $3/up_rate_limit_us ]; then 84 | lockFile $3/up_rate_limit_us "1000" 85 | sendToLog "up_rate_limit_us=1000" 86 | fi 87 | 88 | if [ -e $3/down_rate_limit_us ]; then 89 | lockFile $3/down_rate_limit_us "3000" 90 | sendToLog "down_rate_limit_us=3000" 91 | fi 92 | 93 | if [ -e $3/hispeed_load ]; then 94 | lockFile $3/hispeed_load "85" 95 | sendToLog "hispeed_load=85" 96 | fi 97 | 98 | if [ -e $3/rate_limit_us ]; then 99 | lockFile $3/rate_limit_us "0" 100 | sendToLog "rate_limit_us=0" 101 | fi 102 | 103 | fi 104 | 105 | elif [ $2 = "regular" ]; then 106 | if [ -e $3 ]; then 107 | if [ -e $3/up_rate_limit_us ]; then 108 | lockFile $3/up_rate_limit_us "1000" 109 | sendToLog "up_rate_limit_us=1000" 110 | fi 111 | 112 | if [ -e $3/down_rate_limit_us ]; then 113 | lockFile $3/down_rate_limit_us "3000" 114 | sendToLog "down_rate_limit_us=3000" 115 | fi 116 | 117 | if [ -e $3/hispeed_load ]; then 118 | lockFile $3/hispeed_load "85" 119 | sendToLog "hispeed_load=85" 120 | fi 121 | 122 | if [ -e $3/rate_limit_us ]; then 123 | lockFile $3/rate_limit_us "0" 124 | sendToLog "rate_limit_us=0" 125 | fi 126 | fi 127 | fi 128 | --------------------------------------------------------------------------------