KR/jd_wxTeam.js

24 lines
74 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('组队瓜分奖品(超级无线/超级会员)')
2023-08-03 12:59:27 +08:00
var version_='jsjiami.com.v7';const iii1I=iii1II;(function(ll11II,liIlII,Il1I,iii1i,iii1l,iliIi,iiil1I){return ll11II=ll11II>>0x8,iliIi='hs',iiil1I='hs',function(llII11,lIiI1,IiIi1i,llII1l,iil11l){const Illl1=iii1II;llII1l='tfi',iliIi=llII1l+iliIi,iil11l='up',iiil1I+=iil11l,iliIi=IiIi1i(iliIi),iiil1I=IiIi1i(iiil1I),IiIi1i=0x0;const IiIi1l=llII11();while(!![]&&--iii1i+lIiI1){try{llII1l=parseInt(Illl1(0x1b4,'Mw^m'))/0x1*(-parseInt(Illl1(0x47b,'wRdM'))/0x2)+-parseInt(Illl1(0x349,'(mFA'))/0x3+-parseInt(Illl1(0x1a8,'zx[z'))/0x4*(parseInt(Illl1(0x355,'J7Wd'))/0x5)+parseInt(Illl1(0x2df,'v%Ry'))/0x6+parseInt(Illl1(0x470,'3uc&'))/0x7*(-parseInt(Illl1(0x3b6,'%JX7'))/0x8)+-parseInt(Illl1(0x416,'fa]y'))/0x9*(parseInt(Illl1(0x2a1,'wRdM'))/0xa)+-parseInt(Illl1(0x26b,'%JX7'))/0xb*(-parseInt(Illl1(0x146,'Ffo%'))/0xc);}catch(llII1i){llII1l=IiIi1i;}finally{iil11l=IiIi1l[iliIi]();if(ll11II<=iii1i)IiIi1i?iii1l?llII1l=iil11l:iii1l=iil11l:IiIi1i=iil11l;else{if(IiIi1i==iii1l['replace'](/[brFTpLxEfuyGKdXlAUJSB=]/g,'')){if(llII1l===lIiI1){IiIi1l['un'+iliIi](iil11l);break;}IiIi1l[iiil1I](iil11l);}}}}}(Il1I,liIlII,function(illI1I,ilI1Ii,ilI1Il,illI11,ll11Ii,ll11Il,i11lI){return ilI1Ii='\x73\x70\x6c\x69\x74',illI1I=arguments[0x0],illI1I=illI1I[ilI1Ii](''),ilI1Il='\x72\x65\x76\x65\x72\x73\x65',illI1I=illI1I[ilI1Il]('\x76'),illI11='\x6a\x6f\x69\x6e',(0x137851,illI1I[illI11](''));});}(0xcd00,0xe0b8b,Iii11l,0xcf),Iii11l)&&(version_=Iii11l);const illlli=require('./jdCookie'),illlll=require(iii1I(0x2d6,'doUE')),IIIIiI=require(iii1I(0x2aa,'8ZXg')),II1I1=require(iii1I(0x2ea,'t9O3')),i1i111=require(iii1I(0x3ba,'mq[E')),ii1l1I=process[iii1I(0x46d,'0$8$')][iii1I(0x3d7,'rob2')]||'',lI1lII=process[iii1I(0x329,'Pf!#')][iii1I(0x384,'8ZXg')]==='true',lIill1=process[iii1I(0x3f1,'5i*X')]['jd_wxTeam_Notify']===iii1I(0x33f,'Vr]D');let iiI1i1='',ilIlII='',iIiil1='';const l1lI1i=Object[iii1I(0x205,'5i*X')](illlli)[iii1I(0x370,'doUE')](liliil=>illlli[liliil])[iii1I(0x163,'fa]y')](I1iil1=>I1iil1);function iii1II(_0x4bb4d0,_0x32734e){const _0x2eac2a=Iii11l();return iii1II=function(_0x48ec2c,_0x1daa23){_0x48ec2c=_0x48ec2c-0x108;let _0x2471fa=_0x2eac2a[_0x48ec2c];if(iii1II['LpwlKI']===undefined){var _0x3e4971=function(_0x3c7658){const _0xa62e7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x12d310='',_0x287593='';for(let _0xab731c=0x0,_0x176507,_0x14b890,_0x227bfd=0x0;_0x14b890=_0x3c7658['charAt'](_0x227bfd++);~_0x14b890&&(_0x176507=_0xab731c%0x4?_0x176507*0x40+_0x14b890:_0x14b890,_0xab731c++%0x4)?_0x12d310+=String['fromCharCode'](0xff&_0x176507>>(-0x2*_0xab731c&0x6)):0x0){_0x14b890=_0xa62e7['indexOf'](_0x14b890);}for(let _0x177f6a=0x0,_0x10a724=_0x12d310['length'];_0x177f6a<_0x10a724;_0x177f6a++){_0x287593+='%'+('00'+_0x12d310['charCodeAt'](_0x177f6a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x287593);};const _0x340af6=function(_0x3d8299,_0x2de051){let _0xc400a2=[],_0x4caac9=0x0,_0x37b268,_0x55f767='';_0x3d8299=_0x3e4971(_0x3d8299);let _0x4f3935;for(_0x4f3935=0x0;_0x4f3935<0x100;_0x4f3935++){_0xc400a2[_0x4f3935]=_0x4f3935;}for(_0x4f3935=0x0;_0x4f3935<0x100;_0x4f3935++){_0x4caac9=(_0x4caac9+_0xc400a2[_0x4f3935]+_0x2de051['charCodeAt'](_0x4f3935%_0x2de051['length']))%0x100,_0x37b268=_0xc400a2[_0x4f3935],_0xc400a2[_0x4f3935]=_0xc400a2[_0x4caac9],_0xc400a2[_0x4caac9]=_0x37b268;}_0x4f3935=0x0,_0x4caac9=0x0;for(let _0x845ae2=0x0;_0x845ae2<_0x3d8299['length'];_0x845ae2++){_0x4f3935=(_0x4f3935+0x1)%0x100,_0x4caac9=(_0x4caac9+_0xc400a2[_0x4f3935])%0x100,_0x37b268=_0xc400a2[_0x4f3935],_0xc400a2[_0x4f3935]=_0xc400a2[_0x4caac9],_0xc400a2[_0x4caac9]=_0x37b268,_0x55f767+=String['fromCharCode'](_0x3d8299['charCodeAt'](_0x845ae2)^_0xc400a2[(_0xc400a2[_0x4f3935]+_0xc400a2[_0x4caac9])%0x100]);}return _0x55f767;};iii1II['cNLaqr']=_0x340af6,_0x4bb4d0=arguments,iii1II['LpwlKI']=!![];}const _0x2ebef1=_0x2eac2a[0x0],_0x53ea5a=_0x48ec2c+_0x2ebef1,_0x133f18=_0x4bb4d0[_0x53ea5a];return!_0x133f18?(iii1II['OKznxG']===undefined&&(iii1II['OKznxG']=!![]),_0x2471fa=iii1II['cNLaqr'](_0x2471fa,_0x1daa23),_0x4bb4d0[_0x53ea5a]=_0x2471fa):_0x2471fa=_0x133f18,_0x
2023-08-01 16:47:55 +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