KR/jd_lzkj_loreal_sign.js

21 lines
113 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/**
活动名称签到抽奖超级无线欧莱雅
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=<10001/10002/10003/10004>&templateId=<模板id>&activityId=<活动id>&nodeId=<nodeid>&prd=cjwx
支持activityType (10001/10002/10003/10004)
环境变量jd_lzkj_loreal_sign_url // 活动链接
2023-07-28 21:29:02 +08:00
请使用本地IP环境 请使用本地IP环境 请使用本地IP环境
2023-07-27 16:14:01 +08:00
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#lzkj_loreal签到抽奖
1 1 1 1 * jd_lzkj_loreal_sign.js, tag=lzkj_loreal签到抽奖, enabled=true
*/
const $ = new Env("签到抽奖lzkj_loreal");
2023-07-28 23:36:10 +08:00
var version_='jsjiami.com.v7';const li1lII=iii1II;(function(l111li,Il1ll,Iilil,Iilii,I1il1,IiIlIl,iiliiI){return l111li=l111li>>0x6,IiIlIl='hs',iiliiI='hs',function(Il1li,lIiI11,li111I,IiIlIi,I1ili){const IIi1Ii=iii1II;IiIlIi='tfi',IiIlIl=IiIlIi+IiIlIl,I1ili='up',iiliiI+=I1ili,IiIlIl=li111I(IiIlIl),iiliiI=li111I(iiliiI),li111I=0x0;const iilil1=Il1li();while(!![]&&--Iilii+lIiI11){try{IiIlIi=-parseInt(IIi1Ii(0x484,'i)Vb'))/0x1+parseInt(IIi1Ii(0x479,'$[K6'))/0x2+parseInt(IIi1Ii(0x38b,'gK]d'))/0x3*(-parseInt(IIi1Ii(0x551,'I83M'))/0x4)+-parseInt(IIi1Ii(0x399,'Q%aZ'))/0x5+-parseInt(IIi1Ii(0x453,'!4nf'))/0x6*(-parseInt(IIi1Ii(0x30f,'%j(k'))/0x7)+-parseInt(IIi1Ii(0x4f2,'5zl0'))/0x8+parseInt(IIi1Ii(0x45b,'rs!t'))/0x9;}catch(il1lll){IiIlIi=li111I;}finally{I1ili=iilil1[IiIlIl]();if(l111li<=Iilii)li111I?I1il1?IiIlIi=I1ili:I1il1=I1ili:li111I=I1ili;else{if(li111I==I1il1['replace'](/[ALCYXqVIelntEQpxgSPfHRM=]/g,'')){if(IiIlIi===lIiI11){iilil1['un'+IiIlIl](I1ili);break;}iilil1[iiliiI](I1ili);}}}}}(Iilil,Il1ll,function(i1Il11,li1lI1,ll1I11,l1lli,il1lli,IIi1Il,l1lll){return li1lI1='\x73\x70\x6c\x69\x74',i1Il11=arguments[0x0],i1Il11=i1Il11[li1lI1](''),ll1I11='\x72\x65\x76\x65\x72\x73\x65',i1Il11=i1Il11[ll1I11]('\x76'),l1lli='\x6a\x6f\x69\x6e',(0x136afe,i1Il11[l1lli](''));});}(0x3080,0x67821,Iii11l,0xc4),Iii11l)&&(version_=Iii11l);const liiI=$[li1lII(0x3a3,'0b%z')]()?require(li1lII(0x3f4,'%iT]')):'',liIII1=$['isNode']()?require(li1lII(0x338,')$UD')):'',I111il=require(li1lII(0x343,'0!bx')),l1Ili1=require(li1lII(0x166,'709z')),iliili=require('./function/krgetua');let iliill={},I111ii=process[li1lII(0x4cd,'!4nf')][li1lII(0x2ab,'0!bx')],Ililll=null,I1liII='',I1ii1I='';$['activityEnd']=![];let Ililli=null,lii1=[],iIii1l='',iIliIi='',IIil1l='';if($['isNode']()){if(process[li1lII(0x36d,'PQM!')][li1lII(0x304,')Eg8')])I111ii=process['env']['jd_lzkj_loreal_sign_url'];if(JSON['stringify'](process[li1lII(0x74,'I6[i')])['indexOf']('GITHUB')>-0x1)process[li1lII(0x3a6,'Q%aZ')](0x0);Object['keys'](liIII1)[li1lII(0x1e1,'mJC0')](i1i1li=>{const Il11II=li1lII;lii1[Il11II(0x436,'8e&A')](liIII1[i1i1li]);});if(process[li1lII(0x40a,'709z')][li1lII(0x53d,')$UD')]&&process[li1lII(0x206,'ydd*')][li1lII(0xf8,'10tV')]===li1lII(0x432,'%j(k'))console['log']=()=>{};}else lii1=[$[li1lII(0xe5,'G^B$')](li1lII(0x274,']*2a')),$[li1lII(0x373,'ydd*')](li1lII(0x14e,'rl@%')),...$['toObj']($[li1lII(0x50e,'mJC0')](li1lII(0x57b,'I83M'))||'[]')[li1lII(0x76,'AtDF')](iIill=>iIill[li1lII(0x3d4,'%iT]')])][li1lII(0xfa,'ACsc')](iil1Ii=>!!iil1Ii);let i1i1l1=typeof $request!=='undefined';i1i1l1&&(GetCookie(),$['done']());if(I111ii){const iii11i='2|4|3|1|0'[li1lII(0x138,'G^B$')]('|');let iii11l=0x0;while(!![]){switch(iii11i[iii11l++]){case'0':$[li1lII(0x569,'Cnw9')]=I111ii[li1lII(0x4fc,'G^B$')](/https?:\/\/([^/]+)/)[0x1];continue;case'1':if(I111ii['includes']('lorealjdcampaign-rc'))wxActType=li1lII(0x4ac,'xs6o');else I111ii[li1lII(0x3fc,'I6[i')](li1lII(0x534,'ydd*'))?wxActType=I111ii['match'](/\/(prod\/cc\/interact\w*)\//)[0x1]:console['log']('暂不支持的类型');continue;case'2':Ililll=I1liI1(''+I111ii,li1lII(0xff,'nXzm'));continue;case'3':templateId=I1liI1(''+I111ii,'templateId');continue;case'4':activityType=I1liI1(''+I111ii,li1lII(0x547,'2c!I'));continue;}break;}}let iIii1i=li1lII(0x285,'Ixqi')+$[li1lII(0x52d,'rl@%')];function iii1II(_0xc17b82,_0x2a10c1){const _0x4014e0=Iii11l();return iii1II=function(_0x203147,_0x3e4152){_0x203147=_0x203147-0x68;let _0x52eb10=_0x4014e0[_0x203147];if(iii1II['addkbB']===undefined){var _0x485c1a=function(_0x19a832){const _0x1c3226='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4e5c86='',_0x374354='';for(let _0x582214=0x0,_0x30c5e7,_0x26ecd0,_0x5dc7b6=0x0;_0x26ecd0=_0x19a832['charAt'](_0x5dc7b6++);~_0x26ecd0&&(_0x30c5e7=_0x582214%0x4?_0x30c5e7*0x40+_0x26ecd0:_0x26ecd0,_0x582214++%0x4)?_0x4e5c86+=String['fromCharCode'](0xff&_0x30c5e7>>(-0x2*_0x582214&0x6)):0x0){_0x26ecd0=_0x1c3226['indexOf'](_0x26ecd0);}for(let _0x4f30a8=0x0,_0x4b0bd2=_0x4e5c86['length'];_0x4f30a8<_0x4b0bd2;_0x4f30a8++){_0x374354+='%'+('00'+_0x4e5c86['charCodeA
2023-07-27 16:14:01 +08:00
// prettier-ignore
2023-07-28 21:29:02 +08: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