mirror of
https://github.com/wq-h/qinglong.git
synced 2026-11-06 02:56:47 +08:00
更新望潮
This commit is contained in:
1 parent
2cafd205ff
commit
ac05a8fb94
1 file changed
+2
-2
+2
-2
@@ -3,8 +3,8 @@
|
||||
* export WangChao="账号1&密码1 账号2&密码2"
|
||||
*/
|
||||
const $ = new Env('望潮')
|
||||
const notify = $.isNode() ? require('../sendNotify') : '';
|
||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||
function a0d(a,b){var c=a0c();return a0d=function(d,e){d=d-0x66;var f=c[d];if(a0d['\x46\x58\x6b\x44\x65\x73']===undefined){var g=function(l){var m='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';var n='',o='',p=n+g;for(var q=0x0,r,s,t=0x0;s=l['\x63\x68\x61\x72\x41\x74'](t++);~s&&(r=q%0x4?r*0x40+s:s,q++%0x4)?n+=p['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](t+0xa)-0xa!==0x0?String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0xff&r>>(-0x2*q&0x6)):q:0x0){s=m['\x69\x6e\x64\x65\x78\x4f\x66'](s);}for(var u=0x0,v=n['\x6c\x65\x6e\x67\x74\x68'];u<v;u++){o+='\x25'+('\x30\x30'+n['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](u)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x10))['\x73\x6c\x69\x63\x65'](-0x2);}return decodeURIComponent(o);};var k=function(l,m){var n=[],o=0x0,p,q='';l=g(l);var r;for(r=0x0;r<0x100;r++){n[r]=r;}for(r=0x0;r<0x100;r++){o=(o+n[r]+m['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](r%m['\x6c\x65\x6e\x67\x74\x68']))%0x100,p=n[r],n[r]=n[o],n[o]=p;}r=0x0,o=0x0;for(var t=0x0;t<l['\x6c\x65\x6e\x67\x74\x68'];t++){r=(r+0x1)%0x100,o=(o+n[r])%0x100,p=n[r],n[r]=n[o],n[o]=p,q+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](l['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](t)^n[(n[r]+n[o])%0x100]);}return q;};a0d['\x77\x73\x70\x69\x65\x74']=k,a=arguments,a0d['\x46\x58\x6b\x44\x65\x73']=!![];}var h=c[0x0],i=d+h,j=a[i];if(!j){if(a0d['\x52\x55\x6b\x42\x71\x63']===undefined){var l=function(m){this['\x53\x58\x6d\x56\x70\x75']=m,this['\x71\x41\x77\x4a\x69\x4a']=[0x1,0x0,0x0],this['\x51\x4c\x4f\x4e\x4b\x46']=function(){return'\x6e\x65\x77\x53\x74\x61\x74\x65';},this['\x5a\x79\x56\x48\x6a\x7a']='\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a',this['\x54\x70\x68\x61\x65\x53']='\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d';};l['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x47\x41\x7a\x44\x65\x49']=function(){var m=new RegExp(this['\x5a\x79\x56\x48\x6a\x7a']+this['\x54\x70\x68\x61\x65\x53']),n=m['\x74\x65\x73\x74'](this['\x51\x4c\x4f\x4e\x4b\x46']['\x74\x6f\x53\x74\x72\x69\x6e\x67']())?--this['\x71\x41\x77\x4a\x69\x4a'][0x1]:--this['\x71\x41\x77\x4a\x69\x4a'][0x0];return this['\x7a\x59\x79\x43\x78\x4b'](n);},l['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x7a\x59\x79\x43\x78\x4b']=function(m){if(!Boolean(~m))return m;return this['\x59\x56\x42\x6d\x4b\x71'](this['\x53\x58\x6d\x56\x70\x75']);},l['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x59\x56\x42\x6d\x4b\x71']=function(m){for(var n=0x0,o=this['\x71\x41\x77\x4a\x69\x4a']['\x6c\x65\x6e\x67\x74\x68'];n<o;n++){this['\x71\x41\x77\x4a\x69\x4a']['\x70\x75\x73\x68'](Math['\x72\x6f\x75\x6e\x64'](Math['\x72\x61\x6e\x64\x6f\x6d']())),o=this['\x71\x41\x77\x4a\x69\x4a']['\x6c\x65\x6e\x67\x74\x68'];}return m(this['\x71\x41\x77\x4a\x69\x4a'][0x0]);},new l(a0d)['\x47\x41\x7a\x44\x65\x49'](),a0d['\x52\x55\x6b\x42\x71\x63']=!![];}f=a0d['\x77\x73\x70\x69\x65\x74'](f,e),a[i]=f;}else f=j;return f;},a0d(a,b);}(function(a,b){var bt=a0e,bs=a0d,c=a();while(!![]){try{var d=parseInt(bs(0x8b5,'\x36\x6d\x5d\x49'))/0x1*(-parseInt(bs(0x1c3,'\x62\x36\x64\x43'))/0x2)+-parseInt(bs(0x2e8,'\x4c\x6e\x5b\x25'))/0x3*(parseInt(bt(0x548))/0x4)+-parseInt(bs(0xd49,'\x34\x24\x6c\x6b'))/0x5*(parseInt(bs(0x7fc,'\x65\x47\x77\x31'))/0x6)+-parseInt(bs(0x27c,'\x6f\x45\x24\x73'))/0x7*(-parseInt(bs(0x28b,'\x33\x65\x6d\x67'))/0x8)+parseInt(bs(0x866,'\x4f\x42\x65\x45'))/0x9*(parseInt(bs(0xb4b,'\x63\x73\x43\x75'))/0xa)+-parseInt(bt(0x953))/0xb+-parseInt(bs(0xaa3,'\x77\x5d\x6b\x38'))/0xc*(-parseInt(bt(0xa2e))/0xd);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a0c,0x5c2f0));var a0as=(function(){var bv=a0d,bu=a0e,a={'\x46\x4c\x41\x73\x47':function(c,d){return c===d;},'\x67\x6f\x76\x5a\x73':bu(0xc5f),'\x4f\x53\x6c\x6d\x79':bu(0xdb4),'\x77\x6e\x58\x62\x43':bu(0xdb),'\x54\x77\x69\x47\x51':bv(0x577,'\x6b\x5b\x70\x6b'),'\x51\x58\x4c\x4a\x6a':bu(0x30f)+bu(0xcf9),'\x70\x68\x6b\x61\x6c':function(c,d){return c(d);},'\x71\x6b\x54\x64\x4f':function(c){return c();},'\x6b\x50\x79\x56\x4f':bu(0x7c6),'\x70\x4c\x68\x65\x61':bv(0xc5,'\x4c\x6e\x5b\x25'),'\x49\x58\x47\x4d\x49':bu(0x7b3),'\x62\x6c\x71\x42\x59':bv(0x422,'\x6d\x32\x77\x78')},b=!![];return function(c,d){var by=bv,bx=bu,e={'\x55\x6d\x4d\x4f\x74':function(g){var bw=a0d;return a[bw(0xad2,'\x6a\x4b\x61\x47')](g);},'\x54\x6d\x6b\x75\x7a':function(g,h){return g>h;},'\x4a\x62\x73\x70\x61':function(g,h,i,j,k){return g(h,i,j,k);},'\x52\x78\x4d\x75\x65':a[bx(0x87f)]};if(a[by(0x380,'\x6a\x4b\x61\x47')]!==a[bx(0x5a0)]){var f=b?function(){var bA=by,bz=bx;if(a[bz(0x547)](a[bA(0xd13,'\x53\x34\x50\x65')],a[bz(0x186)])){var i=e[bz(0x70a)](j),j=o[bz(0xc90)]();e[bz(0x1dd)](p[bz(0x2bc)]('\x3f'),0x0)&&(q=k[bA(0xb98,'\x63\x73\x43\x75')](0x0,s[bA(0x4ea,'\x33\x65\x6d\x67')]('\x3f'))),i=u[bA(0x9e8,'\x4c\x6e\x5b\x25')+bz(Line truncated
|
||||
|
||||
// prettier-ignore
|
||||
function Env(t,e){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,o)=>{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.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((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 o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=e&&e.timeout?e.timeout:o;const[r,a]=i.split("@"),n={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":r,Accept:"*/*"},timeout:o};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),o=JSON.stringify(this.data);s?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(e,o):this.fs.writeFileSync(t,o)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return s;return o}lodash_set(t,e,s){return Object(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),o=s?this.getval(s):"";if(o)try{const t=JSON.parse(o);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(e),r=this.getval(i),a=i?"null"===r?null:r||"{}":"{}";try{const e=JSON.parse(a);this.lodash_set(e,o,t),s=this.setval(JSON.stringify(e),i)}catch(e){const r={};this.lodash_set(r,o,t),s=this.setval(JSON.stringify(r),i)}}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.setValueForKey(t,e);case"Node.js":return this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0;default:return this.data&&this.data[e]||null}}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.cookie&&void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar)))}get(t,e=(()=>{})){switch(t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"],delete t.headers["content-type"],delete t.headers["content-length"]),t.params&&(t.url+="?"+this.queryStr(t.params)),void 0===t.followRedirect||t.followRedirect||((this.isSurge()||this.isLoon(Line truncated
|
||||
function Env(t,e){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,o)=>{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.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((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 o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=e&&e.timeout?e.timeout:o;const[r,a]=i.split("@"),n={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":r,Accept:"*/*"},timeout:o};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),o=JSON.stringify(this.data);s?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(e,o):this.fs.writeFileSync(t,o)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return s;return o}lodash_set(t,e,s){return Object(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),o=s?this.getval(s):"";if(o)try{const t=JSON.parse(o);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(e),r=this.getval(i),a=i?"null"===r?null:r||"{}":"{}";try{const e=JSON.parse(a);this.lodash_set(e,o,t),s=this.setval(JSON.stringify(e),i)}catch(e){const r={};this.lodash_set(r,o,t),s=this.setval(JSON.stringify(r),i)}}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.setValueForKey(t,e);case"Node.js":return this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0;default:return this.data&&this.data[e]||null}}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.cookie&&void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar)))}get(t,e=(()=>{})){switch(t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"],delete t.headers["content-type"],delete t.headers["content-length"]),t.params&&(t.url+="?"+this.queryStr(t.params)),void 0===t.followRedirect||t.followRedirect||((this.isSurge()||this.isLoon(Line truncated
|
||||
Reference in new issue
Block a user