mirror of https://github.com/6dylan6/jdpro.git
10 lines
72 KiB
JavaScript
10 lines
72 KiB
JavaScript
|
/*
|
||
|
天天领红包
|
||
|
任务+开红包
|
||
|
39 3 * * * https://raw.githubusercontent.com/6dylan6/jdpro/main/jd_ttlhb.js
|
||
|
*/
|
||
|
|
||
|
const $ = new Env('天天领红包');
|
||
|
var _0xody='jsjiami.com.v7';const _0xa95378=_0x1062;(function(_0x26e9a2,_0x46818d,_0x3f5ffd,_0x341d5e,_0x1652f9,_0x36c8ad,_0x599434){return _0x26e9a2=_0x26e9a2>>0x3,_0x36c8ad='hs',_0x599434='hs',function(_0x49ea05,_0x14dc21,_0x278f12,_0x597615,_0x2de6c3){const _0x1cd537=_0x1062;_0x597615='tfi',_0x36c8ad=_0x597615+_0x36c8ad,_0x2de6c3='up',_0x599434+=_0x2de6c3,_0x36c8ad=_0x278f12(_0x36c8ad),_0x599434=_0x278f12(_0x599434),_0x278f12=0x0;const _0xbf730a=_0x49ea05();while(!![]&&--_0x341d5e+_0x14dc21){try{_0x597615=-parseInt(_0x1cd537(0x245,'@@[8'))/0x1*(parseInt(_0x1cd537(0x29f,'67Nr'))/0x2)+-parseInt(_0x1cd537(0x2f9,'hg[u'))/0x3*(parseInt(_0x1cd537(0x39f,'0gEu'))/0x4)+parseInt(_0x1cd537(0x2aa,'kX3A'))/0x5+parseInt(_0x1cd537(0x216,'6)a2'))/0x6*(parseInt(_0x1cd537(0x21c,'pHBK'))/0x7)+-parseInt(_0x1cd537(0x4ac,'lLwb'))/0x8+parseInt(_0x1cd537(0x2ec,'%kX#'))/0x9+parseInt(_0x1cd537(0x47d,'kX3A'))/0xa;}catch(_0x7eb86e){_0x597615=_0x278f12;}finally{_0x2de6c3=_0xbf730a[_0x36c8ad]();if(_0x26e9a2<=_0x341d5e)_0x278f12?_0x1652f9?_0x597615=_0x2de6c3:_0x1652f9=_0x2de6c3:_0x278f12=_0x2de6c3;else{if(_0x278f12==_0x1652f9['replace'](/[WOKAnuSIDqPTJpeyRxFLYh=]/g,'')){if(_0x597615===_0x14dc21){_0xbf730a['un'+_0x36c8ad](_0x2de6c3);break;}_0xbf730a[_0x599434](_0x2de6c3);}}}}}(_0x3f5ffd,_0x46818d,function(_0x368b52,_0x24ee4a,_0x32ac09,_0x3dd16a,_0x3a1289,_0xb44f27,_0x3af67e){return _0x24ee4a='\x73\x70\x6c\x69\x74',_0x368b52=arguments[0x0],_0x368b52=_0x368b52[_0x24ee4a](''),_0x32ac09=`\x72\x65\x76\x65\x72\x73\x65`,_0x368b52=_0x368b52[_0x32ac09]('\x76'),_0x3dd16a=`\x6a\x6f\x69\x6e`,(0x149f6b,_0x368b52[_0x3dd16a](''));});}(0x640,0x58848,_0x36dd,0xca),_0x36dd)&&(_0xody=0x21c1);const _0x3342c8=$[_0xa95378(0x4aa,'hg[u')]()?require(_0xa95378(0x327,'pHBK')):'',_0x116764=$[_0xa95378(0x4bb,'aW)#')]()?require(_0xa95378(0x362,'*VT!')):'',_0x4cab6e=require(_0xa95378(0x2bf,'67Nr')),_0x509576=require(_0xa95378(0x32e,'ytBj'));let _0x341b2f=!![],_0x16e015=[],_0x271867='',_0x4767ef='';if($[_0xa95378(0x501,'XYlK')]()){Object[_0xa95378(0x400,'Od7e')](_0x116764)[_0xa95378(0x2c7,'J2BN')](_0x149b9b=>{const _0x3aa60f=_0xa95378;_0x16e015[_0x3aa60f(0x50b,'Od7e')](_0x116764[_0x149b9b]);});if(process[_0xa95378(0x259,'MaeP')][_0xa95378(0x3c2,'26$K')]&&process[_0xa95378(0x508,'&VD8')][_0xa95378(0x27e,'VX70')]===_0xa95378(0x3b9,'aW)#'))console[_0xa95378(0x1f5,'6)a2')]=()=>{};}else _0x16e015=[$[_0xa95378(0x4b9,'LnV6')](_0xa95378(0x3c1,'26$K')),$[_0xa95378(0x4ab,'0YnI')](_0xa95378(0x2bb,'9uln')),..._0x5f39bf($[_0xa95378(0x3b7,'a5d5')](_0xa95378(0x3cf,'LnV6'))||'[]')[_0xa95378(0x413,'lLwb')](_0x273d06=>_0x273d06[_0xa95378(0x31e,'Lj$[')])][_0xa95378(0x378,'V&li')](_0x5b53fa=>!!_0x5b53fa);!(async()=>{const _0x5270a1=_0xa95378,_0x1fdc35={'bXymi':function(_0x38802b){return _0x38802b();},'sNnyc':_0x5270a1(0x477,'aW)#'),'ylgQf':_0x5270a1(0x30e,'48Gq'),'WpYtb':function(_0x2222be,_0xc869e4){return _0x2222be(_0xc869e4);},'ZTyXr':function(_0x83594c,_0x525c8a){return _0x83594c(_0x525c8a);},'kkvEL':function(_0x3437de,_0xeee290){return _0x3437de===_0xeee290;},'xeXxj':_0x5270a1(0x325,'0YnI'),'mLfrW':_0x5270a1(0x396,'eK@%'),'bmrdU':_0x5270a1(0x25f,'pvnP'),'jluJV':_0x5270a1(0x2dd,'@@[8'),'pXgdz':function(_0x355e11,_0x5adcf9){return _0x355e11<_0x5adcf9;},'Pisic':function(_0x3a9417,_0x23c74d){return _0x3a9417!==_0x23c74d;},'kOawH':_0x5270a1(0x320,'m5Ii'),'JQikp':function(_0x599e5e,_0x2ac42c){return _0x599e5e!==_0x2ac42c;},'mWjnk':_0x5270a1(0x254,'JLRd'),'LrTdD':function(_0x28e9b6,_0x573a64){return _0x28e9b6+_0x573a64;},'qayee':function(_0x2e66bf){return _0x2e66bf();},'ljyxp':function(_0xf2c192,_0x2d764b){return _0xf2c192===_0x2d764b;},'jKNxZ':_0x5270a1(0x470,'uX0i'),'dCxYk':_0x5270a1(0x2f3,'V5*A'),'sBsah':function(_0x505c2f){return _0x505c2f();},'XzrwG':function(_0x5d40b3,_0x353c6b){return _0x5d40b3!=_0x353c6b;},'PVorV':_0x5270a1(0x2e9,'Oy[G'),'DQRQc':_0x5270a1(0x3ac,'VX70'),'JdCVQ':function(_0x32aa06,_0x535a56){return _0x32aa06===_0x535a56;},'ffrMB':function(_0x2dca5c,_0xd2797){return _0x2dca5c!==_0xd2797;},'lKnNW':_0x5270a1(0x2d7,'uX0i'),'kKHVC':_0x5270a1(0x2a1,'XYlK'),'KwzQJ':_0x5270a1(0x40f,'iRh
|
||
|
// 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
|