mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
15 lines
40 KiB
JavaScript
15 lines
40 KiB
JavaScript
|
/*
|
|||
|
活动名称:818手机节
|
|||
|
环境变量:jd_phone_818_interval // 自定义运行间隔时长(整数,单位毫秒),默认1000
|
|||
|
jd_phone_818_notify // 是否推送通知(true/false),默认不推送
|
|||
|
jd_phone_818_pinFilter // 账号pin过滤,多个用@进行分割
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('818手机节')
|
|||
|
var iil='jsjiami.com.v7';const l1iI1=iii1II;(function(Ii1I1l,IIlIl,ili11l,Iiilll,Iiilli,IIlIi,ili11i){return Ii1I1l=Ii1I1l>>0x5,IIlIi='hs',ili11i='hs',function(iiIi1l,li11I,lliiII,iiIi1i,liI1ll){const l1i1Ii=iii1II;iiIi1i='tfi',IIlIi=iiIi1i+IIlIi,liI1ll='up',ili11i+=liI1ll,IIlIi=lliiII(IIlIi),ili11i=lliiII(ili11i),lliiII=0x0;const ll1II=iiIi1l();while(!![]&&--Iiilll+li11I){try{iiIi1i=-parseInt(l1i1Ii(0x282,'CHOV'))/0x1+-parseInt(l1i1Ii(0x1e1,'G759'))/0x2+parseInt(l1i1Ii(0x1d3,'Pms('))/0x3+-parseInt(l1i1Ii(0x2a7,'W%I@'))/0x4*(parseInt(l1i1Ii(0x281,'n!f&'))/0x5)+-parseInt(l1i1Ii(0x26b,'OE51'))/0x6+-parseInt(l1i1Ii(0x203,'JbRn'))/0x7+parseInt(l1i1Ii(0x1a2,'Pms('))/0x8*(parseInt(l1i1Ii(0x1b9,'PsD3'))/0x9);}catch(IllIii){iiIi1i=lliiII;}finally{liI1ll=ll1II[IIlIi]();if(Ii1I1l<=Iiilll)lliiII?Iiilli?iiIi1i=liI1ll:Iiilli=liI1ll:lliiII=liI1ll;else{if(lliiII==Iiilli['replace'](/[XPULquWHCtfEFTBbNg=]/g,'')){if(iiIi1i===li11I){ll1II['un'+IIlIi](liI1ll);break;}ll1II[ili11i](liI1ll);}}}}}(ili11l,IIlIl,function(liI1li,IllIil,ill1Ii,llIIl1,ill1Il,i1lll1,Ii1I1I){return IllIil='\x73\x70\x6c\x69\x74',liI1li=arguments[0x0],liI1li=liI1li[IllIil](''),ill1Ii=`\x72\x65\x76\x65\x72\x73\x65`,liI1li=liI1li[ill1Ii]('\x76'),llIIl1=`\x6a\x6f\x69\x6e`,(0x17d640,liI1li[llIIl1](''));});}(0x1920,0x20438,Iii11l,0xcb),Iii11l)&&(iil=0x154d);const jdCookie=require(l1iI1(0x2b2,'n!f&')),common=require(l1iI1(0x2fc,'j5^o')),notify=require('./utils/Rebels_sendJDNotify'),getToken=require('./utils/Rebels_Token'),CryptoJS=require(l1iI1(0x192,'HGuy'));let taskThreads=process['env']['jd_phone_818__threads']||'1';const runInterval=process['env'][l1iI1(0x227,'n!f&')]||'1000',isNotify=(process[l1iI1(0x2e7,'J&Xn')]['jd_phone_818_notify']||process[l1iI1(0x2fb,'&*FX')]['jd_phone_818_Notify'])===l1iI1(0x2e4,'F[2%'),pinFilter=(process[l1iI1(0x2c7,'HGuy')][l1iI1(0x18e,'azMP')]||'')['split']('@'),maxThreads=0x3;let shareCodes=[],needRemoveCodes=[],hasPrintActInfo=![],cookiesArr=Object['keys'](jdCookie)[l1iI1(0x19b,'L4&M')](i1ilI=>jdCookie[i1ilI])[l1iI1(0x289,'%IR6')](iii1lI=>iii1lI);!cookiesArr[0x0]&&($[l1iI1(0x267,'yD4F')]($[l1iI1(0x1d9,'hwK(')],l1iI1(0x210,'aryv')),process[l1iI1(0x28e,'Onwy')](0x1));let domains=l1iI1(0x29c,'xBM7'),activityUrl=l1iI1(0x2c3,'e9v1'),act_type='phone-b1b-api',appKey='NYbKyuYV';const skip_task=[0x2,0x3],b1b_type_map={'bag1':0x1,'bag2':0x2,'boom':0x3};function iii1II(_0x142164,_0xc673bc){const _0x3c63ac=Iii11l();return iii1II=function(_0x2442ee,_0x5a2d8c){_0x2442ee=_0x2442ee-0x18e;let _0x44dd78=_0x3c63ac[_0x2442ee];if(iii1II['RopsfH']===undefined){var _0x255658=function(_0x2b1935){const _0x44dcea='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2937a0='',_0x990d1c='';for(let _0x21bfb9=0x0,_0x25b233,_0x34936e,_0x3b82bc=0x0;_0x34936e=_0x2b1935['charAt'](_0x3b82bc++);~_0x34936e&&(_0x25b233=_0x21bfb9%0x4?_0x25b233*0x40+_0x34936e:_0x34936e,_0x21bfb9++%0x4)?_0x2937a0+=String['fromCharCode'](0xff&_0x25b233>>(-0x2*_0x21bfb9&0x6)):0x0){_0x34936e=_0x44dcea['indexOf'](_0x34936e);}for(let _0x16fb0e=0x0,_0x54ec79=_0x2937a0['length'];_0x16fb0e<_0x54ec79;_0x16fb0e++){_0x990d1c+='%'+('00'+_0x2937a0['charCodeAt'](_0x16fb0e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x990d1c);};const _0x4f5cc6=function(_0x1cd165,_0x4299fc){let _0x2ed03b=[],_0x2ff04d=0x0,_0x503d15,_0x2d4c6e='';_0x1cd165=_0x255658(_0x1cd165);let _0x341c08;for(_0x341c08=0x0;_0x341c08<0x100;_0x341c08++){_0x2ed03b[_0x341c08]=_0x341c08;}for(_0x341c08=0x0;_0x341c08<0x100;_0x341c08++){_0x2ff04d=(_0x2ff04d+_0x2ed03b[_0x341c08]+_0x4299fc['charCodeAt'](_0x341c08%_0x4299fc['length']))%0x100,_0x503d15=_0x2ed03b[_0x341c08],_0x2ed03b[_0x341c08]=_0x2ed03b[_0x2ff04d],_0x2ed03b[_0x2ff04d]=_0x503d15;}_0x341c08=0x0,_0x2ff04d=0x0;for(let _0x29d682=0x0;_0x29d682<_0x1cd165['length'];_0x29d682++){_0x341c08=(_0x341c08+0x1)%0x100,_0x2ff04d=(_0x2ff04d+_0x2ed03b[_0x341c08])%0x100,_0x503d15=_0x2ed03b[_0x341c08],_0x2ed03b[_0x341c08]=_0x2ed03b[_0x2ff04d],_0x2ed03b[_0x2ff04d]=_0x503d15,_0x2d4c6e+=String['fromCharCode'](_0x1cd165['charCodeAt'](_0x29d682)^_0x2ed03b[(_0x2ed03b[_0x341c08
|
|||
|
// 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"])
|