jdpro/jd_mkhby1.js

6 lines
40 KiB
JavaScript
Raw Normal View History

2024-01-13 07:46:24 +00:00
/*
3 18-20 13,14 * * jd_mkhby1.js
*/
const $ = new Env('超市下雪本');
var _0xodW='jsjiami.com.v7';function _0xf7ba(_0x166488,_0x5f40ad){const _0x202dd5=_0x9640();return _0xf7ba=function(_0x16b3c2,_0xb4d952){_0x16b3c2=_0x16b3c2-0x13c;let _0x9640b1=_0x202dd5[_0x16b3c2];if(_0xf7ba['sGFDpX']===undefined){var _0xf7ba15=function(_0x787822){const _0x343f2a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5d0665='',_0x23236f='',_0x42efac=_0x5d0665+_0xf7ba15;for(let _0x4f3ee4=0x0,_0x29bade,_0x2304b1,_0x1d1115=0x0;_0x2304b1=_0x787822['charAt'](_0x1d1115++);~_0x2304b1&&(_0x29bade=_0x4f3ee4%0x4?_0x29bade*0x40+_0x2304b1:_0x2304b1,_0x4f3ee4++%0x4)?_0x5d0665+=_0x42efac['charCodeAt'](_0x1d1115+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x29bade>>(-0x2*_0x4f3ee4&0x6)):_0x4f3ee4:0x0){_0x2304b1=_0x343f2a['indexOf'](_0x2304b1);}for(let _0x38b14f=0x0,_0x3a76b8=_0x5d0665['length'];_0x38b14f<_0x3a76b8;_0x38b14f++){_0x23236f+='%'+('00'+_0x5d0665['charCodeAt'](_0x38b14f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x23236f);};const _0x1855a7=function(_0x2d0d59,_0xeb605b){let _0x23f7b6=[],_0x38ad54=0x0,_0x59cbda,_0x1d2a49='';_0x2d0d59=_0xf7ba15(_0x2d0d59);let _0x5a680c;for(_0x5a680c=0x0;_0x5a680c<0x100;_0x5a680c++){_0x23f7b6[_0x5a680c]=_0x5a680c;}for(_0x5a680c=0x0;_0x5a680c<0x100;_0x5a680c++){_0x38ad54=(_0x38ad54+_0x23f7b6[_0x5a680c]+_0xeb605b['charCodeAt'](_0x5a680c%_0xeb605b['length']))%0x100,_0x59cbda=_0x23f7b6[_0x5a680c],_0x23f7b6[_0x5a680c]=_0x23f7b6[_0x38ad54],_0x23f7b6[_0x38ad54]=_0x59cbda;}_0x5a680c=0x0,_0x38ad54=0x0;for(let _0x355dd6=0x0;_0x355dd6<_0x2d0d59['length'];_0x355dd6++){_0x5a680c=(_0x5a680c+0x1)%0x100,_0x38ad54=(_0x38ad54+_0x23f7b6[_0x5a680c])%0x100,_0x59cbda=_0x23f7b6[_0x5a680c],_0x23f7b6[_0x5a680c]=_0x23f7b6[_0x38ad54],_0x23f7b6[_0x38ad54]=_0x59cbda,_0x1d2a49+=String['fromCharCode'](_0x2d0d59['charCodeAt'](_0x355dd6)^_0x23f7b6[(_0x23f7b6[_0x5a680c]+_0x23f7b6[_0x38ad54])%0x100]);}return _0x1d2a49;};_0xf7ba['YGrLAY']=_0x1855a7,_0x166488=arguments,_0xf7ba['sGFDpX']=!![];}const _0x457956=_0x202dd5[0x0],_0x58e65e=_0x16b3c2+_0x457956,_0x231f50=_0x166488[_0x58e65e];if(!_0x231f50){if(_0xf7ba['AmnRdp']===undefined){const _0x26c28d=function(_0x2184a7){this['OYnsaj']=_0x2184a7,this['uZoGgc']=[0x1,0x0,0x0],this['xPGixT']=function(){return'newState';},this['DlAEhr']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['nggdDn']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x26c28d['prototype']['qaZYLb']=function(){const _0x3d381b=new RegExp(this['DlAEhr']+this['nggdDn']),_0x232bc3=_0x3d381b['test'](this['xPGixT']['toString']())?--this['uZoGgc'][0x1]:--this['uZoGgc'][0x0];return this['OamVdV'](_0x232bc3);},_0x26c28d['prototype']['OamVdV']=function(_0x627a2c){if(!Boolean(~_0x627a2c))return _0x627a2c;return this['GJHxdQ'](this['OYnsaj']);},_0x26c28d['prototype']['GJHxdQ']=function(_0x5d9f83){for(let _0xe455f1=0x0,_0x1584ee=this['uZoGgc']['length'];_0xe455f1<_0x1584ee;_0xe455f1++){this['uZoGgc']['push'](Math['round'](Math['random']())),_0x1584ee=this['uZoGgc']['length'];}return _0x5d9f83(this['uZoGgc'][0x0]);},new _0x26c28d(_0xf7ba)['qaZYLb'](),_0xf7ba['AmnRdp']=!![];}_0x9640b1=_0xf7ba['YGrLAY'](_0x9640b1,_0xb4d952),_0x166488[_0x58e65e]=_0x9640b1;}else _0x9640b1=_0x231f50;return _0x9640b1;},_0xf7ba(_0x166488,_0x5f40ad);}const _0x57d07a=_0xf7ba;(function(_0x445d8b,_0x29ddae,_0x38ae15,_0x13b1d8,_0x5d0fa3,_0x1e9ee6,_0x2e8920){return _0x445d8b=_0x445d8b>>0x9,_0x1e9ee6='hs',_0x2e8920='hs',function(_0x44ead7,_0x5d7e5c,_0x1e4be8,_0x43b3af,_0x5ce57d){const _0x3c2da1=_0xf7ba;_0x43b3af='tfi',_0x1e9ee6=_0x43b3af+_0x1e9ee6,_0x5ce57d='up',_0x2e8920+=_0x5ce57d,_0x1e9ee6=_0x1e4be8(_0x1e9ee6),_0x2e8920=_0x1e4be8(_0x2e8920),_0x1e4be8=0x0;const _0x1a7105=_0x44ead7();while(!![]&&--_0x13b1d8+_0x5d7e5c){try{_0x43b3af=-parseInt(_0x3c2da1(0x215,'M*0B'))/0x1+-parseInt(_0x3c2da1(0x153,'iiBI'))/0x2*(-parseInt(_0x3c2da1(0x16d,'FLQ4'))/0x3)+-parseInt(_0x3c2da1(0x182,'stjH'))/0x4+-parseInt(_0x3c2da1(0x26b,'5JxW'))/0x5*(parseInt(_0x3c2da1(0x268,'[*QT'))/0x6)+parseInt(_0x3c2da1(0x174,'89AX'))/0x7+parseInt(_0x3c2da1(0x255,'@AaN'))/0x8*(parseInt(_0x3c2da1(0x267,'^!18'))/0x9)+parseInt(_0x3c2da1(0x157,'*OE7'))/0xa
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