jdpro/jd_dailysign.js

7 lines
59 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
2024-06-29 13:25:02 +00:00
1 0,18 * * * jd_dailysign.js
2024-06-28 07:47:44 +00:00
*/
const $ = new Env('每日签到得豆');
2024-07-28 15:11:09 +00:00
var _0xodb='jsjiami.com.v7';const _0x367eb3=_0x3550;(function(_0x1d0bb1,_0x370c3d,_0x30ea3c,_0x41a9bb,_0x3e1595,_0xf917df,_0x540b36){return _0x1d0bb1=_0x1d0bb1>>0x9,_0xf917df='hs',_0x540b36='hs',function(_0x30d45a,_0x563e28,_0x2a6028,_0x1671e4,_0x4fb956){const _0x1d0364=_0x3550;_0x1671e4='tfi',_0xf917df=_0x1671e4+_0xf917df,_0x4fb956='up',_0x540b36+=_0x4fb956,_0xf917df=_0x2a6028(_0xf917df),_0x540b36=_0x2a6028(_0x540b36),_0x2a6028=0x0;const _0x5a00e6=_0x30d45a();while(!![]&&--_0x41a9bb+_0x563e28){try{_0x1671e4=-parseInt(_0x1d0364(0x284,'kQs!'))/0x1+-parseInt(_0x1d0364(0x1da,'sjGX'))/0x2+parseInt(_0x1d0364(0x369,'#BDu'))/0x3*(-parseInt(_0x1d0364(0x3a6,'&NR^'))/0x4)+-parseInt(_0x1d0364(0x2e1,')@E]'))/0x5*(-parseInt(_0x1d0364(0x3c2,'#BDu'))/0x6)+-parseInt(_0x1d0364(0x212,'qVSE'))/0x7+parseInt(_0x1d0364(0x372,'LaAD'))/0x8+parseInt(_0x1d0364(0x254,'9nKR'))/0x9;}catch(_0x1fd2a9){_0x1671e4=_0x2a6028;}finally{_0x4fb956=_0x5a00e6[_0xf917df]();if(_0x1d0bb1<=_0x41a9bb)_0x2a6028?_0x3e1595?_0x1671e4=_0x4fb956:_0x3e1595=_0x4fb956:_0x2a6028=_0x4fb956;else{if(_0x2a6028==_0x3e1595['replace'](/[xKNVRILyOhYHABnkqXbw=]/g,'')){if(_0x1671e4===_0x563e28){_0x5a00e6['un'+_0xf917df](_0x4fb956);break;}_0x5a00e6[_0x540b36](_0x4fb956);}}}}}(_0x30ea3c,_0x370c3d,function(_0x53d0fb,_0xda8cd3,_0x4691ce,_0x308c1d,_0x19bd9b,_0x47a345,_0x23720d){return _0xda8cd3='\x73\x70\x6c\x69\x74',_0x53d0fb=arguments[0x0],_0x53d0fb=_0x53d0fb[_0xda8cd3](''),_0x4691ce=`\x72\x65\x76\x65\x72\x73\x65`,_0x53d0fb=_0x53d0fb[_0x4691ce]('\x76'),_0x308c1d=`\x6a\x6f\x69\x6e`,(0x17b422,_0x53d0fb[_0x308c1d](''));});}(0x18600,0x557bf,_0x2a6d,0xc5),_0x2a6d)&&(_0xodb=_0x2a6d);const _0x51c869=(function(){const _0x1bb83c=_0x3550,_0xc7792a={'VUrkG':function(_0x3564b7,_0x3cf26b){return _0x3564b7(_0x3cf26b);},'TRRcU':_0x1bb83c(0x406,'LKiB'),'hawtn':_0x1bb83c(0x22d,'Vnpv'),'JjEZI':_0x1bb83c(0x3c6,')CLd'),'IYKgG':function(_0x4c1bb5,_0x2d2d40){return _0x4c1bb5!==_0x2d2d40;},'hQMSv':_0x1bb83c(0x358,'O(^@'),'EhIVg':_0x1bb83c(0x2c9,'aUoj')};let _0x10ea6e=!![];return function(_0x19be7e,_0x3ffb96){const _0x2de199=_0x1bb83c,_0x4243f0={'CzIyP':function(_0x2e12d7,_0x5f8c71){const _0x3e7b4c=_0x3550;return _0xc7792a[_0x3e7b4c(0x30e,'W@G(')](_0x2e12d7,_0x5f8c71);},'sKQqm':_0xc7792a[_0x2de199(0x29c,'vmq!')],'NUmaO':function(_0x448918,_0xbf532b){const _0x4e645e=_0x2de199;return _0xc7792a[_0x4e645e(0x2e9,'LKiB')](_0x448918,_0xbf532b);},'uMdIr':_0xc7792a[_0x2de199(0x33b,'rmBf')],'hitJC':_0xc7792a[_0x2de199(0x23b,'9Ay]')],'JHntu':function(_0x128ec4,_0x434a15){const _0x5bfe31=_0x2de199;return _0xc7792a[_0x5bfe31(0x1e3,'2jw[')](_0x128ec4,_0x434a15);},'QipzU':_0xc7792a[_0x2de199(0x20b,'Lze3')],'qPZIu':_0xc7792a[_0x2de199(0x397,'VM0D')]},_0x295002=_0x10ea6e?function(){const _0x242b79=_0x2de199,_0x53d891={'jtPlY':function(_0x226bb7,_0x41f88c){const _0xfe2584=_0x3550;return _0x4243f0[_0xfe2584(0x2f4,'GsFt')](_0x226bb7,_0x41f88c);},'GpKYA':_0x4243f0[_0x242b79(0x268,'9Ay]')],'KHcTf':function(_0x2931ff,_0x22ef8e){const _0x2415de=_0x242b79;return _0x4243f0[_0x2415de(0x269,'Vnpv')](_0x2931ff,_0x22ef8e);},'hiwRp':_0x4243f0[_0x242b79(0x323,'kQs!')],'TWalT':_0x4243f0[_0x242b79(0x3cc,'[1i$')]};if(_0x4243f0[_0x242b79(0x1e9,'Daud')](_0x4243f0[_0x242b79(0x325,'tH*D')],_0x4243f0[_0x242b79(0x27c,'Lze3')]))try{_0x53d891[_0x242b79(0x26b,'CmsB')](_0x28adb9,_0x53d891[_0x242b79(0x3af,'tH*D')]),_0x1678a9=_0x53d891[_0x242b79(0x208,'Iqux')](_0x5d9642,_0x53d891[_0x242b79(0x1fe,'wPTD')]),_0x7f1616[_0x242b79(0x2bf,'YtL^')]=_0x41c429[_0x242b79(0x40b,'YSp1')](_0x2467ec[_0x242b79(0x2ac,'rmBf')][_0x242b79(0x1e2,'iPTh')](_0x896350)),_0x111a4a[_0x242b79(0x21d,')IqZ')]=_0x9a67c8[_0x242b79(0x2c5,'qVSE')](_0xc987f6[_0x242b79(0x407,')@E]')][_0x242b79(0x37d,')@E]')](_0x956a6b));}catch{_0x4fc473[_0x242b79(0x40c,'Lze3')](_0x53d891[_0x242b79(0x2ce,'11)W')]),_0x1d2024[_0x242b79(0x2e8,'])B[')]=_0x1817e7[_0x242b79(0x297,'hfJl')],_0x28f522[_0x242b79(0x399,'&NR^')]=_0x2377b0[_0x242b79(0x22a,'LaAD')];}else{if(_0x3ffb96){if(_0x4243f0[_0x242b79(0x360,'#BDu')](_0x4243f0[_0x242b79(0x256,'LKiB')],_0x4243f0[_0x242b79(0x215,'y$Ze')]))_0x17a0e3=_0x242b79(0x293,'O(^@')
2024-06-28 07:47:44 +00:00
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