From 8353110f0f26fd71746797a028f8f4296ec35dea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 27 Sep 2025 07:02:07 +0000 Subject: [PATCH 01/11] 2.4.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9f1ef8ea..dbafb19a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "2.3.1", + "version": "2.4.0", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From 89384f111b946fc88a6bcdfbd9f424bea0f47e45 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 27 Sep 2025 07:02:08 +0000 Subject: [PATCH 02/11] Update to release 2.4.0 --- Update.json | 11 +++++++++++ XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 72357a37..2ae346f5 100644 --- a/Update.json +++ b/Update.json @@ -3069,6 +3069,17 @@ } ], "Notes": "本版本修复了由于 PHPSESSID 启用了 httpOnly 导致的后台不可用" + }, + "2.4.0": { + "UpdateDate": 1758956527554, + "Prerelease": false, + "UpdateContents": [ + { + "PR": 856, + "Description": "修复由于 PHPSESSID 启用了 httpOnly 导致的后台不可用" + } + ], + "Notes": "请尽快升级至本版本!" } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 563eddf5..7236b5a8 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 2.3.1 +// @version 2.4.0 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From dcea068cd0c7c1420a8c75e5749dd85f12985354 Mon Sep 17 00:00:00 2001 From: boomzero Date: Thu, 2 Oct 2025 21:44:50 +0800 Subject: [PATCH 03/11] Update CSS selector --- XMOJ.user.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/XMOJ.user.js b/XMOJ.user.js index 7236b5a8..44942855 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1669,6 +1669,9 @@ async function main() { if (SubmitLink == null) { SubmitLink = document.querySelector('.mt-3 > center:nth-child(1) > a:nth-child(9)'); } + if (SubmitLink == null) { //为什么这个破东西老是换位置 + SubmitLink = document.querySelector('.mt-3 > center:nth-child(1) > a:nth-child(7)'); + } let SubmitButton = document.createElement('button'); SubmitButton.id = 'SubmitButton'; SubmitButton.className = 'btn btn-outline-secondary'; From 081f7f325f02b9104899cc15902d35b94b9a731b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 2 Oct 2025 13:47:30 +0000 Subject: [PATCH 04/11] 2.4.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dbafb19a..13e14585 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "2.4.0", + "version": "2.4.1", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From d0f4549e60cde6b6eb87a562ba08a4fe2f5079d3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 2 Oct 2025 13:47:36 +0000 Subject: [PATCH 05/11] Update version info to 2.4.1 --- Update.json | 11 +++++++++++ XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 2ae346f5..55d41a62 100644 --- a/Update.json +++ b/Update.json @@ -3080,6 +3080,17 @@ } ], "Notes": "请尽快升级至本版本!" + }, + "2.4.1": { + "UpdateDate": 1759412851092, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 861, + "Description": "Update CSS selector" + } + ], + "Notes": "No release notes were provided for this release." } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 44942855..0cb98cfd 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 2.4.0 +// @version 2.4.1 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From 249456f06a3f2c3dd5e25efac41c3496a1b4367e Mon Sep 17 00:00:00 2001 From: boomzero Date: Thu, 2 Oct 2025 21:58:09 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E2=80=9CNaN=E5=B9=B4?= =?UTF-8?q?=E5=89=8D=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XMOJ.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 0cb98cfd..4e52b30e 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -81,7 +81,7 @@ let SmartAlert = (Message) => { */ let GetRelativeTime = (Input) => { try { - Input = new Date(Input); + Input = new Date(parseInt(Input)); let Now = new Date().getTime(); let Delta = Now - Input.getTime(); let RelativeName = ""; From 7841538fbf9edf485eb6a54458c63c41fdb12fb8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 2 Oct 2025 13:59:44 +0000 Subject: [PATCH 07/11] 2.4.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 13e14585..96024050 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "2.4.1", + "version": "2.4.2", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From 6b6ffe03a572733ee00060398d72982eda346588 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 2 Oct 2025 13:59:50 +0000 Subject: [PATCH 08/11] Update version info to 2.4.2 --- Update.json | 11 +++++++++++ XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 55d41a62..2d12bb6d 100644 --- a/Update.json +++ b/Update.json @@ -3091,6 +3091,17 @@ } ], "Notes": "No release notes were provided for this release." + }, + "2.4.2": { + "UpdateDate": 1759413584731, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 863, + "Description": "修复“NaN年前“" + } + ], + "Notes": "修复“NaN年前“" } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 4e52b30e..76e939a4 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 2.4.1 +// @version 2.4.2 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen From 3b4873f59aae28c1055557ffe71140a0983dba1d Mon Sep 17 00:00:00 2001 From: boomzero Date: Thu, 2 Oct 2025 22:06:16 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XMOJ.user.js | 117 +-------------------------------------------------- 1 file changed, 1 insertion(+), 116 deletions(-) diff --git a/XMOJ.user.js b/XMOJ.user.js index 76e939a4..33c8a789 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1469,7 +1469,7 @@ async function main() { "Name": "恢复讨论与短消息功能" }, { "ID": "MoreSTD", "Type": "F", "Name": "查看到更多标程" - }, {"ID": "ApplyData", "Type": "A", "Name": "获取数据功能"}, { + }, { "ID": "AutoCheat", "Type": "A", "Name": "自动提交当年代码" }, {"ID": "Rating", "Type": "A", "Name": "添加用户评分和用户名颜色"}, { "ID": "AutoRefresh", "Type": "A", "Name": "比赛列表、比赛排名界面自动刷新" @@ -3420,121 +3420,6 @@ async function main() { if (document.getElementById("apply_data")) { let ApplyDiv = document.getElementById("apply_data").parentElement; console.log("启动!!!"); - if (UtilityEnabled("ApplyData")) { - let GetDataButton = document.createElement("button"); - GetDataButton.className = "ms-2 btn btn-outline-secondary"; - GetDataButton.innerText = "获取数据"; - console.log("按钮创建成功"); - ApplyDiv.appendChild(GetDataButton); - GetDataButton.addEventListener("click", async () => { - GetDataButton.disabled = true; - GetDataButton.innerText = "正在获取数据..."; - let PID = localStorage.getItem("UserScript-Solution-" + SearchParams.get("sid") + "-Problem"); - if (PID == null) { - GetDataButton.innerText = "失败! 无法获取PID"; - GetDataButton.disabled = false; - await new Promise((resolve) => { - setTimeout(resolve, 800); - }); - GetDataButton.innerText = "获取数据"; - return; - } - let Code = ""; - if (localStorage.getItem(`UserScript-Problem-${PID}-IOFilename`) !== null) { - Code = `#define IOFile "${localStorage.getItem(`UserScript-Problem-${PID}-IOFilename`)}"\n`; - } - Code += `//XMOJ-Script 获取数据代码 - #include -using namespace std; -string Base64Encode(string Input) -{ - const string Base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - string Output; - for (int i = 0; i < Input.length(); i += 3) - { - Output.push_back(i + 0 > Input.length() ? '=' : Base64Chars[(Input[i + 0] & 0xfc) >> 2]); - Output.push_back(i + 1 > Input.length() ? '=' : Base64Chars[((Input[i + 0] & 0x03) << 4) + ((Input[i + 1] & 0xf0) >> 4)]); - Output.push_back(i + 2 > Input.length() ? '=' : Base64Chars[((Input[i + 1] & 0x0f) << 2) + ((Input[i + 2] & 0xc0) >> 6)]); - Output.push_back(i + 3 > Input.length() ? '=' : Base64Chars[Input[i + 2] & 0x3f]); - } - return Output; -} -int main() -{ -#ifdef IOFile - freopen(IOFile ".in", "r", stdin); - freopen(IOFile ".out", "w", stdout); -#endif - string Input; - while (1) - { - char Data = getchar(); - if (Data == EOF) - break; - Input.push_back(Data); - } - throw runtime_error("[" + Base64Encode(Input.c_str()) + "]"); - return 0; -}`; - - await fetch("https://www.xmoj.tech/submit.php", { - "headers": { - "content-type": "application/x-www-form-urlencoded" - }, - "referrer": "https://www.xmoj.tech/submitpage.php?id=" + PID, - "method": "POST", - "body": "id=" + PID + "&" + "language=1&" + "source=" + encodeURIComponent(Code) + "&" + "enable_O2=on" - }); - - let SID = await fetch("https://www.xmoj.tech/status.php").then((Response) => { - return Response.text(); - }).then((Response) => { - let ParsedDocument = new DOMParser().parseFromString(Response, "text/html"); - return ParsedDocument.querySelector("#result-tab > tbody > tr:nth-child(1) > td:nth-child(2)").innerText; - }); - - await new Promise((Resolve) => { - let Interval = setInterval(async () => { - await fetch("status-ajax.php?solution_id=" + SID).then((Response) => { - return Response.text(); - }).then((Response) => { - if (Response.split(",")[0] >= 4) { - clearInterval(Interval); - Resolve(); - } - }); - }, 500); - }); - - await fetch(`https://www.xmoj.tech/reinfo.php?sid=${SID}`).then((Response) => { - return Response.text(); - }).then((Response) => { - let ParsedDocument = new DOMParser().parseFromString(Response, "text/html"); - let ErrorData = ParsedDocument.getElementById("errtxt").innerText; - let MatchResult = ErrorData.match(/\what\(\): \[([A-Za-z0-9+\/=]+)\]/g); - if (MatchResult === null) { - GetDataButton.innerText = "获取数据失败"; - GetDataButton.disabled = false; - return; - } - for (let i = 0; i < MatchResult.length; i++) { - let Data = CryptoJS.enc.Base64.parse(MatchResult[i].substring(10, MatchResult[i].length - 1)).toString(CryptoJS.enc.Utf8); - ApplyDiv.appendChild(document.createElement("hr")); - ApplyDiv.appendChild(document.createTextNode("数据" + (i + 1) + ":")); - let CodeElement = document.createElement("div"); - ApplyDiv.appendChild(CodeElement); - CodeMirror(CodeElement, { - value: Data, - theme: (UtilityEnabled("DarkMode") ? "darcula" : "default"), - lineNumbers: true, - readOnly: true - }).setSize("100%", "auto"); - } - GetDataButton.innerText = "获取数据成功"; - GetDataButton.disabled = false; - }); - }); - } document.getElementById("apply_data").addEventListener("click", () => { let ApplyElements = document.getElementsByClassName("data"); for (let i = 0; i < ApplyElements.length; i++) { From 037a14eeb12b4a814fb660b7f1ee37d4bf5af0fd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 2 Oct 2025 14:10:58 +0000 Subject: [PATCH 10/11] 2.4.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 96024050..8bee29cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xmoj-script", - "version": "2.4.2", + "version": "2.4.3", "description": "an improvement script for xmoj.tech", "main": "AddonScript.js", "scripts": { From d5a66904c3efae720dea5c952766287408653940 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 2 Oct 2025 14:11:04 +0000 Subject: [PATCH 11/11] Update version info to 2.4.3 --- Update.json | 11 +++++++++++ XMOJ.user.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Update.json b/Update.json index 2d12bb6d..b1d2d6cf 100644 --- a/Update.json +++ b/Update.json @@ -3102,6 +3102,17 @@ } ], "Notes": "修复“NaN年前“" + }, + "2.4.3": { + "UpdateDate": 1759414259108, + "Prerelease": true, + "UpdateContents": [ + { + "PR": 865, + "Description": "删除获取数据功能" + } + ], + "Notes": "因为它利用的bug被修复了" } } } \ No newline at end of file diff --git a/XMOJ.user.js b/XMOJ.user.js index 33c8a789..812c41a0 100644 --- a/XMOJ.user.js +++ b/XMOJ.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name XMOJ -// @version 2.4.2 +// @version 2.4.3 // @description XMOJ增强脚本 // @author @XMOJ-Script-dev, @langningchen and the community // @namespace https://github/langningchen