jdpro/jd_wxSignRed.js

8 lines
64 KiB
JavaScript
Raw Normal View History

2024-01-02 12:59:48 +00:00
/*
微信签到领红包
2 2 * * * https://raw.githubusercontent.com/6dylan6/jdpro/main/jd_wxSignRed.js
*/
const $ = new Env("微信签到红包-加密");
var version_='jsjiami.com.v7';const IlillI1=lllii1iI;(function(iil11lIl,liii1iIi,l11Ili1,iIlIl11i,lI11liIl,iiI1IIIi,I1iIi11){return iil11lIl=iil11lIl>>0x6,iiI1IIIi='hs',I1iIi11='hs',function(Iil11I,l1iI11i,lil1iI1,li11I1lI,il1ii111){const l1I1Il1i=lllii1iI;li11I1lI='tfi',iiI1IIIi=li11I1lI+iiI1IIIi,il1ii111='up',I1iIi11+=il1ii111,iiI1IIIi=lil1iI1(iiI1IIIi),I1iIi11=lil1iI1(I1iIi11),lil1iI1=0x0;const lii1Il11=Iil11I();while(!![]&&--iIlIl11i+l1iI11i){try{li11I1lI=-parseInt(l1I1Il1i(0x3de,'Xr@@'))/0x1*(parseInt(l1I1Il1i(0x315,'PoGH'))/0x2)+-parseInt(l1I1Il1i(0x3d0,'pV(J'))/0x3+-parseInt(l1I1Il1i(0x19a,'3SOw'))/0x4*(-parseInt(l1I1Il1i(0x1b1,'A@e$'))/0x5)+-parseInt(l1I1Il1i(0x408,'PoGH'))/0x6*(-parseInt(l1I1Il1i(0x23a,'iA[L'))/0x7)+parseInt(l1I1Il1i(0x1a5,'b&!!'))/0x8+parseInt(l1I1Il1i(0x2d5,'wLf2'))/0x9+-parseInt(l1I1Il1i(0x2f9,'kLf)'))/0xa*(parseInt(l1I1Il1i(0x428,'6GaM'))/0xb);}catch(IlllIIil){li11I1lI=lil1iI1;}finally{il1ii111=lii1Il11[iiI1IIIi]();if(iil11lIl<=iIlIl11i)lil1iI1?lI11liIl?li11I1lI=il1ii111:lI11liIl=il1ii111:lil1iI1=il1ii111;else{if(lil1iI1==lI11liIl['replace'](/[UFwYhMQupRWeNVxDXLl=]/g,'')){if(li11I1lI===l1iI11i){lii1Il11['un'+iiI1IIIi](il1ii111);break;}lii1Il11[I1iIi11](il1ii111);}}}}}(l11Ili1,liii1iIi,function(i1iii1i1,liliiIl,li1Iiil1,ilii1i11,l11i11Ii,Ili1111l,i1l){return liliiIl='\x73\x70\x6c\x69\x74',i1iii1i1=arguments[0x0],i1iii1i1=i1iii1i1[liliiIl](''),li1Iiil1=`\x72\x65\x76\x65\x72\x73\x65`,i1iii1i1=i1iii1i1[li1Iiil1]('\x76'),ilii1i11=`\x6a\x6f\x69\x6e`,(0x129daf,i1iii1i1[ilii1i11](''));});}(0x3080,0xc65f6,I1llIIll,0xc4),I1llIIll)&&(version_=I1llIIll);const lI11i11l=(function(){let iIl1Ii1I=!![];return function(llI1lIl,iI111lii){const illi1ill=iIl1Ii1I?function(){const IIiliIII=lllii1iI;if(iI111lii){const i1il1il1=iI111lii[IIiliIII(0x3ab,'Xr@@')](llI1lIl,arguments);return iI111lii=null,i1il1il1;}}:function(){};return iIl1Ii1I=![],illi1ill;};}()),iII1Il1l=lI11i11l(this,function(){const iIIiiIli=lllii1iI,iI1lIiIl={'mCgbe':iIIiiIli(0x25b,'3SOw')};return iII1Il1l[iIIiiIli(0x295,')vu3')]()[iIIiiIli(0x464,'pV(J')](iI1lIiIl[iIIiiIli(0x21a,'pV(J')])[iIIiiIli(0x3f0,'SXBj')]()[iIIiiIli(0x19c,'OLtf')](iII1Il1l)[iIIiiIli(0x391,'GmRw')](iI1lIiIl[iIIiiIli(0x275,'2I&I')]);});iII1Il1l();const iI1iiiI=$[IlillI1(0x330,'Ls2t')]()?require(IlillI1(0x195,'*xL@')):'',lI1lIiiI=$[IlillI1(0x452,'vpF3')]()?require(IlillI1(0x2e3,'X%5k')):'';let I1iI111l=[],l1I1l1I='';if($[IlillI1(0x456,'Y]Z$')]()){var lI1liiiI=new Buffer[(IlillI1(0x3f9,'DY(^'))](IlillI1(0x2d4,'3SOw'),IlillI1(0x2b0,'x1AV'))[IlillI1(0x36e,'[eHP')](IlillI1(0x2c1,'emNE'));Object[IlillI1(0x340,'kB[T')](iI1iiiI)[IlillI1(0x2bf,'Tw^b')](liIliI1=>{const l1IIl1iI=IlillI1;I1iI111l[l1IIl1iI(0x373,'t0R0')](iI1iiiI[liIliI1]);});if(process[IlillI1(0x458,'OLtf')][IlillI1(0x3d8,'Xj*i')]&&process[IlillI1(0x28a,'wLf2')][IlillI1(0x43a,'&CcK')]===IlillI1(0x278,'Xj*i'))$[IlillI1(0x3a2,'t9W&')]=()=>{};}else{let iIIl1i=$[IlillI1(0x365,'F#O)')](IlillI1(0x3a8,'OLtf'))||'[]';iIIl1i=JSON[IlillI1(0x38e,'F#O)')](iIIl1i),I1iI111l=iIIl1i[IlillI1(0x21f,'F1u2')](iiIi1ii1=>iiIi1ii1[IlillI1(0x1ab,'[eHP')]),I1iI111l[IlillI1(0x37d,'emNE')](),I1iI111l[IlillI1(0x373,'t0R0')](...[$[IlillI1(0x21d,'[eHP')](IlillI1(0x3ae,'DY(^')),$[IlillI1(0x20a,'vpF3')](IlillI1(0x384,'E0l]'))]),I1iI111l[IlillI1(0x425,'*xL@')](),I1iI111l=I1iI111l[IlillI1(0x2c8,'kB[T')](iIi1I1I=>!!iIi1I1I);}!(async()=>{const IIIIIli1=IlillI1,iIl111iI={'TaLok':IIIIIli1(0x2da,'X%5k'),'gAaZc':IIIIIli1(0x27a,'*xL@'),'kQbIF':IIIIIli1(0x274,'t9W&'),'xCwSq':IIIIIli1(0x3f7,'W&1x'),'eBgrf':IIIIIli1(0x2be,'CUJp'),'DwJaI':IIIIIli1(0x349,')vu3'),'ldZaE':IIIIIli1(0x44a,'fRtX'),'tBsXl':IIIIIli1(0x2c0,'Ls2t'),'rnCmb':function(Il11ili){return Il11ili();},'dLTKw':function(I1i111li,l1iIlil1){return I1i111li===l1iIlil1;},'lhwkk':IIIIIli1(0x28c,'4zl0'),'JQnHf':IIIIIli1(0x2ac,'pV(J'),'oCGiE':IIIIIli1(0x1cd,'Ls2t'),'OuFfb':IIIIIli1(0x2d9,'A@e$'),'TNqDg':IIIIIli1(0x1a6,'[eHP'),'ISBIQ':IIIIIli1(0x3d1,'kLf)'),'ypvTQ':function(iI11lI1l,liilil1I){return iI11lI1l(liilil1I);},'ebTBo':IIIIIli1(0x3ef,'@rCg'),'wOocF':function(ll11III,l1I111lI,iiIil111){return ll11III(l1
// 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