faker3/jd_XinFarm_help.js

22 lines
82 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
新东东农场助力
助力领取助力奖励
环境变量
jd_XinFarm_Notify // 是否推送通知true/false默认不推送
cron:45 6,16 * * *
============Quantumultx===============
[task_local]
#新东东农场助力
45 6,16 * * * jd_XinFarm_help.js, tag=新东东农场助力, enabled=true
*/
const $ = new Env('新东东农场助力')
var _0xodg='jsjiami.com.v7';const _0x13a9f7=_0x2813;(function(_0x280bd8,_0x1958cb,_0x527376,_0x3caacb,_0x5da2bf,_0x36134c,_0x54732e){return _0x280bd8=_0x280bd8>>0x6,_0x36134c='hs',_0x54732e='hs',function(_0x1d8629,_0x17376c,_0x457acf,_0x9de00e,_0x6222e4){const _0x5df376=_0x2813;_0x9de00e='tfi',_0x36134c=_0x9de00e+_0x36134c,_0x6222e4='up',_0x54732e+=_0x6222e4,_0x36134c=_0x457acf(_0x36134c),_0x54732e=_0x457acf(_0x54732e),_0x457acf=0x0;const _0x2606fd=_0x1d8629();while(!![]&&--_0x3caacb+_0x17376c){try{_0x9de00e=-parseInt(_0x5df376(0x3a9,'a7ES'))/0x1+-parseInt(_0x5df376(0x3d1,'ho1H'))/0x2+parseInt(_0x5df376(0x398,'ho1H'))/0x3*(parseInt(_0x5df376(0x25b,'toA3'))/0x4)+parseInt(_0x5df376(0x3e8,'U@3F'))/0x5*(-parseInt(_0x5df376(0x3ae,'BTXK'))/0x6)+-parseInt(_0x5df376(0x1d6,'sl[w'))/0x7+-parseInt(_0x5df376(0x207,']qsc'))/0x8*(parseInt(_0x5df376(0x408,'qeA*'))/0x9)+parseInt(_0x5df376(0x300,'j1do'))/0xa;}catch(_0x536b63){_0x9de00e=_0x457acf;}finally{_0x6222e4=_0x2606fd[_0x36134c]();if(_0x280bd8<=_0x3caacb)_0x457acf?_0x5da2bf?_0x9de00e=_0x6222e4:_0x5da2bf=_0x6222e4:_0x457acf=_0x6222e4;else{if(_0x457acf==_0x5da2bf['replace'](/[XndKpIutLGYDfkbSeC=]/g,'')){if(_0x9de00e===_0x17376c){_0x2606fd['un'+_0x36134c](_0x6222e4);break;}_0x2606fd[_0x54732e](_0x6222e4);}}}}}(_0x527376,_0x1958cb,function(_0x3dc917,_0x528dd6,_0x2f291d,_0x1f188a,_0x1067e5,_0x1d8994,_0x594f23){return _0x528dd6='\x73\x70\x6c\x69\x74',_0x3dc917=arguments[0x0],_0x3dc917=_0x3dc917[_0x528dd6](''),_0x2f291d='\x72\x65\x76\x65\x72\x73\x65',_0x3dc917=_0x3dc917[_0x2f291d]('\x76'),_0x1f188a='\x6a\x6f\x69\x6e',(0x174494,_0x3dc917[_0x1f188a](''));});}(0x3280,0xbf556,_0x2eeb,0xcc),_0x2eeb)&&(_0xodg=0xcc);function _0x2813(_0x3d425a,_0x477c3a){const _0x2eeb5f=_0x2eeb();return _0x2813=function(_0x281303,_0x79d3b){_0x281303=_0x281303-0x1b0;let _0x5b01ed=_0x2eeb5f[_0x281303];if(_0x2813['RYicKf']===undefined){var _0xecf984=function(_0x2b5640){const _0x4c2bf2='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x36bdc9='',_0x522e8f='';for(let _0x567e45=0x0,_0x192e15,_0x1f1446,_0x337575=0x0;_0x1f1446=_0x2b5640['charAt'](_0x337575++);~_0x1f1446&&(_0x192e15=_0x567e45%0x4?_0x192e15*0x40+_0x1f1446:_0x1f1446,_0x567e45++%0x4)?_0x36bdc9+=String['fromCharCode'](0xff&_0x192e15>>(-0x2*_0x567e45&0x6)):0x0){_0x1f1446=_0x4c2bf2['indexOf'](_0x1f1446);}for(let _0x94831c=0x0,_0x33ccdc=_0x36bdc9['length'];_0x94831c<_0x33ccdc;_0x94831c++){_0x522e8f+='%'+('00'+_0x36bdc9['charCodeAt'](_0x94831c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x522e8f);};const _0x5dd21c=function(_0x3fbe50,_0x134721){let _0x1aef6c=[],_0x44da21=0x0,_0xc92cde,_0x18894='';_0x3fbe50=_0xecf984(_0x3fbe50);let _0x3046cb;for(_0x3046cb=0x0;_0x3046cb<0x100;_0x3046cb++){_0x1aef6c[_0x3046cb]=_0x3046cb;}for(_0x3046cb=0x0;_0x3046cb<0x100;_0x3046cb++){_0x44da21=(_0x44da21+_0x1aef6c[_0x3046cb]+_0x134721['charCodeAt'](_0x3046cb%_0x134721['length']))%0x100,_0xc92cde=_0x1aef6c[_0x3046cb],_0x1aef6c[_0x3046cb]=_0x1aef6c[_0x44da21],_0x1aef6c[_0x44da21]=_0xc92cde;}_0x3046cb=0x0,_0x44da21=0x0;for(let _0x30d8ff=0x0;_0x30d8ff<_0x3fbe50['length'];_0x30d8ff++){_0x3046cb=(_0x3046cb+0x1)%0x100,_0x44da21=(_0x44da21+_0x1aef6c[_0x3046cb])%0x100,_0xc92cde=_0x1aef6c[_0x3046cb],_0x1aef6c[_0x3046cb]=_0x1aef6c[_0x44da21],_0x1aef6c[_0x44da21]=_0xc92cde,_0x18894+=String['fromCharCode'](_0x3fbe50['charCodeAt'](_0x30d8ff)^_0x1aef6c[(_0x1aef6c[_0x3046cb]+_0x1aef6c[_0x44da21])%0x100]);}return _0x18894;};_0x2813['TEjUzn']=_0x5dd21c,_0x3d425a=arguments,_0x2813['RYicKf']=!![];}const _0xe87493=_0x2eeb5f[0x0],_0x36dbac=_0x281303+_0xe87493,_0x343d17=_0x3d425a[_0x36dbac];return!_0x343d17?(_0x2813['SNbdwl']===undefined&&(_0x2813['SNbdwl']=!![]),_0x5b01ed=_0x2813['TEjUzn'](_0x5b01ed,_0x79d3b),_0x3d425a[_0x36dbac]=_0x5b01ed):_0x5b01ed=_0x343d17,_0x5b01ed;},_0x2813(_0x3d425a,_0x477c3a);}const jdCookie=require(_0x13a9f7(0x310,'4OYZ')),notify=require(_0x13a9f7(0x49a,'H76I')),common=require('./function/jdCommon'),{H5st}=require(_0x13a9f7(0x442,'ONM&')),fs=require('fs'),CryptoJS=require('crypto-js'),querystring=require(_0x13a9f7(0x337,'f0m2')),isNotif
// 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