// ====================== DOWNLOAD CONFIG EDIT AREA ======================
const downloadMainDomain = "zsp10.cn";
const downloadSubList = ["Lucky001","Lucky002","Lucky003","Lucky004","Lucky005","Lucky006","Lucky007","Lucky008"];
const apkFilePath = "/apk_output/XYG.apk";
const saveFileName = "APP.apk";
// =======================================================================

function getRandomDownloadLink() {
    const randomSub = downloadSubList[Math.floor(Math.random() * downloadSubList.length)];
    return `https://${randomSub}.${downloadMainDomain}${apkFilePath}`;
}

window.addEventListener("DOMContentLoaded", function () {
    const downloadBtn = document.querySelector(".download-btn");
    if (downloadBtn) {
        downloadBtn.addEventListener("click", function () {
            const tempA = document.createElement("a");
            tempA.href = getRandomDownloadLink();
            tempA.download = saveFileName;
            document.body.appendChild(tempA);
            tempA.click();
            document.body.removeChild(tempA);
        })
    }
})