faker2/jd_pointExgBeans.js

20 lines
99 KiB
JavaScript
Raw Normal View History

2024-06-28 07:27:40 +00:00
/*
活动名称积分兑换京豆 · 超级会员
活动链接https://cjhy-isv.isvjcloud.com/mc/wxPointShopView/pointExgBeans?venderId=<店铺id>&giftId=<活动id>
环境变量jd_pointExgBeans_activityUrl // 活动链接
jd_pointExgBeans_notify // 是否推送通知,默认不推送
7 7 7 7 *
*/
const $ = new Env('积分兑换京豆(超级会员)')
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
const notify = require('./function/sendJDNotify')
const getToken = require('./function/getToken')
var version_='jsjiami.com.v7';function lI1il1i1(_0x2dfbe3,_0x1d4523){const _0x1d3ed1=iii111l1();return lI1il1i1=function(_0x5becd3,_0x34a0cd){_0x5becd3=_0x5becd3-0x1ed;let _0x25033f=_0x1d3ed1[_0x5becd3];if(lI1il1i1['ikDOgf']===undefined){var _0x4da050=function(_0xfd27a9){const _0x2dfe09='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x20299f='',_0x5b4c1a='';for(let _0x1c6ca0=0x0,_0x10af45,_0x1dc9dd,_0x465cca=0x0;_0x1dc9dd=_0xfd27a9['charAt'](_0x465cca++);~_0x1dc9dd&&(_0x10af45=_0x1c6ca0%0x4?_0x10af45*0x40+_0x1dc9dd:_0x1dc9dd,_0x1c6ca0++%0x4)?_0x20299f+=String['fromCharCode'](0xff&_0x10af45>>(-0x2*_0x1c6ca0&0x6)):0x0){_0x1dc9dd=_0x2dfe09['indexOf'](_0x1dc9dd);}for(let _0xc5556c=0x0,_0x86c63d=_0x20299f['length'];_0xc5556c<_0x86c63d;_0xc5556c++){_0x5b4c1a+='%'+('00'+_0x20299f['charCodeAt'](_0xc5556c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5b4c1a);};lI1il1i1['xwJClH']=_0x4da050,_0x2dfbe3=arguments,lI1il1i1['ikDOgf']=!![];}const _0x28efb3=_0x1d3ed1[0x0],_0x120fd0=_0x5becd3+_0x28efb3,_0x3ad24c=_0x2dfbe3[_0x120fd0];return!_0x3ad24c?(_0x25033f=lI1il1i1['xwJClH'](_0x25033f),_0x2dfbe3[_0x120fd0]=_0x25033f):_0x25033f=_0x3ad24c,_0x25033f;},lI1il1i1(_0x2dfbe3,_0x1d4523);}const iliI1II=lI1il1i1;(function(ii1l1Ili,lilllII,lIIIil1I,i1IllllI,ii1IllI,iilIiliI,liii1Ill){return ii1l1Ili=ii1l1Ili>>0x9,iilIiliI='hs',liii1Ill='hs',function(iIili1i1,l11i1IiI,lil11iIl,lilli1Il,IllIi1I){const lilliIii=lI1il1i1;lilli1Il='tfi',iilIiliI=lilli1Il+iilIiliI,IllIi1I='up',liii1Ill+=IllIi1I,iilIiliI=lil11iIl(iilIiliI),liii1Ill=lil11iIl(liii1Ill),lil11iIl=0x0;const Illlllll=iIili1i1();while(!![]&&--i1IllllI+l11i1IiI){try{lilli1Il=parseInt(lilliIii(0x5af))/0x1+parseInt(lilliIii(0x338))/0x2*(-parseInt(lilliIii(0x1ef))/0x3)+parseInt(lilliIii(0x4fe))/0x4*(parseInt(lilliIii(0x466))/0x5)+-parseInt(lilliIii(0x4fd))/0x6*(-parseInt(lilliIii(0x355))/0x7)+parseInt(lilliIii(0x5a2))/0x8+-parseInt(lilliIii(0x598))/0x9+-parseInt(lilliIii(0x4f0))/0xa;}catch(li1Iil11){lilli1Il=lil11iIl;}finally{IllIi1I=Illlllll[iilIiliI]();if(ii1l1Ili<=i1IllllI)lil11iIl?ii1IllI?lilli1Il=IllIi1I:ii1IllI=IllIi1I:lil11iIl=IllIi1I;else{if(lil11iIl==ii1IllI['replace'](/[BLDTKbygXQAeMVGutwSHhE=]/g,'')){if(lilli1Il===l11i1IiI){Illlllll['un'+iilIiliI](IllIi1I);break;}Illlllll[liii1Ill](IllIi1I);}}}}}(lIIIil1I,lilllII,function(IIlI1llI,IiliIIli,i1liI,ilIlIIIl,I1111III,i1iliiiI,iIllllii){return IiliIIli='\x73\x70\x6c\x69\x74',IIlI1llI=arguments[0x0],IIlI1llI=IIlI1llI[IiliIIli](''),i1liI=`\x72\x65\x76\x65\x72\x73\x65`,IIlI1llI=IIlI1llI[i1liI]('\x76'),ilIlIIIl=`\x6a\x6f\x69\x6e`,(0x136c00,IIlI1llI[ilIlIIIl](''));});}(0x19200,0x34e10,iii111l1,0xcb),iii111l1)&&(version_=iii111l1);function iii111l1(){const liI11i11=(function(){return[...[version_,'ejsDjwLiAaTmBiEK.HVcggoHMmS.uvet7XVyGbQh==','B0TzuNm','yKz4yxy','qNzRy20','tLPxrwq','shHQBwq','z2fuA1K','t05Zz3C','v1vkBLa','qMvYr1e','vKn5qvq','yLjju2m','t1vtExC','rgTeDfG','ANLSBe0','D2Dqs00','yMDXB2q','Ewndrha','y0ToveW','zhPgEM4','v0jWv24','ChrSEKe','v25TA1G','Ce5vswi','AMrFCg9PBNrfEgDczwfUC19UB3rPzNK','5PYQ5BYa5AEl','z0vgtu8','tvnMrMu','sfH2uhe','vMf2sK0','z2v0zgf0yq','jNzLBMrLCKLKpq','AgLZugLU','r2PQwgK','q29VA2LLsKq','Ae1UCvO','v3rbCgG','Efj6DMK','jNn1yLr5Cgu9yxbW','yu5MwNa','yxbWBgLJyxrPB24VEc13D3CTzM9YBs11CMXLBMnVzgvK','BuHqug8','tvzSsLK','igDLDfnPBxbSzufJDeLUzM9wBYbbueNOR7FMSylLPlhOTkxVViZOR7FMO4dMN6xNVzhOT6/PH43OR5u','AhzSqu4','C3rYAw5NAwz5','C1rMshe','BhjhBfq','rKvtDMC','uhfNuK8','C2vJB25KtgLUzurLC2m','ugnqs3a','zKjnvxC','r2fdr2O','zer5t2W','5Rs75yQO57g75z6l77YA5zU65A6A5ywr5O2I5PwW6yEp','cUkBLo+4JYdNLkJMIlFNP6/LIiBKUi3OTRm','vgzfy0C','5OIq5yQF5ywr5O2I','Ahr0Chm6lY8','D0nICK8','qNr5zuK','5y+y5PU05yc8','zwr3uva','qxDrAhy','rwL5swy','Eg9ltuK','BwvZC2fNzq','r2LNrfK','yNHyAei','DgXlwfa','q0PdELa','vNjLv0y','Cg9PBNqY','EfH6vg8','ANvZAeC','qKfdAeS','r21Kzeu','z2v0uhjPEMu','Ahr0Chm6lY9JAMH5lwLZDI5PC3zQy2XVDwqUy29Tl2nVBw1VBI9Hy2nLC3nmB2C','tuP2swi','AxnoB2rL','BuDjzMm','y1rbD1u','rgDkvuu','jMjLyw5Ztgv2zwW9mq','5ywO6yoO6kkR6Akg5y+w','5Rs75yQO57g75z6l77YA55sO5OI36iEQ5A6A5lMj5ywr5O2I5PwW6yEp','swLPDem','zg5uvu
// 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"])