jdpro/jd_opencard0905.js

7 lines
133 KiB
JavaScript
Raw Normal View History

2024-09-13 01:02:28 +00:00
/*
0 0 5 9 * jd_opencard0905.js
*/
const $ = new Env('9.5-9.17 中秋团圆夜好礼聚好味');
const _0x4a9f=['rIRdJ8k0WRO9','hHhcTmkiaG','WQlcQdvaltG','WRxcRXTqbG','WQdcOYbBgIKYsW','WOqRW492W4ddNa','zWmmW63dHmk9zq59WP0','WRFcTgG','WOtdKqhcVmow','W4SFBG','WP8oBqjg','mGRcVCk7cSoKFCkV','dNmuqNjKu8oEWRBcVG','WOCXDd9M','x8ohwSk7bmk6W5pdSCk+W7C','WPxdO8oDc8oWW5iOx04','WPawWRVcTJDqW7O','6l+75yAS5Qge5l2t5Pwx5yAq5AYjt+w4OUIUNG','jmo6jd/cQSk1W4nmW50','E3uGW6rQqX5qWRhcSG','f8kDzHRdNq','umoFWPe6fK9eFCoPtG','5QY7v8ke5BwF6kgu6zQr5yM477+06k+R6l6q','WOhcSfJcUmou','lYSwdCkWeCkaW650WQa','iaqiW6JdJ8oGzq','w8oml8oDsW','F8oLgtlcUa','57Is5P6F5PAI6zEg7722','mYTQWRGGtX4yWOa','WRqGBdTbW68lWQO','WQDXD8klW74QxM8ZyG','W4ZdV2NdNetdUmkqvWnP','WP4rW4lcI8osWOtdT8kmW5JdIG','WQ0hfYm','oCkIE8o+dq','W5CvzSoXWQu','qUISSEMhTEAvNoEzLow9KUIoVEwoGCkEiG','aCkVW4mh','Ct1j','WQLIzSkmW6SUzw8','lsTJm1KzW4lcMcFcKa','jmkdt8oXoa','W69EWRGqeG','WRTKFmkbW5mKwgikFW','of0HhSkicSo+uWJdSG','kYqwc8kQ','gJtcO8kUjq','W7RdPfxcG8k2WOhcUG','W7FcVCoGWOldKa','kIPPWRqO','WRiSW5XuW7y','fWOueSkj','kSoqbW','nMefuZC','W6XIWP8xnq','C8oYW6y','oSkNvSkiqgO','W7lcVmoJ','WOFdVmoDc8oXW4K8w08','WR1TD8kPW7q4wa','Au1lo8os','WRjhsSk2W5y','l8oAbmoFW6HHWRC','FmooW7NcK2q','mqzNWQKp','5yId5yIz57UD5PY+W6NLJAFOTORKUiNMN5tPOQW','uvHKkSoVjs4KW5ZdNq','lvVcHmobWP7cOIS','fmokl8opW78','fCkHW54iyZ0','WQBdTWC','htfUjfKeW4u','5yMu5yMu57Qk5P2Wt+w0UUs6MUs6TUs6IowlSa','WOKgW4pcKComWR0','yfyPiwXwWPpcVmkrW7q','smoMcSosFWpdNSkgyG','p1qG','AUAiRUs5U+wVRUEkRCku','aCovWQaHcKvy','B8oRiJe','WR/cJG7cNri','kcehemoShmkhW7DR','WPecW6n9W4u','oqZcVa','WONcJJzZpG','WRVdOJFcLmow','mSkMrmovfa','iqm7W4JdGG','i8o1j8k0WOa','WRGdtqj6WOO','amkoxCkHsG','vCogqmkTaSkTW5xdPSk5W5e','W5pdI1FdQSkH','aCoKnWlcOmo6WOCtrq','kSk2Fmo1','iKyUjCknhmotzJ3dGW','WPP9W54+WO8','bSotWPe8','WRZdVri','Emo+nYtcP8k/WQ5jW4Od','W7qHtXhdUa','oCk5zMJdPSo6W50qWP9x','gI4XW5xcL8k1DXDZWOy','WQdcOZDxhdHwq8oHW4u','WO/cOtLx','WQ3cPtPvgcq','cCkQDSoughZdHdZcNv4','WPhcSwZcSSoL','WQTrW48NWPVdImkBDbxdLa','W5ldKeHljq','WQCdwhpcPNi9ewNcKq','ouyWAaW','pXeglmks','WOG/lmk/e8k1W5CHWR56','W7JdNx9hc1m','m8oWWPGBaa','W5ZcLmoNWOldIG','WRSvbJBcQWLyExhcKG','W5mzzmoEWPnLW54','WOBcPWD0lq','kZr+WPiZ','caTHWQ4Y','WPOHW5TgW57dMG','d8obWPS9fq','ECoejCoDDxpdL8kgBq','WPpdRSovcCk4WRWTv03dJq','WOvQy8kSW6u','5lI355gGyJvh77+UWQdcKSooCq','WRfOySkxW78','E1K+mdfqWO/cPCkpW4K','WR03BcjeWRbTW6hdJWG','pK7dOfZcSq','W6hcSCk1','Eh5cg8oN','mYKmlSka','b8kRAmoydwe','WRXTDxXDW65SWQ3dKXC','WPeYyaXB','W6njsq','5yMj6l+U6zUk5yMi','aMtdVN7dQmkyW6qmW4bT','6BQj6kY15OUr5AA3W7pMRkVVV47dIKRcPG','W4JdI1Leaq','mCoYjCo8W5a','WRKSFZTz','cSosWOaNf0LcB8kiwa','W4f1pSkUhmkIW4i','4P2WWOJNMy/LVP3LPyhOT60','ftxdTbNdMXW','W6RcUSoRWONcLW','W4PWWQKa','xCoyrmkbfa','5lQt5lIN6lsJ5y6V','W7tcT8oLWPFdMmkPFfhdJs8','W7BdN8keW7W','W6RdM8kd','W6BcPmooWORdUW','WQjgW48+WP7cL8o9pW','5BET6ycD6k2277+e','xSoNidhcIa','E8oKmG','m2uqvdPxrW','WOGlW5hcLSofWOddTG','WQjsW5OLWOZcPSonkXG','cw/cRCoiWPu','kIPPWPG0va','W4yuBCo4WP1IW54','k8krgSkcW6nIW7XuWRldLa','hJxdRG','W79cWQGBna','WQldQG/cKCoq','WQtdLXdcMSoVW5ldVCoqxZO','WQvdW63cMq','WQmcnY3dVtLI','iGlcSSk7','W7BcP8oWWPFdM8kOoI7dLJO','W5zIi8kWgmkyW4iLWRq','iSkbDmkODq','lYT6WRG0qWmjWPFcSW','WQVdTK7cKSkVWPFdQSkwxsC','aCoWiHNcSSorWQ8A','prdcUSkenW','msrNWQK','WQXOyCkgW7i+qN8/CG','5yUZ5yMy57UC5PYbx+wpKoI2Oos4M+wiTEwiJW','5yAK5l+A6i+J5B6LvG','WP0irWb2W4ZcHCkOW6vi','dmo8mq','W7pdM8kEW73dRCoU','aCoEWP0Gkeq','umouDG3dUCoLW4ypWOu9','WOaWFsb5W6SVWQS','nIhcOSkyiW','W6BdHmkeW7JcRCk6WPapWO7cNW','aIVcLSkxdG','eSo2jqxcQmoa','pxydrJC','oNquhh9hrG','W6KbEY7cM1qTW7H/ca','bmkTW5qdz3S','5Rw95yUT57UD5P6c772h77YN772X','WReMW7lcRCoY','WQO3W6NcVCksW73cOSogWPVcNG','WQbNW5iHWQ0','xY3dH8kOWPy0fW','CIfDW4Khk0eYW5ddJa','zmo+nSoBFI/dJG','tIRdGSkJ','mq8SW6FdOG','WQdcOYbBgIK','hXy7Ea','772t5y6f5AkF5ys05z+p5z6bDmoY','WQNcRYq','o1NcKCoz','iuO9jSkm','nhauxNjqrSox','W4PuWOWYdG','lvVcH8oyWPpcTq','W6WwvZJdNvaK','W4VcN8kNW5xcLa','lKJdJgtcVq','fXz7WQCU','jrio','W6RcQSonWOm','kSkeD8oQjW','hNtdUhpcQSkFW6LwW7PQ','qCk1W5RcGaBdU8kSW4/dT1S','W4SBrbldNa','hMRcMSoxWPW','sSk5W5ieDcdcSmoPrmkh','WRKbdq/dVq','hfmSCCk3pmkWuxNcLW','nLdcL8obWORcPsVcIW','WQFdI8kyW6hdPCkNW4XsW5ddIW','WRZcVNS','W7ldLSkcW7JdJmo/WPKiWO3cGq','ncrGWRKPsW','gxldPhVcRmkp','WOFMIjFOOyx
function Env(o,t){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((r,i)=>{s.call(this,t,(t,e,s)=>{t?i(t):r(e)})})}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.logLevels={debug:0,info:1,warn:2,error:3},this.logLevelPrefixs={debug:"[DEBUG] ",info:"[INFO] ",warn:"[WARN] ",error:"[ERROR] "},this.logLevel="info",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.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null,...s){try{return JSON.stringify(t,...s)}catch{return e}}getjson(t,e){let s=e;if(this.getdata(t))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(r=>{this.get({url:t},(t,e,s)=>r(s))})}runScript(a,o){return new Promise(r=>{let t=this.getdata("@chavy_boxjs_userCfgs.httpapi");t=t&&t.replace(/\n/g,"").trim();var e=(e=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"))?+e:20,[s,i]=(e=o&&o.timeout?o.timeout:e,t.split("@"));this.post({url:`http://${i}/v1/scripting/evaluate`,body:{script_text:a,mock_type:"cron",timeout:e},headers:{"X-Key":s,Accept:"*/*"},timeout:e},(t,e,s)=>r(s))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};this.fs=this.fs||require("fs"),this.path=this.path||require("path");var t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),r=!s&&this.fs.existsSync(e);if(!s&&!r)return{};r=s?t:e;try{return JSON.parse(this.fs.readFileSync(r))}catch(t){return{}}}writedata(){var t,e,s,r,i;this.isNode()&&(this.fs=this.fs||require("fs"),this.path=this.path||require("path"),t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),r=!(s=this.fs.existsSync(t))&&this.fs.existsSync(e),i=JSON.stringify(this.data),!s&&r?this.fs.writeFileSync(e,i):this.fs.writeFileSync(t,i))}lodash_get(t,e,s){let r=t;for(const t of e.replace(/\[(\d+)\]/g,".$1").split("."))if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,r,e){return Object(t)===t&&((r=Array.isArray(r)?r:r.toString().match(/[^.[\]]+/g)||[]).slice(0,-1).reduce((t,e,s)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(r[s+1])>>0==+r[s+1]?[]:{},t)[r[r.length-1]]=e),t}getdata(t){let e=this.getval(t);if(/^@/.test(t)){var[,s,r]=/^@(.*?)\.(.*?)$/.exec(t);if(s=s?this.getval(s):"")try{const t=JSON.parse(s);e=t?this.lodash_get(t,r,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){var[,r,i]=/^@(.*?)\.(.*?)$/.exec(e),a=this.getval(r),a=r?"null"===a?null:a||"{}":"{}";try{const e=JSON.parse(a);this.lodash_set(e,i,t),s=this.setval(JSON.stringify(e),r)}catch(e){this.lodash_set(a={},i,t),s=this.setval(JSON.stringify(a),r)}}else s=this.setval(t,e);return s}getval(t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(t);case"Quantumult X":return $prefs.valueForKey(t);case"Node.js":return this.data=this.loaddata(),this.data[t];default:return this.data&&this.data[t]||null}}setval(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(t,e);case"Quantumult X":return $prefs.setValueF