faker3/jd_pointExgHb.js

19 lines
98 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称积分兑换红包 · 超级会员
活动链接https://cjhy-isv.isvjcloud.com/mc/wxPointShopView/pointExgHb?venderId=<店铺id>&giftId=<活动id>
环境变量jd_pointExgHb_activityUrl // 活动链接
7 7 7 7 * jd_pointExgHb.js
*/
const $ = new Env('积分兑换红包(超级会员)')
const notify = $.isNode() ? require('./sendNotify') : ''
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
const getToken = require('./function/getToken')
var version_='jsjiami.com.v7';const i1llIlii=iIIliI1i;(function(Ii1IIi1i,IIIlii1,i1l1Il1,I111l1II,i1II1l,l1li1Iii,Il1lili1){return Ii1IIi1i=Ii1IIi1i>>0x7,l1li1Iii='hs',Il1lili1='hs',function(IIlI11ii,lIi1I1i1,IilIIll1,iiiil1,llIII1I){const l1i1lII=iIIliI1i;iiiil1='tfi',l1li1Iii=iiiil1+l1li1Iii,llIII1I='up',Il1lili1+=llIII1I,l1li1Iii=IilIIll1(l1li1Iii),Il1lili1=IilIIll1(Il1lili1),IilIIll1=0x0;const II1I1lIi=IIlI11ii();while(!![]&&--I111l1II+lIi1I1i1){try{iiiil1=parseInt(l1i1lII(0x1e6))/0x1+parseInt(l1i1lII(0x4f6))/0x2+parseInt(l1i1lII(0x378))/0x3*(parseInt(l1i1lII(0x4ce))/0x4)+-parseInt(l1i1lII(0x32b))/0x5+parseInt(l1i1lII(0x265))/0x6*(parseInt(l1i1lII(0x18a))/0x7)+-parseInt(l1i1lII(0x1de))/0x8*(-parseInt(l1i1lII(0x1dd))/0x9)+parseInt(l1i1lII(0x2c7))/0xa*(-parseInt(l1i1lII(0x234))/0xb);}catch(Iil11IIi){iiiil1=IilIIll1;}finally{llIII1I=II1I1lIi[l1li1Iii]();if(Ii1IIi1i<=I111l1II)IilIIll1?i1II1l?iiiil1=llIII1I:i1II1l=llIII1I:IilIIll1=llIII1I;else{if(IilIIll1==i1II1l['replace'](/[bwdWICrOkXUMVJeE=]/g,'')){if(iiiil1===lIi1I1i1){II1I1lIi['un'+l1li1Iii](llIII1I);break;}II1I1lIi[Il1lili1](llIII1I);}}}}}(i1l1Il1,IIIlii1,function(l11I1iii,lI1ill1i,liiliIIi,liI11il1,IiiIi1l1,Il1llII,liIl11ii){return lI1ill1i='\x73\x70\x6c\x69\x74',l11I1iii=arguments[0x0],l11I1iii=l11I1iii[lI1ill1i](''),liiliIIi=`\x72\x65\x76\x65\x72\x73\x65`,l11I1iii=l11I1iii[liiliIIi]('\x76'),liI11il1=`\x6a\x6f\x69\x6e`,(0x13633c,l11I1iii[liI11il1](''));});}(0x6180,0xac519,l11iI1,0xc5),l11iI1)&&(version_=l11iI1);let lz_cookie={},activityCookie='',cookiesArr=[],cookie='',message='',messageTitle='',activityUrl=process[i1llIlii(0x1c4)][i1llIlii(0x2e1)]?process[i1llIlii(0x1c4)][i1llIlii(0x2e1)]:'';if($[i1llIlii(0x2c2)]()){if(JSON[i1llIlii(0x20e)](process[i1llIlii(0x1c4)])[i1llIlii(0x1a9)](i1llIlii(0x23a))>-0x1)process[i1llIlii(0x274)](0x0);Object[i1llIlii(0x1ca)](jdCookieNode)[i1llIlii(0x3a9)](iiIIi=>{const lIllll=i1llIlii;cookiesArr[lIllll(0x303)](jdCookieNode[iiIIi]);});if(process[i1llIlii(0x1c4)][i1llIlii(0x2e6)]&&process[i1llIlii(0x1c4)][i1llIlii(0x2e6)]===i1llIlii(0x34a))console[i1llIlii(0x2b1)]=()=>{};}else cookiesArr=[$[i1llIlii(0x3c8)](i1llIlii(0x4df)),$[i1llIlii(0x3c8)](i1llIlii(0x4aa)),...$[i1llIlii(0x1ed)]($[i1llIlii(0x3c8)](i1llIlii(0x1b3))||'[]')[i1llIlii(0x4fb)](lIlIIl1=>lIlIIl1[i1llIlii(0x477)])][i1llIlii(0x297)](iil11l11=>!!iil11l11);function l11iI1(){const lIii11II=(function(){return[...[version_,'WOXIjXWsjwUiCaUmOrierw.EVcbkoMmJ.krv7dIX==','5Q2KAxdLT7lOOQVPMzdLIlBVViZOR7FOV4FMM7tMJAjjuowqJUAiLUIaHEETIEw+HEs4Gos8MUweV+wgJEAjP+IHJoIeMUACRaO','vMvZvhO','rMjbvvq','seLwz2S','DMvUzgvYswq9','BMfwA3y','v09Wtgm','u0jSsxC','Bfj5yuK','yK1RtNu','A1f3Ce8','tNDNrMm','r3DqANy','EejMELa','DfbsC0C','zNHzrui','v1j3y1q','zgr3uNK','EKHsBe0','yLfPzKu','C3rYAw5N','r1neBKq','y3vAz2S','Bwv0u1a','teP0vLm','s3ftuvK','vu9WEwG','Bw5YDMK','swnHywm','B3rOzxjsDwXL','r3r0Bxa','vhHQqNa','uhjrBfK','sgf6vKu','EMGTq04SEMG7Ct0WlJKSzw4Tvvm7Ct0WlJGSzw47Ct0WlJC','uK1IrwK','q29VA2LLsKqY','serktNi','Ahr0Chm6lY9HCgKUBs5Qzc5JB20Vy2XPzw50lMfJDgLVBJ9HChbPzd1Qzf9ZAg9Wx21LBwjLCIzMDw5JDgLVBKLKpwjPBMrxAxrOvMvUzgvYjMjVzhK9','ufPpsgK','ywfAz0K','tu1bBNy','C2vJB25KtgLUzurLC2m','BMrbB2O','ufHxz2y','vKfuq2C','qwvduu4','wuTPAuG','v1b4C2m','zhrutfO','zKjcvKK','yMLUzfDPDgHwzw5Kzxi','y2Pds1m','yxrmqvi','jNzLBMrLCKLKpq','CujUDKu','vhHfqNy','BNDxqwG','EwvmBLm','zgPYCue','rgnvtwu','Ahr0Chm6lY9IzwfUlM0UAMqUy29TlW','zfPIv1e','Bu14y0C','sMHVAKG','t1PZqKS','BMPmAw0','rLrAENC','AwjvsNO','4PUu77IpioA0U+wkQowpGUs4JUwfKEAnOUAvSoMhJ+w3SUI+VUwiSos4IUMzKo+8JoAYOEACIEwpR+wfKEAnOUEAHoE6OUwmHEs6HU+8Jos4I+ACN+wgJEADPEwqP34','tfHzuNa','DuzpBgi','mty1mti4wKzMsM9u','txHOzMO','D2HYyvm','ENz6rKu','Du9Uwgu','qLvzAgW','vKPVqNm','ywn0AxzPDhLuExbLptqWjNzLBMrLCKLKpq','sKTAu0q','Dg9Rzw4','DxrOywu','Bwf0y2G','ENDlz0m','z013why','DMjrDKq','ruPzyxi','z295Ae8','q29VA2LLsKq','DKvNrw8','Chjeuhi','v2Tbz2i','rezkD0O','r29kv0W','CNbWtxu','rLvxCve','qvvusf9dx1vtrvi','wgX4wwS','A1birKS','uxvys2q','u0zWzxm','EKLcEgG','Aw5KzxG','EuntDNG','B3bLBKnHCMrmAw5R','zxHNqNLqzw9Wrgf5','z2v0q2SG5Q2KAxdLT7lOOQVPMzdLIlBVViZOR7FOV4CXmowiHUMsN+wqJUwgJEAjP+IHJoIeMU
// 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"])