jdpro/jd_farm_help_new.js

9 lines
83 KiB
JavaScript
Raw Normal View History

2024-01-02 12:59:48 +00:00
/*
新农场助力
33 3,9 * * * jd_farm_help_new.js
export NEWFRUITCODES = 'xxx&xxx' 可指定助力码助力多个用&分割不指定则自动搜集任务助力码
*/
const $ = new Env('新农场助力');
var _0xodi='jsjiami.com.v7';const _0x111021=_0xad07;(function(_0x18e6c4,_0x3d017f,_0x2e662e,_0x3e4188,_0x8e2dca,_0x1c2f97,_0x3d37b6){return _0x18e6c4=_0x18e6c4>>0x9,_0x1c2f97='hs',_0x3d37b6='hs',function(_0x27e3f2,_0x45d0da,_0x33fc53,_0x20e95c,_0x32cf32){const _0x4503a6=_0xad07;_0x20e95c='tfi',_0x1c2f97=_0x20e95c+_0x1c2f97,_0x32cf32='up',_0x3d37b6+=_0x32cf32,_0x1c2f97=_0x33fc53(_0x1c2f97),_0x3d37b6=_0x33fc53(_0x3d37b6),_0x33fc53=0x0;const _0x4dba6a=_0x27e3f2();while(!![]&&--_0x3e4188+_0x45d0da){try{_0x20e95c=parseInt(_0x4503a6(0x17a,'9Vj]'))/0x1+-parseInt(_0x4503a6(0x122,'K*9p'))/0x2*(-parseInt(_0x4503a6(0xb2,'$mtg'))/0x3)+parseInt(_0x4503a6(0x321,'AD!u'))/0x4+-parseInt(_0x4503a6(0x2da,']%Yd'))/0x5*(parseInt(_0x4503a6(0x1e0,'AD!u'))/0x6)+parseInt(_0x4503a6(0x3a9,'N!hM'))/0x7*(parseInt(_0x4503a6(0x451,'K*9p'))/0x8)+-parseInt(_0x4503a6(0x11f,']%Yd'))/0x9*(parseInt(_0x4503a6(0x37a,'aQ4Z'))/0xa)+-parseInt(_0x4503a6(0x336,'Bd82'))/0xb;}catch(_0x29bf58){_0x20e95c=_0x33fc53;}finally{_0x32cf32=_0x4dba6a[_0x1c2f97]();if(_0x18e6c4<=_0x3e4188)_0x33fc53?_0x8e2dca?_0x20e95c=_0x32cf32:_0x8e2dca=_0x32cf32:_0x33fc53=_0x32cf32;else{if(_0x33fc53==_0x8e2dca['replace'](/[dIuXlJPhVgWQLUMqkK=]/g,'')){if(_0x20e95c===_0x45d0da){_0x4dba6a['un'+_0x1c2f97](_0x32cf32);break;}_0x4dba6a[_0x3d37b6](_0x32cf32);}}}}}(_0x2e662e,_0x3d017f,function(_0x1f3e7c,_0x248709,_0x5f972,_0x22b025,_0x10fe36,_0x2aac15,_0x5e83c2){return _0x248709='\x73\x70\x6c\x69\x74',_0x1f3e7c=arguments[0x0],_0x1f3e7c=_0x1f3e7c[_0x248709](''),_0x5f972=`\x72\x65\x76\x65\x72\x73\x65`,_0x1f3e7c=_0x1f3e7c[_0x5f972]('\x76'),_0x22b025=`\x6a\x6f\x69\x6e`,(0x14a93f,_0x1f3e7c[_0x22b025](''));});}(0x18a00,0x8b481,_0x7226,0xc7),_0x7226)&&(_0xodi=0x1c6);const _0x5de56a=(function(){const _0x1a0bcb=_0xad07,_0x3e3585={'AfWxP':function(_0x3f1b16,_0x599cf5){return _0x3f1b16==_0x599cf5;},'NOJLQ':_0x1a0bcb(0x1c7,'K*9p'),'lFVfK':function(_0x1b9491,_0x5716b4){return _0x1b9491!==_0x5716b4;},'pLqVR':_0x1a0bcb(0x20e,'op%h'),'SdVVo':function(_0x587f62,_0x210793){return _0x587f62===_0x210793;},'AvnTf':_0x1a0bcb(0x20d,'aQ4Z'),'OGpky':_0x1a0bcb(0xc5,'3y4F'),'DroOT':function(_0x1bffd5,_0x3ac498){return _0x1bffd5===_0x3ac498;}};let _0x47f39a=!![];return function(_0x31afc3,_0x425ce7){const _0x5a9fcd={'LIpsF':function(_0x144f3f,_0x4ba232){const _0x1de445=_0xad07;return _0x3e3585[_0x1de445(0xd4,'t$tq')](_0x144f3f,_0x4ba232);}},_0x36ed86=_0x47f39a?function(){const _0x6233fd=_0xad07,_0x1c38a5={'BXGiE':function(_0x44e506,_0x1686fd){const _0x4d7892=_0xad07;return _0x3e3585[_0x4d7892(0x10f,'AD!u')](_0x44e506,_0x1686fd);},'NHXjB':_0x3e3585[_0x6233fd(0xe3,'K43e')]};if(_0x3e3585[_0x6233fd(0x2f8,'OrBR')](_0x3e3585[_0x6233fd(0x2a9,'vTrj')],_0x3e3585[_0x6233fd(0x196,'Bd82')])){if(_0x3c728b){_0x4ad693=_0x3d81fd[_0x6233fd(0x200,'N!hM')](_0x2b9752);if(_0x5a9fcd[_0x6233fd(0x2c1,'6L6s')](_0x4ea38d[_0x6233fd(0x36b,'AD!u')],'1')){}else _0x5a9fcd[_0x6233fd(0x15e,'oN4E')](_0x2cba2c[_0x6233fd(0x384,'%lQ[')],'0')&&(_0x4ecfb4[_0x6233fd(0x2c9,'6@wF')]=![]);}}else{if(_0x425ce7){if(_0x3e3585[_0x6233fd(0x215,'K43e')](_0x3e3585[_0x6233fd(0x1aa,'6L6s')],_0x3e3585[_0x6233fd(0x39f,'JCAs')]))try{if(_0x1c38a5[_0x6233fd(0x392,'8x^l')](typeof _0x1707e8[_0x6233fd(0x282,'8x^l')](_0x17e6f6),_0x1c38a5[_0x6233fd(0xb1,'x[PS')]))return!![];}catch(_0x7ad234){return _0xdf659[_0x6233fd(0x28c,'EU$Q')](_0x7ad234),_0x3e50a9[_0x6233fd(0x350,'Xs1n')](_0x6233fd(0x242,'x1Vb')),![];}else{const _0x5c2363=_0x425ce7[_0x6233fd(0x2eb,'JCAs')](_0x31afc3,arguments);return _0x425ce7=null,_0x5c2363;}}}}:function(){};return _0x47f39a=![],_0x36ed86;};}()),_0x7353d9=_0x5de56a(this,function(){const _0x3b42bc=_0xad07,_0x387c12={'RyRfl':_0x3b42bc(0x29e,'N!hM')};return _0x7353d9[_0x3b42bc(0x2e6,'vTrj')]()[_0x3b42bc(0xe4,'%gzd')](_0x387c12[_0x3b42bc(0x2bb,'BEfQ')])[_0x3b42bc(0x3e6,'jZiY')]()[_0x3b42bc(0x207,'PYDN')](_0x7353d9)[_0x3b42bc(0xff,'%lQ[')](_0x387c12[_0x3b42bc(0x320,'TD7r')]);});_0x7353d9();let _0x3a0a8c=[],_0x42c2f0=[],_0x334df1='',_0x1e9e8b,_0x5cec30=[],_0x62633d='',_0xe34c3d='',_0x27be5f='',_0x290e59=[],_0x4a3a73={},_0x3d39fe=0x0,_0x32c7de=![];const _0x42154f=require('fs
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