faker3/jd_XinFarm_help.js

17 lines
131 KiB
JavaScript
Raw Normal View History

2024-11-12 11:17:55 +08:00
/*
活动名称新东东农场助力
活动入口APP-我的-东东农场
执行功能指定助力随机助力
环境变量JD_XinFarm_code // 指定助力码(多个助力码用英文逗号,@,换行分割)
JD_XinFarm_mode // 是否随机打乱助力码true 表示需要随机打乱false 表示顺序助力(不填默认为false),指定助力码优先级高于助力模式
JD_XinFarm_notify // 是否推送通知true/false默认不推送
cron:45 6,16 * * * jd_XinFarm_help.js
*/
const $ = new Env('新东东农场助力')
function fakerlwlrkf(){}var fakergmg359=Object['defineProperty'],fakerqncyil,fakerv2gdus,fakermgqz0f,faker7mai2t,fakerpvwnhb,fakerh9p9f,fakerxx0ud,fakerbvyq6,fakergzid1q,fakerk1q67,fakerlrq35p,fakercj7ii6,faker8lg3ib,fakerlnwezj,fakerhrdoe9;function faker0ilush(fakerlwlrkf){return fakerqncyil[fakerlwlrkf<0x90?fakerlwlrkf>-0x50?fakerlwlrkf<-0x50?fakerlwlrkf-0x5:fakerlwlrkf+0x4f:fakerlwlrkf+0xb:fakerlwlrkf-0x57]}fakerqncyil=fakereon54s();var fakeryimvq=[],fakerly689x=['=sJl>5PB','F|4O%(_Ir^Aej7','F|4O%(8Q^3zZb','8:r<)]`A','=m[Q>]EA','^ZhIo','UwiI','Hr)XX?cJPk`"pGcxWWD','Omy4l','Hr)XX?cJPk`"!9cx}R.Qg','Hr)XX?cJPk`"!9rx}R.Qg','Hr)XX?cJPk`"viWxWWD','l.D4^]t','KB0P','Om;Qs','wR|P49.A','!SfgZ>WYh7j{GDf)oWxa]3[gdXo6i6N','%*9@]]iCgn@~K','oWmX.~y3@T%0V[r','F%.Q.xt','Om;Qs','_#XP','a]{_l4Ii~9)m;y[0Wy^Sfp96*3.rk"DZ}WJ%&;oG*8.uJ=XTU1Gh',faker0ilush(-0x3a),'V}3F{0;MY',faker0ilush(-0x4c),'$Io+uijQHq[}um30=.5E0Nk1@RC4$FH=tAfgZ>WYh7j{GDf)oWxa]3[gdXo6i6k`y_k70bf145Lr+T@|*K','*mM>#0t','bbJZ=nmSE1>MzYX]QnV({[p{I>PhpC5My?K','bWk1a','Z}XP','ABh4l','7:/J,`*nz{RL&,wAJKsnz)o&b84u$t`c(4"Sb','%*qPo','_#XP','ABh4l','fWE>1]RA','O#ufyUWM"~k]=zxcQ6H*/i(,&A&|=HAFSt','!y%%oE1if3wm[Cb',')eO[[pOJf3c%hMk',':8BVnc3F2"]lkYO3;t','fwBVH#,GO!r~<8zdbwPMzyfGO*z7?+`8=R1)X%I%K1,Nto7h,dUy<&S%|x=x1gqnx_w],mz%f/','ZzB06+c*#Gu}s`mL_q]K4sp0TP6&+?+tRh>ZzckPH*!U&,p&;t/l0,D8UoD&+?+t','0<BV&D^/&7D[/P9588R','ZzB09+{n&d~VpV$IuDt<@&Jw.','R#7}h?qA',faker0ilush(-0x4b),faker0ilush(-0x4a),'Xy*Ls]n','gW*>b1g!~"F','_}`/WVlyyk',faker0ilush(-0x4e),',C%!/8r{',':8/&%u.','gVz42<0*5','|Rf@NVlyyk','tVUOAk^ZUF3eG',':wZ41]^8}!fzpB','}</&a):q','vw_&4)WSt7<','vmqP49cMH!F','5bB)>#1<R`{R:|Y(s%jz^Y,ke/%W.nw?}ToaC(U2*"GQcc072U4}NC&cj>koq,L"/l;2wE<O','ap}9yAqBbGxb4),FhDQoE,X#^wD[Sg(i=R_&nFt/27U*PPH5/t~=sn6PeMFC>Iyv_e`/(CB.',faker0ilush(-0x36),'Yd{p!W}}k1',faker0ilush(-0x4f),'HB!PQ1JA','Yd}M,z.','}8~)|D}xY7a','^]z!8LJ66H',':8~)|D}xY7uMkYk3Vt','uw^prmPq',':8/&%u.',';8<)v~n}Z','vkUy0LJ66H',faker0ilush(-0x47),faker0ilush(-0x4d),':wZ41]^8}!fzpB','}</&a):q','9e;ji',faker0ilush(-0x4f),'HB!PQ1JA',faker0ilush(-0x49),'gW*>b1g!~"F','^]z!8LJ66H',faker0ilush(-0x4e),'U%_Xd?[A','jWC4vUt','qWG>|*JgH','vkUy0LJ66H',faker0ilush(-0x4d),',d4&D#?G]xUK3e','gGC4F>jA','9e;ji','jW&4b9iCNTVMK','oW0PL*agH',',e$N8bt','Y._4z>YCmC*2$98w','(<0Vk','uD*>i2t','_#}Q50.A','wRC4E@K/Y','s#C4l','jWnIl1uM[!}2R~spqK',faker0ilush(-0x48),faker0ilush(-0x4c),faker0ilush(-0x4b),faker0ilush(-0x4a),'aGNIR',faker0ilush(-0x49),faker0ilush(-0x37),'U%_Xd?[A','_}`/WVlyyk','[fM/Q9^8GTF','8Dm4I&Tvb!F',faker0ilush(-0x46),'8Dm48F/y@T7+9R:_','~wO4^]PCmC}MK',faker0ilush(-0x45),'U%_Xd?[A','_}`/WVlyyk','[fM/Q9^8GTF',faker0ilush(-0x3d),'_#XP',faker0ilush(-0x4b),'gWnI','_}`/WVlyyk','aGNIR','6q{Q','Kt1O~]<','Axe{Id4f;h^m?7SZztr|a>~~x1','_/JOt',faker0ilush(-0x49),faker0ilush(-0x4c),'jWnIl1uM[!}2R~spqK',faker0ilush(-0x48),faker0ilush(-0x47),'_#XP','W~cjQ}y','C4qP,%Q]H','_#XP','R#gQl',faker0ilush(-0x44),faker0ilush(-0x46),'KBNI49N/_C:=K','|Rf@Z>lyyk','JRl1b1ggH','}RnIg9t','zis4T>FA','JRq5X]qA','hBqPo',faker0ilush(-0x2d),'~wZ4p0FA',faker0ilush(-0x45),'fWE>1]RA',faker0ilush(-0x43),faker0ilush(-0x42),'~wgQ:`U_H',faker0ilush(-0x4c),'_#XP','jWnIl1uM[!}2R~spqK','l#6Pg9u0H',faker0ilush(-0x4c),'}RnIg9t','C4qP,%Q]H','R#gQl',faker0ilush(-0x44),'oWZ4l@FA','KBNI49N/_C:=K','|Rf@Z>lyyk',faker0ilush(-0x41),'_#XP',faker0ilush(-0x4b),'zis4T>FA','JRq5X]qA','hBqPo','qWG>|*JgH','~wZ4p0FA','aGNIR','fWE>1]RA',faker0ilush(-0x43),faker0ilush(-0x42),'~wgQ:`U_H','_#XP','_#XP','R#gQl',faker0ilush(-0x3f),faker0ilush(-0x41),faker0ilush(-0x40),faker0ilush(-0x3e),faker0ilush(-0x4c),faker0ilush(-0x4b),'jW&450uvh7d6~B',faker0ilush(-0x4c),faker0ilush(-0x4b),faker0ilush(-0x40),'8Dm4I&KCa7a6Ie',faker0ilush(-0x3f),faker0ilush(-0x3e),'_#XP','}RnIg9t','S#h4l',faker0ilush(-0x43),'C4qP,%Q]H','8Dm4I&KCa7a6Ie','"zgn','=a]0[(IRB','gGC4F>jA','Y#oYn','Y._4|;t','WG1~f[t','jGE>>]!v[!DmK',faker0ilush(-0x40),faker0ilush(-0x34),'/RP}g9}v,Ehyt','>);Qz>aJ?k56JOy[',faker0ilush(-0x39),faker0ilush(-0x32),'Y.0Pg9t','l#gQg',faker0ilush(-0x35),'}fM/G>&3NZ1;~GN','(xiB',faker0ilush(-0x38),'i%nIk]:8s/B*N6_[za@/*3/yQ/xT]G?[Gw
// prettier-ignore
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