jdpro/jd_opencard1101.js

7 lines
142 KiB
JavaScript
Raw Normal View History

2024-11-01 03:59:55 +00:00
/*
0 0 1 11 * jd_opencard1101.js
*/
const $ = new Env('11.1-11.7 狂聚好物 约惠生活');
function hFn2809(){}var ZargZL=Object['defineProperty'],gMLSKkq,UJkxeab,f16LyC,NrPKl3,FJXYnb,R0D9Xx,VSkJKze,NCniPy,kE3pRnO,M0lNFj,VGhVZq9,yExLaKw,fYco22z,rypJJxj,dKgWFO,qshgSsO,s7Pby9,lp0I5Ab,rkT1nX,EHaCFqk;function Q8MGgT(hFn2809){return gMLSKkq[hFn2809>0x142?hFn2809+0x21:hFn2809<0x142?hFn2809+0x1c:hFn2809-0x16]}gMLSKkq=NZMFJYa();function gg_f9i(hFn2809,ZargZL){return UJkxeab.call(null,hFn2809,'length',{value:ZargZL,configurable:!0x0})}hFn2809(UJkxeab=Object.defineProperty,f16LyC=jai3u8y((hFn2809,ZargZL)=>{return ZargZL(hFn2809())},0x2)(mUoZd5R,k9cg2O));var S5VhIJx=[],klLXjfr=[NbGBZPN(Q8MGgT(0x15)),NbGBZPN(0x1),NbGBZPN(0x2),NbGBZPN(Q8MGgT(0x17)),NbGBZPN(0x4),NbGBZPN(Q8MGgT(0x1e)),NbGBZPN(Q8MGgT(0x20)),NbGBZPN(Q8MGgT(0x42)),NbGBZPN(0x8),'q+]|XpWn',NbGBZPN(Q8MGgT(0x46)),NbGBZPN(0xa),NbGBZPN(0xb),NbGBZPN(Q8MGgT(-0x1c)),NbGBZPN(Q8MGgT(0x3b)),NbGBZPN(Q8MGgT(-0x1b)),NbGBZPN(Q8MGgT(0x40)),NbGBZPN(0x10),NbGBZPN(0x11),NbGBZPN(0x12),NbGBZPN(Q8MGgT(0x7e)),NbGBZPN(Q8MGgT(-0x1c)),NbGBZPN(0x14),NbGBZPN(Q8MGgT(0x47)),NbGBZPN(0x16),NbGBZPN(0x17),NbGBZPN(Q8MGgT(0x119)),NbGBZPN(Q8MGgT(0x44)),NbGBZ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),NbGBZPN(Q8MGgT(0x3f)),NbGBZPN(Q8MGgT(-0x16)),'@r>]25x|o*^Y_*mpB2T',NbGBZPN(0x5a),NbGBZPN(0x45),NbGBZPN(Q8MGgT(0x6d)),NbGBZPN(Q8MGgT(-0x16)),NbGBZPN(0x5b),Q8MGgT(-0x1a),NbGBZPN(Q8MGgT(-0x16)),NbGBZPN(0x5c),NbGBZPN(0x5d),NbGBZPN(0x5e),NbGBZPN(0x5f),NbGBZPN(Q8MGgT(-0x16)),NbGBZPN(Q8MGgT(0x28)),NbGBZPN(0x47),'bB:s|hFn',NbGBZPN(0x2f),NbGBZPN(0x61),NbGBZPN(0x47),Q8MGgT(-0x15),NbGBZPN(Q8MGgT(-0x3)),NbGBZPN(0x2f),NbGBZPN(Q8MGgT(0x52)),NbGBZPN(0x64),NbGBZPN(Q8MGgT(-0x5)),NbGBZPN(Q8MGgT(0x77)),NbGBZPN(Q8MGgT(0x78)),NbGBZPN(Q8MGgT(0x8)),NbGBZPN(Q8MGgT(0x6)),NbGBZPN(Q8MGgT(0xd)),NbGBZPN(0x6b),'oxE|4O_yb',NbGBZPN(Q8MGgT(0x3d)),NbGBZPN(0x6d),NbGBZPN(Q8MGgT(0x80)),NbGBZPN(Q8MGgT(0x2b)),'oxE|4O_yb','U>Df6N!|9RUa(f(pg*TK[V/{=XP,zi7t,SegP~9|s','$zfS}n=`#e}Yz&j%vos$qB9_|Xn)lRd',NbGBZPN(0x47),'bB:s|hFn',NbGBZPN(0x45),NbGBZPN(0x70),NbGBZPN(0x
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