#!/bin/bash

# 提示用户输入版本号
read -p "请输入 Clashmi 版本号 (例如 1.0.7.115): " VERSION
FOLDER="v${VERSION}"
BASE_URL="https://github.com/KaringX/clashmi/releases/download/v${VERSION}"

# 创建版本目录
mkdir -p "$FOLDER"

# 要下载的文件列表
FILES=(
    "clashmi_${VERSION}_android_arm.apk"
    "clashmi_${VERSION}_android_arm64-v8a.apk"
    "clashmi_${VERSION}_android_armeabi-v7a.apk"
    "clashmi_${VERSION}_macos_universal.dmg"
    "clashmi_${VERSION}_windows_x64.exe"
    "clashmi_${VERSION}_windows_x64.zip"
)

echo "开始下载 Clashmi v${VERSION}..."

for FILE in "${FILES[@]}"; do
    echo "正在下载: $FILE"
    wget -q --show-progress -O "${FOLDER}/${FILE}" "${BASE_URL}/${FILE}"
done

echo "全部文件已下载到 ${FOLDER}/"

