mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
22 lines
38 KiB
JavaScript
22 lines
38 KiB
JavaScript
|
/*
|
|||
|
粉丝福利红包
|
|||
|
活动链接:https://wqs.jd.com/sns/202109/22/fansactiveall/index.html?qwer=<活动id>
|
|||
|
环境变量:jd_fansDraw_activityUrl // 活动链接
|
|||
|
jd_fansDraw_Notify // 是否推送通知(true/false),默认不推送
|
|||
|
|
|||
|
注:活动非百分百中奖,请勿重复运行
|
|||
|
|
|||
|
7 7 7 7 * jd_fansDraw.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('粉丝福利红包')
|
|||
|
const jdCookie = require('./jdCookie')
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
const notify = require('./function/sendJDNotify')
|
|||
|
|
|||
|
var version_='jsjiami.com.v7';const iIlliIIl=Il11I1i1;(function(iii1l1l1,I1lilllI,iIlil1li,llii1iI,li11lli,I11I111I,iIIiil1i){return iii1l1l1=iii1l1l1>>0x1,I11I111I='hs',iIIiil1i='hs',function(iI11illi,i1l1ilI,i1iiI1ii,i1i1ii11,IilIlI1){const I11i11Ii=Il11I1i1;i1i1ii11='tfi',I11I111I=i1i1ii11+I11I111I,IilIlI1='up',iIIiil1i+=IilIlI1,I11I111I=i1iiI1ii(I11I111I),iIIiil1i=i1iiI1ii(iIIiil1i),i1iiI1ii=0x0;const l11iII1=iI11illi();while(!![]&&--llii1iI+i1l1ilI){try{i1i1ii11=parseInt(I11i11Ii(0x2a1,'0%QM'))/0x1*(parseInt(I11i11Ii(0x2c4,'f[bz'))/0x2)+parseInt(I11i11Ii(0x291,'F%1n'))/0x3*(parseInt(I11i11Ii(0x2b8,'F%1n'))/0x4)+-parseInt(I11i11Ii(0x245,'(Y1*'))/0x5+-parseInt(I11i11Ii(0x293,'0tfd'))/0x6+-parseInt(I11i11Ii(0x1e2,'@x^3'))/0x7+-parseInt(I11i11Ii(0x2a6,'F%1n'))/0x8*(parseInt(I11i11Ii(0x26e,'@x^3'))/0x9)+parseInt(I11i11Ii(0x286,'f[bz'))/0xa*(parseInt(I11i11Ii(0x277,'p^yu'))/0xb);}catch(I111ilii){i1i1ii11=i1iiI1ii;}finally{IilIlI1=l11iII1[I11I111I]();if(iii1l1l1<=llii1iI)i1iiI1ii?li11lli?i1i1ii11=IilIlI1:li11lli=IilIlI1:i1iiI1ii=IilIlI1;else{if(i1iiI1ii==li11lli['replace'](/[QdONtYqBlSDJHPnKe=]/g,'')){if(i1i1ii11===i1l1ilI){l11iII1['un'+I11I111I](IilIlI1);break;}l11iII1[iIIiil1i](IilIlI1);}}}}}(iIlil1li,I1lilllI,function(iI1llii,IIIII1i,II1iIII,i1l1Iii,II11IlIl,llIIIii1,iliI111l){return IIIII1i='\x73\x70\x6c\x69\x74',iI1llii=arguments[0x0],iI1llii=iI1llii[IIIII1i](''),II1iIII=`\x72\x65\x76\x65\x72\x73\x65`,iI1llii=iI1llii[II1iIII]('\x76'),i1l1Iii=`\x6a\x6f\x69\x6e`,(0x13d639,iI1llii[i1l1Iii](''));});}(0x178,0xa9c18,lI1Ill1,0xbe),lI1Ill1)&&(version_=lI1Ill1);function Il11I1i1(_0x1080fc,_0xfc7b3a){const _0x4d3f3c=lI1Ill1();return Il11I1i1=function(_0x326bb4,_0x49a075){_0x326bb4=_0x326bb4-0x161;let _0x1a2182=_0x4d3f3c[_0x326bb4];if(Il11I1i1['zxlRdV']===undefined){var _0x4201ce=function(_0x30f833){const _0x3a861f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x7ac962='',_0x544932='';for(let _0x7ec41=0x0,_0x2ac998,_0x58310c,_0x3b8044=0x0;_0x58310c=_0x30f833['charAt'](_0x3b8044++);~_0x58310c&&(_0x2ac998=_0x7ec41%0x4?_0x2ac998*0x40+_0x58310c:_0x58310c,_0x7ec41++%0x4)?_0x7ac962+=String['fromCharCode'](0xff&_0x2ac998>>(-0x2*_0x7ec41&0x6)):0x0){_0x58310c=_0x3a861f['indexOf'](_0x58310c);}for(let _0x56ce60=0x0,_0x481ad2=_0x7ac962['length'];_0x56ce60<_0x481ad2;_0x56ce60++){_0x544932+='%'+('00'+_0x7ac962['charCodeAt'](_0x56ce60)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x544932);};const _0x25cdd0=function(_0x310d80,_0xa74bc4){let _0x32b575=[],_0x547acc=0x0,_0x3256b4,_0xac5894='';_0x310d80=_0x4201ce(_0x310d80);let _0x4c7e8a;for(_0x4c7e8a=0x0;_0x4c7e8a<0x100;_0x4c7e8a++){_0x32b575[_0x4c7e8a]=_0x4c7e8a;}for(_0x4c7e8a=0x0;_0x4c7e8a<0x100;_0x4c7e8a++){_0x547acc=(_0x547acc+_0x32b575[_0x4c7e8a]+_0xa74bc4['charCodeAt'](_0x4c7e8a%_0xa74bc4['length']))%0x100,_0x3256b4=_0x32b575[_0x4c7e8a],_0x32b575[_0x4c7e8a]=_0x32b575[_0x547acc],_0x32b575[_0x547acc]=_0x3256b4;}_0x4c7e8a=0x0,_0x547acc=0x0;for(let _0x3a6654=0x0;_0x3a6654<_0x310d80['length'];_0x3a6654++){_0x4c7e8a=(_0x4c7e8a+0x1)%0x100,_0x547acc=(_0x547acc+_0x32b575[_0x4c7e8a])%0x100,_0x3256b4=_0x32b575[_0x4c7e8a],_0x32b575[_0x4c7e8a]=_0x32b575[_0x547acc],_0x32b575[_0x547acc]=_0x3256b4,_0xac5894+=String['fromCharCode'](_0x310d80['charCodeAt'](_0x3a6654)^_0x32b575[(_0x32b575[_0x4c7e8a]+_0x32b575[_0x547acc])%0x100]);}return _0xac5894;};Il11I1i1['EEdRdA']=_0x25cdd0,_0x1080fc=arguments,Il11I1i1['zxlRdV']=!![];}const _0x36a4aa=_0x4d3f3c[0x0],_0xbbd137=_0x326bb4+_0x36a4aa,_0x46aa60=_0x1080fc[_0xbbd137];return!_0x46aa60?(Il11I1i1['spmZVt']===undefined&&(Il11I1i1['spmZVt']=!![]),_0x1a2182=Il11I1i1['EEdRdA'](_0x1a2182,_0x49a075),_0x1080fc[_0xbbd137]=_0x1a2182):_0x1a2182=_0x46aa60,_0x1a2182;},Il11I1i1(_0x1080fc,_0xfc7b3a);}const activityUrl=process[iIlliIIl(0x2b0,'0%QM')][iIlliIIl(0x2ab,'(8]2')]||'',isNotify=process[iIlliIIl(0x2bb,'0tfd')][iIlliIIl(0x229,'CK$L')]===iIlliIIl(0x2b4,'F%1n'),appCode=iIlliIIl(0x241,'N[D]');let cookie='';function lI1Ill1(){const lIl11lI=(function(){return[...[version_,'HOQjtqsQPjelitSalmYNiD.KPcdHoBdlmeH.nJv7==','dCk2W5tcJsK','rSklx
|
|||
|
|
|||
|
// 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
|