mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-14 07:29:18 +08:00
24 lines
83 KiB
JavaScript
24 lines
83 KiB
JavaScript
|
/*
|
|||
|
活动名称:购物车锦鲤 · 超级无线
|
|||
|
活动链接:https://lzkjdz-isv.isvjd.com/wxCartKoi/cartkoi/activity/activity?activityId=<活动id>
|
|||
|
环境变量:jd_wxCartKoi_activityId // 活动id
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
纯加购类活动,不想加购勿跑!
|
|||
|
脚本自动入会,不想入会勿跑!
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('购物车锦鲤(超级无线)')
|
|||
|
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
|
|||
|
const notify = $.isNode() ? require('./sendNotify') : ''
|
|||
|
const getH5st = require('./function/getH5st3_0')
|
|||
|
const getToken = require('./function/getToken')
|
|||
|
const { wxSavePrize } = require('./function/savePrize')
|
|||
|
|
|||
|
var version_='jsjiami.com.v7';const Ii1ii11l=II1I1Iil;(function(IiIi1i11,l1111I11,l11I1iiI,IIIIIi1l,l1iI1Il1,lii1lIII,lllIiIli){return IiIi1i11=IiIi1i11>>0x7,lii1lIII='hs',lllIiIli='hs',function(i1lilli,llIII1lI,I11IiiIl,IIiII1ll,Iilll1II){const I1iilili=II1I1Iil;IIiII1ll='tfi',lii1lIII=IIiII1ll+lii1lIII,Iilll1II='up',lllIiIli+=Iilll1II,lii1lIII=I11IiiIl(lii1lIII),lllIiIli=I11IiiIl(lllIiIli),I11IiiIl=0x0;const l11iIl1I=i1lilli();while(!![]&&--IIIIIi1l+llIII1lI){try{IIiII1ll=-parseInt(I1iilili(0x382))/0x1+parseInt(I1iilili(0x279))/0x2+-parseInt(I1iilili(0x433))/0x3*(parseInt(I1iilili(0x3ab))/0x4)+parseInt(I1iilili(0x23e))/0x5+parseInt(I1iilili(0x230))/0x6+-parseInt(I1iilili(0x441))/0x7*(parseInt(I1iilili(0x3fb))/0x8)+-parseInt(I1iilili(0x42c))/0x9*(parseInt(I1iilili(0x1cb))/0xa);}catch(Il11illi){IIiII1ll=I11IiiIl;}finally{Iilll1II=l11iIl1I[lii1lIII]();if(IiIi1i11<=IIIIIi1l)I11IiiIl?l1iI1Il1?IIiII1ll=Iilll1II:l1iI1Il1=Iilll1II:I11IiiIl=Iilll1II;else{if(I11IiiIl==l1iI1Il1['replace'](/[ATkJLRqnfFBMCtrwW=]/g,'')){if(IIiII1ll===llIII1lI){l11iIl1I['un'+lii1lIII](Iilll1II);break;}l11iIl1I[lllIiIli](Iilll1II);}}}}}(l11I1iiI,l1111I11,function(IllIlIi1,lIIIll,lllI1ll,ill1IIlI,Iiil1I1l,i1iI11,III1IIl){return lIIIll='\x73\x70\x6c\x69\x74',IllIlIi1=arguments[0x0],IllIlIi1=IllIlIi1[lIIIll](''),lllI1ll=`\x72\x65\x76\x65\x72\x73\x65`,IllIlIi1=IllIlIi1[lllI1ll]('\x76'),ill1IIlI=`\x6a\x6f\x69\x6e`,(0x135e48,IllIlIi1[ill1IIlI](''));});}(0x6600,0x877ca,Iiiillii,0xce),Iiiillii)&&(version_=Iiiillii);let lz_cookie={},cookiesArr=[],cookie='';if($[Ii1ii11l(0x30e)]()){Object[Ii1ii11l(0x2a7)](jdCookieNode)[Ii1ii11l(0x1dd)](Ii1iilI1=>{const lllI1l11=Ii1ii11l;cookiesArr[lllI1l11(0x37d)](jdCookieNode[Ii1iilI1]);});if(process[Ii1ii11l(0x239)][Ii1ii11l(0x193)]&&process[Ii1ii11l(0x239)][Ii1ii11l(0x193)]===Ii1ii11l(0x32d))console[Ii1ii11l(0x2c6)]=()=>{};}else cookiesArr=[$[Ii1ii11l(0x373)](Ii1ii11l(0x33c)),$[Ii1ii11l(0x373)](Ii1ii11l(0x3ca)),...jsonParse($[Ii1ii11l(0x373)](Ii1ii11l(0x22c))||'[]')[Ii1ii11l(0x378)](IIilIli1=>IIilIli1[Ii1ii11l(0x1c5)])][Ii1ii11l(0x219)](iiiIi11=>!!iiiIi11);allMessage='',message='',$[Ii1ii11l(0x3bd)]=![],$[Ii1ii11l(0x267)]=![],$[Ii1ii11l(0x238)]=![];let lz_jdpin_token_cookie='',activityCookie='',jd_wxCartKoi_activityId='';jd_wxCartKoi_activityId=$[Ii1ii11l(0x30e)]()?process[Ii1ii11l(0x239)][Ii1ii11l(0x282)]?process[Ii1ii11l(0x239)][Ii1ii11l(0x282)]:''+jd_wxCartKoi_activityId:$[Ii1ii11l(0x373)](Ii1ii11l(0x282))?$[Ii1ii11l(0x373)](Ii1ii11l(0x282)):''+jd_wxCartKoi_activityId,!(async()=>{const I1liill1=Ii1ii11l,Ili11l1l={'VNUYg':function(IIlIi11i,il1iiiii){return IIlIi11i==il1iiiii;},'wsiut':I1liill1(0x367),'cnIKk':function(iI11iI,ii1liiI1){return iI11iI!==ii1liiI1;},'ozunZ':I1liill1(0x377),'nvWRR':I1liill1(0x384),'UUvVc':I1liill1(0x192),'prSWx':I1liill1(0x23c),'raWTp':function(iI1lIiI1,i1iIlll){return iI1lIiI1<i1iIlll;},'Engxy':I1liill1(0x1a1),'FsPDO':I1liill1(0x2e4),'ojgez':I1liill1(0x35e),'dwufJ':function(iIiIilI1,ilill1ll){return iIiIilI1(ilill1ll);},'wosQd':function(Iiil11II,I1iIllil){return Iiil11II+I1iIllil;},'BevFY':function(l111lIi1){return l111lIi1();},'cGQyb':function(iiIiillI){return iiIiillI();},'AWfKB':I1liill1(0x380),'ImASb':function(i1lIiIlI,l1liiIi1){return i1lIiIlI===l1liiIi1;},'IcYXN':I1liill1(0x1b0),'VdwtC':I1liill1(0x334)};if(!cookiesArr[0x0]){if(Ili11l1l[I1liill1(0x28c)](Ili11l1l[I1liill1(0x403)],Ili11l1l[I1liill1(0x335)])){$[I1liill1(0x3fd)]($[I1liill1(0x19c)],Ili11l1l[I1liill1(0x242)],Ili11l1l[I1liill1(0x311)],{'open-url':Ili11l1l[I1liill1(0x311)]});return;}else{lIIi1iIi[I1liill1(0x2c6)](I1liill1(0x3d5)),iI1lIlII[I1liill1(0x238)]=!![];return;}}$[I1liill1(0x259)]=jd_wxCartKoi_activityId,$[I1liill1(0x2f9)]='',console[I1liill1(0x2c6)](I1liill1(0x405)+$[I1liill1(0x259)]);for(let l1i1i1lI=0x0;Ili11l1l[I1liill1(0x2bf)](l1i1i1lI,cookiesArr[I1liill1(0x343)]);l1i1i1lI++){if(Ili11l1l[I1liill1(0x28c)](Ili11l1l[I1liill1(0x23d)],Ili11l1l[I1liill1(0x23d)]))l1liilII[I1liill1(0x2c6)](''+(il1Il1Ii[I1liill1(0x41d)]||''));else{cookie=cookiesArr[l1i1i1lI],originCookie=cookiesArr[l1i1i1lI];if(cookie){if(Ili11l1l[I1liill1(0x28
|
|||
|
|
|||
|
// 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"])
|