KR/jd_wxKnowledgeActivity.js

23 lines
98 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
知识超人 · 超级无线/超级会员
活动链接https://cjhy-isv.isvjcloud.com/wxKnowledgeActivity/activity/activity?activityId=<活动id>
https://lzkj-isv.isvjcloud.com/wxKnowledgeActivity/activity/activity?activityId=<活动id>
环境变量jd_wxKnowledgeActivity_activityUrl // 活动链接
jd_wxKnowledgeActivity_openCard // 是否开卡,默认不开卡
jd_wxKnowledgeActivity_blacklist 黑名单 &隔开 pin值
JD_LZ_OPEN // 是否开启LZ活动运行默认运行
JD_CJ_OPEN // 是否开启CJ活动运行默认运行
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#知识超人
1 1 1 1 * jd_wxKnowledgeActivity.js, tag=知识超人, enabled=true
*/
const $ = new Env('知识超人(超级无线/超级会员)')
var version_='jsjiami.com.v7';const l111I1=iii1II;(function(ilIIi,IiII1l,IiII1i,Ii11Ii,Ii11Il,lIlIlI,iiIIll){return ilIIi=ilIIi>>0x2,lIlIlI='hs',iiIIll='hs',function(I1li1l,I11li1,lIIIi,iiI1I,lIIIl){const lIlIll=iii1II;iiI1I='tfi',lIlIlI=iiI1I+lIlIlI,lIIIl='up',iiIIll+=lIIIl,lIlIlI=lIIIi(lIlIlI),iiIIll=lIIIi(iiIIll),lIIIi=0x0;const ilIII=I1li1l();while(!![]&&--Ii11Ii+I11li1){try{iiI1I=parseInt(lIlIll(0x255,'uDo4'))/0x1+parseInt(lIlIll(0x378,'AGV!'))/0x2*(-parseInt(lIlIll(0x458,'gsCx'))/0x3)+parseInt(lIlIll(0x1ab,'EdCZ'))/0x4*(-parseInt(lIlIll(0x1d0,'6]ae'))/0x5)+-parseInt(lIlIll(0x389,'G[LU'))/0x6+parseInt(lIlIll(0x145,'uiy8'))/0x7*(parseInt(lIlIll(0x341,'Q1Nr'))/0x8)+parseInt(lIlIll(0x1b8,'G[LU'))/0x9+-parseInt(lIlIll(0x373,'*3n3'))/0xa*(-parseInt(lIlIll(0xd7,'G[LU'))/0xb);}catch(IiII1I){iiI1I=lIIIi;}finally{lIIIl=ilIII[lIlIlI]();if(ilIIi<=Ii11Ii)lIIIi?Ii11Il?iiI1I=lIIIl:Ii11Il=lIIIl:lIIIi=lIIIl;else{if(lIIIi==Ii11Il['replace'](/[fekqQSIOxUXLFMVwgpDb=]/g,'')){if(iiI1I===I11li1){ilIII['un'+lIlIlI](lIIIl);break;}ilIII[iiIIll](lIIIl);}}}}}(IiII1i,IiII1l,function(IIl1I1,I1li1i,IIi111,Ii11II,iiI11,lIlIli,ilII1){return I1li1i='\x73\x70\x6c\x69\x74',IIl1I1=arguments[0x0],IIl1I1=IIl1I1[I1li1i](''),IIi111='\x72\x65\x76\x65\x72\x73\x65',IIl1I1=IIl1I1[IIi111]('\x76'),Ii11II='\x6a\x6f\x69\x6e',(0x136469,IIl1I1[Ii11II](''));});}(0x308,0x4a69a,Iii11l,0xc4),Iii11l)&&(version_=Iii11l);const iiiIil=$[l111I1(0x45c,'0x$2')]()?require(l111I1(0x15f,'bbRs')):'',lilll=$['isNode']()?require(l111I1(0x496,'6]ae')):'',l1iilI=require(l111I1(0x27a,'fHyL')),lilli=require(l111I1(0x214,'tRoc')),iiII=require('./function/krgetua'),Iil11=require(l111I1(0x39f,'ml%W'));let Ill1iI={},i1Ii1l=[],IIll='';function iii1II(_0x5edf7e,_0xf5f8b5){const _0x9fe09d=Iii11l();return iii1II=function(_0x31a0f0,_0x372fb4){_0x31a0f0=_0x31a0f0-0xc1;let _0x5e6738=_0x9fe09d[_0x31a0f0];if(iii1II['tgZMTn']===undefined){var _0x6193d5=function(_0x48fff8){const _0x214272='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2a37c7='',_0x5d9fef='';for(let _0x3078de=0x0,_0x251d70,_0x15aabc,_0x5521bd=0x0;_0x15aabc=_0x48fff8['charAt'](_0x5521bd++);~_0x15aabc&&(_0x251d70=_0x3078de%0x4?_0x251d70*0x40+_0x15aabc:_0x15aabc,_0x3078de++%0x4)?_0x2a37c7+=String['fromCharCode'](0xff&_0x251d70>>(-0x2*_0x3078de&0x6)):0x0){_0x15aabc=_0x214272['indexOf'](_0x15aabc);}for(let _0x4f6bcb=0x0,_0x889e49=_0x2a37c7['length'];_0x4f6bcb<_0x889e49;_0x4f6bcb++){_0x5d9fef+='%'+('00'+_0x2a37c7['charCodeAt'](_0x4f6bcb)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5d9fef);};const _0x1a19b2=function(_0x4f2892,_0x58d8dd){let _0x30142d=[],_0x48de7d=0x0,_0x5a23f9,_0x38fab2='';_0x4f2892=_0x6193d5(_0x4f2892);let _0x2f27b9;for(_0x2f27b9=0x0;_0x2f27b9<0x100;_0x2f27b9++){_0x30142d[_0x2f27b9]=_0x2f27b9;}for(_0x2f27b9=0x0;_0x2f27b9<0x100;_0x2f27b9++){_0x48de7d=(_0x48de7d+_0x30142d[_0x2f27b9]+_0x58d8dd['charCodeAt'](_0x2f27b9%_0x58d8dd['length']))%0x100,_0x5a23f9=_0x30142d[_0x2f27b9],_0x30142d[_0x2f27b9]=_0x30142d[_0x48de7d],_0x30142d[_0x48de7d]=_0x5a23f9;}_0x2f27b9=0x0,_0x48de7d=0x0;for(let _0x149693=0x0;_0x149693<_0x4f2892['length'];_0x149693++){_0x2f27b9=(_0x2f27b9+0x1)%0x100,_0x48de7d=(_0x48de7d+_0x30142d[_0x2f27b9])%0x100,_0x5a23f9=_0x30142d[_0x2f27b9],_0x30142d[_0x2f27b9]=_0x30142d[_0x48de7d],_0x30142d[_0x48de7d]=_0x5a23f9,_0x38fab2+=String['fromCharCode'](_0x4f2892['charCodeAt'](_0x149693)^_0x30142d[(_0x30142d[_0x2f27b9]+_0x30142d[_0x48de7d])%0x100]);}return _0x38fab2;};iii1II['DYdgBw']=_0x1a19b2,_0x5edf7e=arguments,iii1II['tgZMTn']=!![];}const _0x149ecf=_0x9fe09d[0x0],_0x12d9ec=_0x31a0f0+_0x149ecf,_0x2cbc05=_0x5edf7e[_0x12d9ec];return!_0x2cbc05?(iii1II['OoFEec']===undefined&&(iii1II['OoFEec']=!![]),_0x5e6738=iii1II['DYdgBw'](_0x5e6738,_0x372fb4),_0x5edf7e[_0x12d9ec]=_0x5e6738):_0x5e6738=_0x2cbc05,_0x5e6738;},iii1II(_0x5edf7e,_0xf5f8b5);}if($[l111I1(0x2b6,'dZN3')]()){Object[l111I1(0x3ab,'*3n3')](iiiIil)['forEach'](l1iI1I=>{const IiII11=l111I1;i1Ii1l[IiII11(0x26f,'66!^')](iiiIil[l1iI1I]);});if(process[l111I1(0x4b1,'ZiN%')]['JD_DEBUG']&&process[l111I1(0x46a,'HXen')][l111I1(0x44d,'uD
// 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