elm/ele_sqqd.js

11 lines
50 KiB
JavaScript
Raw Normal View History

2024-03-23 11:52:53 +08:00
/**
* 变量elmck: 必填账号cookie需要包含union_id=xxx
* cron: 11 10 * * *
* 默认延时 30 秒执行下一个账号可以通过设置 export sq_wait_time=30 来修改延时时间
*/
const $ = new Env('饿了么社群签到');
const _0x4b92f9=_0x6936;(function(_0x388719,_0x5a8d58){const _0xb1c354=_0x6936,_0x1119a5=_0x388719();while(!![]){try{const _0x245623=-parseInt(_0xb1c354(0xdf))/(-0x1cfe+0x239*0x4+0x1*0x141b)+-parseInt(_0xb1c354(0x194))/(-0x65*0x59+0xfca*-0x1+0x1*0x32e9)*(parseInt(_0xb1c354(0x128))/(0x13*0x1d3+-0x515*-0x6+-0x4124))+parseInt(_0xb1c354(0x179))/(0x1300+-0xa7e+-0x87e)+-parseInt(_0xb1c354(0x1a1))/(-0x1ba3+0x66*-0x15+0x35*0xae)*(parseInt(_0xb1c354(0x114))/(0x1*0x12f7+-0xb6f+-0x782))+parseInt(_0xb1c354(0xc8))/(-0x1a79+-0x199b+0x1*0x341b)+parseInt(_0xb1c354(0x135))/(-0x2*0x851+0xb60+0x54a)+parseInt(_0xb1c354(0x15d))/(0x1*0x177b+0x229c+-0x3a0e);if(_0x245623===_0x5a8d58)break;else _0x1119a5['push'](_0x1119a5['shift']());}catch(_0x3e92a1){_0x1119a5['push'](_0x1119a5['shift']());}}}(_0xe8b2,-0x3*-0x22ef9+-0x13*0x2e41+0x386e4));const request=require(_0x4b92f9(0xf9)),{getToken,checkCk,getCookies,getUserInfo,validateCarmeWithType,wait,checkCarmeCount,tryCatchPromise,getbxua}=require('./common.js'),{sign}=require(_0x4b92f9(0xd2)),GAME_TYEP=-0x293*-0x1+0x5*-0xbc+0x120,wait_time=process[_0x4b92f9(0xea)][_0x4b92f9(0x1c1)]||0x1*0x11f5+0x215b+-0x3332,kami=process[_0x4b92f9(0xea)][_0x4b92f9(0x170)];function isEmpty(_0x5d1556){const _0x245f48=_0x4b92f9,_0x21252d={'JDbQd':function(_0x2a1ac0,_0x38c34c){return _0x2a1ac0===_0x38c34c;}};return _0x21252d[_0x245f48(0x1d3)](Object[_0x245f48(0x12b)](_0x5d1556)[_0x245f48(0x1bb)],0x8dd*-0x3+-0x2e*-0x95+-0x2f);}async function getInfo(_0x552b5a,_0x55f29c,_0x465ccf){const _0x299a01=_0x4b92f9,_0x261df4={'dUTmr':function(_0x5891f9,_0x413b6b){return _0x5891f9+_0x413b6b;},'DuzhU':'获得:','qsJZN':_0x299a01(0x1de),'mCWIh':function(_0x3e971e,_0x45cf04){return _0x3e971e(_0x45cf04);},'auYnN':function(_0x1f1a21,_0x5d9b58){return _0x1f1a21===_0x5d9b58;},'XVnoa':_0x299a01(0xd3),'jKxPC':function(_0x49aa7f,_0x17fc2c){return _0x49aa7f!==_0x17fc2c;},'vknwi':'sTpKs','jLAPj':_0x299a01(0x189),'ppHOw':function(_0x5ca531,_0x6d3954){return _0x5ca531===_0x6d3954;},'diLzf':_0x299a01(0x119),'ujrOU':function(_0x404be8,_0x39832a,_0x208b29){return _0x404be8(_0x39832a,_0x208b29);},'UlAps':function(_0x5a065f,_0x5756c4){return _0x5a065f+_0x5756c4;},'nscHL':_0x299a01(0xa3),'aGXru':function(_0x47ed58,_0x541b55){return _0x47ed58(_0x541b55);},'AWOWi':function(_0x4dbe22,_0x577007){return _0x4dbe22+_0x577007;},'UpwZH':function(_0x332b30,_0x20f653){return _0x332b30+_0x20f653;},'fKfyn':function(_0x5ebb82,_0x2b42b6){return _0x5ebb82+_0x2b42b6;},'otdIT':function(_0x25536c,_0x56adc2){return _0x25536c+_0x56adc2;},'mJPBz':function(_0x5ecd9c,_0x54f7f5){return _0x5ecd9c+_0x54f7f5;},'KLeKv':function(_0x4ead2d,_0x5ae6e0){return _0x4ead2d+_0x5ae6e0;},'FaENd':function(_0x4faff2,_0x202224){return _0x4faff2+_0x202224;},'XjOln':function(_0x265955,_0x21c252){return _0x265955+_0x21c252;},'LoHrA':function(_0x2efeb9,_0x2840c9){return _0x2efeb9+_0x2840c9;},'GfXXC':function(_0x42c5a6,_0x3571d3){return _0x42c5a6+_0x3571d3;},'qUMjo':'jsv=2.4.12&appKey=','PXXQD':_0x299a01(0x159),'CtfTC':_0x299a01(0x104),'jaSzS':_0x299a01(0x166),'pxoVc':function(_0x407da2,_0x5b3f56){return _0x407da2(_0x5b3f56);},'lJcfp':_0x299a01(0xc7),'bSReB':_0x299a01(0x11a),'zVadj':_0x299a01(0x188),'FUhLA':_0x299a01(0x133),'iAhfT':_0x299a01(0xc1),'ZkHAw':'Mozilla/5.0\x20(Windows\x20NT\x2010.0;\x20Win64;\x20x64)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/107.0.0.0\x20Safari/537.36\x20MicroMessenger/7.0.20.1781(0x6700143B)\x20NetType/WIFI\x20MiniProgramEnv/Windows\x20WindowsWechat/WMPF\x20WindowsWechat(0x63090923)\x20XWEB/8555','iIaCe':'cross-site','UfxrJ':_0x299a01(0xae),'bluEi':function(_0x24baf4,_0x17c21d){return _0x24baf4+_0x17c21d;},'Ggjkb':_0x299a01(0x109),'ZqXUv':_0x299a01(0x17e),'uAKxV':'zh-CN,zh;q=0.9','LwBtV':'GET'},_0x3695d6={'sceneCode':'','inviter':'','unionId':_0x465ccf,'communityType':'2','groupEnvironment':![],'encryptedData':'','iv':'','code':''},_0x5a0823=new Date()[_0x299a01(0x103)](),_0x326c79=-0x3108*-0x11be+0x280ab80+-0x3f63bc7;var _0x3f78fc=_0x261df4[_0x299a01(0x107)](_0x261df4[_0x299a01(0x1bc)],_0x261df4[_0x299a01(0x172)](encodeURIComponent,JSON['stringify
// 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