jdpro/jd_wanyiwan.js

7 lines
122 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
23 5,10 * * * jd_wanyiwan.js
*/
const $ = new Env('玩一玩_任务');
2024-07-28 15:11:09 +00:00
var _0xode='jsjiami.com.v7';const _0x2bb902=_0x23f8;(function(_0x271068,_0x560881,_0x78f26b,_0x47be21,_0xae19f9,_0x1ae7ad,_0x530274){return _0x271068=_0x271068>>0x6,_0x1ae7ad='hs',_0x530274='hs',function(_0x518076,_0x24373d,_0x2d3f2f,_0x2f9f64,_0x4dd6e8){const _0x857a52=_0x23f8;_0x2f9f64='tfi',_0x1ae7ad=_0x2f9f64+_0x1ae7ad,_0x4dd6e8='up',_0x530274+=_0x4dd6e8,_0x1ae7ad=_0x2d3f2f(_0x1ae7ad),_0x530274=_0x2d3f2f(_0x530274),_0x2d3f2f=0x0;const _0x581ef7=_0x518076();while(!![]&&--_0x47be21+_0x24373d){try{_0x2f9f64=-parseInt(_0x857a52(0x352,']ujc'))/0x1*(-parseInt(_0x857a52(0x2f1,'l)b2'))/0x2)+parseInt(_0x857a52(0x1bb,'2[*s'))/0x3+parseInt(_0x857a52(0x1b4,'olKd'))/0x4+-parseInt(_0x857a52(0x5db,'V6Bh'))/0x5+-parseInt(_0x857a52(0x563,'dXkD'))/0x6*(-parseInt(_0x857a52(0x13f,'6])('))/0x7)+parseInt(_0x857a52(0x442,'4^)s'))/0x8+-parseInt(_0x857a52(0x448,'z[fo'))/0x9;}catch(_0x3ec025){_0x2f9f64=_0x2d3f2f;}finally{_0x4dd6e8=_0x581ef7[_0x1ae7ad]();if(_0x271068<=_0x47be21)_0x2d3f2f?_0xae19f9?_0x2f9f64=_0x4dd6e8:_0xae19f9=_0x4dd6e8:_0x2d3f2f=_0x4dd6e8;else{if(_0x2d3f2f==_0xae19f9['replace'](/[QYSyuXUELbKxgnG=]/g,'')){if(_0x2f9f64===_0x24373d){_0x581ef7['un'+_0x1ae7ad](_0x4dd6e8);break;}_0x581ef7[_0x530274](_0x4dd6e8);}}}}}(_0x78f26b,_0x560881,function(_0x13c65a,_0x4e465a,_0x48cb09,_0x2a0ece,_0x39bb49,_0x287f23,_0xd3d48e){return _0x4e465a='\x73\x70\x6c\x69\x74',_0x13c65a=arguments[0x0],_0x13c65a=_0x13c65a[_0x4e465a](''),_0x48cb09=`\x72\x65\x76\x65\x72\x73\x65`,_0x13c65a=_0x13c65a[_0x48cb09]('\x76'),_0x2a0ece=`\x6a\x6f\x69\x6e`,(0x17b41a,_0x13c65a[_0x2a0ece](''));});}(0x2f00,0x3f7d1,_0x45c7,0xbe),_0x45c7)&&(_0xode=0xbe);const _0xb10bb8=(function(){const _0x1f29f7=_0x23f8,_0x58afc5={'hWZpS':function(_0x357801,_0x204c7b){return _0x357801==_0x204c7b;},'iMhQr':_0x1f29f7(0x5c1,'uRU$'),'nAKUM':function(_0x80d698,_0x12476e){return _0x80d698!=_0x12476e;},'obbcV':_0x1f29f7(0x446,'5p#B'),'WYoYz':_0x1f29f7(0x196,'ba6R'),'aJzAg':function(_0x807687,_0x33a1b2){return _0x807687!==_0x33a1b2;},'CRBBm':_0x1f29f7(0x64d,'j6nT'),'qocHJ':_0x1f29f7(0x30b,'jMXQ')};let _0x51d445=!![];return function(_0x755609,_0x5ca9b0){const _0x16f25a=_0x1f29f7,_0x152458={'kmMvu':function(_0x1c33fe,_0x23bee7){const _0x9b4b38=_0x23f8;return _0x58afc5[_0x9b4b38(0x452,'DmQg')](_0x1c33fe,_0x23bee7);},'nxHVp':_0x58afc5[_0x16f25a(0x5b0,'0[!f')],'GRwtf':function(_0x9e8b6d,_0x2a3f56){const _0x57db93=_0x16f25a;return _0x58afc5[_0x57db93(0x69f,'gRF^')](_0x9e8b6d,_0x2a3f56);},'gEDJW':_0x58afc5[_0x16f25a(0x421,'V6Bh')],'ogdiL':_0x58afc5[_0x16f25a(0x679,'mB!O')],'Klrqs':function(_0x15881a,_0x2e447d){const _0xcb0de2=_0x16f25a;return _0x58afc5[_0xcb0de2(0x51d,'POOQ')](_0x15881a,_0x2e447d);},'snlOu':_0x58afc5[_0x16f25a(0x573,'dXkD')],'FYxXN':_0x58afc5[_0x16f25a(0x34e,'DJ[[')]},_0xa64298=_0x51d445?function(){const _0x4daab9=_0x16f25a;if(_0x5ca9b0){if(_0x152458[_0x4daab9(0x184,'MOnz')](_0x152458[_0x4daab9(0x1b6,'R[%1')],_0x152458[_0x4daab9(0x41c,'dP5Y')])){const _0x2779c7=_0x5ca9b0[_0x4daab9(0x5e3,'mB!O')](_0x755609,arguments);return _0x5ca9b0=null,_0x2779c7;}else{if(_0x152458[_0x4daab9(0x68f,'!kQ7')](_0x12d6da[_0x4daab9(0x519,'dP5Y')][_0x4daab9(0x3bd,'*buL')],0x0)){const _0x415a2e=_0x152458[_0x4daab9(0x1d6,'mB!O')][_0x4daab9(0x36a,'VhYa')]('|');let _0x997085=0x0;while(!![]){switch(_0x415a2e[_0x997085++]){case'0':_0x214baa[_0x4daab9(0x377,'POOQ')]=_0x46fe60[_0x4daab9(0x24d,'D7c^')]?.[_0x4daab9(0x4ee,'ba6R')]?.[_0x4daab9(0x46d,'POOQ')]||[];continue;case'1':_0x54b82a[_0x4daab9(0x50a,'V6Bh')](_0x4daab9(0x60d,'j6nT')+_0x4ff3ff[_0x4daab9(0x355,'2[*s')][_0x4daab9(0x5df,'KRlS')][_0x4daab9(0x465,'aKnq')]+_0x4daab9(0x4f2,'2[*s'));continue;case'2':_0xdf0a9d[_0x4daab9(0x562,'3Z0T')]=_0x274551[_0x4daab9(0x564,'0[!f')]?.[_0x4daab9(0x571,'htYD')]?.[_0x4daab9(0x560,'D7c^')]?.[_0x4daab9(0x241,'u)BH')]||0x0;continue;case'3':_0x152458[_0x4daab9(0x245,'hK]z')](_0x3fdce9[_0x4daab9(0x355,'2[*s')][_0x4daab9(0x2fe,'8Li*')][_0x4daab9(0x669,'8DVB')][_0x4daab9(0x54a,'ba6R')],0x0)&&_0x5d58f9[_0x4daab9(0x10a,'6])(')](_0x152458[_0x4daab9(0x206,'u)BH')],_0x105dae[_0x4daab9(0x3b3,'dXkD')][_0x4daab9(0x3e0,'3Z0T')][_0x4daab9(0x19
2024-06-28 07:47:44 +00:00
function Env(o, t) { 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((r, i) => { s.call(this, t, (t, e, s) => { t ? i(t) : r(e) }) }) } 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.logLevels = { debug: 0, info: 1, warn: 2, error: 3 }, this.logLevelPrefixs = { debug: "[DEBUG] ", info: "[INFO] ", warn: "[WARN] ", error: "[ERROR] " }, this.logLevel = "info", 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.encoding = "utf-8", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null, ...s) { try { return JSON.stringify(t, ...s) } catch { return e } } getjson(t, e) { let s = e; if (this.getdata(t)) 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(r => { this.get({ url: t }, (t, e, s) => r(s)) }) } runScript(a, o) { return new Promise(r => { let t = this.getdata("@chavy_boxjs_userCfgs.httpapi"); t = t && t.replace(/\n/g, "").trim(); var e = (e = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout")) ? +e : 20, [s, i] = (e = o && o.timeout ? o.timeout : e, t.split("@")); this.post({ url: `http://${i}/v1/scripting/evaluate`, body: { script_text: a, mock_type: "cron", timeout: e }, headers: { "X-Key": s, Accept: "*/*" }, timeout: e }, (t, e, s) => r(s)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; this.fs = this.fs || require("fs"), this.path = this.path || require("path"); var t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), r = !s && this.fs.existsSync(e); if (!s && !r) return {}; r = s ? t : e; try { return JSON.parse(this.fs.readFileSync(r)) } catch (t) { return {} } } writedata() { var t, e, s, r, i; this.isNode() && (this.fs = this.fs || require("fs"), this.path = this.path || require("path"), t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), r = !(s = this.fs.existsSync(t)) && this.fs.existsSync(e), i = JSON.stringify(this.data), !s && r ? this.fs.writeFileSync(e, i) : this.fs.writeFileSync(t, i)) } lodash_get(t, e, s) { let r = t; for (const t of e.replace(/\[(\d+)\]/g, ".$1").split(".")) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, r, e) { return Object(t) === t && ((r = Array.isArray(r) ? r : r.toString().match(/[^.[\]]+/g) || []).slice(0, -1).reduce((t, e, s) => Object(t[e]) === t[e] ? t[e] : t[e] = Math.abs(r[s + 1]) >> 0 == +r[s + 1] ? [] : {}, t)[r[r.length - 1]] = e), t } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { var [, s, r] = /^@(.*?)\.(.*?)$/.exec(t); if (s = s ? this.getval(s) : "") try { const t = JSON.parse(s); e = t ? this.lodash_get(t, r, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { var [, r, i] = /^@(.*?)\.(.*?)$/.exec(e), a = this.getval(r), a = r ? "null" === a ? null : a || "{}" : "{}"; tr