mirror of https://github.com/KingRan/KR.git
24 lines
100 KiB
JavaScript
24 lines
100 KiB
JavaScript
|
/*
|
|||
|
活动名称:关注店铺有礼 · 超级无线
|
|||
|
活动链接:https://cjhy-isv.isvjcloud.com/wxShopFollowActivity/activity?activityId=<活动id>
|
|||
|
https://lzkj-isv.isvjcloud.com/wxShopFollowActivity/activity/activity?activityId=<活动id>
|
|||
|
环境变量:jd_wxShopFollowActivity_activityUrl // 活动链接
|
|||
|
jd_wxShopFollowActivity_openCard // 是否开卡,默认不开卡
|
|||
|
jd_wxShopFollowActivity_blacklist 黑名单 用&隔开 pin值
|
|||
|
JD_LZ_OPEN // 是否开启LZ活动运行,默认运行
|
|||
|
JD_CJ_OPEN // 是否开启CJ活动运行,默认运行
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#关注店铺有礼
|
|||
|
1 1 1 1 * jd_wxShopFollowActivity.js, tag=关注店铺有礼, enabled=true
|
|||
|
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('关注店铺有礼(超级无线/超级会员)')
|
|||
|
var version_='jsjiami.com.v7';const IiII1I=iii1II;(function(IIl1Ii,ilIIl,I11ll1,lIIII,li1IlI,iiI1i,iiI1l){return IIl1Ii=IIl1Ii>>0x8,iiI1i='hs',iiI1l='hs',function(Ili1lI,lIlIl1,ilIIi,IiII1l,IiII1i){const ilIII=iii1II;IiII1l='tfi',iiI1i=IiII1l+iiI1i,IiII1i='up',iiI1l+=IiII1i,iiI1i=ilIIi(iiI1i),iiI1l=ilIIi(iiI1l),ilIIi=0x0;const Ii11Ii=Ili1lI();while(!![]&&--lIIII+lIlIl1){try{IiII1l=-parseInt(ilIII(0x415,'9eB3'))/0x1*(parseInt(ilIII(0x16a,'X]yc'))/0x2)+-parseInt(ilIII(0x1cd,'Sq9l'))/0x3*(-parseInt(ilIII(0x35e,'TNbr'))/0x4)+parseInt(ilIII(0x54f,'CzuC'))/0x5+parseInt(ilIII(0x209,'*LSZ'))/0x6*(parseInt(ilIII(0x2f4,'VAY)'))/0x7)+-parseInt(ilIII(0x1fe,'aMR]'))/0x8+parseInt(ilIII(0x59c,'FIJk'))/0x9*(parseInt(ilIII(0x513,'*LSZ'))/0xa)+-parseInt(ilIII(0x4ae,'aMR]'))/0xb;}catch(Ii11Il){IiII1l=ilIIi;}finally{IiII1i=Ii11Ii[iiI1i]();if(IIl1Ii<=lIIII)ilIIi?li1IlI?IiII1l=IiII1i:li1IlI=IiII1i:ilIIi=IiII1i;else{if(ilIIi==li1IlI['replace'](/[eXdpqCrWKtSLUuRhGNlFIQ=]/g,'')){if(IiII1l===lIlIl1){Ii11Ii['un'+iiI1i](IiII1i);break;}Ii11Ii[iiI1l](IiII1i);}}}}}(I11ll1,ilIIl,function(lIlIlI,iiIIll,I1li1l,I11li1,lIIIi,iiI1I,lIIIl){return iiIIll='\x73\x70\x6c\x69\x74',lIlIlI=arguments[0x0],lIlIlI=lIlIlI[iiIIll](''),I1li1l='\x72\x65\x76\x65\x72\x73\x65',lIlIlI=lIlIlI[I1li1l]('\x76'),I11li1='\x6a\x6f\x69\x6e',(0x13637b,lIlIlI[I11li1](''));});}(0xc600,0x51791,Iii11l,0xc8),Iii11l)&&(version_=Iii11l);const l1ilI=$[IiII1I(0x2b9,'@gIr')]()?require('./jdCookie'):'',IIi1=$[IiII1I(0x35c,'QbP@')]()?require(IiII1I(0x16c,'@T]D')):'',illl1i=require('./function/krgetToken'),l1iiii=require(IiII1I(0x2e6,'N3s!')),iiiIi1=require(IiII1I(0x5d9,'#T1T')),illl1l=require(IiII1I(0x39d,'@T]D'));let Il11I={},li1lll=[],lill1='';if($[IiII1I(0x48c,'s2ny')]()){Object[IiII1I(0x2ee,'@cba')](l1ilI)['forEach'](IIii=>{const IIl1I1=IiII1I;li1lll[IIl1I1(0x264,'lPa!')](l1ilI[IIii]);});if(process[IiII1I(0x5bd,'sh8C')][IiII1I(0x381,'dwu0')]&&process['env']['JD_DEBUG']===IiII1I(0x538,']P3*'))console[IiII1I(0x257,'In9s')]=()=>{};}else li1lll=[$[IiII1I(0x51a,'@cba')](IiII1I(0x1a9,'@cba')),$[IiII1I(0x5cc,'@gIr')]('CookieJD2'),...IIlI($['getdata']('CookiesJD')||'[]')[IiII1I(0x1ba,'jLHE')](i1Ii1I=>i1Ii1I['cookie'])][IiII1I(0x5c7,'XIGg')](llIiIl=>!!llIiIl);let IiIIl=process[IiII1I(0x574,'aMR]')]['jd_wxShopFollowActivity_activityUrl']?process[IiII1I(0x387,'m44q')][IiII1I(0x525,'(m0z')]:'',IiIIi=process[IiII1I(0x458,'VAY)')][IiII1I(0x420,']P3*')]===IiII1I(0x473,'TNbr')?!![]:![],li1lli='';allMessage='',message='',$[IiII1I(0x392,'a8wS')]=![],$['activityEnd']=![];let iiiIl1='',I1i1I='',IIl1=process[IiII1I(0x412,'XIGg')][IiII1I(0x4db,'!6vk')]?process[IiII1I(0x4fa,'WKUJ')]['JD_LZ_OPEN']:IiII1I(0x431,'lPa!'),l1ili=process[IiII1I(0x284,'AU5#')][IiII1I(0x57c,'@gIr')]?process[IiII1I(0x17c,'cK$R')]['JD_CJ_OPEN']:IiII1I(0x2e4,'sh8C'),i1Ii11='',l1iill='';$['whitelist']=process['env'][IiII1I(0x49a,'m44q')]||i1Ii11,$['blacklist']=process[IiII1I(0x4ac,'*LSZ')][IiII1I(0x17b,'8OFv')]||l1iill,IllII(),I1i11();if(IiIIl){const I1i1i=IiII1I(0x3a9,'cK$R')[IiII1I(0x38a,'WKUJ')]('|');let lIi1II=0x0;while(!![]){switch(I1i1i[lIi1II++]){case'0':if(IiIIl[IiII1I(0x3f9,'@gIr')](IiII1I(0x22b,'e4#r'))){if(IIl1===IiII1I(0x4f3,'AU5#')){console['log'](IiII1I(0x40c,'@T]D'));return;}else $[IiII1I(0x51b,'2#gZ')]=IiIIl['match'](/https?:\/\/([^/]+)/)[0x1];}else{if(IiIIl[IiII1I(0x4b0,'Box2')](IiII1I(0x3d6,'m44q'))){if(l1ili==='false'){console[IiII1I(0x18e,']P3*')](IiII1I(0x55e,'8OFv'));return;}else $['domain']=IiIIl[IiII1I(0x569,'K%U(')](/https?:\/\/([^/]+)/)[0x1];}}continue;case'1':if($[IiII1I(0x385,'WKUJ')][IiII1I(0x2a8,'CzuC')](IiII1I(0x1c9,'AU5#')))$[IiII1I(0x2cf,'!6vk')]=IiII1I(0x430,'A@fk');continue;case'2':$[IiII1I(0x422,'sh8C')]=null;continue;case'3':$['domain_mode']==null&&console[IiII1I(0x349,'lPa!')]('请填写正确的活动链接');continue;case'4':if($[IiII1I(0x49d,'X]yc')]['includes']('lzkj'))$[IiII1I(0x391,'lPa!')]=IiII1I(0x42d,'A@fk');continue;case'5':li1lli=I1i1l(''+IiIIl,IiII1I(0x527,']P3*'));continue;}break;}}else console[IiII1I(0x5df,'a8wS')](IiII1I(0x234,'XIGg'));let l1ill=IiII1I(0x5c9,'N3s!')+$['domain'];!(async()=>{c
|
|||
|
// 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
|