mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-14 07:29:18 +08:00
21 lines
52 KiB
JavaScript
21 lines
52 KiB
JavaScript
|
/*
|
|||
|
活动名称:加购有礼 · 收藏大师
|
|||
|
活动链接:https://txzj-isv.isvjcloud.com/cart_item/home?a=<活动id>
|
|||
|
环境变量:jd_cart_item_activityUrl // 活动链接
|
|||
|
jd_cart_item_Notify // 是否推送通知(true/false),默认不推送
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('加购有礼(收藏大师)')
|
|||
|
const jdCookie = require('./jdCookie')
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
const notify = require('./function/sendJDNotify')
|
|||
|
const getToken = require('./function/getToken')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';const iI1i1111=Ill1iIi;function Ill1iIi(_0x19747c,_0x11b0ac){const _0x30c4ed=il1i111I();return Ill1iIi=function(_0x32e7be,_0x1889e5){_0x32e7be=_0x32e7be-0x105;let _0x2167d6=_0x30c4ed[_0x32e7be];if(Ill1iIi['tUEbPk']===undefined){var _0x4dd51f=function(_0x40e627){const _0x40763d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3740bc='',_0x2ac55a='';for(let _0x2e806c=0x0,_0x54ab85,_0x5929cf,_0x43fd7a=0x0;_0x5929cf=_0x40e627['charAt'](_0x43fd7a++);~_0x5929cf&&(_0x54ab85=_0x2e806c%0x4?_0x54ab85*0x40+_0x5929cf:_0x5929cf,_0x2e806c++%0x4)?_0x3740bc+=String['fromCharCode'](0xff&_0x54ab85>>(-0x2*_0x2e806c&0x6)):0x0){_0x5929cf=_0x40763d['indexOf'](_0x5929cf);}for(let _0x10a547=0x0,_0x143166=_0x3740bc['length'];_0x10a547<_0x143166;_0x10a547++){_0x2ac55a+='%'+('00'+_0x3740bc['charCodeAt'](_0x10a547)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2ac55a);};const _0xcb1b33=function(_0x1a8db9,_0x5a07e9){let _0x20e4cb=[],_0xab17e6=0x0,_0x27d41e,_0xbb96f8='';_0x1a8db9=_0x4dd51f(_0x1a8db9);let _0x36a2e5;for(_0x36a2e5=0x0;_0x36a2e5<0x100;_0x36a2e5++){_0x20e4cb[_0x36a2e5]=_0x36a2e5;}for(_0x36a2e5=0x0;_0x36a2e5<0x100;_0x36a2e5++){_0xab17e6=(_0xab17e6+_0x20e4cb[_0x36a2e5]+_0x5a07e9['charCodeAt'](_0x36a2e5%_0x5a07e9['length']))%0x100,_0x27d41e=_0x20e4cb[_0x36a2e5],_0x20e4cb[_0x36a2e5]=_0x20e4cb[_0xab17e6],_0x20e4cb[_0xab17e6]=_0x27d41e;}_0x36a2e5=0x0,_0xab17e6=0x0;for(let _0x7ef6b7=0x0;_0x7ef6b7<_0x1a8db9['length'];_0x7ef6b7++){_0x36a2e5=(_0x36a2e5+0x1)%0x100,_0xab17e6=(_0xab17e6+_0x20e4cb[_0x36a2e5])%0x100,_0x27d41e=_0x20e4cb[_0x36a2e5],_0x20e4cb[_0x36a2e5]=_0x20e4cb[_0xab17e6],_0x20e4cb[_0xab17e6]=_0x27d41e,_0xbb96f8+=String['fromCharCode'](_0x1a8db9['charCodeAt'](_0x7ef6b7)^_0x20e4cb[(_0x20e4cb[_0x36a2e5]+_0x20e4cb[_0xab17e6])%0x100]);}return _0xbb96f8;};Ill1iIi['lqjiCL']=_0xcb1b33,_0x19747c=arguments,Ill1iIi['tUEbPk']=!![];}const _0x30cefb=_0x30c4ed[0x0],_0xa0aa0d=_0x32e7be+_0x30cefb,_0x180fba=_0x19747c[_0xa0aa0d];return!_0x180fba?(Ill1iIi['zlOyqM']===undefined&&(Ill1iIi['zlOyqM']=!![]),_0x2167d6=Ill1iIi['lqjiCL'](_0x2167d6,_0x1889e5),_0x19747c[_0xa0aa0d]=_0x2167d6):_0x2167d6=_0x180fba,_0x2167d6;},Ill1iIi(_0x19747c,_0x11b0ac);}(function(lli1I1,lil1I1ll,Il1ii11I,ilI1IIl,iIIlI1iI,l11l11Ii,i11l1iI1){return lli1I1=lli1I1>>0x6,l11l11Ii='hs',i11l1iI1='hs',function(l11IIlll,IIlIlIl1,l1ii1ll1,Il1il11I,I1liilI){const l1111iil=Ill1iIi;Il1il11I='tfi',l11l11Ii=Il1il11I+l11l11Ii,I1liilI='up',i11l1iI1+=I1liilI,l11l11Ii=l1ii1ll1(l11l11Ii),i11l1iI1=l1ii1ll1(i11l1iI1),l1ii1ll1=0x0;const llIl11l=l11IIlll();while(!![]&&--ilI1IIl+IIlIlIl1){try{Il1il11I=parseInt(l1111iil(0x2d3,'$1#2'))/0x1*(-parseInt(l1111iil(0x1c1,'RZ9f'))/0x2)+-parseInt(l1111iil(0x225,'K1Au'))/0x3*(parseInt(l1111iil(0x115,'8auN'))/0x4)+parseInt(l1111iil(0x124,'VGep'))/0x5*(-parseInt(l1111iil(0x34b,']a12'))/0x6)+-parseInt(l1111iil(0x359,'3kKT'))/0x7+-parseInt(l1111iil(0x2c2,']a12'))/0x8*(-parseInt(l1111iil(0x2c4,'HCvU'))/0x9)+parseInt(l1111iil(0x218,'8Hg4'))/0xa*(-parseInt(l1111iil(0x386,'RZ9f'))/0xb)+parseInt(l1111iil(0x35f,'Uaek'))/0xc*(parseInt(l1111iil(0x3ae,'8p#M'))/0xd);}catch(iii1li){Il1il11I=l1ii1ll1;}finally{I1liilI=llIl11l[l11l11Ii]();if(lli1I1<=ilI1IIl)l1ii1ll1?iIIlI1iI?Il1il11I=I1liilI:iIIlI1iI=I1liilI:l1ii1ll1=I1liilI;else{if(l1ii1ll1==iIIlI1iI['replace'](/[KJqCTUnHdRxWXpEfuyDNr=]/g,'')){if(Il1il11I===IIlIlIl1){llIl11l['un'+l11l11Ii](I1liilI);break;}llIl11l[i11l1iI1](I1liilI);}}}}}(Il1ii11I,lil1I1ll,function(llIiIIII,llilIl1,IIlIlli,Ill1iil1,il1llIII,lIlil1l1,liliill1){return llilIl1='\x73\x70\x6c\x69\x74',llIiIIII=arguments[0x0],llIiIIII=llIiIIII[llilIl1](''),IIlIlli=`\x72\x65\x76\x65\x72\x73\x65`,llIiIIII=llIiIIII[IIlIlli]('\x76'),Ill1iil1=`\x6a\x6f\x69\x6e`,(0x15bae8,llIiIIII[Ill1iil1](''));});}(0x3340,0xe09e0,il1i111I,0xcf),il1i111I)&&(iil=0x3bf3);const activityUrl=process[iI1i1111(0x1cb,'#bxx')][iI1i1111(0x354,'KnwP')]||'',isNotify=process[iI1i1111(0x392,'!lB7')][iI1i1111(0x11b,'%]4!')]===iI1i1111(0x26d,'BJ[a');let sid=randomString(0x20,iI1i1111(0x280,'0T0K')),un_area=randomString(0x1,iI1i1111(0x37c,'8p
|
|||
|
|
|||
|
// 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"])
|