𝗘𝘀𝗧𝗲𝗵𝗔𝗻𝗴𝗲𝘁 𝗧𝗲𝗰𝗵
179 subscribers
344 photos
22 videos
172 files
234 links
FOSS file and apps android
modded and original

Support me on saweria : https://saweria.co/erine433
Download Telegram
Forwarded from LyK.21 | Shell Project
#LimitThread@lykafkaa

THRESH=80

for a in $(pm list packages --user 0 | cut -f2 -d:); do
pid=$(pidof $a)
if [ ! -z "$pid" ]; then
threads=$(grep Threads "/proc/$pid/status" 2>/dev/null | cut -f2 -d:)
if [ ! -z "$threads" ]; then
echo "$threads Threads ($a)"

# kalau thread di atas threshold → apply limit
if [ "$threads" -gt "$THRESH" ]; then
echo ">>> limiting $a (threads=$threads)"

# App standby restricted
am set-standby-bucket $a restricted

# batasi kemampuan background
cmd appops set $a RUN_IN_BACKGROUND ignore
cmd appops set $a RUN_ANY_IN_BACKGROUND ignore
cmd appops set $a WAKE_LOCK ignore
cmd appops set $a START_FOREGROUND ignore
cmd appops set $a SCHEDULE_EXACT_ALARM ignore

# kill active thread burst
killall -9 $a 2>/dev/null
fi
fi
fi
done | sort -n


dibantu chatgpt