KR/jd_wxSign.js

27 lines
106 KiB
JavaScript
Raw Normal View History

2023-09-27 09:06:49 +08:00
/*
活动名称店铺签到 · 超级无线/超级会员
活动链接https://lzkj-isv.isvjd.com/sign/signActivity2?activityId=<活动id>
https://lzkj-isv.isvjd.com/sign/sevenDay/signActivity?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/sign/sevenDay/signActivity?activityId=<活动id>
环境变量jd_wxSign_sign_lzkj_Ids // 超级无线签到有礼活动id旧变量 LZKJ_SIGN
jd_wxSign_sevenDay_lzkj_Ids // 超级无线7日签到活动id旧变量 LZKJ_SEVENDAY
jd_wxSign_sign_cjhy_Ids // 超级会员签到有礼活动id旧变量 CJHY_SIGN
jd_wxSign_sevenDay_cjhy_Ids // 超级会员7日签到活动id旧变量 CJHY_SEVENDAY
jd_wxSign_lzkjInterval // 自定义超级无线活动签到间隔整数默认1秒
jd_wxSign_cjhyInterval // 自定义超级会员活动签到间隔整数默认1秒
jd_wxSign_lzkjFilter // 账号pin过滤跳过不跑多个用户名用@分割
jd_wxSign_cjhyFilter // 账号pin过滤跳过不跑多个用户名用@分割
jd_wxSign_Notify // 是否推送通知true/false默认不推送
不同环境变量对应不同链接类型注意区分环境变量所对应活动类型的排列顺序与链接的排列顺序一致如果有多个活动ID用英文逗号分割即可实现多活动签到
cron: 7 7 7 7 * jd_wxSign.js
*/
const $ = new Env('店铺签到(超级无线/超级会员)')
2023-09-27 11:29:26 +08:00
var version_='jsjiami.com.v7';const IlilIli=iIl1II1l;(function(lIli1iII,II1li1iI,li1i1iiI,iIil1i1i,l1Iii1l1,Il11IiIi,iIIliIll){return lIli1iII=lIli1iII>>0x1,Il11IiIi='hs',iIIliIll='hs',function(i1illill,iI11lli1,illII1li,l1ilill,I1iIiII1){const IIIi1i1I=iIl1II1l;l1ilill='tfi',Il11IiIi=l1ilill+Il11IiIi,I1iIiII1='up',iIIliIll+=I1iIiII1,Il11IiIi=illII1li(Il11IiIi),iIIliIll=illII1li(iIIliIll),illII1li=0x0;const li1li1II=i1illill();while(!![]&&--iIil1i1i+iI11lli1){try{l1ilill=-parseInt(IIIi1i1I(0x4f7,'yKQ4'))/0x1*(-parseInt(IIIi1i1I(0x1bd,'@Hcn'))/0x2)+parseInt(IIIi1i1I(0xed,'xO2Y'))/0x3*(parseInt(IIIi1i1I(0xd5,'87c$'))/0x4)+-parseInt(IIIi1i1I(0x283,'87c$'))/0x5*(-parseInt(IIIi1i1I(0x2a1,'&EJz'))/0x6)+-parseInt(IIIi1i1I(0x3d4,'Rnkl'))/0x7*(parseInt(IIIi1i1I(0x10a,'ano9'))/0x8)+-parseInt(IIIi1i1I(0x20d,'1QRy'))/0x9+-parseInt(IIIi1i1I(0x341,'W%C('))/0xa+parseInt(IIIi1i1I(0x478,'4rZh'))/0xb*(parseInt(IIIi1i1I(0x4dc,'B1OW'))/0xc);}catch(il11iiIi){l1ilill=illII1li;}finally{I1iIiII1=li1li1II[Il11IiIi]();if(lIli1iII<=iIil1i1i)illII1li?l1Iii1l1?l1ilill=I1iIiII1:l1Iii1l1=I1iIiII1:illII1li=I1iIiII1;else{if(illII1li==l1Iii1l1['replace'](/[wkAEuPBeYngyNHtGSXxr=]/g,'')){if(l1ilill===iI11lli1){li1li1II['un'+Il11IiIi](I1iIiII1);break;}li1li1II[iIIliIll](I1iIiII1);}}}}}(li1i1iiI,II1li1iI,function(Il11I1lI,I1lI111l,il11lIi1,IIlII1iI,liilllIi,iiIlIIl1,i1i1Iill){return I1lI111l='\x73\x70\x6c\x69\x74',Il11I1lI=arguments[0x0],Il11I1lI=Il11I1lI[I1lI111l](''),il11lIi1=`\x72\x65\x76\x65\x72\x73\x65`,Il11I1lI=Il11I1lI[il11lIi1]('\x76'),IIlII1iI=`\x6a\x6f\x69\x6e`,(0x140242,Il11I1lI[IIlII1iI](''));});}(0x178,0x9f5cc,Il1iIlll,0xbe),Il1iIlll)&&(version_=Il1iIlll);const liiIIII=$[IlilIli(0x148,'tyWo')]()?require(IlilIli(0x379,'Rnkl')):'',i1ili1=require(IlilIli(0x2b5,'lU3I')),iiI1Il=require(IlilIli(0x240,'Xg1(')),ll11I1ll=require(IlilIli(0xc4,'Oe)e')),{wuxian_savePrize:liil11ll}=require(IlilIli(0x2f6,'f0(s')),I1lii1ll=require(IlilIli(0x46c,'1RbH'));let IIlIi1ll=[];const IIi1l1l1=process['env'][IlilIli(0x4a1,'Xhc$')]||'',lIlIi1=process['env'][IlilIli(0x3f6,'C[zN')]||'',i11iI1li=process['env'][IlilIli(0x242,'C)1L')]===IlilIli(0x2ff,'B1OW');let Ii11Iii1=(process['env'][IlilIli(0x3c4,'IkxA')]||process[IlilIli(0x1cb,'xO2Y')][IlilIli(0x4be,'HnLY')]||'')[IlilIli(0x1d5,'2Tg$')](','),lI11li1I=(process['env']['jd_wxSign_sign_lzkj_Ids']||process[IlilIli(0x302,'87c$')][IlilIli(0x382,'2Tg$')]||'')[IlilIli(0x1d0,'yKQ4')](','),llI1ll=(process['env'][IlilIli(0x24d,'87c$')]||process[IlilIli(0x3b8,'EGoW')][IlilIli(0x14e,'954)')]||'')[IlilIli(0x11a,'W%C(')](','),iiiilIlI=(process[IlilIli(0xeb,'4rZh')]['jd_wxSign_sign_cjhy_Ids']||process[IlilIli(0x302,'87c$')]['CJHY_SIGN']||'')[IlilIli(0x2a9,'IkxA')](','),l1i1111i=(process[IlilIli(0x14c,'C)1L')]['jd_wxSign_lzkjFilter']||'')['split']('@'),iililIll=(process[IlilIli(0x2d8,'Xhc$')][IlilIli(0x45a,'gUH6')]||'')[IlilIli(0x229,'4rZh')]('@'),II1IIiI='',iIilIili={};if($['isNode']()){if(JSON['stringify'](process['env'])[IlilIli(0xf2,'Xg1(')](IlilIli(0x329,'BS*C'))>-0x1)process[IlilIli(0x3ff,'9D4f')](0x0);Object[IlilIli(0x4d5,'HnLY')](liiIIII)[IlilIli(0x33f,'B1OW')](iIl111ll=>{const liliiiiI=IlilIli;IIlIi1ll[liliiiiI(0x320,'Xhc$')](liiIIII[iIl111ll]);});if(process[IlilIli(0x30b,'Rnkl')]['JD_DEBUG']&&process[IlilIli(0x207,'!Aig')][IlilIli(0x377,'mDQ&')]===IlilIli(0x403,'lU3I'))console[IlilIli(0x3ac,'EGoW')]=()=>{};}else IIlIi1ll=[$[IlilIli(0x2f9,'HnLY')](IlilIli(0x401,'1Q2B')),$['getdata'](IlilIli(0x461,'dr]&')),...$['toObj']($[IlilIli(0x501,'C)1L')](IlilIli(0x21b,'EGoW'))||'[]')['map'](Il1iI1l1=>Il1iI1l1[IlilIli(0xc5,'PI^r')])][IlilIli(0x445,'lRax')](i1III1lI=>!!i1III1lI);!IIlIi1ll[0x0]&&($['msg']($[IlilIli(0x3f8,'gUH6')],IlilIli(0x33d,'Q##!')),process['exit'](0x1));!(async()=>{const iI1ilIii=IlilIli,I1iliI1l={'LKICt':function(II11liil,iI11l1I1){return II11liil===iI11l1I1;},'clIRW':'自定义抽奖间隔格式错误,已使用默认值','kFYbA':function(I1il1lII,li1lilIi){return I1il1lII===li1lilIi;},'HQTrG':'headers','pMrXV':'set-cookie','nWEil':function(iiIi1iI,iIIllll1){return iiIi1iI+iIIllll1;},'JmPbX':function(Ili1iIiI,II1l1lI1){
2023-09-27 09:06:49 +08:00
// 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