faker3/jd_XinFarm_help.js

17 lines
112 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
2024-09-18 18:11:20 +08:00
活动名称新东东农场助力
活动入口APP-我的-东东农场
执行功能指定助力随机助力
环境变量JD_XinFarm_code // 指定助力码(多个助力码用英文逗号,@,换行分割)
JD_XinFarm_mode // 是否随机打乱助力码true 表示需要随机打乱false 表示顺序助力(不填默认为false),指定助力码优先级高于助力模式
JD_XinFarm_notify // 是否推送通知true/false默认不推送
2024-09-18 10:49:29 +08:00
2024-09-18 18:11:20 +08:00
cron:45 6,16 * * * jd_XinFarm_help.js
2024-06-28 15:38:28 +08:00
*/
const $ = new Env('新东东农场助力')
2024-09-18 18:11:20 +08:00
function fakerqtq4d(){}var faker5oawfs=Object['defineProperty'],fakergdaizk,fakertdwl8c,fakertfrmw,faker7rtlv7,fakerwtnij,fakertk7gb,fakero88pw,fakerndc9m6,fakerytnw0e,fakercwovzua,fakerbv3q5w,faker6c67x8,fakerww1uv,fakerpks02,fakerxs8uu,faker160uid,fakerycbg6,fakerqlwbv;function faker6zgjl(fakerqtq4d){return fakergdaizk[fakerqtq4d<0x7d?fakerqtq4d<0x7d?fakerqtq4d>-0x19?fakerqtq4d>-0x19?fakerqtq4d+0x18:fakerqtq4d-0x25:fakerqtq4d-0x6:fakerqtq4d-0x21:fakerqtq4d+0x2b]}fakergdaizk=fakerj88ui();var fakerm4vkrd=[],fakerj3m3q=['|.yFwhzN','+X{7b/aN|y?e?n','+X{7b/aVI}WF]N','g]xZO5!F','sR6!p>]L','Eu<yX','Hf9y','l02bb&ecm`jI.We*TTP','|RC@V','l02bb&ecm`jI~ae*o(+!;','l02bb&ecm`jI~a0*o(+!;','l02bb&ecm`jI[9T*TTP','V+P@E>,','Mn)m','|RJ!Q','f($m@a+L','~F_;upTG<1w%WP_2XT*3>i6;=bX494/','NUa#>>9Y;:#5M','XTRb+5Ci#^N)h60','}N+!+*,','|RJ!Q',faker6zgjl(-0x18),'3>%zV@y95a2RJC6)TCEF_.a4Ui+0`IPuoTcNgJXWUK+kcsb^HqW<','nn{p!a,','hoi}%)J{G',faker6zgjl(-0x18),'ZyX8k9w!lB6okRi)s+7])/`q#(Y@Z}ls,L_;upTG<1w%WP_2XT*3>i6;=bX494`jCz`1)D_q@7S08^#$UM','UR{pr),','DDcus:RF]qp{"Gb>!:hv%6.%ypm<.Y7{C&M','DT`q3','uobm','Ln<@V','4RsvHjiI)(3<"HaEv8_I)D*"q~5f]LjJN5S$q','NUBmX','zrbm','Ln<@V','_T]pq>(L','Q>H9#_k!sU(ovj~)dC`1YX3A@4@Dv`4S{M','~CNNX]q9_ifR6YD','2d|66.|c_ieN<{`','wT:yc).S7so?(5Q.BM','9N:y`>AKQx=UWTjf2N6!j#9KQ1jIEaZTvP]pG[^["]A+MeIFAf_#W@{[D~v~]|Lc~RNoA&j[9Y','_P6);adohs{u|mjJ47tp`|R)Yr;,a>aIN]@_PdHr^oMS,eR,&Iv9)eTzSbT,a>aI','/W:y@qzY@IqJY6<*TTP','_P6)xa!0,+}EREQF{TI.C,G1X','HCotxj&7',faker6zgjl(-0xf),'GzBRU1?;Mv/%:hbq{Hr#4~uuz6',faker6zgjl(-0xe),';TUpDq;~5I}',faker6zgjl(-0x17),'wTUpDq;~5IH!(5(.yM','{1nR3jr7',faker6zgjl(-0x14),faker6zgjl(-0x16),faker6zgjl(-0x13),'XTDh9K%{D~(4M','Afu@q>EKo~_".n',';WY@}pwL','214,`~L%I/.','[RBm@ae{l~}','$Rux[876"si"`~eg]T=bOeAhn1T5%BWlKN4,0gIv?/Sorr^qvI}K|0;r=[h49A@/1wmvW*6X','}b;<#4L:2K~2upASFqdeOAG>zNqJ{|3XvPR@cSMY7I_166`*YMUvtcC6n!S08^#$RnZY30:,','?CGtD','5fgbxk;;(]',faker6zgjl(-0x15),'_wiZ#T07','c+u#ePX','uz}~(Tuic/$',faker6zgjl(-0x17),'fz}~(Tuic/{#HcHVEI','HNzb=&6L','fzv,U{X',faker6zgjl(-0x16),'$(_#/hVCC`',').6E,Tnv,/T5vrxqzzN','Afu@q>EKo~_".n','u.v,$~f7','xw&Zl',faker6zgjl(-0x15),'_wiZ#T07','c+u#ePX','uz}~(Tuic/$','ntPMzJG;;^','wTUpDq;~5IH!(5(.yM','{1nR3jr7',faker6zgjl(-0x14),faker6zgjl(-0xb),faker6zgjl(-0x13),').6E,Tnv,/T5vrxqzzN','Afu@q>EKo~_".n','u.v,$~f7',faker6zgjl(-0xc),'fz!,(ayv)FJ%I','XT)mSU3;l','OdZ/KD,','Akn,p~Av4v}9mas+','W.)EH','kPUp9?,',faker6zgjl(-0x4),'f(Y@]#MxG','QrY@V',faker6zgjl(-0xa),faker6zgjl(-0x9),'zrbm','o(:y;a,','VT|b[N7CxYI{s>e*H(6!Rp;;T:',faker6zgjl(-0x12),'5f;!Aj,',faker6zgjl(-0x7),'HNzb=&6L',faker6zgjl(-0x11),faker6zgjl(-0x10),faker6zgjl(-0x6),faker6zgjl(-0xd),'KPR@K}xC#^18a(Az','5f|@E>mYRYo{M',faker6zgjl(-0x12),'HNzb=&6L',faker6zgjl(-0x11),faker6zgjl(-0x10),'<nBmX','zrbm','o(:y;a,',faker6zgjl(-0x1),'zojxThVCC`',faker6zgjl(-0x12),faker6zgjl(-0x18),faker6zgjl(-0xf),'VT|b[N7CxYI{s>e*H(6!Rp;;T:','3W/y(',faker6zgjl(-0xe),'zrbm','wT:yVqk{6~o?(5Q.BM','Vr4m;ak)l','zrbm','o(:y;a,','Y@BmON!>l','(r;!V','KPR@ygMY3134yd',faker6zgjl(-0xd),'Mn/y@a/xzYAsM','$(_#upVCC`','c(VqDq;;l','zrbm',faker6zgjl(-0xf),'"9Q@^p}L','c(B7b>BL',faker6zgjl(-0xc),faker6zgjl(0x8),faker6zgjl(-0x8),faker6zgjl(-0xb),'5fu@.)}L','3W/y(','_T]pq>(L','5fgbxk;;(]','V+P@|i]L','5f;!AjHzl',faker6zgjl(-0x18),'zrbm',faker6zgjl(-0xa),faker6zgjl(-0x9),'zrbm','o(:y;a,',faker6zgjl(-0x5),'(r;!V','KPR@ygMY3134yd',faker6zgjl(-0xd),'Mn/y@a/xzYAsM','$(_#upVCC`','c(VqDq;;l','zrbm',faker6zgjl(-0xf),'"9Q@^p}L','OT`v6%`m','qW`4o',faker6zgjl(-0x8),faker6zgjl(-0xb),'5fu@.)}L','3W/y(',faker6zgjl(-0x7),'5fgbxk;;(]','V+P@|i]L','5f;!AjHzl','zrbm',faker6zgjl(-0x18),'(r;!V','|Pg@B','c(VqDq;;l','KPR@yg^[D~}','wTg@7)k[<1=45n',faker6zgjl(-0x18),faker6zgjl(-0xf),'wTg@7)k[<1=45n',faker6zgjl(-0x18),faker6zgjl(-0xf),faker6zgjl(-0x6),'KPR@ygMY3134yd','|Pg@B','wTg@7)k[<1=45n',faker6zgjl(-0x18),'o(:y;a,','Fr<@V','5fgbxk;;(]',faker6zgjl(-0x5),'KPR@ygMY3134yd','zrbm','BTWp$Uc;l',';WY@}pwL','GrXG:','G+z@$J,','TWq5_6,','(hXaab9H89@.j',faker6zgjl(-0x6),'=F*5z_J','x(mo;ao[O]<C,','a>_AVa/Srk{"S&#8',faker6zgjl(-0x3),'a>_AVa^C','=F2No+J','Vr;!;','7T{p=&Y>l',']nQw','(BP%KQ@Y=','Q4P%kb
2024-06-28 15:38:28 +08:00
// prettier-ignore
2024-09-18 10:49:29 +08:00
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } 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.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.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) 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 r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; 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), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== 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), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.d