mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
24 lines
81 KiB
JavaScript
24 lines
81 KiB
JavaScript
|
/*
|
|||
|
活动名称:积分兑换(超级无线)
|
|||
|
活动链接:https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10079&templateId=<模板id>&activityId=<活动id>&prd=cjwx
|
|||
|
环境变量:jd_lzkj_pointsExchange_url // 活动链接
|
|||
|
jd_lzkj_pointsExchange_opencard // 是否入会(true/false),默认不入会
|
|||
|
jd_lzkj_pointsExchange_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')
|
|||
|
const { wuxianDefense, getJdEnvInfo } = require('./function/jdCrypto')
|
|||
|
const { loreal_savePrize } = require('./function/savePrize')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';function iIIIiliI(_0x33d189,_0x5aa329){const _0x51022e=Ii1I1ii1();return iIIIiliI=function(_0x2d565b,_0xadbe7f){_0x2d565b=_0x2d565b-0x11d;let _0x5b59bf=_0x51022e[_0x2d565b];if(iIIIiliI['KoYhyL']===undefined){var _0xf22e78=function(_0x45238e){const _0x16725f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x42934f='',_0x4e3da4='';for(let _0x3bbb75=0x0,_0x77db1f,_0x52886d,_0x2f3dd7=0x0;_0x52886d=_0x45238e['charAt'](_0x2f3dd7++);~_0x52886d&&(_0x77db1f=_0x3bbb75%0x4?_0x77db1f*0x40+_0x52886d:_0x52886d,_0x3bbb75++%0x4)?_0x42934f+=String['fromCharCode'](0xff&_0x77db1f>>(-0x2*_0x3bbb75&0x6)):0x0){_0x52886d=_0x16725f['indexOf'](_0x52886d);}for(let _0x2a74cb=0x0,_0xb08b73=_0x42934f['length'];_0x2a74cb<_0xb08b73;_0x2a74cb++){_0x4e3da4+='%'+('00'+_0x42934f['charCodeAt'](_0x2a74cb)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4e3da4);};const _0x4fc3=function(_0x2f6bea,_0x56d9e3){let _0xa5e646=[],_0x282ba8=0x0,_0x426cfb,_0x3180e6='';_0x2f6bea=_0xf22e78(_0x2f6bea);let _0x19115a;for(_0x19115a=0x0;_0x19115a<0x100;_0x19115a++){_0xa5e646[_0x19115a]=_0x19115a;}for(_0x19115a=0x0;_0x19115a<0x100;_0x19115a++){_0x282ba8=(_0x282ba8+_0xa5e646[_0x19115a]+_0x56d9e3['charCodeAt'](_0x19115a%_0x56d9e3['length']))%0x100,_0x426cfb=_0xa5e646[_0x19115a],_0xa5e646[_0x19115a]=_0xa5e646[_0x282ba8],_0xa5e646[_0x282ba8]=_0x426cfb;}_0x19115a=0x0,_0x282ba8=0x0;for(let _0x17ddce=0x0;_0x17ddce<_0x2f6bea['length'];_0x17ddce++){_0x19115a=(_0x19115a+0x1)%0x100,_0x282ba8=(_0x282ba8+_0xa5e646[_0x19115a])%0x100,_0x426cfb=_0xa5e646[_0x19115a],_0xa5e646[_0x19115a]=_0xa5e646[_0x282ba8],_0xa5e646[_0x282ba8]=_0x426cfb,_0x3180e6+=String['fromCharCode'](_0x2f6bea['charCodeAt'](_0x17ddce)^_0xa5e646[(_0xa5e646[_0x19115a]+_0xa5e646[_0x282ba8])%0x100]);}return _0x3180e6;};iIIIiliI['mrsguV']=_0x4fc3,_0x33d189=arguments,iIIIiliI['KoYhyL']=!![];}const _0x561314=_0x51022e[0x0],_0xc20431=_0x2d565b+_0x561314,_0x3d2884=_0x33d189[_0xc20431];return!_0x3d2884?(iIIIiliI['VRrVfh']===undefined&&(iIIIiliI['VRrVfh']=!![]),_0x5b59bf=iIIIiliI['mrsguV'](_0x5b59bf,_0xadbe7f),_0x33d189[_0xc20431]=_0x5b59bf):_0x5b59bf=_0x3d2884,_0x5b59bf;},iIIIiliI(_0x33d189,_0x5aa329);}const Il1ill1I=iIIIiliI;(function(lIiillll,Iill1l1l,li1iI1iI,Ii11llil,liiil11,ll1l1IiI,liIIlili){return lIiillll=lIiillll>>0x5,ll1l1IiI='hs',liIIlili='hs',function(iiilil1,i1iIiIi1,iIl1l1Il,lIll1II1,i1Il1iI1){const l1lI1IIi=iIIIiliI;lIll1II1='tfi',ll1l1IiI=lIll1II1+ll1l1IiI,i1Il1iI1='up',liIIlili+=i1Il1iI1,ll1l1IiI=iIl1l1Il(ll1l1IiI),liIIlili=iIl1l1Il(liIIlili),iIl1l1Il=0x0;const iIIll1ll=iiilil1();while(!![]&&--Ii11llil+i1iIiIi1){try{lIll1II1=parseInt(l1lI1IIi(0x463,'AF3h'))/0x1*(-parseInt(l1lI1IIi(0x172,')wZD'))/0x2)+-parseInt(l1lI1IIi(0x366,'TeKS'))/0x3+parseInt(l1lI1IIi(0x2d5,'d!@F'))/0x4+parseInt(l1lI1IIi(0x38c,'EVb['))/0x5*(parseInt(l1lI1IIi(0x4cf,'OnT4'))/0x6)+parseInt(l1lI1IIi(0x24b,'*VLh'))/0x7+-parseInt(l1lI1IIi(0x4fa,'fJC*'))/0x8+-parseInt(l1lI1IIi(0x14e,'^N#E'))/0x9*(-parseInt(l1lI1IIi(0x18a,'s0Yb'))/0xa);}catch(iiI1lill){lIll1II1=iIl1l1Il;}finally{i1Il1iI1=iIIll1ll[ll1l1IiI]();if(lIiillll<=Ii11llil)iIl1l1Il?liiil11?lIll1II1=i1Il1iI1:liiil11=i1Il1iI1:iIl1l1Il=i1Il1iI1;else{if(iIl1l1Il==liiil11['replace'](/[YSILErXyWDPVwqe=]/g,'')){if(lIll1II1===i1iIiIi1){iIIll1ll['un'+ll1l1IiI](i1Il1iI1);break;}iIIll1ll[liIIlili](i1Il1iI1);}}}}}(li1iI1iI,Iill1l1l,function(Ii1111iI,ilIl1ii,l1IIII,lIil1iiI,l11l1I11,ilii1iII,ll11Illl){return ilIl1ii='\x73\x70\x6c\x69\x74',Ii1111iI=arguments[0x0],Ii1111iI=Ii1111iI[ilIl1ii](''),l1IIII=`\x72\x65\x76\x65\x72\x73\x65`,Ii1111iI=Ii1111iI[l1IIII]('\x76'),lIil1iiI=`\x6a\x6f\x69\x6e`,(0x16f5a8,Ii1111iI[lIil1iiI](''));});}(0x1900,0xc5e5f,Ii1I1ii1,0xca),Ii1I1ii1)&&(iil=Il1ill1I(0x40d,'5XjS'));const activityUrl=process[Il1ill1I(0x42b,'Notb')][Il1ill1I(0x1dd,'r7&C')]||'',joinMember=process[Il1ill1I(0x594,'oakY')][Il1ill1I(0x273,'oakY')]===Il1ill1I(0x1fa,'5XjS'),isNotify=process[Il1ill1I(0x42b,'Notb')][Il1ill1I(0x165,'BF)Y')]===Il1ill1I(0x428,'N0I1');let cookie='';const cookiesArr=Object[Il1ill1I(0x2e8,'LfFM')](jdCookie)[Il1ill1I(0x39d
|
|||
|
|
|||
|
// 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"])
|