KR/jd_daily.js

25 lines
132 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
活动名称每日抢好礼 · 超级无线/超级会员
活动链接https://cjhy-isv.isvjcloud.com/wxShopFollowActivity/activity?activityId=<活动id>
https://lzkj-isv.isvjcloud.com/activity/daily/wx/indexPage?activityId=<活动id>
环境变量
export jd_daily_activityUrl // 活动链接
export jd_daily_openCard // 是否开卡,默认不开卡
export jd_daily_blacklist="" // 黑名单 用&隔开 pin值
export JD_CJ_OPEN="false" //关闭CJ相关活动运行
export JD_LZ_OPEN="false" //关闭LZ相关活动运行
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#CJ每日抢好礼通用活动
1 1 1 1 * jd_daily.js, tag=每日抢好礼通用活动, enabled=true
*/
const $ = new Env('每日抢好礼(超级无线/超级会员)')
2023-08-24 15:53:15 +08:00
var version_='jsjiami.com.v7';const _0x43de94=_0x4401;(function(_0x59a761,_0x3ee956,_0x4dd4da,_0x275108,_0x57ea4f,_0x1382a4,_0x4bf258){return _0x59a761=_0x59a761>>0x9,_0x1382a4='hs',_0x4bf258='hs',function(_0x23860c,_0x3c3709,_0x17a41f,_0x335056,_0x425ee2){const _0x3a2ab1=_0x4401;_0x335056='tfi',_0x1382a4=_0x335056+_0x1382a4,_0x425ee2='up',_0x4bf258+=_0x425ee2,_0x1382a4=_0x17a41f(_0x1382a4),_0x4bf258=_0x17a41f(_0x4bf258),_0x17a41f=0x0;const _0x200106=_0x23860c();while(!![]&&--_0x275108+_0x3c3709){try{_0x335056=-parseInt(_0x3a2ab1(0x376,'UGAD'))/0x1+-parseInt(_0x3a2ab1(0x217,'VokE'))/0x2*(parseInt(_0x3a2ab1(0x52d,'V57B'))/0x3)+-parseInt(_0x3a2ab1(0x4df,'!xp9'))/0x4+-parseInt(_0x3a2ab1(0xfb,']bgu'))/0x5+parseInt(_0x3a2ab1(0x359,'UGAD'))/0x6+parseInt(_0x3a2ab1(0x1a5,'RFEn'))/0x7*(-parseInt(_0x3a2ab1(0x285,'8RoK'))/0x8)+parseInt(_0x3a2ab1(0x2ca,'84SN'))/0x9*(parseInt(_0x3a2ab1(0x1ad,'M&$u'))/0xa);}catch(_0x5e8851){_0x335056=_0x17a41f;}finally{_0x425ee2=_0x200106[_0x1382a4]();if(_0x59a761<=_0x275108)_0x17a41f?_0x57ea4f?_0x335056=_0x425ee2:_0x57ea4f=_0x425ee2:_0x17a41f=_0x425ee2;else{if(_0x17a41f==_0x57ea4f['replace'](/[UneLkOYrgBVNqpHTbFSl=]/g,'')){if(_0x335056===_0x3c3709){_0x200106['un'+_0x1382a4](_0x425ee2);break;}_0x200106[_0x4bf258](_0x425ee2);}}}}}(_0x4dd4da,_0x3ee956,function(_0x3f5daa,_0x3f8c11,_0x48df24,_0x3d29c7,_0x5342a5,_0x4a5978,_0x386d88){return _0x3f8c11='\x73\x70\x6c\x69\x74',_0x3f5daa=arguments[0x0],_0x3f5daa=_0x3f5daa[_0x3f8c11](''),_0x48df24='\x72\x65\x76\x65\x72\x73\x65',_0x3f5daa=_0x3f5daa[_0x48df24]('\x76'),_0x3d29c7='\x6a\x6f\x69\x6e',(0x13ae51,_0x3f5daa[_0x3d29c7](''));});}(0x18e00,0x78545,_0x1569,0xc9),_0x1569)&&(version_=_0x1569);function _0x4401(_0x5d76d7,_0xd819b6){const _0x156902=_0x1569();return _0x4401=function(_0x440168,_0x4928d4){_0x440168=_0x440168-0xae;let _0x386c25=_0x156902[_0x440168];if(_0x4401['TNPwwP']===undefined){var _0x50d208=function(_0x307f20){const _0x32baf0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x92eb69='',_0x3176b5='';for(let _0x3e6afb=0x0,_0x4bd8e1,_0x37922f,_0x32dcf0=0x0;_0x37922f=_0x307f20['charAt'](_0x32dcf0++);~_0x37922f&&(_0x4bd8e1=_0x3e6afb%0x4?_0x4bd8e1*0x40+_0x37922f:_0x37922f,_0x3e6afb++%0x4)?_0x92eb69+=String['fromCharCode'](0xff&_0x4bd8e1>>(-0x2*_0x3e6afb&0x6)):0x0){_0x37922f=_0x32baf0['indexOf'](_0x37922f);}for(let _0xc4f3d9=0x0,_0x511e22=_0x92eb69['length'];_0xc4f3d9<_0x511e22;_0xc4f3d9++){_0x3176b5+='%'+('00'+_0x92eb69['charCodeAt'](_0xc4f3d9)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3176b5);};const _0x4a2f38=function(_0x85c140,_0x5b8764){let _0x323780=[],_0x5023a7=0x0,_0x13689d,_0x430957='';_0x85c140=_0x50d208(_0x85c140);let _0x2b5530;for(_0x2b5530=0x0;_0x2b5530<0x100;_0x2b5530++){_0x323780[_0x2b5530]=_0x2b5530;}for(_0x2b5530=0x0;_0x2b5530<0x100;_0x2b5530++){_0x5023a7=(_0x5023a7+_0x323780[_0x2b5530]+_0x5b8764['charCodeAt'](_0x2b5530%_0x5b8764['length']))%0x100,_0x13689d=_0x323780[_0x2b5530],_0x323780[_0x2b5530]=_0x323780[_0x5023a7],_0x323780[_0x5023a7]=_0x13689d;}_0x2b5530=0x0,_0x5023a7=0x0;for(let _0x4bf839=0x0;_0x4bf839<_0x85c140['length'];_0x4bf839++){_0x2b5530=(_0x2b5530+0x1)%0x100,_0x5023a7=(_0x5023a7+_0x323780[_0x2b5530])%0x100,_0x13689d=_0x323780[_0x2b5530],_0x323780[_0x2b5530]=_0x323780[_0x5023a7],_0x323780[_0x5023a7]=_0x13689d,_0x430957+=String['fromCharCode'](_0x85c140['charCodeAt'](_0x4bf839)^_0x323780[(_0x323780[_0x2b5530]+_0x323780[_0x5023a7])%0x100]);}return _0x430957;};_0x4401['jeoEqK']=_0x4a2f38,_0x5d76d7=arguments,_0x4401['TNPwwP']=!![];}const _0x311f26=_0x156902[0x0],_0x40e5c8=_0x440168+_0x311f26,_0x225087=_0x5d76d7[_0x40e5c8];return!_0x225087?(_0x4401['eeENHm']===undefined&&(_0x4401['eeENHm']=!![]),_0x386c25=_0x4401['jeoEqK'](_0x386c25,_0x4928d4),_0x5d76d7[_0x40e5c8]=_0x386c25):_0x386c25=_0x225087,_0x386c25;},_0x4401(_0x5d76d7,_0xd819b6);}function _0x1569(){const _0x1dd7ad=(function(){return[version_,'eqbjLTVsFpjNBiagmrSiUe.coYqTmOkn.lv7HHkb==','W7BINyOPWRJLTBtOROxNVPpLHAxLSQBLHlFPL7XIW4tNMzlLHBJMTRFLIjXx','W5P8eCkAWPW','CmoGnmo1lvLwW60','W5SevZxdG8kbW4tdJ193EMu','f8k4W7JcQmo8W6iNe8oPm8
2023-07-27 16:14:01 +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