
iptables -F
iptables -X 
iptables -Z
iptables -t nat -F 
echo "本地缓存数据处理成功"
#清楚iptables规则
iptables -F
echo "iptables规则清除成功"
ip6tables=/system/bin/ip6tables
iptables=/system/bin/iptables
#和平清除down
rm -rf /data/data/com.tencent.tmgp.pubgmhd/files/ano_tmp
rm -rf /data/user/*/com.tencent.tmgp.pubgmhd/files/ano_tmp
#暗区清除down
rm -rf /data/data/com.tencent.mf.uam/files/ano_tmp/
rm -rf /data/user/*/com.tencent.mf.uam/files/ano_tmp/
#使命清除down
rm -rf /data/data/com.tencent.tmgp.cod/files/ano_tmp
rm -rf /data/user/*/com.tencent.tmgp.cod/files/ano_tmp
#王者清除down
rm -rf /data/data/com.tencent.tmgp.sgame/files/ano_tmp
rm -rf /data/user/*/com.tencent.tmgp.sgame/files/ano_tmp
#CFM清除down
rm -rf /data/data/com.tencent.tmgp.cf/files/ano_tmp
rm -rf /data/user/*/com.tencent.tmgp.cf/files/ano_tmp
#三角洲清除down
rm -rf /data/data/com.tencent.tmgp.dfm/files/ano_tmp
rm -rf /data/user/*/com.tencent.tmgp.dfm/files/ano_tmp
#修复第三方环境异常
echo 16384 > /proc/sys/fs/inotify/max_queued_events
echo 128 > /proc/sys/fs/inotify/max_user_instances
echo 8192 > /proc/sys/fs/inotify/max_user_watches
#清除王者荣耀日志
echo "缓存数据清理完成"



#!/system/bin/sh
if [ ! -f /sys/kernel/mm/transparent_hugepage/enabled ] || [ ! -f /sys/kernel/mm/transparent_hugepage/defrag ]; then
    echo "检测失败，找不到 HUGE_PAGE 配置文件"
    exit 1
fi

setenforce 0

khugepaged=$(cat /sys/kernel/mm/transparent_hugepage/khugepaged/scan_sleep_millisecs)
defrag=$(cat /sys/kernel/mm/transparent_hugepage/khugepaged/defrag)
pages_to_scan=$(cat /sys/kernel/mm/transparent_hugepage/khugepaged/pages_to_scan)
scan_sleep_millisecs=$(cat /sys/kernel/mm/transparent_hugepage/khugepaged/scan_sleep_millisecs)

if [[ "$khugepaged" != *"0"* ]] || [[ "$defrag" != *"0"* ]] || [[ "$pages_to_scan" != *"1"* ]] || [[ "$scan_sleep_millisecs" != *"4294967295"* ]]; then
    echo "正在处理 khugepaged ..."
    echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag
    echo 1 > /sys/kernel/mm/transparent_hugepage/khugepaged/pages_to_scan
    echo 4294967295 > /sys/kernel/mm/transparent_hugepage/khugepaged/scan_sleep_millisecs
fi

khugepaged=$(cat /sys/kernel/mm/transparent_hugepage/khugepaged/scan_sleep_millisecs)
defrag=$(cat /sys/kernel/mm/transparent_hugepage/khugepaged/defrag)
pages_to_scan=$(cat /sys/kernel/mm/transparent_hugepage/khugepaged/pages_to_scan)
scan_sleep_millisecs=$(cat /sys/kernel/mm/transparent_hugepage/khugepaged/scan_sleep_millisecs)

if [[ "$defrag" == *"0"* ]] && [[ "$pages_to_scan" == *"1"* ]] && [[ "$scan_sleep_millisecs" == *"4294967295"* ]]; then
    echo "\033[32mkhugepaged 已处理\033[0m"
else
    echo "\033[31mkhugepaged 处理失败\033[0m"
fi

enabled=$(cat /sys/kernel/mm/transparent_hugepage/enabled)
defrag=$(cat /sys/kernel/mm/transparent_hugepage/defrag)

if [[ "$enabled" != *"[never]"* ]] || [[ "$defrag" != *"[never]"* ]]; then
    echo "正在处理 HUGE_PAGE..."
    echo "never" > /sys/kernel/mm/transparent_hugepage/enabled
    echo "never" > /sys/kernel/mm/transparent_hugepage/defrag
fi
enabled=$(cat /sys/kernel/mm/transparent_hugepage/enabled)
defrag=$(cat /sys/kernel/mm/transparent_hugepage/defrag)
if [[ "$enabled" == *"[never]"* ]] && [[ "$defrag" == *"[never]"* ]]; then
    echo "\033[32mHUGE_PAGE 已处理\033[0m"
else
    echo "\033[31mHUGE_PAGE 处理失败\033[0m"
fi

setenforce 1