KR/jd_wxTeam.js

24 lines
72 KiB
JavaScript
Raw Normal View History

2023-08-01 16:47:55 +08:00
/*
活动名称组队瓜分奖品 · 超级无线/超级会员
活动链接https://lzkj-isv.isvjd.com/wxTeam/activity/activity?activityId=<活动id>
https://cjhydz-isv.isvjcloud.com/wxTeam/activity?activityId=<活动id>
环境变量jd_wxTeam_activityUrl // 活动链接(必填)
jd_wxTeam_joinMember // 是否入会true/false默认不入会
jd_wxTeam_Notify // 是否推送通知true/false默认不推送
队长无效或无法创建战队时会退出执行
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#组队瓜分奖品
1 1 1 1 * jd_wxTeam.js, tag=组队瓜分奖品, enabled=true
*/
const $ = new Env('组队瓜分奖品(超级无线/超级会员)')
var version_='jsjiami.com.v7';const l1IIil=iii1II;(function(iill1I,Illi1,l1iiIl,lIIi1i,liI11I,III1,l1IIl1){return iill1I=iill1I>>0x9,III1='hs',l1IIl1='hs',function(l1iiIi,lIIi1l,I1lI1i,illili,iiiII1){const lIIi1I=iii1II;illili='tfi',III1=illili+III1,iiiII1='up',l1IIl1+=iiiII1,III1=I1lI1i(III1),l1IIl1=I1lI1i(l1IIl1),I1lI1i=0x0;const liI111=l1iiIi();while(!![]&&--lIIi1i+lIIi1l){try{illili=parseInt(lIIi1I(0x1d7,'qa@d'))/0x1+-parseInt(lIIi1I(0x2e6,'oS*u'))/0x2*(-parseInt(lIIi1I(0x161,'6]8z'))/0x3)+-parseInt(lIIi1I(0x336,'DdT8'))/0x4*(-parseInt(lIIi1I(0x413,'oS*u'))/0x5)+parseInt(lIIi1I(0x337,'DdT8'))/0x6*(-parseInt(lIIi1I(0x136,'fKy5'))/0x7)+parseInt(lIIi1I(0x2be,'lYYD'))/0x8*(parseInt(lIIi1I(0x134,'E9F)'))/0x9)+parseInt(lIIi1I(0x31f,'PmHi'))/0xa+-parseInt(lIIi1I(0x17f,'6!i('))/0xb;}catch(IiIlI){illili=I1lI1i;}finally{iiiII1=liI111[III1]();if(iill1I<=lIIi1i)I1lI1i?liI11I?illili=iiiII1:liI11I=iiiII1:I1lI1i=iiiII1;else{if(I1lI1i==liI11I['replace'](/[IhbqKDRgVFtkGNrCwdSQ=]/g,'')){if(illili===lIIi1l){liI111['un'+III1](iiiII1);break;}liI111[l1IIl1](iiiII1);}}}}}(l1iiIl,Illi1,function(iIlI1i,iII1Il,IIIliI,iII1Ii,iIlI1l,llIill,l1IIii){return iII1Il='\x73\x70\x6c\x69\x74',iIlI1i=arguments[0x0],iIlI1i=iIlI1i[iII1Il](''),IIIliI='\x72\x65\x76\x65\x72\x73\x65',iIlI1i=iIlI1i[IIIliI]('\x76'),iII1Ii='\x6a\x6f\x69\x6e',(0x1372f5,iIlI1i[iII1Ii](''));});}(0x17a00,0x9e65d,Iii11l,0xbf),Iii11l)&&(version_=Iii11l);const illll1=require('./jdCookie'),IIIIl1=require(l1IIil(0x44a,'jwQV')),liiilI=require('./function/sendJDNotify'),lI111l=require(l1IIil(0x2b6,'l)Xl')),liiii1=require(l1IIil(0x1bc,']h$x')),IIiiIl=process[l1IIil(0x12d,'!QoA')][l1IIil(0x374,'DdT8')]||'',l1ilIl=process[l1IIil(0x12d,'!QoA')][l1IIil(0x329,'ErY#')]==='true',IIiiIi=process[l1IIil(0x233,'W%B2')]['jd_wxTeam_Notify']==='true';function iii1II(_0x1efcb0,_0x2252eb){const _0x1923c4=Iii11l();return iii1II=function(_0x44795d,_0x22082c){_0x44795d=_0x44795d-0x12d;let _0x5576b4=_0x1923c4[_0x44795d];if(iii1II['nuEcLi']===undefined){var _0x584c7f=function(_0x539a9e){const _0x291a93='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x14e799='',_0x355205='';for(let _0x396331=0x0,_0x14b020,_0x3014ac,_0x535291=0x0;_0x3014ac=_0x539a9e['charAt'](_0x535291++);~_0x3014ac&&(_0x14b020=_0x396331%0x4?_0x14b020*0x40+_0x3014ac:_0x3014ac,_0x396331++%0x4)?_0x14e799+=String['fromCharCode'](0xff&_0x14b020>>(-0x2*_0x396331&0x6)):0x0){_0x3014ac=_0x291a93['indexOf'](_0x3014ac);}for(let _0x485d1f=0x0,_0xcbfab7=_0x14e799['length'];_0x485d1f<_0xcbfab7;_0x485d1f++){_0x355205+='%'+('00'+_0x14e799['charCodeAt'](_0x485d1f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x355205);};const _0x206092=function(_0x15bb0a,_0x587b2e){let _0x2e1f15=[],_0x497a6b=0x0,_0x1eab06,_0x219024='';_0x15bb0a=_0x584c7f(_0x15bb0a);let _0x39eacf;for(_0x39eacf=0x0;_0x39eacf<0x100;_0x39eacf++){_0x2e1f15[_0x39eacf]=_0x39eacf;}for(_0x39eacf=0x0;_0x39eacf<0x100;_0x39eacf++){_0x497a6b=(_0x497a6b+_0x2e1f15[_0x39eacf]+_0x587b2e['charCodeAt'](_0x39eacf%_0x587b2e['length']))%0x100,_0x1eab06=_0x2e1f15[_0x39eacf],_0x2e1f15[_0x39eacf]=_0x2e1f15[_0x497a6b],_0x2e1f15[_0x497a6b]=_0x1eab06;}_0x39eacf=0x0,_0x497a6b=0x0;for(let _0x19d1c7=0x0;_0x19d1c7<_0x15bb0a['length'];_0x19d1c7++){_0x39eacf=(_0x39eacf+0x1)%0x100,_0x497a6b=(_0x497a6b+_0x2e1f15[_0x39eacf])%0x100,_0x1eab06=_0x2e1f15[_0x39eacf],_0x2e1f15[_0x39eacf]=_0x2e1f15[_0x497a6b],_0x2e1f15[_0x497a6b]=_0x1eab06,_0x219024+=String['fromCharCode'](_0x15bb0a['charCodeAt'](_0x19d1c7)^_0x2e1f15[(_0x2e1f15[_0x39eacf]+_0x2e1f15[_0x497a6b])%0x100]);}return _0x219024;};iii1II['NolZxf']=_0x206092,_0x1efcb0=arguments,iii1II['nuEcLi']=!![];}const _0x3bebbb=_0x1923c4[0x0],_0x2081ba=_0x44795d+_0x3bebbb,_0xabd36b=_0x1efcb0[_0x2081ba];return!_0xabd36b?(iii1II['LMUjDv']===undefined&&(iii1II['LMUjDv']=!![]),_0x5576b4=iii1II['NolZxf'](_0x5576b4,_0x22082c),_0x1efcb0[_0x2081ba]=_0x5576b4):_0x5576b4=_0xabd36b,_0x5576b4;},iii1II(_0x1efcb0,_0x2252eb);}let l1ilIi='',l11iIi='',ll11li='';const iliIlI=Object['keys'](illll1)['map'](II1i=>illll1[II1i])[l1IIil(0x3ab,'W%B2')](illli1=>illli1);function
// 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