├── LICENSE ├── README.md ├── Surge: Record Module.shortcut └── akino.js /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Sliverkiss 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Surge 基于捷径生成重放脚本模块 2 | 3 | ## 项目介绍 4 | 5 | 该项目旨在通过捷径自动生成 Surge 重放脚本模块,支持多账号签到功能。用户可以根据需求修改相关参数,自定义所需的功能,便捷地管理和执行多账号的单接口调用。 6 | 7 | ## 特性 8 | 9 | - **多账号支持**:可以同时处理多个账号的签到请求。 10 | - **参数化定制**:通过修改参数,轻松定制重放脚本的功能。 11 | - **配合捷径使用**:本模块需要与捷径配合使用,以便自动化执行任务。 12 | - **简洁高效**:易于设置与使用,支持快速生成和执行脚本。 13 | 14 | ## 安装与使用 15 | 16 | ### 依赖 17 | 18 | - Surge 代理工具 19 | - iOS 设备 20 | - 捷径应用 21 | 22 | ### 使用步骤 23 | 24 | 1. **安装 Surge** 25 | 请确保你的设备已经安装并配置好 Surge,具体安装与配置过程请参考 [Surge 官方文档](https://manual.nssurge.com/). 26 | 27 | 2. **导入捷径** 28 | 下载并导入本项目提供的捷径文件。 29 | 30 | 3. **使用方法** 31 | 将抓包好的接口数据选择har格式导出到捷径文件,根据提示填写相关参数,并在surge中打开生成的模块,手动重放一次接口以获取相关数据。 32 | 33 | 4. **执行脚本** 34 | 配置完成后,可以从模块中的外部资源进入脚本编辑器,选择cron环境,然后运行即可进行调试。 35 | 36 | -------------------------------------------------------------------------------- /Surge: Record Module.shortcut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sliverkiss/surge_auto_sign/461a2ccd1a8da73780d52bfea63731c6a8d146c4/Surge: Record Module.shortcut -------------------------------------------------------------------------------- /akino.js: -------------------------------------------------------------------------------- 1 | const moduleName = "Akino CheckIn"; 2 | const $ = new Env(moduleName); 3 | //获取参数 4 | $.is_debug = $.getdata("is_debug")||false 5 | $.arguments = getArguments(); 6 | $.name = $.arguments?.scriptName || moduleName;//脚本名 7 | $.ckName = $.arguments?.ckName || $.getdata("sliverkiss_surge_retry") || "default";//变量名 8 | $.isGetCookie = $.arguments?.isGetCookie || "1"//是否打开获取cookie 9 | $.bodyRegx = $.arguments?.bodyRegx || "";//body正则匹配 10 | $.userCookie = $.arguments?.account || [];//账号数组 11 | $.accountIndex = parseInt($.arguments?.accountIndex || 0)//账号数组下标 12 | //用户多账号配置 13 | $.succCount = 0, $.notifyMsg = [], $.is_debug = ($.isNode() ? process.env.IS_DEDUG : $.getdata('is_debug')) || 'false'; 14 | //主程序执行入口 15 | !(async () => { 16 | try { 17 | if (typeof $request != "undefined") { 18 | if ($.isGetCookie != "0") await getCookie(); 19 | } else { 20 | await main(); 21 | } 22 | } catch (e) { 23 | throw e; 24 | } 25 | })() 26 | .catch((e) => { $.logErr(e), $.msg($.name, `⛔️ script run error!`, e.message || e) }) 27 | .finally(async () => { 28 | $.done({ ok: 1 }); 29 | }); 30 | 31 | //主函数 32 | async function main() { 33 | try { 34 | if ($.userCookie.length <= 0) return $.msg($.name, "❌ account not found"); 35 | $.info(`当前共${$.userCookie?.length}个账号`) 36 | let index = 0; 37 | for (let item of $.userCookie) { 38 | if (item?.url) { 39 | let res = await exchange(item); 40 | let str = index == $.userCookie?.length-1 ? " └ " : " ├ "; 41 | res = typeof res === 'string' ? res : $.toStr(res); 42 | $.info(`账号[${index+1}]: ${res}`) 43 | $.notifyMsg.push(`${str}[${index++}]: ${res}`) 44 | $.succCount++ 45 | } else { 46 | throw new Error("opts参数缺失,请先设置模块参数"); 47 | } 48 | } 49 | $.msg($.name, ` ❀ 共${$.userCookie?.length}个账号,成功${$.succCount}个,失败${$.userCookie?.length - $.succCount}个`, $.notifyMsg.join("\n")); 50 | } catch (e) { 51 | throw e; 52 | } 53 | } 54 | 55 | //重放 56 | function exchange(opts) { 57 | try { 58 | return new Promise((resolve) => { 59 | $[opts?.method](opts, (err, resp, data) => { 60 | let res = $.toObj(data) || data; 61 | resolve(executeCode(res, $.arguments?.path || "") ?? res); 62 | }); 63 | }); 64 | } catch (e) { 65 | throw e; 66 | } 67 | } 68 | 69 | //执行传入代码 70 | function executeCode(res, codeString) { 71 | try { 72 | // 创建一个新的函数并执行 73 | const func = new Function('res', `return ${codeString ?? res};`); 74 | return func(res); 75 | } catch (e) { 76 | return res; 77 | } 78 | } 79 | 80 | function getCookie() { 81 | try { 82 | if (!$request?.body || !$.bodyRegx || isMatch($request?.body, $.bodyRegx)) { 83 | const url = $request?.url; 84 | const headers = $request?.headers 85 | const method = $request?.method?.toLocaleLowerCase(); 86 | const body = $request?.body; 87 | let opts = { url, headers, method, body } 88 | //存储多账号数据 89 | if ($.userCookie[$.accountIndex]) { 90 | $.userCookie[$.accountIndex] = opts; 91 | } else { 92 | $.userCookie.push(opts); 93 | } 94 | $.setjson($.userCookie, `@akino.record.${$.ckName}`); 95 | let result = url && method ? `🎉 账号[${$.accountIndex}]获取重放数据成功!` : `❌ 账号[${$.accountIndex}]获取重放数据失败!` 96 | $.msg($.name, result, ``); 97 | } 98 | } catch (e) { 99 | throw e; 100 | } 101 | } 102 | 103 | /** 104 | * 去重完全相同的对象 105 | * @param {Object[]} array - 要去重的对象数组 106 | * @returns {Object[]} - 去重后的数组 107 | */ 108 | function uniqueObjects(array) { 109 | const seen = new Set(); 110 | return array.filter(item => { 111 | const key = JSON.stringify(item); 112 | if (seen.has(key)) { 113 | return false; 114 | } 115 | seen.add(key); 116 | return true; 117 | }); 118 | } 119 | 120 | //正则判断body是否匹配 121 | function isMatch(res, regexString) { 122 | // 确保 res 是字符串,如果不是,则转换为 JSON 字符串 123 | const stringToMatch = typeof res === 'string' ? res : JSON.stringify(res); 124 | 125 | // 创建正则表达式对象 126 | const regex = new RegExp(regexString); 127 | 128 | // 判断字符串是否匹配正则表达式 129 | return regex.test(stringToMatch); 130 | } 131 | 132 | //封装一个获取Surge参数的方法 133 | function getArguments() { 134 | let arg; 135 | if (typeof $argument != 'undefined') { 136 | arg = Object.fromEntries($argument.split('&').map(item => item.split('='))); 137 | } else { 138 | arg = {}; 139 | } 140 | 141 | arg = { ...arg, account: $.getjson(`@akino.record.${arg.ckName}`) || [] }; 142 | 143 | if($.is_debug!="false"){ 144 | $.info(`传入的 $argument: ${$.toStr(arg)} `); 145 | $.info(`从持久化存储读取参数后: ${$.toStr(arg)} `); 146 | } 147 | 148 | return arg; 149 | } 150 | 151 | // prettier-ignore 152 | //From chavyleung's Env.js 153 | function Env(t, e) { class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; "POST" === e && (s = this.post); const i = new Promise(((e, i) => { s.call(this, t, ((t, s, o) => { t ? i(t) : e(s) })) })); return t.timeout ? ((t, e = 1e3) => Promise.race([t, new Promise(((t, s) => { setTimeout((() => { s(new Error("请求超时")) }), e) }))]))(i, t.timeout) : i } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.logLevels = { debug: 0, info: 1, warn: 2, error: 3 }, this.logLevelPrefixs = { debug: "[DEBUG] ", info: "[INFO] ", warn: "[WARN] ", error: "[ERROR] " }, this.logLevel = "info", this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.encoding = "utf-8", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null, ...s) { try { return JSON.stringify(t, ...s) } catch { return e } } getjson(t, e) { let s = e; if (this.getdata(t)) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise((e => { this.get({ url: t }, ((t, s, i) => e(i))) })) } runScript(t, e) { return new Promise((s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let o = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); o = o ? 1 * o : 20, o = e && e.timeout ? e.timeout : o; const [r, a] = i.split("@"), n = { url: `http://${a}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: o }, headers: { "X-Key": r, Accept: "*/*" }, policy: "DIRECT", timeout: o }; this.post(n, ((t, e, i) => s(i))) })).catch((t => this.logErr(t))) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), o = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, o) : i ? this.fs.writeFileSync(e, o) : this.fs.writeFileSync(t, o) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let o = t; for (const t of i) if (o = Object(o)[t], void 0 === o) return s; return o } lodash_set(t, e, s) { return Object(t) !== t || (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce(((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}), t)[e[e.length - 1]] = s), t } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), o = s ? this.getval(s) : ""; if (o) try { const t = JSON.parse(o); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, o] = /^@(.*?)\.(.*?)$/.exec(e), r = this.getval(i), a = i ? "null" === r ? null : r || "{}" : "{}"; try { const e = JSON.parse(a); this.lodash_set(e, o, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const r = {}; this.lodash_set(r, o, t), s = this.setval(JSON.stringify(r), i) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return this.data = this.loaddata(), this.data[t]; default: return this.data && this.data[t] || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0; default: return this.data && this.data[e] || null } } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.cookie && void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar))) } get(t, e = (() => { })) { switch (t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), t.params && (t.url += "?" + this.queryStr(t.params)), void 0 === t.followRedirect || t.followRedirect || ((this.isSurge() || this.isLoon()) && (t["auto-redirect"] = !1), this.isQuanX() && (t.opts ? t.opts.redirection = !1 : t.opts = { redirection: !1 })), this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, ((t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status ? s.status : s.statusCode, s.status = s.statusCode), e(t, s, i) })); break; case "Quantumult X": this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t => { const { statusCode: s, statusCode: i, headers: o, body: r, bodyBytes: a } = t; e(null, { status: s, statusCode: i, headers: o, body: r, bodyBytes: a }, r, a) }), (t => e(t && t.error || "UndefinedError"))); break; case "Node.js": let s = require("iconv-lite"); this.initGotEnv(t), this.got(t).on("redirect", ((t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } })).then((t => { const { statusCode: i, statusCode: o, headers: r, rawBody: a } = t, n = s.decode(a, this.encoding); e(null, { status: i, statusCode: o, headers: r, rawBody: a, body: n }, n) }), (t => { const { message: i, response: o } = t; e(i, o, o && s.decode(o.rawBody, this.encoding)) })); break } } post(t, e = (() => { })) { const s = t.method ? t.method.toLocaleLowerCase() : "post"; switch (t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), void 0 === t.followRedirect || t.followRedirect || ((this.isSurge() || this.isLoon()) && (t["auto-redirect"] = !1), this.isQuanX() && (t.opts ? t.opts.redirection = !1 : t.opts = { redirection: !1 })), this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient[s](t, ((t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status ? s.status : s.statusCode, s.status = s.statusCode), e(t, s, i) })); break; case "Quantumult X": t.method = s, this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t => { const { statusCode: s, statusCode: i, headers: o, body: r, bodyBytes: a } = t; e(null, { status: s, statusCode: i, headers: o, body: r, bodyBytes: a }, r, a) }), (t => e(t && t.error || "UndefinedError"))); break; case "Node.js": let i = require("iconv-lite"); this.initGotEnv(t); const { url: o, ...r } = t; this.got[s](o, r).then((t => { const { statusCode: s, statusCode: o, headers: r, rawBody: a } = t, n = i.decode(a, this.encoding); e(null, { status: s, statusCode: o, headers: r, rawBody: a, body: n }, n) }), (t => { const { message: s, response: o } = t; e(s, o, o && i.decode(o.rawBody, this.encoding)) })); break } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } queryStr(t) { let e = ""; for (const s in t) { let i = t[s]; null != i && "" !== i && ("object" == typeof i && (i = JSON.stringify(i)), e += `${s}=${i}&`) } return e = e.substring(0, e.length - 1), e } msg(e = t, s = "", i = "", o = {}) { const r = t => { const { $open: e, $copy: s, $media: i, $mediaMime: o } = t; switch (typeof t) { case void 0: return t; case "string": switch (this.getEnv()) { case "Surge": case "Stash": default: return { url: t }; case "Loon": case "Shadowrocket": return t; case "Quantumult X": return { "open-url": t }; case "Node.js": return }case "object": switch (this.getEnv()) { case "Surge": case "Stash": case "Shadowrocket": default: { const r = {}; let a = t.openUrl || t.url || t["open-url"] || e; a && Object.assign(r, { action: "open-url", url: a }); let n = t["update-pasteboard"] || t.updatePasteboard || s; if (n && Object.assign(r, { action: "clipboard", text: n }), i) { let t, e, s; if (i.startsWith("http")) t = i; else if (i.startsWith("data:")) { const [t] = i.split(";"), [, o] = i.split(","); e = o, s = t.replace("data:", "") } else { e = i, s = (t => { const e = { JVBERi0: "application/pdf", R0lGODdh: "image/gif", R0lGODlh: "image/gif", iVBORw0KGgo: "image/png", "/9j/": "image/jpg" }; for (var s in e) if (0 === t.indexOf(s)) return e[s]; return null })(i) } Object.assign(r, { "media-url": t, "media-base64": e, "media-base64-mime": o ?? s }) } return Object.assign(r, { "auto-dismiss": t["auto-dismiss"], sound: t.sound }), r } case "Loon": { const s = {}; let o = t.openUrl || t.url || t["open-url"] || e; o && Object.assign(s, { openUrl: o }); let r = t.mediaUrl || t["media-url"]; return i?.startsWith("http") && (r = i), r && Object.assign(s, { mediaUrl: r }), console.log(JSON.stringify(s)), s } case "Quantumult X": { const o = {}; let r = t["open-url"] || t.url || t.openUrl || e; r && Object.assign(o, { "open-url": r }); let a = t["media-url"] || t.mediaUrl; i?.startsWith("http") && (a = i), a && Object.assign(o, { "media-url": a }); let n = t["update-pasteboard"] || t.updatePasteboard || s; return n && Object.assign(o, { "update-pasteboard": n }), console.log(JSON.stringify(o)), o } case "Node.js": return }default: return } }; if (!this.isMute) switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: $notification.post(e, s, i, r(o)); break; case "Quantumult X": $notify(e, s, i, r(o)); break; case "Node.js": break }if (!this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } debug(...t) { this.logLevels[this.logLevel] <= this.logLevels.debug && (t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(`${this.logLevelPrefixs.debug}${t.map((t => t ?? String(t))).join(this.logSeparator)}`)) } info(...t) { this.logLevels[this.logLevel] <= this.logLevels.info && (t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(`${this.logLevelPrefixs.info}${t.map((t => t ?? String(t))).join(this.logSeparator)}`)) } warn(...t) { this.logLevels[this.logLevel] <= this.logLevels.warn && (t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(`${this.logLevelPrefixs.warn}${t.map((t => t ?? String(t))).join(this.logSeparator)}`)) } error(...t) { this.logLevels[this.logLevel] <= this.logLevels.error && (t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(`${this.logLevelPrefixs.error}${t.map((t => t ?? String(t))).join(this.logSeparator)}`)) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.map((t => t ?? String(t))).join(this.logSeparator)) } logErr(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: this.log("", `❗️${this.name}, 错误!`, e, t); break; case "Node.js": this.log("", `❗️${this.name}, 错误!`, e, void 0 !== t.message ? t.message : t, t.stack); break } } wait(t) { return new Promise((e => setTimeout(e, t))) } done(t = {}) { const e = ((new Date).getTime() - this.startTime) / 1e3; switch (this.log("", `🔔${this.name}, 结束! 🕛 ${e} 秒`), this.log(), this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: $done(t); break; case "Node.js": process.exit(1) } } }(t, e) } 154 | --------------------------------------------------------------------------------