AppleWare Key Bypasser

by yours truly, an appleware bypasser :)

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         AppleWare Key Bypasser
// @description  by yours truly, an appleware bypasser :)
// @version      0.2
// @license MIT
// @icon         https://appleware.dev/favicon.png
// @match        https://loot-link.com/*
// @match        https://lootdest.org/*
// @grant        unsafeWindow
// @grant        GM_xmlhttpRequest
// @grant        GM_setValue
// @grant        GM_getValue
// @connect      gforanopportu.info
// @connect      entlysearchin.info
// @run-at       document-end
// @namespace https://greasyfork.org/users/1287532
// ==/UserScript==

(function () {
    "use strict";

    // Function to decode the string
    function decodeString(input, length = 5) {
        let result = "";
        let decodedString = atob(input);
        let key = decodedString.substring(0, length);
        let message = decodedString.substring(length);

        for (let i = 0; i < message.length; i++) {
            let charCode = message.charCodeAt(i);
            let keyCharCode = key.charCodeAt(i % key.length);
            let decodedCharCode = charCode ^ keyCharCode;
            result += String.fromCharCode(decodedCharCode);
        }

        return result;
    }

    function waitForScript() {
        return new Promise((resolve, reject) => {
            const observer = new MutationObserver((mutations, observer) => {
                const dataScript = document.querySelector("body > script:nth-child(2)");
                if (dataScript) {
                    observer.disconnect();
                    resolve(dataScript);
                }
            });

            observer.observe(document.body, {
                childList: true,
                subtree: true,
            });
        });
    }

    async function main() {
        try {
            var dataScript = await waitForScript();
            eval(dataScript.innerText);

            var TID = p.TID;
            var KEY = p.KEY;

            const response = await fetch("https://gforanopportu.info/tc", {
                method: "POST",
                headers: {
                    "Content-Type": "application/json",
                    "User-Agent":
                        "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
                },
                body: JSON.stringify({
                    tid: TID,
                    bl: [
                        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
                        19,
                    ],
                    session:
                        Math.floor(Math.random() * (0x3b9ac9ff - 0x5f5e100 + 0x1)) +
                        0x5f5e100,
                    max_tasks: 2,
                    design_id: 3,
                    cur_url: window.location.href,
                    doc_ref: document.referrer,
                    cookie_id: (
                        Math.floor(Math.random() * (0x3b9ac9ff - 0x5f5e100 + 0x1)) +
                        0x5f5e100
                    ).toString(),
                    taboola_user_sync: "",
                    fps: 512,
                    gpu: "nvidia",
                    isMobile: true,
                    tier: 1,
                    type: "FALLBACK",
                }),
            });

            const tc = (await response.json())[0];

            const socket = new WebSocket(
                `wss://2.entlysearchin.info/c?uid=${tc.urid}&cat=${tc.task_id}&key=${KEY}`
            );

            socket.onopen = function (event) {
                console.log("WebSocket connection opened:", event);
            };

            socket.onmessage = function (event) {
                console.log("Message received:", event.data);

                const message = event.data;
                const prefix = "r:";
                if (message.startsWith(prefix)) {
                    const extractedText = message.substring(prefix.length);
                    setTimeout(function () {
                        window.location.href = decodeString(extractedText);
                    }, 2000);
                }
            };

            socket.onerror = function (event) {
                console.error("WebSocket error:", event);
            };

            socket.onclose = function (event) {
                console.log("WebSocket connection closed:", event);
            };

            await fetch(
                `https://2.entlysearchin.info/st?uid=${tc.urid}&cat=${tc.task_id}`,
                {
                    method: "POST",
                }
            );
        } catch (error) {
            console.error("An error occurred:", error);
        }
    }

    window.addEventListener("load", main);
})();