0% found this document useful (0 votes)
24 views3 pages

Ultgamenroot

This document is a shell script designed for optimizing game performance on non-rooted Android devices. It takes a game package name and graphics quality as input, calculates the appropriate downscaling factor, and applies various performance settings including FPS throttling and RAM clearing. The script ultimately launches the specified game with optimized settings to enhance gameplay experience.

Uploaded by

hnyz110207
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views3 pages

Ultgamenroot

This document is a shell script designed for optimizing game performance on non-rooted Android devices. It takes a game package name and graphics quality as input, calculates the appropriate downscaling factor, and applies various performance settings including FPS throttling and RAM clearing. The script ultimately launches the specified game with optimized settings to enhance gameplay experience.

Uploaded by

hnyz110207
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

#!

/system/bin/sh

echo "
"
echo "[ Universal Game Optimization Script by Droid Everything ]"
echo "[ No ROOT version - FOR NON ROOTED DEVICES ]"
sleep 0.5
echo "
"

# Check if package name, graphics quality, and downscaling factor are provided as
arguments
if [ $# -lt 2 ]; then
echo "Error: Please provide the package name of the game and the graphics
quality [ low, medium, high, full ]"
exit 1
fi

gamepackage="$1" # Get the package name from the first argument

# Get the application name associated with the package name


appname=$(pm list packages -f | grep "$gamepackage" | sed 's/.*=//' | sed 's/\./
/g' | awk '{print $NF}')

# Map descriptive terms to their corresponding numerical values


case "$2" in
"low")
downscaleFactor=0.45
;;
"medium")
downscaleFactor=0.75
;;
"high")
downscaleFactor=0.9
;;
"full")
downscaleFactor=1
;;
*)
echo "Error: Please choose from 'low', 'medium', 'high', or 'full'."
exit 1
;;
esac

echo "
■ Running Calculations:
"
sleep 0.5
echo " ■ Step 1: Assigning game package name to variable: $gamepackage"
sleep 0.5

echo " ■ Step 2: Calculating FPS for assigning "


sleep 0.5
# Assign calculated FPS
fps="$(dumpsys display | grep -o -E 'fps=[0-9]+(\.[0-9]+)?' | cut -d'=' -f2 | sort
-u | awk '{print $1 - 10}' | bc)"

echo " ■ Step 3: Performance mode is being set for: [ $appname ]"
sleep 0.5
echo " ■ Step 4: Displaying supported Display Refresh Rate: [ $(dumpsys display |
grep -o -E 'fps=[0-9]+(\.[0-9]+)?' | cut -d'=' -f2 | sort -u | head -n1) Hz ]"
sleep 0.5

echo " ■ Step 5: Enabled FPS throttling for stability. FPS currently capped to:
$fps FPS "
sleep 0.5

echo "
■ Applying settings according to calculations:
"
sleep 0.5

echo " ■ Step 6: Evaluating Interventions "


# Evaluate Interventions
/system/bin/device_config put game_overlay "$gamepackage"
mode=2,skiagl=1,downscaleFactor="$downscaleFactor",fps="$fps":mode=3,skiagl=1,downs
caleFactor="$downscaleFactor",fps="$fps"
sleep 0.5

echo " ■ Step 7: Backing up Default Interventions "


# Backup Default Intervention [ If null, then just avoid ]
echo " $(/system/bin/device_config get game_overlay "$gamepackage")"
sleep 0.5

echo " ■ Step 8: Changing between Game Modes "


# Change between game modes
/system/bin/cmd game mode performance "$gamepackage"
echo " ■ Step 9: Gamemode has been set to [ Performance ] "
sleep 0.5

echo " ■ Step 10: Clearing RAM "


# Clear RAM
am kill-all
sleep 0.5

echo " ■ Step 11: Launching $appname "


sleep 0.5

echo " ■ Step 12: Fetching $appname process PID "


sleep 0.5

echo " ■ Step 13: Setting $appname priority with nice "
sleep 0.5
echo " ■ Step 14: Setting $appname priority with renice "
sleep 0.5

echo " ■ Step 15: Priority set successfully for $appname "
sleep 0.5

echo "
FPS is set 10 FPS less than supported refresh rate to avoid fluctuations
"

echo "
[ Code written by Droid_Everything ] "
echo "
"
sleep 0.5

# Launch the package with Monkey


monkey -p "$gamepackage" 1
sleep 1

# Get PID of the package


pid=$(pidof "$gamepackage")

# Set priority for the process


nice -n 1 -p "$pid"
renice -n 1 -p "$pid"

You might also like