jdpro/jd_opencard_plus.js

7 lines
174 KiB
JavaScript
Raw Normal View History

2024-09-23 07:06:41 +00:00
/*
0 0 22 9 * jd_opencard_plus.js
*/
const $ = new Env('9.22-10.7 Plus尊享 宠爱驾到');
function _0x9AE865(){}var _0x7209C3=Object['defineProperty'],_0xF48750F,_0x377960E,_0xFBB9E9,_0xDF9FEBC,_0x659673,_0x04FF9D,_0x2E493B,_0x8247C21,_0xBFC49B5,_0x2D38C96,_0x73C0B8,_0xC5BA3B,_0x5689DFD,_0x905E307,_0x1768FFA,_0x90F3560,_0x8EDB930,_0xF9162B4,_0xC387F9,_0xE0EA0FA;function _0x79F16F(_0x9AE865){return _0xF48750F[_0x9AE865<0x37?_0x9AE865-0x34:_0x9AE865<0x37?_0x9AE865+0x17:_0x9AE865<0x1a9?_0x9AE865>0x1a9?_0x9AE865+0x64:_0x9AE865-0x38:_0x9AE865-0x54]}_0xF48750F=_0xEE70F3();function _0x888CB2(_0x9AE865,_0x7209C3){return _0x377960E(_0x9AE865,'length',{value:_0x7209C3,configurable:!0x0})}_0x9AE865(_0x377960E=Object.defineProperty,_0xFBB9E9=_0xC7AF6A((_0x9AE865,_0x7209C3)=>{return _0x7209C3(_0x9AE865())},0x2)(_0x915841F,_0xCA28045));var _0xB76017F=[],_0x109FAE=[_0xA13048(0x0),_0xA13048(0x1),_0xA13048(0x2),_0xA13048(_0x79F16F(0x6d)),_0xA13048(0x4),_0xA13048(_0x79F16F(0x6c)),_0xA13048(0x6),'s|pvM&wX',_0xA13048(0x7),_0xA13048(0x8),_0xA13048(0x9),_0xA13048(_0x79F16F(0x74)),_0xA13048(_0x79F16F(0x9b)),_0xA13048(_0x79F16F(0x38)),'.C}9|1(I2?oM.O%>,*',_0xA13048(_0x79F16F(0x9f)),_0xA13048(_0x79F16F(0x89)),_0xA13048(0xf),_0xA13048(_0x79F16F(0x39)),_0xA13048(_0x79F16F(0xa0)),_0xA13048(0x12),_0xA13048(0x13),_0xA13048(0x14),_0xA13048(_0x79F16F(0x3b)),_0xA13048(0x16),_0xA13048(_0x79F16F(0x38)),_0xA13048(0x17),_0xA13048(0xb),_0xA13048(0x18),_0xA13048(0xb),_0xA13048(0x18),_0xA13048(_0x79F16F(0x38)),_0xA13048(_0x79F16F(0x63)),_0xA13048(_0x79F16F(0xa8)),_0xA13048(0x1a),_0xA13048(_0x79F16F(0x144)),_0xA13048(_0x79F16F(0x15f)),_0xA13048(_0x79F16F(0x18c)),_0xA13048(0x1e),_0xA13048(_0x79F16F(0x8d)),_0xA13048(_0x79F16F(0x8e)),_0xA13048(_0x79F16F(0xaa)),_0xA13048(0x22),_0xA13048(0x23),_0xA13048(_0x79F16F(0x17f)),_0xA13048(0x25),_0xA13048(_0x79F16F(0xac)),_0xA13048(_0x79F16F(0x75)),_0xA13048(0x28),_0xA13048(0x29),'0ZCm*qYG`s~|A','Y+C%+OEAeW7M8;mfb|bT','Ci{z?|fX',_0xA13048(_0x79F16F(0xad)),_0xA13048(_0x79F16F(0x77)),_0xA13048(0x2c),_0xA13048(0x2d),_0xA13048(_0x79F16F(0xa2)),_0xA13048(_0x79F16F(0x125)),_0xA13048(_0x79F16F(0xa3)),_0xA13048(_0x79F16F(0x39)),_0xA13048(_0x79F16F(0x124)),'3e|mI5tJa',_0xA13048(0x32),_0xA13048(0x33),_0xA13048(_0x79F16F(0xec)),_0xA13048(0x15),_0xA13048(0x35),_0xA13048(_0x79F16F(0x78)),_0xA13048(0x37),_0xA13048(_0x79F16F(0x79)),_0xA13048(_0x79F16F(0x82)),_0xA13048(_0x79F16F(0x59)),_0xA13048(_0x79F16F(0x49)),_0xA13048(0x3c),_0xA13048(0x3d),_0xA13048(_0x79F16F(0xb1)),_0xA13048(_0x79F16F(0x70)),_0xA13048(_0x79F16F(0xaf)),_0xA13048(0x41),_0xA13048(_0x79F16F(0x56)),'}XD7Ho|[!>(<qHx&7sR[!Egq*MmP7|DD&A','Xhh;kIlv>h"|oW!Ope1v%',_0xA13048(0x43),'zNaKqfp*.mz|Nz_&,1twNOgqGm',_0xA13048(0x44),_0xA13048(0x45),_0xA13048(_0x79F16F(0x149)),_0xA13048(_0x79F16F(0xb5)),'Mwkm|MFFa',_0xA13048(_0x79F16F(0xb6)),_0xA13048(0x49),_0xA13048(0x4a),_0xA13048(0x15),'l"_jaZeWo?~|A[=&[f.Xx@WX:?tO{~',_0xA13048(_0x79F16F(0x54)),_0xA13048(0x4c),_0xA13048(0x4d),_0xA13048(0x4e),_0xA13048(_0x79F16F(0xbb)),_0xA13048(0x50),_0xA13048(0x51),_0xA13048(0x52),_0xA13048(_0x79F16F(0x3a)),_0xA13048(0x42),_0xA13048(_0x79F16F(0xc3)),_0xA13048(0x53),_0xA13048(0x54),_0xA13048(0x55),_0xA13048(0x4d),'aE&<[}Ts+i||`&[_,?H2*E:Q!YxVWdYN,_U(bR}H&osdXX',_0xA13048(0x56),'Z$6BEnp:pvZ8lfoi?yT7|.jx&r3.!#sJ<};wiT^Hac)(]@$J$f"nicaxg_,I;2Rj',_0xA13048(0x41),_0xA13048(0x42),_0xA13048(_0x79F16F(0x3a)),_0xA13048(0x42),_0xA13048(0x57),_0xA13048(0x58),_0xA13048(0x59),_0xA13048(0x5a),_0xA13048(_0x79F16F(0x81)),_0xA13048(0x5c),_0xA13048(_0x79F16F(0x7c)),_0xA13048(0x5e),_0xA13048(0x5f),_0xA13048(_0x79F16F(0xbe)),_0xA13048(0x61),_0xA13048(_0x79F16F(0xbf)),_0xA13048(_0x79F16F(0xbc)),_0xA13048(_0x79F16F(0x3b)),_0xA13048(0x63),_0xA13048(_0x79F16F(0xc5)),_0xA13048(0x15),_0xA13048(0x65),_0xA13048(0x66),'JY13|n7;0Yu!rtG^}+NX[MB',_0xA13048(_0x79F16F(0xc4)),_0xA13048(_0x79F16F(0x3d)),_0xA13048(0x15),_0xA13048(0x69),_0xA13048(0x6a),_0xA13048(0x6b),_0xA13048(0x6c),_0xA13048(0x6d),_0xA13048(0x6e),_0xA13048(_0x79F16F(0x85)),_0xA13048(0x70),_0xA13048(0x71),_0xA13048(0x72),_0xA13048(0x15),_0xA13048(_0x79F16F(0xc7)),_0xA13048(_0x79F16F(0xb7)),_0xA13048(0x60),_0xA13048(0x75),_0xA13048(0x76),_0xA13048(_0x79F16F(0x3
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