setGameMode SH

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#!

/system/bin/sh

# // Sync to data in the rare case a device crashes


sync

# // Array
MIUI="grep miui"

# // Check if performance mode is active and power save mode is not active
if ( getprop | $MIUI ); then
setprop debug.power.monitor_tools false
settings put system POWER_PERFORMANCE_MODE_OPEN 0
settings put system POWER_SAVE_MODE_OPEN 1
settings put system power_mode high
settings put system POWER_SAVE_PRE_HIDE_MODE performance
settings put system POWER_SAVE_PRE_SYNCHRONIZE_ENABLE 0
else
echo ""
fi

# // Function to set game mode


setGameMode() {
setprop security.perf_harden "0"
setprop debug.performance.tuning "1"
setprop debug.sf.hw "1"
cmd power set-adaptive-power-saver-enabled "false"
cmd power set-fixed-performance-mode-enabled "true"
cmd thermalservice override-status "0"
settings put global heads_up_notifications_enabled "0"
dumpsys deviceidle enable
dumpsys deviceidle enable deep
dumpsys deviceidle force-idle deep
dumpsys deviceidle step deep
settings put global activity_manager_constants
"power_check_max_cpu_0=15,power_check_max_cpu_1=15,power_check_max_cpu_2=30,power_c
heck_max_cpu_3=30,power_check_max_cpu_4=60,power_check_max_cpu_5=60,power_check_max
_cpu_6=90,power_check_max_cpu_7=90"
}
setGameMode > /dev/null 2>&1
setprop debug.game.mode running

# // Send notification when optimization is completed


am start -a android.intent.action.MAIN -e toasttext "Game Has Been Optimized 🚀" -
n bellavita.toast/.MainActivity > /dev/null 2>&1

# bye bye......
# thanks all contributors...

You might also like