#!/bin/bash
TARGET_DIR="/data/user/0/com.tencent.tmgp.dfm/files/ano_tmp/"
while true; do
if ! pgrep -f "com.tencent.tmgp.sgame" > /dev/null; then
    if [ -d "$TARGET_DIR" ]; then
        find "$TARGET_DIR" \( \
            -name "mrpcs_a_v.data" \
            -o -name "mrpcs_a_c.data" \
            -o -name "mrpcs_a.data" \
            -o -name "dec_fpv.zip" \
            -o -name "crt.i2.dat" \
            -o -name "config3.xml" \
            -o -name "config2.xml.5d34141b" \
            -o -name "HANYCJLZOEUS_TOKEN2.dat" \
            -o -name "juscrkat.dat" \
            -o -name "nbavmc_unxqbih.dat" \
        \) -exec rm -f {} \;
        if [ -f "$TARGET_DIR"mn_cache.dat ]; then
            rm "$TARGET_DIR"mn_cache.dat
            echo "Deleted file: $TARGET_DIR"mn_cache.dat
        fi
        for FILE in "$TARGET_DIR"ms_*_tmp.dat; do
            if [ -f "$FILE" ]; then
                rm "$FILE"
                echo "Deleted file: $FILE"
            fi
        done
        chmod 000 "$TARGET_DIR"ano.ano3.dat
        chmod 000 "$TARGET_DIR"ace_cache_db.dat
        echo "Permissions for $TARGET_DIR"ano.ano3.dat" changed to 000"
        echo "Permissions for $TARGET_DIR"ace_cache_db.dat" changed to 000"
    fi
fi
    sleep 1
done