if [ -L "zjjr.apk" ]; then
    rm zjjr.apk
    echo "Existing 'zjjr.apk' link removed."
fi

latest_file=$(find . -type f -name "mining_v2*" -printf "%T@ %p\n" | sort -n | tail -1 | cut -d' ' -f2-)

# 检查是否找到了文件
if [ -z "$latest_file" ]; then
    echo "No files found."
    exit 1
fi

# 构建软链接
ln -s "$latest_file" zjjr.apk

# 输出结果
if [ $? -eq 0 ]; then
    echo "Symbolic link 'zjjr.apk' created successfully, pointing to '$latest_file'."
else
    echo "Failed to create the symbolic link."
fi
