jdpro/jd_nhjred.js

19 lines
330 KiB
JavaScript
Raw Normal View History

2024-01-17 12:54:05 +00:00
/*
变量NHJCODE='7位字母'
export NHJCODE="xxxxxxx"
每次领取红包次数
export RedCount="5"
每个账号之间延时单位毫秒
export RedTimes="5000"
59 59 23,19 * * * jd_nhjred.js
*/
const $ = new Env('年货Red');
2024-01-20 12:29:25 +00:00
var _0xod7='jsjiami.com.v7';const _0x44dd13=_0x2ea3;(function(_0x56916c,_0x802108,_0x22be3d,_0x2e637d,_0x8ce15c,_0x5e5f00,_0x24009d){return _0x56916c=_0x56916c>>0x3,_0x5e5f00='hs',_0x24009d='hs',function(_0x8c0faa,_0x5c2892,_0x4d251d,_0x24d6b5,_0x134703){const _0x2af1e3=_0x2ea3;_0x24d6b5='tfi',_0x5e5f00=_0x24d6b5+_0x5e5f00,_0x134703='up',_0x24009d+=_0x134703,_0x5e5f00=_0x4d251d(_0x5e5f00),_0x24009d=_0x4d251d(_0x24009d),_0x4d251d=0x0;const _0x4868e8=_0x8c0faa();while(!![]&&--_0x2e637d+_0x5c2892){try{_0x24d6b5=-parseInt(_0x2af1e3(0xc5c,'!h($'))/0x1*(parseInt(_0x2af1e3(0x7e6,'E)#s'))/0x2)+-parseInt(_0x2af1e3(0x526,'!h($'))/0x3+-parseInt(_0x2af1e3(0x1084,'5Q5m'))/0x4*(-parseInt(_0x2af1e3(0x4aa,'lAnA'))/0x5)+parseInt(_0x2af1e3(0xa45,'U8g4'))/0x6*(-parseInt(_0x2af1e3(0x26b,'NGMn'))/0x7)+parseInt(_0x2af1e3(0x565,'WwwO'))/0x8*(parseInt(_0x2af1e3(0xfab,'Id#O'))/0x9)+parseInt(_0x2af1e3(0xa27,'Oh%m'))/0xa*(parseInt(_0x2af1e3(0x15d,'D)AW'))/0xb)+-parseInt(_0x2af1e3(0xd34,'H8WN'))/0xc*(parseInt(_0x2af1e3(0x178,'3FgF'))/0xd);}catch(_0x28f9c6){_0x24d6b5=_0x4d251d;}finally{_0x134703=_0x4868e8[_0x5e5f00]();if(_0x56916c<=_0x2e637d)_0x4d251d?_0x8ce15c?_0x24d6b5=_0x134703:_0x8ce15c=_0x134703:_0x4d251d=_0x134703;else{if(_0x4d251d==_0x8ce15c['replace'](/[dPEbAUVLGMHQeXSIKWJD=]/g,'')){if(_0x24d6b5===_0x5c2892){_0x4868e8['un'+_0x5e5f00](_0x134703);break;}_0x4868e8[_0x24009d](_0x134703);}}}}}(_0x22be3d,_0x802108,function(_0xab6970,_0x102619,_0x3dd86e,_0x2eb35e,_0xe8fef1,_0x40b6fc,_0x5bf028){return _0x102619='\x73\x70\x6c\x69\x74',_0xab6970=arguments[0x0],_0xab6970=_0xab6970[_0x102619](''),_0x3dd86e=`\x72\x65\x76\x65\x72\x73\x65`,_0xab6970=_0xab6970[_0x3dd86e]('\x76'),_0x2eb35e=`\x6a\x6f\x69\x6e`,(0x1512dc,_0xab6970[_0x2eb35e](''));});}(0x650,0xaab6b,_0x4bae,0xcc),_0x4bae)&&(_0xod7=0x3de4);const _0xd5af1c=$[_0x44dd13(0xfe4,'5Q5m')]()?require(_0x44dd13(0x54d,'3uQq')):'';let _0x2fc97c='',_0x5070c9=0xbb8,_0x2b1acb=0x4,_0x25a070=0x0;$[_0x44dd13(0xcc8,'lAnA')]=require(_0x44dd13(0x394,'ORL3'));const _0x2c2f45=require(_0x44dd13(0x872,'KsaY'));if(process[_0x44dd13(0x98c,'TAeO')][_0x44dd13(0x5e7,'KsaY')])try{require(_0x44dd13(0x54b,'X^t3')),ccc=require(_0x44dd13(0x8d5,'3FgF')),$[_0x44dd13(0x185,'sCt]')]=ccc[_0x44dd13(0x687,'1&6i')]($[_0x44dd13(0x3fa,'1&6i')][_0x44dd13(0xdb4,'eo!0')]($)),$[_0x44dd13(0x8f6,'1@mx')]=ccc[_0x44dd13(0x757,'KsaY')]($[_0x44dd13(0x1073,'U8g4')][_0x44dd13(0xc1b,'1@mx')]($));}catch{$[_0x44dd13(0x733,'lAnA')](_0x44dd13(0xeca,'gbFr')),$[_0x44dd13(0x846,'mQuF')]=$[_0x44dd13(0xc1f,'sCt]')],$[_0x44dd13(0x173,'IB4X')]=$[_0x44dd13(0x363,'$RBM')];}else $[_0x44dd13(0x50f,'lAnA')]=$[_0x44dd13(0x1130,'a[uW')],$[_0x44dd13(0x1081,'dblz')]=$[_0x44dd13(0x574,'IB4X')];let _0x4d117c=[],_0x450513='';if($[_0x44dd13(0x10e0,'H8WN')]()){Object[_0x44dd13(0x65e,'ORL3')](_0xd5af1c)[_0x44dd13(0xdbe,'3FgF')](_0x3742ea=>{const _0x15e00d=_0x44dd13;_0x4d117c[_0x15e00d(0xe5a,'WwwO')](_0xd5af1c[_0x3742ea]);});if(process[_0x44dd13(0x115,'91Vd')][_0x44dd13(0xb92,'Bnq@')]&&process[_0x44dd13(0x762,'KgqR')][_0x44dd13(0xb33,'D)AW')]===_0x44dd13(0x111d,'0@HQ'))console[_0x44dd13(0x1047,'DEHA')]=()=>{};}else _0x4d117c=[$[_0x44dd13(0x9d9,'!h($')](_0x44dd13(0x6e2,'NGMn')),$[_0x44dd13(0xdc4,'gbFr')](_0x44dd13(0x604,'Bnq@')),..._0x49c351($[_0x44dd13(0xcda,'1@mx')](_0x44dd13(0x6b3,'Bnq@'))||'[]')[_0x44dd13(0x654,'3uQq')](_0x4673a0=>_0x4673a0[_0x44dd13(0x387,'DJRi')])][_0x44dd13(0x57c,'TAeO')](_0x34e52a=>!!_0x34e52a);let _0x241014='';if(!_0x241014)_0x241014='';_0x241014=$[_0x44dd13(0x5ae,'uo]z')]()?process[_0x44dd13(0xe5e,'DEHA')][_0x44dd13(0xbdd,'IB4X')]?process[_0x44dd13(0xaa9,'1&6i')][_0x44dd13(0xa46,'LpOX')]:''+_0x241014:$[_0x44dd13(0x110a,'xs$V')](_0x44dd13(0xd31,'Oh%m'))?$[_0x44dd13(0x10a,'5Q5m')](_0x44dd13(0x6da,'KsaY')):''+_0x241014,_0x2b1acb=$[_0x44dd13(0xce0,'DJRi')]()?process[_0x44dd13(0x103f,'LpOX')][_0x44dd13(0x1ea,'X^t3')]?process[_0x44dd13(0x702,'FHsN')][_0x44dd13(0xce2,'$RBM')]:''+_0x2b1acb:$[_0x44dd13(0x1e7,'91Vd')](_0x44dd13(0xa90,'gbFr'))?$[_0x44dd13(0xd3c,'X^t3')](_0x44dd13(0xc80,'WwwO')):''+_0x2b1acb,_0x5070c9=$[_0x44dd13(0x62a,'0@HQ')]()?process[_0x44dd13(
2024-01-17 12:54:05 +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