jdpro/jd_znshb_help.js

8 lines
110 KiB
JavaScript
Raw Normal View History

2024-01-15 12:52:31 +00:00
/*
*/
const $ = new Env('炸年兽抽红包_助力');
2024-01-21 03:21:25 +00:00
var _0xodX='jsjiami.com.v7';const _0x5846fa=_0x98b6;function _0x98b6(_0x535385,_0x237811){const _0x1fcc81=_0x2701();return _0x98b6=function(_0x41b048,_0x2a368e){_0x41b048=_0x41b048-0x14d;let _0x270166=_0x1fcc81[_0x41b048];if(_0x98b6['HVLGHd']===undefined){var _0x98b61c=function(_0x1ca56e){const _0x2419d1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x353872='',_0x78d95c='',_0x40dac4=_0x353872+_0x98b61c;for(let _0x50e75e=0x0,_0x3c57e5,_0x500992,_0x2a6f5d=0x0;_0x500992=_0x1ca56e['charAt'](_0x2a6f5d++);~_0x500992&&(_0x3c57e5=_0x50e75e%0x4?_0x3c57e5*0x40+_0x500992:_0x500992,_0x50e75e++%0x4)?_0x353872+=_0x40dac4['charCodeAt'](_0x2a6f5d+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x3c57e5>>(-0x2*_0x50e75e&0x6)):_0x50e75e:0x0){_0x500992=_0x2419d1['indexOf'](_0x500992);}for(let _0x4e8adb=0x0,_0x38557c=_0x353872['length'];_0x4e8adb<_0x38557c;_0x4e8adb++){_0x78d95c+='%'+('00'+_0x353872['charCodeAt'](_0x4e8adb)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x78d95c);};const _0x34b866=function(_0x5e311c,_0x44d310){let _0x16145d=[],_0x560aeb=0x0,_0x3fe987,_0x41f245='';_0x5e311c=_0x98b61c(_0x5e311c);let _0x420546;for(_0x420546=0x0;_0x420546<0x100;_0x420546++){_0x16145d[_0x420546]=_0x420546;}for(_0x420546=0x0;_0x420546<0x100;_0x420546++){_0x560aeb=(_0x560aeb+_0x16145d[_0x420546]+_0x44d310['charCodeAt'](_0x420546%_0x44d310['length']))%0x100,_0x3fe987=_0x16145d[_0x420546],_0x16145d[_0x420546]=_0x16145d[_0x560aeb],_0x16145d[_0x560aeb]=_0x3fe987;}_0x420546=0x0,_0x560aeb=0x0;for(let _0x57e291=0x0;_0x57e291<_0x5e311c['length'];_0x57e291++){_0x420546=(_0x420546+0x1)%0x100,_0x560aeb=(_0x560aeb+_0x16145d[_0x420546])%0x100,_0x3fe987=_0x16145d[_0x420546],_0x16145d[_0x420546]=_0x16145d[_0x560aeb],_0x16145d[_0x560aeb]=_0x3fe987,_0x41f245+=String['fromCharCode'](_0x5e311c['charCodeAt'](_0x57e291)^_0x16145d[(_0x16145d[_0x420546]+_0x16145d[_0x560aeb])%0x100]);}return _0x41f245;};_0x98b6['QOFLDx']=_0x34b866,_0x535385=arguments,_0x98b6['HVLGHd']=!![];}const _0xad9328=_0x1fcc81[0x0],_0x43fee3=_0x41b048+_0xad9328,_0x5a1189=_0x535385[_0x43fee3];if(!_0x5a1189){if(_0x98b6['phAITx']===undefined){const _0x5aa526=function(_0x58cd8a){this['wRSsng']=_0x58cd8a,this['icyyDF']=[0x1,0x0,0x0],this['GMcqQv']=function(){return'newState';},this['VJtJXq']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['xzmaDe']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x5aa526['prototype']['YlMEed']=function(){const _0x8a0403=new RegExp(this['VJtJXq']+this['xzmaDe']),_0x3cda98=_0x8a0403['test'](this['GMcqQv']['toString']())?--this['icyyDF'][0x1]:--this['icyyDF'][0x0];return this['jmNdwR'](_0x3cda98);},_0x5aa526['prototype']['jmNdwR']=function(_0x10ecac){if(!Boolean(~_0x10ecac))return _0x10ecac;return this['qLozxz'](this['wRSsng']);},_0x5aa526['prototype']['qLozxz']=function(_0x42a918){for(let _0x6cd510=0x0,_0x4d14a8=this['icyyDF']['length'];_0x6cd510<_0x4d14a8;_0x6cd510++){this['icyyDF']['push'](Math['round'](Math['random']())),_0x4d14a8=this['icyyDF']['length'];}return _0x42a918(this['icyyDF'][0x0]);},new _0x5aa526(_0x98b6)['YlMEed'](),_0x98b6['phAITx']=!![];}_0x270166=_0x98b6['QOFLDx'](_0x270166,_0x2a368e),_0x535385[_0x43fee3]=_0x270166;}else _0x270166=_0x5a1189;return _0x270166;},_0x98b6(_0x535385,_0x237811);}(function(_0x2b7b14,_0x3054f1,_0x1076f5,_0x163478,_0x4d4362,_0x32184d,_0x5bb2aa){return _0x2b7b14=_0x2b7b14>>0x1,_0x32184d='hs',_0x5bb2aa='hs',function(_0x4dfea1,_0xcce9c2,_0x40ea5f,_0x1cbbfa,_0x363ffd){const _0x29dda3=_0x98b6;_0x1cbbfa='tfi',_0x32184d=_0x1cbbfa+_0x32184d,_0x363ffd='up',_0x5bb2aa+=_0x363ffd,_0x32184d=_0x40ea5f(_0x32184d),_0x5bb2aa=_0x40ea5f(_0x5bb2aa),_0x40ea5f=0x0;const _0x753c05=_0x4dfea1();while(!![]&&--_0x163478+_0xcce9c2){try{_0x1cbbfa=parseInt(_0x29dda3(0x5fd,'Wx#u'))/0x1+-parseInt(_0x29dda3(0x2c5,'yZ*t'))/0x2+parseInt(_0x29dda3(0x215,'xZ6Y'))/0x3*(parseInt(_0x29dda3(0x513,'q%%&'))/0x4)+parseInt(_0x29dda3(0x481,'rpHD'))/0x5*(parseInt(_0x29dda3(0x225,'$EA('))/0x6)+-parseInt(_0x29dda3(0x36c,'rYj6'))/0x7+-parseInt(_0x29dda3(0x4c7,'nJU4'))/0x8+-parseInt(_0x29dda3(0x318,'kL(H'))/0x9;}catch(_0x1cb90f){_0x1cbbfa=_0x40ea5f;}f
2024-01-15 12:52:31 +00: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