KR/jd_wxSign.js

27 lines
100 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-29 11:34:31 +08:00
var version_='jsjiami.com.v7';const Iiili1lI=iIlIi1il;function iIlIi1il(_0x5998cc,_0x2dc67c){const _0x170e68=ilIIIl1l();return iIlIi1il=function(_0x412a0a,_0x1c5b04){_0x412a0a=_0x412a0a-0xa0;let _0x469764=_0x170e68[_0x412a0a];if(iIlIi1il['bDLfQK']===undefined){var _0x3e9376=function(_0x532c1d){const _0x27e4ad='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x16244a='',_0x24b6ee='';for(let _0x14bab3=0x0,_0x16f726,_0x20e8b0,_0x555da1=0x0;_0x20e8b0=_0x532c1d['charAt'](_0x555da1++);~_0x20e8b0&&(_0x16f726=_0x14bab3%0x4?_0x16f726*0x40+_0x20e8b0:_0x20e8b0,_0x14bab3++%0x4)?_0x16244a+=String['fromCharCode'](0xff&_0x16f726>>(-0x2*_0x14bab3&0x6)):0x0){_0x20e8b0=_0x27e4ad['indexOf'](_0x20e8b0);}for(let _0x539cac=0x0,_0x1a8aa1=_0x16244a['length'];_0x539cac<_0x1a8aa1;_0x539cac++){_0x24b6ee+='%'+('00'+_0x16244a['charCodeAt'](_0x539cac)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x24b6ee);};const _0x49edac=function(_0x454a13,_0x31ea3d){let _0x1fcbb0=[],_0x5d6151=0x0,_0x1cfbdf,_0x2d7de4='';_0x454a13=_0x3e9376(_0x454a13);let _0x4aa071;for(_0x4aa071=0x0;_0x4aa071<0x100;_0x4aa071++){_0x1fcbb0[_0x4aa071]=_0x4aa071;}for(_0x4aa071=0x0;_0x4aa071<0x100;_0x4aa071++){_0x5d6151=(_0x5d6151+_0x1fcbb0[_0x4aa071]+_0x31ea3d['charCodeAt'](_0x4aa071%_0x31ea3d['length']))%0x100,_0x1cfbdf=_0x1fcbb0[_0x4aa071],_0x1fcbb0[_0x4aa071]=_0x1fcbb0[_0x5d6151],_0x1fcbb0[_0x5d6151]=_0x1cfbdf;}_0x4aa071=0x0,_0x5d6151=0x0;for(let _0x56131d=0x0;_0x56131d<_0x454a13['length'];_0x56131d++){_0x4aa071=(_0x4aa071+0x1)%0x100,_0x5d6151=(_0x5d6151+_0x1fcbb0[_0x4aa071])%0x100,_0x1cfbdf=_0x1fcbb0[_0x4aa071],_0x1fcbb0[_0x4aa071]=_0x1fcbb0[_0x5d6151],_0x1fcbb0[_0x5d6151]=_0x1cfbdf,_0x2d7de4+=String['fromCharCode'](_0x454a13['charCodeAt'](_0x56131d)^_0x1fcbb0[(_0x1fcbb0[_0x4aa071]+_0x1fcbb0[_0x5d6151])%0x100]);}return _0x2d7de4;};iIlIi1il['UrgbVx']=_0x49edac,_0x5998cc=arguments,iIlIi1il['bDLfQK']=!![];}const _0xda77a8=_0x170e68[0x0],_0x5c04df=_0x412a0a+_0xda77a8,_0x2089f9=_0x5998cc[_0x5c04df];return!_0x2089f9?(iIlIi1il['Noozko']===undefined&&(iIlIi1il['Noozko']=!![]),_0x469764=iIlIi1il['UrgbVx'](_0x469764,_0x1c5b04),_0x5998cc[_0x5c04df]=_0x469764):_0x469764=_0x2089f9,_0x469764;},iIlIi1il(_0x5998cc,_0x2dc67c);}(function(I11ili,IiillI11,I1II1IlI,lI1IliIi,ii1iIi1l,I1l1Il1I,IIlliIll){return I11ili=I11ili>>0x2,I1l1Il1I='hs',IIlliIll='hs',function(l11111II,IIll1I,iliIlili,li1l1l1i,iI1lIiII){const iIi11lll=iIlIi1il;li1l1l1i='tfi',I1l1Il1I=li1l1l1i+I1l1Il1I,iI1lIiII='up',IIlliIll+=iI1lIiII,I1l1Il1I=iliIlili(I1l1Il1I),IIlliIll=iliIlili(IIlliIll),iliIlili=0x0;const iil1liIl=l11111II();while(!![]&&--lI1IliIi+IIll1I){try{li1l1l1i=parseInt(iIi11lll(0x31f,'c@RN'))/0x1*(parseInt(iIi11lll(0x33a,'b7(6'))/0x2)+-parseInt(iIi11lll(0x31e,'Rix&'))/0x3+-parseInt(iIi11lll(0x18a,'vxZT'))/0x4+parseInt(iIi11lll(0x15d,'SFXo'))/0x5*(-parseInt(iIi11lll(0xec,'GV8g'))/0x6)+-parseInt(iIi11lll(0x33e,'l^bV'))/0x7*(-parseInt(iIi11lll(0x3d8,'Igep'))/0x8)+-parseInt(iIi11lll(0x395,'[Vim'))/0x9*(parseInt(iIi11lll(0x116,'2f5r'))/0xa)+parseInt(iIi11lll(0x277,'L&4H'))/0xb;}catch(llI1l1i1){li1l1l1i=iliIlili;}finally{iI1lIiII=iil1liIl[I1l1Il1I]();if(I11ili<=lI1IliIi)iliIlili?ii1iIi1l?li1l1l1i=iI1lIiII:ii1iIi1l=iI1lIiII:iliIlili=iI1lIiII;else{if(iliIlili==ii1iIi1l['replace'](/[PKBNlHgfUFuVpAQyWTM=]/g,'')){if(li1l1l1i===IIll1I){iil1liIl['un'+I1l1Il1I](iI1lIiII);break;}iil1liIl[IIlliIll](iI1lIiII);}}}}}(I1II1IlI,IiillI11,function(IiIIIII1,IiIllli1,lll1IIIl,l1IliI1,Il1l1l1,iiIiiIII,IIiiliil){return IiIllli1='\x73\x70\x6c\x69\x74',IiIIIII1=arguments[0x0],IiIIIII1=IiIIIII1[IiIllli1](''),lll1IIIl=`\x72\x65\x76\x65\x72\x73\x65`,IiIIIII1=IiIIIII1[lll1IIIl]('\x76'),l1IliI1=`\x6a\x6f\x69\x6e`,(0x14069f,IiIIIII1[l1IliI1](''));});}(0x2fc,0xca0c2,ilIIIl1l,0xc1),ilIIIl1l)&&(version_=ilIIIl1l);const i1IlIlii=require(Iiili1lI(0x426,'EAw3')),I11lili1=require(Iiili1lI(0x38a,'Igep')),IliIlI1i=require('./function/sendJDNotify'),l1i1IIIl=require('./function/krgetToken'),{wuxian_savePrize:Il11iiII}=require('./function/krsavePrize'),il1IlIiI=require(Iiili1lI(0xd2,'g7xu')),lIlii111=process[Iiili1lI(0x319,'H#k
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