mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
24 lines
78 KiB
JavaScript
24 lines
78 KiB
JavaScript
|
/*
|
|||
|
活动名称:完善有礼(超级无线V2)
|
|||
|
活动链接:https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/10049/<模板id>/?activityId=<活动id>&shopId=<店铺id>
|
|||
|
环境变量:jd_lzkj_v2_perfectInfo_url // 活动链接
|
|||
|
jd_lzkj_v2_perfectInfo_opencard // 是否入会(true/false),默认不入会
|
|||
|
jd_lzkj_v2_perfectInfo_notify // 是否推送通知(true/false),默认不推送
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('完善有礼(超级无线V2)')
|
|||
|
const jdCookie = require('./jdCookie')
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
const notify = require('./function/sendJDNotify')
|
|||
|
const getToken = require('./function/getToken')
|
|||
|
const { wuxianDefense } = require('./function/jdCrypto')
|
|||
|
const { lzkj_interaction_v2_savePrize } = require('./function/savePrize')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';function I1Iii11l(_0x32f16e,_0x557d20){const _0x279c12=IIII11II();return I1Iii11l=function(_0x2d09a6,_0x45fc03){_0x2d09a6=_0x2d09a6-0x1c4;let _0x410fbc=_0x279c12[_0x2d09a6];if(I1Iii11l['XFqkrq']===undefined){var _0x7c736f=function(_0x47f5a8){const _0xc107c6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x13c6f3='',_0x48da39='';for(let _0x14aa18=0x0,_0x2705d4,_0x15cb98,_0x3136d4=0x0;_0x15cb98=_0x47f5a8['charAt'](_0x3136d4++);~_0x15cb98&&(_0x2705d4=_0x14aa18%0x4?_0x2705d4*0x40+_0x15cb98:_0x15cb98,_0x14aa18++%0x4)?_0x13c6f3+=String['fromCharCode'](0xff&_0x2705d4>>(-0x2*_0x14aa18&0x6)):0x0){_0x15cb98=_0xc107c6['indexOf'](_0x15cb98);}for(let _0x24b256=0x0,_0x42b8a0=_0x13c6f3['length'];_0x24b256<_0x42b8a0;_0x24b256++){_0x48da39+='%'+('00'+_0x13c6f3['charCodeAt'](_0x24b256)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x48da39);};const _0x5d1844=function(_0x1bbec7,_0x1df0a0){let _0x5f5226=[],_0xd0cc35=0x0,_0x3cfb43,_0x402989='';_0x1bbec7=_0x7c736f(_0x1bbec7);let _0x554755;for(_0x554755=0x0;_0x554755<0x100;_0x554755++){_0x5f5226[_0x554755]=_0x554755;}for(_0x554755=0x0;_0x554755<0x100;_0x554755++){_0xd0cc35=(_0xd0cc35+_0x5f5226[_0x554755]+_0x1df0a0['charCodeAt'](_0x554755%_0x1df0a0['length']))%0x100,_0x3cfb43=_0x5f5226[_0x554755],_0x5f5226[_0x554755]=_0x5f5226[_0xd0cc35],_0x5f5226[_0xd0cc35]=_0x3cfb43;}_0x554755=0x0,_0xd0cc35=0x0;for(let _0x1cf93a=0x0;_0x1cf93a<_0x1bbec7['length'];_0x1cf93a++){_0x554755=(_0x554755+0x1)%0x100,_0xd0cc35=(_0xd0cc35+_0x5f5226[_0x554755])%0x100,_0x3cfb43=_0x5f5226[_0x554755],_0x5f5226[_0x554755]=_0x5f5226[_0xd0cc35],_0x5f5226[_0xd0cc35]=_0x3cfb43,_0x402989+=String['fromCharCode'](_0x1bbec7['charCodeAt'](_0x1cf93a)^_0x5f5226[(_0x5f5226[_0x554755]+_0x5f5226[_0xd0cc35])%0x100]);}return _0x402989;};I1Iii11l['hpDikK']=_0x5d1844,_0x32f16e=arguments,I1Iii11l['XFqkrq']=!![];}const _0x58327f=_0x279c12[0x0],_0x57f08c=_0x2d09a6+_0x58327f,_0xbdd4b=_0x32f16e[_0x57f08c];return!_0xbdd4b?(I1Iii11l['ayiYdt']===undefined&&(I1Iii11l['ayiYdt']=!![]),_0x410fbc=I1Iii11l['hpDikK'](_0x410fbc,_0x45fc03),_0x32f16e[_0x57f08c]=_0x410fbc):_0x410fbc=_0xbdd4b,_0x410fbc;},I1Iii11l(_0x32f16e,_0x557d20);}const lIIlilI1=I1Iii11l;(function(lliliI1I,lI111lll,I1llilil,li111il,iliIi1i,iI1IiIIl,l11i1ii1){return lliliI1I=lliliI1I>>0x5,iI1IiIIl='hs',l11i1ii1='hs',function(IiliIiiI,i1lII11,iIIiIiII,lIIIlI1l,l1l1Ii){const l1li11l1=I1Iii11l;lIIIlI1l='tfi',iI1IiIIl=lIIIlI1l+iI1IiIIl,l1l1Ii='up',l11i1ii1+=l1l1Ii,iI1IiIIl=iIIiIiII(iI1IiIIl),l11i1ii1=iIIiIiII(l11i1ii1),iIIiIiII=0x0;const lIlI1II=IiliIiiI();while(!![]&&--li111il+i1lII11){try{lIIIlI1l=-parseInt(l1li11l1(0x5da,'3WXA'))/0x1+-parseInt(l1li11l1(0x5ba,'$&@r'))/0x2+-parseInt(l1li11l1(0x2e8,'3WXA'))/0x3+-parseInt(l1li11l1(0x1dc,'F7Hp'))/0x4+parseInt(l1li11l1(0x44d,'rJA$'))/0x5+-parseInt(l1li11l1(0x349,'u4[^'))/0x6+parseInt(l1li11l1(0x45b,'ttWU'))/0x7*(parseInt(l1li11l1(0x48d,'PXV%'))/0x8);}catch(IIl1Ii1i){lIIIlI1l=iIIiIiII;}finally{l1l1Ii=lIlI1II[iI1IiIIl]();if(lliliI1I<=li111il)iIIiIiII?iliIi1i?lIIIlI1l=l1l1Ii:iliIi1i=l1l1Ii:iIIiIiII=l1l1Ii;else{if(iIIiIiII==iliIi1i['replace'](/[hVxOXPApDEFwRLtfeJrGT=]/g,'')){if(lIIIlI1l===i1lII11){lIlI1II['un'+iI1IiIIl](l1l1Ii);break;}lIlI1II[l11i1ii1](l1l1Ii);}}}}}(I1llilil,lI111lll,function(i1iiIl1i,lII1Ili1,iiilliIl,Iiil1li,l1i1iliI,II1I1llI,I11lli1i){return lII1Ili1='\x73\x70\x6c\x69\x74',i1iiIl1i=arguments[0x0],i1iiIl1i=i1iiIl1i[lII1Ili1](''),iiilliIl=`\x72\x65\x76\x65\x72\x73\x65`,i1iiIl1i=i1iiIl1i[iiilliIl]('\x76'),Iiil1li=`\x6a\x6f\x69\x6e`,(0x16d73a,i1iiIl1i[Iiil1li](''));});}(0x1860,0x7bba3,IIII11II,0xc5),IIII11II)&&(iil=0x4df7);const activityUrl=process[lIIlilI1(0x502,'17B!')][lIIlilI1(0x55d,'aVra')]||'',joinMember=process[lIIlilI1(0x3af,'DI#f')][lIIlilI1(0x477,'U#kT')]===lIIlilI1(0x4a8,'WFc!'),isNotify=process[lIIlilI1(0x4d8,'ttWU')][lIIlilI1(0x5b1,'Vvsm')]===lIIlilI1(0x5d7,'DI#f');let cookie='',originCookie='';const cookiesArr=Object[lIIlilI1(0x3ac,'g@bl')](jdCookie)[lIIlilI1(0x591,'RPB[')](iiiili1=>jdCookie[iiiili1])[lIIlilI1(0x5d8,'bGQl')](iI1i1ii=>iI1i1ii);!cookiesArr
|
|||
|
|
|||
|
// 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"])
|