Skip to content

Instantly share code, notes, and snippets.

@waseem-h
Created January 12, 2021 06:19
Show Gist options
  • Save waseem-h/863e2ff24c18971318fa66ffcba82cef to your computer and use it in GitHub Desktop.
Save waseem-h/863e2ff24c18971318fa66ffcba82cef to your computer and use it in GitHub Desktop.
#!/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