mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-03-14 22:54:41 +08:00
16 lines
77 KiB
JavaScript
16 lines
77 KiB
JavaScript
|
/*
|
|||
|
活动名称:手机里的新年味
|
|||
|
环境变量:jd_tower_phone_interval // 自定义运行间隔时长(整数,单位毫秒),默认1000
|
|||
|
jd_tower_phone_notify // 是否推送通知(true/false),默认不推送
|
|||
|
jd_tower_phone_pinFilter // 账号pin过滤,多个用@进行分割
|
|||
|
|
|||
|
cron:59 23 29 2 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('手机里的新年味')
|
|||
|
function UBqum4h(){}var yC66Ng1=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],nKs9erR,tTNuTyk,gNkKnwG,xqlj1OT,MqWtPk,ReaKPf,tACxT7F,HsIGU1G,BBfrjLI,mK9jaT,NhdIZm3,xJpKqcH,HHBdKV8,Sq865dF,dPzMAI,QDdzHz,uxrIQ31,izlNuE,HICY5KA;function caV5xla(UBqum4h){return nKs9erR[UBqum4h>-0x1c?UBqum4h>-0x1c?UBqum4h+0x1b:UBqum4h-0x20:UBqum4h-0x4f]}UBqum4h(nKs9erR=qT8cw9(),tTNuTyk=ZRGIjWC((UBqum4h,yC66Ng1)=>{return yC66Ng1(UBqum4h())},0x2)(a0cvDfe,azWts6_));var MT0vwHx=[],CVWODj=[SocdNKE(caV5xla(-0x12)),'\u0024\u0073\u002b\u0058\u004e\u0034\u0064\u0063',SocdNKE(0x1),'\u006f\u005e\u0076\u0040\u0068\u004e\u0047\u005a',SocdNKE(0x2),'\x7b\x62\x37\x51\x37\x72\x67\x4e\x34\x44\x58\x67\x7a\x2c\x73\x7b\x3f\x71\x5f\x51\x33\x52\x60\x4e\x34\x4c\x28\x48\x35','{b7Q7rgN4DXgz,s{?qSWio@uAD{)5',SocdNKE(0x3),SocdNKE(caV5xla(-0xa)),'\u007b\u0062\u0037\u0051\u0037\u0072\u0067\u004e\u0034\u0044\u0058\u0067\u007a\u002c\u0073\u007b\u003f\u0071\u0078\u004a\u0069\u006f\u0045\u0078\u0061\u002f',SocdNKE(caV5xla(-0x2)),SocdNKE(0x6),'e~Xz%oI','YFLrp','\u0035\u0050\u0069\u005b','](O[zZ~t',SocdNKE(0x7),'\x74\x50\x34\x7a\x65','\u003b\u0074\u0044\u0047\u0076\u0034\u002b\u0033\u0026\u0070\u003c\u005e\u002c\u0076\u005a\u006f\u0047\u007c\u0032\u0033\u0026\u006a\u0069\u002c\u0065\u0055\u007a\u0059\u005f\u005d\u0034\u004d\u0046\u007a\u006b\u0061\u0065','\x47\x67\x53\x5b\x3f','BG/CLo$l(QN`znnK|BmAn,#+(w|#_1vM1bWZNrxt','\u0042\u0047\u002f\u0043\u004c\u006f\u0024\u006c\u0028\u0051\u004e\u0060\u007a\u006e\u006e\u004b\u007c\u0042\u006d\u0041\u006e\u002c\u0023\u002b\u0028\u0077\u007c\u0023\u005f\u0031\u0076\u004d\u0031\u0062\u0057\u005a\u004e\u0072\u0048\u0039\u0038\u0064\u0055\u0032\u0025\u002c\u0026\u004b\u0067\u002b\u0026\u0058\u004b\u0052\u003e\u006f\u0041\u0029\u0048\u004a\u0039\u0031\u0076\u004d\u003f\u0062\u003b\u0028\u0039\u0041\u007d\u004b\u0041\u0029\u0038\u007e\u004c\u0076\u0024\u0076','{b&X7rgN4Dmcz,s{)BnCSAEQ8),Gjvzx)B1Q*JI','\x62\x42\x55\x28\x46\x6f\x59\x7e\x5a\x77','\x28\x40\x44\x57\x34\x4a\x53\x74',SocdNKE(0x8),'\u0074\u0050\u0034\u007a\u0065',SocdNKE(0x9),SocdNKE(0xa),'=XgUBRI',SocdNKE(0xb),'\x5d\x28\x3e\x7a\x77\x41\x35\x54\x3a','\x6e\x40\x3e\x7a\x65',SocdNKE(caV5xla(-0x10)),'\x34\x50\x53\x5b\x78\x23\x4b\x73\x73\x4c',caV5xla(-0x1a),'\u0047\u0073\u0043\u002a\u002f\u0052\u0059\u0023\u005f\u005d\u004f\u0042\u006e\u002f\u004d\u004f\u006d\u0056\u0044\u0062\u0055\u003c\u007c\u0054\u0068\u0028\u0038\u0060\u004a\u002b\u003a\u006f\u005e\u0032\u0050\u0040\u0044\u0079\u0069\u002c\u004f\u0072\u0045\u0036\u002e\u0064\u0066\u0022\u004c\u0053\u0056\u003d\u0040',SocdNKE(caV5xla(-0x1b)),'\x74\x50\x34\x7a\x65',SocdNKE(caV5xla(-0x6)),SocdNKE(caV5xla(0x2)),'\u0028\u0040\u0077\u0055\u0061\u0023\u0035\u003e\u006f\u0064',SocdNKE(caV5xla(0x3)),'N8>z^Udt','\x3c\x46\x77\x55\x72\x6f\x28\x74','\u0031\u005d\u0063\u0051\u0054\u003d\u004e\u004e\u0028\u0077','\x26\x70\x3f\x30\x3e\x21\x65\x6e\x63\x2a\x54\x2c\x61','\x23\x70\x7d\x50\x5f\x75\x2e\x66\x45',SocdNKE(0x11),SocdNKE(0xd),'\x4e\x38\x3e\x7a\x5e\x55\x64\x74','\x64\x46\x67\x55\x59\x72\x4e\x68\x31\x32\x3b\x61\x28\x31\x28\x4b\x43\x35','\x3b\x47\x37\x51\x2a\x4a\x7b\x74',SocdNKE(caV5xla(0x4)),'\u0025\u002b\u0065\u0057\u0069\u006f\u005e\u0022\u0023\u004c\u003d\u0030\u0035','\u007c\u002b\u007b\u0061\u0055\u006f\u0077\u0074','\x3c\x46\x77\x55\x72\x6f\x28\x74','\x31\x5d\x63\x51\x54\x3d\x4e\x4e\x28\x77','\u005d\u0028\u0054\u0043',SocdNKE(0x13),SocdNKE(caV5xla(-0x1b)),SocdNKE(0x14),'\u0065\u0046\u002c\u0051\u0039\u0047\u0066\u0073\u0054\u003e\u0032\u0022\u007c\u006f\u0076\u004d\u003b\u0028\u007b\u0061\u002b\u0055\u004e\u004e\u0046\u002f','\u0070\u0038\u0075\u0043\u0028','\x64\x46\x2f\x43\x65\x72\x3d\x22\x7b\x68\x57\x52\x28\x31\x6e\x4b\x53\x35',SocdNKE(0x15),caV5xla(-0x1a),'\u0065\u0046\u002c\u0051\u0039\u0047\u0066\u0073\u0054\u003e\u0032\u0022\u007c\u006f\u0076\u004d\u003b\u0028\u007b\u0061\u002b\u0055\u004e\u004e\u0046\u002f','\u0060\u0054\u0031\u002b\u007b','dF>z9;I','`(DWW=Ks;2TA(uT]M?cQfr:eFT#|RP','\u0034\u0050\u0053\u005b\u003f','\u0034\u0050\u0053\u005b\u0078\u0023\u004b\u0073\u0073\u004c','\x75\x38
|
|||
|
|
|||
|
// prettier-ignore
|
|||
|
function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);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,r)=>{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.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.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)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 r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};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),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==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),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):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:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])
|