faker3/jd_fruit_friend.js

16 lines
127 KiB
JavaScript
Raw Normal View History

2024-11-12 11:17:55 +08:00
/*
东东农场好友删减奖励 jd_fruit_friend.js
活动入口京东APP我的-更多工具-东东农场
#东东农场好友删减奖励
cron "10 2 * * *" script-path=jd_fruit_friend.js,tag=东东农场好友删减奖励
*/
const $ = new Env('东东农场好友删减奖励')
2024-12-12 14:33:07 +08:00
function hUC1k8O(){}var YSoCRm3=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],kkBv5zS,_FZfuw,KQtZoRa,hRnix8,o474XH,SJhiXv,hVk8R7O,jxqg8B,xVjSoQ,lewVCd,GdcAPe,I8T26X,RrymrXV,PxwOO3,PXLYrYH,BkTIDb,Qaiayh,HpVRnBn;function zfUw98P(hUC1k8O){return kkBv5zS[hUC1k8O<0x47?hUC1k8O+0x17:hUC1k8O<0x47?hUC1k8O+0x3b:hUC1k8O>0xc1?hUC1k8O-0x41:hUC1k8O-0x48]}hUC1k8O(kkBv5zS=fbGXmOK(),_FZfuw=dcVfziV((hUC1k8O,YSoCRm3)=>{return YSoCRm3(hUC1k8O())},0x2)(l9gHQZ,ve1CvfG));var dnelCfw=[],_oTHGq=[AI5hqrA(0x0),'\x34\x4c\x76\x32\x6b\x62\x2f\x31','\x5b\x68\x38\x78\x75\x32\x52\x75','\x3e\x5b\x61\x6e\x56\x6c\x24\x65',AI5hqrA(zfUw98P(0x69)),'\u002c\u0077\u003c\u0031\u0061\u0048\u002a\u0069\u0068','LP6g`',AI5hqrA(0x2),'\x68\x58\x7c\x5a\x7a\x3a\x79\x2c\x49\x58',AI5hqrA(zfUw98P(0x68)),'EwZB',AI5hqrA(0x4),AI5hqrA(zfUw98P(0xb1)),'\x6b\x3e\x5d\x6f\x23\x77\x71\x21\x55\x23\x73','\x54\x59\x4c\x23\x58\x6e\x42\x25\x5a\x36\x7c','\u0043\u006a\u0033\u0042','\u0032\u0047\u005d\u006f\u0023\u0077\u0056\u005e','\u004d\u0032\u0049\u004e\u0031\u0048\u0041\u005e','EwZB','\x6f\x2e\x24\x23\x32\x52\x60\x65',AI5hqrA(zfUw98P(0x71)),',.x1gnpvg*/mec','\x21\x2e\x55\x67\x57\x48\x6b\x5a\x68','\u0030\u003f\u0041\u0067\u002c',AI5hqrA(0x6),'\x6b\x3c\x57\x6a\x7d\x61\x6d\x7b\x52\x5b\x4c',AI5hqrA(zfUw98P(0x6a)),'\u006b\u003c\u0057\u006a\u007d\u0061\u006d\u007b\u0052\u005b\u004b\u0078\u0026','\x22\x57\x6c\x49\x3b\x64\x4e\x2c\x44','\x33\x7c\x4c\x23\x77\x33\x26','\x68\x6a\x40\x42\x4e\x32\x64\x65',AI5hqrA(zfUw98P(0x6f)),'\u0040\u0059\u006b\u003c\u005b\u0035\u006e\u0075\u005e\u0028\u007a\u004f\u0039\u0060\u0028\u0045\u0022\u0044\u0078\u005a\u002c\u0039\u0062\u0056\u0029\u007a\u004c\u007a\u0043','VH9=RRa%MU=IC','\x38\x67\x2c\x4f\x35\x61\x21\x4e\x68\x75\x3e\x3c\x58\x79\x45\x33\x5e\x33\x2a\x7a\x63\x24\x3c\x5e\x6e\x23\x50\x54\x48\x2f\x36\x28\x22\x21\x39\x33\x3b\x6c\x33\x61\x71\x58\x6b\x4b\x5f\x49\x3c\x46\x7d\x6f\x6d\x79\x4e\x39\x42\x66\x77\x2a\x4f\x6d\x49\x75\x79\x7b\x3e\x7b\x6a\x55\x73\x5a\x6f\x32\x46\x32\x60\x5a\x5e\x6e\x55\x6b\x47\x26',',.<ZGIK4=/V3>}X',AI5hqrA(0x9),zfUw98P(0x4c),AI5hqrA(0xa),zfUw98P(0x62),AI5hqrA(0xb),AI5hqrA(0xc),'\u0061\u0056\u0055\u0067\u002a\u0052\u0028\u0054\u0060\u005a\u0079\u006d\u005e\u0039\u002c\u006b\u0079\u007b\u004d\u0042\u0056\u0031\u006d\u0037\u002b\u0040\u0066\u003a\u0040\u002e\u006e\u007d\u0038\u0079\u0039\u003d\u005f\u0023\u007c\u0033\u0050\u002f\u002c\u0030\u0060\u0036\u0037\u007c\u005b\u0060\u0070\u005b\u0029',AI5hqrA(zfUw98P(0x6e)),'\x22\x5a\x4d\x41\x71\x39\x36\x6a\x46\x54\x45\x6b\x36\x3e\x21\x40\x69\x32\x3d\x4f\x44\x65\x5a\x77\x55\x29\x46\x3c\x7a\x4d\x5d\x33\x3d\x60\x46\x24\x36\x43\x39\x5e\x48\x34\x64\x2c\x7d\x6d\x7a\x7a\x56\x2e\x5a\x61\x22\x39\x6a\x7a\x31\x7b\x34\x57\x69\x55\x33\x56\x65\x6c\x6a\x45\x50\x66\x50\x4e\x6b\x6e\x66\x79\x66\x7b\x68\x52\x2a\x7d\x5b\x59\x25\x24\x26\x63\x79\x62\x63',zfUw98P(0x4a),zfUw98P(0x48),AI5hqrA(0xe),AI5hqrA(zfUw98P(0x65)),AI5hqrA(zfUw98P(0x51)),AI5hqrA(0x11),'\u003f\u005b\u005a\u0042','fB$n!',AI5hqrA(zfUw98P(0x7b)),AI5hqrA(0x13),AI5hqrA(0x14),AI5hqrA(0x15),',.+>aT&','AjuB,','AjuB,',':V<1?#5mC;P',AI5hqrA(zfUw98P(0x7e)),'\x22\x5a\x4d\x41\x3d\x5e\x65\x55\x7c\x54\x40\x7c\x3f\x23\x28\x69\x59\x32\x68\x28\x46\x33\x25\x79\x77\x7a\x2b\x29\x3d\x2e\x24\x7b\x22\x42\x68\x3d\x61\x70\x51\x33\x28\x3b\x78\x5d\x46\x5e\x6e\x5b\x32\x21\x75\x36\x69\x39\x2b\x42\x53\x7b\x44\x79\x55\x45\x2c\x57\x5d\x2c\x26','\x22\x5a\x4d\x41\x3d\x5e\x65\x55\x7c\x54\x40\x7c\x3f\x23\x28\x69\x59\x32\x68\x28\x46\x33\x25\x79\x77\x7a\x2b\x29\x3d\x2e\x24\x7b\x22\x42\x68\x3d\x61\x70\x51\x33\x28\x3b\x78\x5d\x46\x5e\x6e\x5b\x32\x21\x75\x36\x24\x5e\x26\x44\x46\x7b\x46\x7e\x55\x45\x2c\x57\x5d\x2c\x26','"ZMA]l1.F{q_kgyW$x$SAYSdk`(_Fn@3(E9s+.9^H4s$e@.>S.>kE9mz3{{[28I@d%+|He%`21#m1*btKEssrqB"S4<@<pUk7Z=Fqf&',AI5hqrA(0x17),zfUw98P(0x48),'I{MN(t&','>[Unx^fRh',AI5hqrA(0x10),'\x22\x7e\x29\x6a\x6e\x58\x3a\x6e',AI5hqrA(0x18),AI5hqrA(zfUw98P(0x83)),'UGty7NK6h%','B+lVo6^tmqj)xF|gjK*D+=);2zY<zr]T%jFp7Z4AEM|0mS;4"m?"a',AI5hqrA(0x14),'ir/=;fH','\u007c\u0072\u0032\u0024\u0042\u0074\u0048',AI5hqrA(0x1a),zfUw98P(0x5c),'\x4d\x2e\x40\x42\x58\x3e\x37\x75\x49\x21\x78\x33\x43'
2024-11-12 11:17:55 +08:00
// 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