// ==UserScript== // @name Crack Forclass 4 // @namespace https://www.forclass.tk/script?4 // @version 3.1.3 // @description 这同样适用于 Forclass,Sunclass,271BAY,Zhizhiniao // @author Houtarchat // @match *://*.forclass.net/Account/SignIn* // @contributionURL https://www.houtarchat.ml/donate.html // @contributionAmount 5 RMB // @license GNU General Public License // @grant GM.xmlHttpRequest // @grant GM_getValue // @grant GM_setValue // @connect zhizhiniao.com // @run-at document-end // @noframes // @downloadURL none // ==/UserScript== (function () { "use strict"; /* jslint browser: true */ /* global window */ /* global GM */ if (sessionStorage.account) return; let account = GM_getValue('account'), password = GM_getValue('password'); if (!account || !window.confirm(`登录至"${account}"?`)) { account = window.prompt("Your username here:"); password = window.prompt("Your password here:"); if (window.confirm(`将"${account}"替换当前存储的账户?`)) { GM_setValue('account', account); GM_setValue('password', password); } } GM.xmlHttpRequest({ method: "POST", url: `${location.protocol}//www.zhizhiniao.com/ANAService.asmx/LoginAccountJson`, data: JSON.stringify({ session: null, page: 0, account, password }), headers: { "Content-Type": "application/json; charset=utf-8" }, onload: function ({responseText}, response = JSON.parse(responseText)) { let ifr = document.createElement("iframe"); let session; if (response["ReturnText"]) { window.alert(response["ReturnText"]); location.reload(); } session = response.result?.[0].session ifr.setAttribute( "src", `${location.protocol}//account.sun.forclass.net/Account/SignIn?session=${session ?? ""}` ); document.head.appendChild(ifr); ifr.onload = () => window.location.href = `${location.protocol}//zzn.sun.forclass.net/Student/WdzySun`; } }); })();