mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
12 lines
30 KiB
JavaScript
12 lines
30 KiB
JavaScript
|
/*
|
|||
|
超市红包雨
|
|||
|
|
|||
|
cron:1 1 1 1 * jd_redrain_supermarket.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('超市红包雨');
|
|||
|
var iil='jsjiami.com.v7';const iil1ii=iii1II;(function(I1lIil,IIIl1i,liiII1,IIIl1l,lllll,i11ili,iil1l1){return I1lIil=I1lIil>>0x3,i11ili='hs',iil1l1='hs',function(lllli,iiili1,ill11i,lllill,ill11l){const IIIl1I=iii1II;lllill='tfi',i11ili=lllill+i11ili,ill11l='up',iil1l1+=ill11l,i11ili=ill11i(i11ili),iil1l1=ill11i(iil1l1),ill11i=0x0;const I1lIiI=lllli();while(!![]&&--IIIl1l+iiili1){try{lllill=parseInt(IIIl1I(0x19c,'Ebl9'))/0x1*(-parseInt(IIIl1I(0x12d,'sn$9'))/0x2)+-parseInt(IIIl1I(0x178,'gQc8'))/0x3*(-parseInt(IIIl1I(0x13d,'*F9X'))/0x4)+parseInt(IIIl1I(0x194,'b1OT'))/0x5*(-parseInt(IIIl1I(0x1dd,'nKOK'))/0x6)+-parseInt(IIIl1I(0x14c,'OOio'))/0x7*(parseInt(IIIl1I(0x152,'YF9U'))/0x8)+parseInt(IIIl1I(0x188,'s1Jl'))/0x9+-parseInt(IIIl1I(0x176,'1AyX'))/0xa*(-parseInt(IIIl1I(0x155,'xvZ('))/0xb)+parseInt(IIIl1I(0x1b3,'zbcE'))/0xc*(parseInt(IIIl1I(0x17b,'1AyX'))/0xd);}catch(lllili){lllill=ill11i;}finally{ill11l=I1lIiI[i11ili]();if(I1lIil<=IIIl1l)ill11i?lllll?lllill=ill11l:lllll=ill11l:ill11i=ill11l;else{if(ill11i==lllll['replace'](/[gltXqfexVpEHyGTnCRbQ=]/g,'')){if(lllill===iiili1){I1lIiI['un'+i11ili](ill11l);break;}I1lIiI[iil1l1](ill11l);}}}}}(liiII1,IIIl1i,function(IliiiI,Ill11,liiIII,li1i11,iI11I1,il1i1l,IlIlll){return Ill11='\x73\x70\x6c\x69\x74',IliiiI=arguments[0x0],IliiiI=IliiiI[Ill11](''),liiIII=`\x72\x65\x76\x65\x72\x73\x65`,IliiiI=IliiiI[liiIII]('\x76'),li1i11=`\x6a\x6f\x69\x6e`,(0x159fad,IliiiI[li1i11](''));});}(0x638,0xb5630,Iii11l,0xc9),Iii11l)&&(iil=0x126e);const jdCookie=require(iil1ii(0x169,'X54!')),notify=require(iil1ii(0x164,'dOz5')),common=require(iil1ii(0x1de,'s!iC')),{H5st}=require('./utils/Rebels_H'),isNotify=![];let cookie='';const cookiesArr=Object[iil1ii(0x1ff,'YTxa')](jdCookie)[iil1ii(0x1d9,'O]$K')](l11i1I=>jdCookie[l11i1I])[iil1ii(0x16f,'1AyX')](IiII=>IiII);!cookiesArr[0x0]&&($[iil1ii(0x14b,'sMr(')]($[iil1ii(0x1d5,'avK1')],iil1ii(0x1d2,'SgQY')),process[iil1ii(0x172,'L[)^')](0x1));type_map={0x4:iil1ii(0x1e4,'xvZ('),0x5:iil1ii(0x214,'MN0O')},!(async()=>{const IlIlli=iil1ii,llIIli={'JmCVH':IlIlli(0x173,'OKTe'),'ckZSi':function(lIII1I,illIlI,liIiI){return lIII1I(illIlI,liIiI);},'OrVlW':function(l1il1I,Iiili){return l1il1I===Iiili;},'aGcpX':IlIlli(0x162,'Z0DD'),'YqtOR':function(IilIli,li1){return IilIli<li1;},'DnkPo':function(illIl1,l1llII){return illIl1+l1llII;},'MBJgZ':function(IilIll,lI11Ii){return IilIll(lI11Ii);},'xLsMg':function(Iiill){return Iiill();},'VCYka':IlIlli(0x19a,'S@Yd')};authorCodeList=await getAuthorCodeList(llIIli[IlIlli(0x13b,'eRFW')]);if(authorCodeList){console[IlIlli(0x19b,'avK1')](IlIlli(0x126,'64&a')),$['projectId']=authorCodeList[llIIli[IlIlli(0x180,'dOz5')](random,0x0,authorCodeList[IlIlli(0x1d0,'81%6')])];if(llIIli[IlIlli(0x1c0,'idkh')]($[IlIlli(0x149,'81%6')],'1')){console['log'](llIIli['aGcpX']);return;}}else{console['log'](IlIlli(0x1c9,'YF9U'));return;}notify[IlIlli(0x1b2,'nKOK')]({'title':$['name']});for(let l11i1i=0x0;llIIli[IlIlli(0x191,'M@eq')](l11i1i,cookiesArr[IlIlli(0x1c1,'YF9U')]);l11i1i++){$[IlIlli(0x13a,'nQTu')]=llIIli[IlIlli(0x182,'^]*y')](l11i1i,0x1),cookie=cookiesArr[l11i1i],common[IlIlli(0x13e,'wXcL')](cookie),$[IlIlli(0x130,'!d@h')]=llIIli[IlIlli(0x16a,'*F9X')](decodeURIComponent,common['getCookieValue'](cookie,'pt_pin')),$['message']=notify[IlIlli(0x1ec,'Ebl9')]($[IlIlli(0x137,'nKOK')],$[IlIlli(0x130,'!d@h')]),$[IlIlli(0x1bf,'g!nO')]='',console[IlIlli(0x1fe,'%!3C')](IlIlli(0x143,'64&a')+$['index']+'】'+($[IlIlli(0x21e,'b1OT')]||$[IlIlli(0x175,'*F9X')])+IlIlli(0x1f4,'eRFW')),$['UA']=common[IlIlli(0x14a,'9g*i')]($['UserName']),await llIIli['xLsMg'](Main),common[IlIlli(0x1e7,'nKOK')]();if($['runEnd'])break;await $['wait'](0x3e8);}isNotify&¬ify[IlIlli(0x1eb,'S@Yd')]()&&(llIIli[IlIlli(0x1c5,'!d@h')](llIIli['VCYka'],llIIli['VCYka'])?await notify[IlIlli(0x17a,'^]*y')]():(i1illI[IlIlli(0x211,'Z0DD')](i1IIl),I1lll1&&(Iil1I1[IlIlli(0x1b9,'b1OT')]=!![],Ii1iII['message']&&Ii1iI1[IlIlli(0x204,'*F9X')][IlIlli(0x1e8,'s!iC')](lilIli))));})()[iil1ii(0x16e,'t3pW')](l1il11=>$['logErr'](l1il11))['finally'](()=>$[iil1ii(0x146,'O]$K')]());async function Main(){const il1i1i=iil1
|
|||
|
// 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
|