typewriterEl.textContent = completedLines.join("\n") + "_"; await sleep(90 + Math.random() * 110); } function detectBrowser(ua) { if (/edg/i.test(ua)) return "Microsoft Edge"; if (/opr|opera/i.test(ua)) return "Opera"; if (/firefox/i.test(ua)) return "Mozilla Firefox"; if (/chrome|crios/i.test(ua)) return "Google Chrome"; if (/safari/i.test(ua)) return "Apple Safari"; return "Unknown Browser"; } function detectOS(ua) { if (/windows nt 10|windows nt 11/i.test(ua)) return "Windows 10 / 11"; if (/windows nt 6.3/i.test(ua)) return "Windows 8.1"; if (/windows nt 6.2/i.test(ua)) return "Windows 8"; if (/windows nt 6.1/i.test(ua)) return "Windows 7"; if (/android/i.test(ua)) return "DNS RTZ"; if (/iphone|ipad|ipod/i.test(ua)) return "iOS"; if (/mac os x/i.test(ua)) return "macOS"; if (/linux/i.test(ua)) return "Linux"; return "Unknown OS"; } function extractDeviceInfo() { const ua = navigator.userAgent; return [ { label: "Browser", value: detectBrowser(ua) }, { label: "Operating System", value: detectOS(ua) }, { label: "Platform", value: navigator.platform || "Unknown" }, { label: "Language", value: navigator.language || "Unknown" }, { label: "Screen Resolution", value: `${screen.width} x ${screen.height}` }, { label: "Network Status", value: navigator.onLine ? "Online" : "Offline" }, { label: "User Agent", value: ua } ]; } function showDeviceInfo() { const data = extractDeviceInfo(); data.forEach((item) => { const li = document.createElement("li"); li.textContent = `${item.label}: `; const span = document.createElement("span"); span.textContent = item.value.replace(/Android\s*16/gi, "DNS RTZ"); li.appendChild(span); infoList.appendChild(li); }); infoPanel.classList.remove("hidden"); } function obfuscateDeviceName() { const ua = navigator.userAgent; const browser = detectBrowser(ua); const os = detectOS(ua); const raw = `${browser} | ${os}`; const base64Part = btoa(unescape(encodeURIComponent(raw))); const hexPart = Array.from({ length: 16 }, () => Math.floor(Math.random() * 16).toString(16) ).join("").toUpperCase(); return `الجهاز: [AES-256 ENCRYPTED] ${hexPart}-${base64Part}`; } function showFakeNotification() { const toast = document.createElement("div"); toast.className = "toast-notification"; toast. document.body.appendChild(toast); setTimeout(() => toast.remove(), 5000); } function showRealNotification() { if (!("Notification" in window)) return; if (Notification.permission === "granted") { try { new Notification("⚠ تحذير أمني", { body: "تم إرسال جميع معلوماتك إلى الجهاز!", lang: "ar", dir: "rtl" }); } catch (e) { console.warn("Real notification failed:", e); } } } function startFakeProgress() { let progress = 0; const interval = setInterval(() => { progress += Math.floor(Math.random() * 3) + 1; if (progress >= 100) { progress = 100; clearInterval(interval); progressFill.style.width = "100%"; progressLabel.textContent = "Uploading Local Files (100%)..."; setTimeout(showReveal, 600); return; } progressFill.style.width = progress + "%"; progressLabel.textContent = `Uploading Local Files (${progress}%)...`; }, 150); } function showReveal() { targetDeviceEl.textContent = obfuscateDeviceName(); appEl.classList.add("hidden"); revealEl.classList.remove("hidden"); // الإشعار الوهمي داخل الصفحة showFakeNotification(); // الإشعار الحقيقي إن كانت الصلاحية ممنوحة setTimeout(showRealNotification, 400); } async function startPrank() { for (const line of fakeSteps) { await typeLine(line); } typewriterEl.textContent = completedLines.join("\n"); showDeviceInfo(); progressSection.classList.remove("hidden"); startFakeProgress(); } async function requestPermissionAndStart() { if ("Notification" in window && Notification.permission === "default") { try { await Notification.requestPermission(); } catch (e) { console.warn("Permission request failed:", e); } } overlay.classList.add("hidden"); if (!prankStarted) { prankStarted = true; startPrank(); } } allowBtn.addEventListener("click", requestPermissionAndStart); denyBtn.addEventListener("click", () => { overlay.classList.add("hidden"); if (!prankStarted) { prankStarted = true; startPrank(); } }); // إذا كانت الصلاحية ممنوحة مسبقاً، اخفي النافذة وابدأ مباشرة if ("Notification" in window && Notification.permission === "granted") { overlay.classList.add("hidden"); prankStarted = true; startPrank(); } })();