elm/ele_assest.js

16 lines
123 KiB
JavaScript
Raw Normal View History

2024-03-23 11:52:53 +08:00
/**
* @平行绳 飞机频道https://t.me/tigerorrose
* 变量ELE_CARME自己购买的卡密
* 定时随意每天跑一遍就可以
* cron: 0 22 * * *
* 2023.7.10 更新首次发版 目前推送今日乐园币总吃货豆和钱包余额
* 推送 wxpush要求 cookie 里面有 wxUid,'unb=xxx;cookie2=xxxUSERID=xx;SID=xxx;wxUid=xx;'
* 2023.8.25 更新增加自动续期 ck 功能
*/
const $ = new Env('饿了么资产推送');
const _0x2188=['dmVtwpLDuVk4w4Yp','SV7CuA==','Iwxww7oj','SVZZwpjDmg==','ZVYow5HCoMK5DQfDjsKH','w4dFwrLCuxQ=','w5PDncOQRsO3','EinCncKdbw==','wr3CocO+I2U=','VEFvNMKg','woXCmQ3DsMOv','w4YjKsO8wqo=','cGRfw6o=','DxbCgMOzDg==','w47DmMOoVMOvXcK1wp3DihY=','LcOAaCVw','bGARw79gwp1maXPCoQ==','QMKpw7jCtcKK','Djdfw70Z','wq0yL3NX','w5c3IXrCjg==','wopTMz/CuA==','wrpLG0la','RMKRE8K+Uw==','B8OJcCd8','TsK2R25l','X8OJeMKoA8Kcw6TCrirChw==','w5N7wrjCuAE=','acKlw7DCpcKD','F8O9w6nDpsO+Xw==','NsK3w6TDmi0=','woZQVj18','w73DnTZEwrvmgYXlkrPotJLosLbCvQ==','K8OmfyhZ','V2B+NcK+w5XCtVjCokg=','wq5ICC7Cng==','CMOeXjNx','wojClwbDlsOJ','FCoiwpnDmQ==','worCmsOVGWE=','SlwvAjk=','w54+B3bCkg==','wp9lLHpqWx7DvsODw4Y=','SSfDmMKDw6A=','wrDCmVdRw5c=','wpDCukJzw4M=','w6zDqcKaTFc=','X0VDw5Ql','A0jDpRLCqQ==','w5bCp8O2wosQ','D2rDhsKaw6TCuENFw79w','SHTDlmQW','FcKYST1a','HwMQwobDsw==','byfDgMKAw6U=','YibDnsK1w7o=','w5JJZcOJbQ==','bUXDqsOvw4fCoRDCrmfDiw==','wrXCssOPC8K1','fcOxwoXDocKM','w4rCrRIbLQ==','WXkqw43Cpw==','e8KJw73CoMKL','YkMoHjk=','bUXDuMKxw5/CuA==','w4jDgnfDlMKu','esOTWMKmNA==','RsOMwo/DjsKk','aHTCo8Kuwrw=','JU/DiDrCqA==','w7PDsMKDW30=','RsODJMOOVcOrDBNuwqU=','KlRCFxYcw7jCiUVC','McOHAHp9woBFwrDCkXs=','w4zChSrDjMKa','RcKrfER3','ZkZqwrfDtg==','w7HCi8KZwpbCsw==','U0tnw5QC','BhnCmsKxUQ==','C2BmJcOiw5bDsFjDsg0=','wqvClcO8M2E=','GAvCmMKqTg==','wpAdK0Ne','wqfCvMOfH8KR','UjzDvcK3w5o=','RsObDHbCnA==','wr3CoRvDsMOf','w7rDksOgQsOI','OsK8w7TDoBg=','wqkcMlF3','w7UrBVrCqQ==','wp9+bh9e','Rh0cQx8ew77Ct1pN','MMKnw53DgwQ=','TC7DpcKyw6c=','R8KGDcKaeQ==','w5zDvMK4V1k=','aMOPV8KVHg==','wq3CtjPDtMON','wqTClB3Dm8OC','wrIcF3dH','Y8KyYT95AhrDh8OM','V24Ww6XClA==','V8KVwpHCtxRDwrg=','wpnCow/DhcON','b2ldw4Yz','w6rCk8OLwr4HAyfCnQ==','QMK1THVh','w4nChxU6Ew==','dWZhw6Qb','w5oCHcOrwqk=','TVnClcKSwqI=','HMKlfiBc','ckFKw60k','XMOfYw0y','Wl7Cv8Ky','w4DCpMOYwrEx','VcOIwojDisKk','wpTCmlBhw44=','RcOoPHHClw==','aMKJWENg','wovCqMO0MsKt','HGrCjsOBw7LCvVVbw71r','eEjDtWwq','w6TDkMO/bsOY','w47DhMO/','CDDCrcKMQcKvw7A=','w5jChTXDh8Kxw61Tw6jDhcK3','w7NfD3ID','woTCn8KFw6MP','w5M8PMORwp4=','J1DDjTjCpQ==','wp/Ck1lRw78=','wovCmERtw64=','w6LChMOEwpkF','wo/Cq8OCF3E=','wqkaBVFI','XU/CrcKywp7DnSNzOcKD','Z3AZw4fCow==','ZFkow5U=','w4RuPGUH','a8OJXwI1','VkoTw57CkA==','w5zClBbDksKgwpwVwrPCgsK3','w4dvwpPCnALCqcK1Q07Cjw==','wqzCqmJBw7Y=','w5vCucOIwo8X','YMKXWH1xwpcNw7nCmG4=','wqnCowc=','E1DCg8K9w5I=','w7DDsMKiaSzDiirDgEwr','fcOH5pid56eGNMOOEMOowop7','wrZMTSN1','wqDCgcOOMMKf','csKkwrPCoiU=','wpjClyfDjcO/','McKiQcOcY8OGLTJNwpM=','Cxoawp/DoQ==','wprCj8O7AsK+','VsOPesKpFsKawro=','BMK3RjFo','Y28pw7jCsw==','EyjCgcKcw7nCug==','T8KveUV/','Q1czw5/Cu8Oy','Vl0Qw6zCvw==','w7DCkxElLQ==','w75WwqvCrQs=','WiTDtBrCjQ==','wphCYytH','w5nCtiHDpMKV','TGLDomApZsOAPcOlw4A=','Y8KrSkV4','MCQ9wqbDhw==','OsKhw5TDggg=','RcKyAsKwUQ==','w7woIWvClQ==','worCl0xgw7g=','w4PDmH3DmMKK','6Le75YyK5aSn5pWw776a6K6J6YW95paF55iL5b+I','wrzCqsOnHHk=','wrjCgDjDl8OE','wrfCucOoN8KMUwXDp8O3w4k=','wrnCmGJZw7ISw6RMAMO4','w4jClicaMg==','WErDlGI6','DnTCv8KOw6c=','w7hjIQ==','w4LCuhIWCA==','AC7CucKFUMKDw7fCr8K5wpM=','w5DCqcKyworCmQ==','PgMHwos=','Y2VZwo7DhA==','HMKQw7TDpR4=','wq7Dg8KKwogCV2jDlnc=','GMKqdsOTbA==','JDnCpMOPHQ==','w5ZPQcOmbA==','SlrCuMKn','WFDCmsKPwqY=','wppXU04PHMKcZMKawoM=','EcO+w7bDrsOn','aMOGwqzCmGIZwqk6wq3Dtw==','w5NhcMOzTQ==','w5J7A2wa','WsOywq4=','UcKISkxt','X8OsUMKZCg==','w6rCpMOgwooH','woXClsOdNUI=','By/Cg8Oi','w7VvMkoewqPClTYsJw==','ecOnMmPDgU/Do1hYw6o=','ZMO6KnfCnSfDvUFiw58=','QUxbCsKH','wpk7OMK+Fi3DgsOoB8K4','ZsO/UMKJJQ==','S8KXeQ1wwqbCosOJwoQu','d8OMQiY=','bFnDpXA0','w6/DrHXDlsKb','EsOnw6jDrsOjU8OXbxZl','wofClcOdCEs=','w7DDrlfDucKH','w6zCuTk+Lw==','PmjChMKEw7/CsQ==','woFDfRtW','wqtgCBjCgg==','w44iJMOgwp/DsTlawo13','w4DDi8K6SUE=','wpzCk3JKw7QXw5QVSMKz','SVjDtUI0','WcOPb8KZGsKFwqw=','XAbDvhrCmg==','w51lBcOXw5PDgHNdwphy','V09Kw5MY','w5x+EVAZ','Ng0U','w55lf8O+','a0pGw70j','TMOFdw==','w5VAWgHDtA==','ZsKUw5DCucKU','N8K7w7zDhxo=','QcKlw4XCksK+','wq5ZNzfCvQ==','w40vMsOzwrU=','w7Nawp3Cqhw=','bWVrwovDpAR+wo8iUQ==','w5rDs8KSYmc=','bm9CNcKr','wpbCh1l7w5Y=','McOTMMOu','wpk/K11G','KBULwr7DnA==','BcOWw5XDjVwGw67DtBLCoQ==','BcKsw7/CkcOXWRLDo8OewpM=','TlJPwrDDr
// 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