faker3/jd_fruit_diyhelp.js

17 lines
53 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
2024-06-29 17:05:17 +08:00
活动名称东东农场指定助力
活动入口APP-我的-东东农场-旧版
执行功能指定助力随机助力
环境变量jd_fruit_code // 指定助力码(多个助力码用英文逗号,@,换行分割)
jd_fruit_mode // 是否随机打乱助力码true 表示需要随机打乱false 表示顺序助力(不填默认为false),指定助力码优先级高于助力模式
jd_fruit_notify // 是否推送通知true/false默认不推送
2024-06-28 15:38:28 +08:00
cron:1 1 1 1 *
*/
2024-06-29 17:05:17 +08:00
const $ = new Env('东东农场指定助力')
const _0x1ca87d=_0x36d7;(function(_0x1dbc5b,_0x719d89){const _0x5464fc=_0x36d7,_0x404b8c=_0x1dbc5b();while(!![]){try{const _0x50482d=-parseInt(_0x5464fc(0x2ad,'jS*O'))/0x1+parseInt(_0x5464fc(0x1cd,'A)Tz'))/0x2+parseInt(_0x5464fc(0x221,'hF3F'))/0x3*(parseInt(_0x5464fc(0xcc,'6tYb'))/0x4)+parseInt(_0x5464fc(0x128,'f3Zz'))/0x5*(parseInt(_0x5464fc(0x1c6,'hF3F'))/0x6)+-parseInt(_0x5464fc(0x27a,'LMT['))/0x7*(-parseInt(_0x5464fc(0xea,'X&C]'))/0x8)+parseInt(_0x5464fc(0xcf,'XGdt'))/0x9*(-parseInt(_0x5464fc(0x24e,'WQfb'))/0xa)+parseInt(_0x5464fc(0x194,'8xNG'))/0xb*(-parseInt(_0x5464fc(0x288,'dj[6'))/0xc);if(_0x50482d===_0x719d89)break;else _0x404b8c['push'](_0x404b8c['shift']());}catch(_0x283e1d){_0x404b8c['push'](_0x404b8c['shift']());}}}(_0x5d46,0x955db));const jdCookie=require('./jdCookie'),notify=require('./utils/Rebels_sendJDNotify'),common=require(_0x1ca87d(0xbb,'o0@I')),{H5st}=require(_0x1ca87d(0x181,'dj[6')),fs=require('fs'),CryptoJS=require(_0x1ca87d(0x105,'fi5S')),querystring=require(_0x1ca87d(0x23a,'i9bY')),shuffleShareCodes=process[_0x1ca87d(0x144,'dj[6')][_0x1ca87d(0x1ba,'$RNs')]===_0x1ca87d(0x1e4,'*1PY'),isNotify=(process[_0x1ca87d(0x1ee,'8xNG')][_0x1ca87d(0x135,'Yzl)')]||process[_0x1ca87d(0x281,'oGdI')]['jd_fruit_Notify'])==='true',helparr=(process['env'][_0x1ca87d(0x28c,'LMT[')]||'')[_0x1ca87d(0x180,'haI#')](/[,@\n]+/g)[_0x1ca87d(0x1bc,'$RNs')](_0x142fd7=>_0x142fd7[_0x1ca87d(0x13a,'$RNs')]())[_0x1ca87d(0x20c,'Nc$H')](Boolean),ShareCodesCacheFile=_0x1ca87d(0x134,'U]W&');function _0x5d46(){const _0x3ac986=['W75PEmkQW7y','WRNcRSkHECo+DSkie8kFW7hdTxO5sepcRCowW4iCW5eLWR3dRwBdHdXYWOJcNmoPzvDaWP05hrJcPhhdKCodW4ZdL2nNWRBdVCoFjuDuW5dcN8oPimoVzcbMWRxcOSkBpwKTWO7cH8ocWO4KqrddSmo9qJ3dG8oWW4ZdPaPMW4fhW6xdI3ZcI8k7D8o8WO3cOWFcItOofmouW44ZW4pcUmoJnZNdLxJdLrukmYxdGrPhW7fGWRtcGCkDWQHdWRuoW408k8kABHxcVmofAH4pW7i8w8oLW4pcJ0ZcH8klW603h8kaymodWQddTSouW7y2WPD+gHyXCSo/','6Ag85BQV5OId6kcN','i8onfW','WR8gW541W6NdRmk5rSk3kSk/ASotW7NcLgzlW7HNteNdLJBdS8oKW5GwWR7cPCkr','CmkVk8kJW7xdLa','fSkqW7ldT0VcPW','fSkZoWrtW7hcISo+','tCoLaZzTW7xcGCo6dKBcJmk2W6G+eriYpG','a8o9mCkpw8kZ','C8k4mmknW6RdJ8oCkNq','WR5pFmoKWOZcNa','fwhdMq','W4NdR8khlSkcjCkneG','mdbDzqJcSq','WR4TWQpcNNVcRKaJcSoqW592','W4VdRxhcSIhcU1JdO8kGW5fbWOe','WPhdISo0WOe','WQZdJID3','cSkmWOi','isDlCrdcOa','p8oInCkfsSkflNRdTG','8yQOMSkFW4OZW7dcQIi4sa7dMHf2BaFcKSkaW6qtrmogW61W6k+A5RgZ5AEE6lEIWOlINArI5PsJ5zgr5BM85Pss5O+v','tbHUrCkwW7ZcQW','WRSoW5CTWOn1W5zxpa','W5JcMZ8','WP/cUdldJNhdUwRdQSkYW6H0WOSlvuz5tHzT','WPOhW6RcI8oOWOjAWRy','W6X8FmkGW73dGmkJW4Xy','cmkgWOdcJLJdTHjPW5ddLdzoWOPkASkYW5HkAmogvW','WPenW7K','W4XwWQZdVSkYW5SxWRvwW5vOlSoA','W5xcMfRcS8ovfCob','WPZdQmkywWe','W5tJGABMNyVORRVJGPhMNQpMR7NLJ53LIBFLI57OT7FLJRlLH4JMNOpcOa','WPPPdCkDwZ4','WQKVW7WaW7RcI8oogMhcV0m','Afuj','D8oLW6W','W7lJG43MOOBMT4NJGihLIQ3PMAVNG7lNI4dMIR/OGihMLjVMLjxOTjBLJ4pLUOxLJ5bdi3K','WOldHmoIWPDx','ncDmsb3cOafvqtXHWQKXnhWtx8ocWOurWPVdTSkPuW','oIXBAaNcSafv','WR0eW5CPW7tdOmo1wmkT','W6zkWPvzWODIW4i','W7lcIrGbqmkH','cfNdKW','W7H8FmkUW7VdG8kKW4XoySkEWQeUWRbt','WOCZWQNcGhW','WPhKUitLIRVLIjVNO6ldUW','W79MW7hcPr8','AeejdG','hmkrW7NdUvO','W7BcTIW','vmkGWQRcKG','W4JdSHPl','idzkBrlcSW1ata','wNRcNJxdVmox','WQRdOSkjrwmctv7dGs9x','zrP5wmkQW5i','WR9oDwegBHW','W7/cNayVua','WRqpW4O2WONdKq','W6PkWOHFWQHOW4pdMvepWOW','W4BcKt7dJZyHWRy','tgdcHq','txpcHmofW7K','a8kAW6/dR0VcRCoI','hmklW4JcQuq','5yM25yQHgW','WRzkWRPOWRNcHW','4P6cWOhOHzNMNklOV4dOORRPGBlLI77KU4RPLOJORjLb','6kw95P28572L5AY+5PAZ5lI/5PEt5ywy6zssma','nw/dKZK9W7lcHxNdKHFcLSo1W7xdPrWstmoUWOlcQmk5BuzkW40FW5BdM8kJW7vmfCoxWQjc','4P+CWOFdSqFcNwBcQq84F8kBW4VcJH7cUSk6phDSW7qggZNLNjBLPyFNK7/MJ5pLJzNLK6ZLU7NMLyxPGi7LI7/KU5RPLjVORQ5U4P+ioW','W7b7ySkgW7hdMW','5yUU5yQ65QIy5BYoW7uLWQC','W5hdQqfmWQBdN8kGomkr','twtdIYuxW4VcSa','WPtcSIe','WQmrWR7cLIfFWP1CtmkJbSkXW4iW','WQNdU8ksxa','q8kfDWL+s8k4WOK','j23dIdS0W43cJthcIq','W6pcPtOyW7/dHW','W5FcMZZdJW','WQusW501WPnxW5Pi','WQnsE0i','W7T4W6i','WPD8e8kZsW','W5ZcISowWPzhW7XAW64bgCk7W60zW5ZdISkjW5WdfJv/W6rO','WQzktCoMWPhcHmkUW7VdNNrFW6iaW63cKa','ESkcf3lcK8o5','8ygzTMy','WOxdHMK','WPBdHmoKWOu','umo5aY8','nvrxrmkHyq','aCkgWPhcUw/dSbbOW4ldGG','WRvjC0Gy','W47cQCooeY
2024-06-28 15:38:28 +08:00
// prettier-ignore
2024-06-29 17:05:17 +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