Created
January 12, 2021 06:19
-
-
Save waseem-h/863e2ff24c18971318fa66ffcba82cef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/system/bin/sh | |
POGO_PACKAGE=com.nianticlabs.pokemongo | |
POGO_SAMSUNG_PACKAGE=com.nianticlabs.pokemongo.ares | |
keepInMemory() { | |
PACKAGE=$1 | |
echo $1 | |
while :; do | |
PID=$(pidof "$PACKAGE") | |
if [ $? -ne 1 ]; then | |
echo "Setting $PACKAGE oom params to unkillable values..." | |
echo -17 >/proc/$PID/oom_adj | |
echo -1000 >/proc/$PID/oom_score_adj | |
else | |
echo "ERROR: PoGO is dead :(" | |
fi | |
sleep 30 | |
done | |
} | |
keepInMemory "$POGO_PACKAGE" & | |
keepInMemory "$POGO_SAMSUNG_PACKAGE" & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment