KR/jd_jinggeng_showTaskDraw.js

17 lines
85 KiB
JavaScript
Raw Normal View History

2023-07-28 10:10:43 +08:00
/*
活动名称九宫格抽奖 · 京耕
活动链接https://jinggeng-isv.isvjcloud.com/ql/front/showTaskDraw?id=<活动id>&user_id=<店铺id>
环境变量jd_jinggeng_showTaskDraw_activityUrl // 活动链接
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#九宫格抽奖
1 1 1 1 * jd_jinggeng_showTaskDraw.js, tag=九宫格抽奖, enabled=true
*/
const $ = new Env('九宫格抽奖(京耕)')
2023-07-28 10:29:22 +08:00
var version_='jsjiami.com.v7';function iii1II(_0x3718a6,_0x134e3f){const _0x5eac95=Iii11l();return iii1II=function(_0x37f98f,_0x29b15d){_0x37f98f=_0x37f98f-0x151;let _0x3ef12f=_0x5eac95[_0x37f98f];if(iii1II['EnPYxC']===undefined){var _0x474459=function(_0x2d37e7){const _0x358e76='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x200d3a='',_0x4a75bc='';for(let _0x1075d3=0x0,_0x249df5,_0x59cee9,_0x1aad65=0x0;_0x59cee9=_0x2d37e7['charAt'](_0x1aad65++);~_0x59cee9&&(_0x249df5=_0x1075d3%0x4?_0x249df5*0x40+_0x59cee9:_0x59cee9,_0x1075d3++%0x4)?_0x200d3a+=String['fromCharCode'](0xff&_0x249df5>>(-0x2*_0x1075d3&0x6)):0x0){_0x59cee9=_0x358e76['indexOf'](_0x59cee9);}for(let _0x4f844b=0x0,_0x52a26a=_0x200d3a['length'];_0x4f844b<_0x52a26a;_0x4f844b++){_0x4a75bc+='%'+('00'+_0x200d3a['charCodeAt'](_0x4f844b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4a75bc);};const _0xb0bd91=function(_0x2491ad,_0x33e9f0){let _0x5894e6=[],_0x49eab5=0x0,_0x5692b6,_0x5c3686='';_0x2491ad=_0x474459(_0x2491ad);let _0x1e6aad;for(_0x1e6aad=0x0;_0x1e6aad<0x100;_0x1e6aad++){_0x5894e6[_0x1e6aad]=_0x1e6aad;}for(_0x1e6aad=0x0;_0x1e6aad<0x100;_0x1e6aad++){_0x49eab5=(_0x49eab5+_0x5894e6[_0x1e6aad]+_0x33e9f0['charCodeAt'](_0x1e6aad%_0x33e9f0['length']))%0x100,_0x5692b6=_0x5894e6[_0x1e6aad],_0x5894e6[_0x1e6aad]=_0x5894e6[_0x49eab5],_0x5894e6[_0x49eab5]=_0x5692b6;}_0x1e6aad=0x0,_0x49eab5=0x0;for(let _0x1809f7=0x0;_0x1809f7<_0x2491ad['length'];_0x1809f7++){_0x1e6aad=(_0x1e6aad+0x1)%0x100,_0x49eab5=(_0x49eab5+_0x5894e6[_0x1e6aad])%0x100,_0x5692b6=_0x5894e6[_0x1e6aad],_0x5894e6[_0x1e6aad]=_0x5894e6[_0x49eab5],_0x5894e6[_0x49eab5]=_0x5692b6,_0x5c3686+=String['fromCharCode'](_0x2491ad['charCodeAt'](_0x1809f7)^_0x5894e6[(_0x5894e6[_0x1e6aad]+_0x5894e6[_0x49eab5])%0x100]);}return _0x5c3686;};iii1II['bxzcCx']=_0xb0bd91,_0x3718a6=arguments,iii1II['EnPYxC']=!![];}const _0x5392f3=_0x5eac95[0x0],_0x3bf259=_0x37f98f+_0x5392f3,_0x214b44=_0x3718a6[_0x3bf259];return!_0x214b44?(iii1II['WRghlM']===undefined&&(iii1II['WRghlM']=!![]),_0x3ef12f=iii1II['bxzcCx'](_0x3ef12f,_0x29b15d),_0x3718a6[_0x3bf259]=_0x3ef12f):_0x3ef12f=_0x214b44,_0x3ef12f;},iii1II(_0x3718a6,_0x134e3f);}const il1lIi=iii1II;(function(ll1l1l,l1II11,iIl1Ii,ll1l1i,iI1iI1,i1IIii,i1IIil){return ll1l1l=ll1l1l>>0x7,i1IIii='hs',i1IIil='hs',function(il111l,iIl1Il,il111i,iI1iII,l111Ii){const iIl1II=iii1II;iI1iII='tfi',i1IIii=iI1iII+i1IIii,l111Ii='up',i1IIil+=l111Ii,i1IIii=il111i(i1IIii),i1IIil=il111i(i1IIil),il111i=0x0;const lI1i11=il111l();while(!![]&&--ll1l1i+iIl1Il){try{iI1iII=parseInt(iIl1II(0x2d6,'OuLq'))/0x1*(parseInt(iIl1II(0x1ee,'ZMS6'))/0x2)+-parseInt(iIl1II(0x25e,'*jVG'))/0x3*(parseInt(iIl1II(0x37c,'wKEL'))/0x4)+-parseInt(iIl1II(0x174,'ShWf'))/0x5+-parseInt(iIl1II(0x21e,'f]n%'))/0x6+-parseInt(iIl1II(0x343,'mNSS'))/0x7+-parseInt(iIl1II(0x385,'s2B@'))/0x8+parseInt(iIl1II(0x346,'IY8a'))/0x9;}catch(lili1I){iI1iII=il111i;}finally{l111Ii=lI1i11[i1IIii]();if(ll1l1l<=ll1l1i)il111i?iI1iI1?iI1iII=l111Ii:iI1iI1=l111Ii:il111i=l111Ii;else{if(il111i==iI1iI1['replace'](/[CRIlNFdLXKASWrbDTpuJwq=]/g,'')){if(iI1iII===iIl1Il){lI1i11['un'+i1IIii](l111Ii);break;}lI1i11[i1IIil](l111Ii);}}}}}(iIl1Ii,l1II11,function(i1iiII,l111Il,I1III,l1II1I,iiliI1,iIi11I,iiii11){return l111Il='\x73\x70\x6c\x69\x74',i1iiII=arguments[0x0],i1iiII=i1iiII[l111Il](''),I1III='\x72\x65\x76\x65\x72\x73\x65',i1iiII=i1iiII[I1III]('\x76'),l1II1I='\x6a\x6f\x69\x6e',(0x1368af,i1iiII[l1II1I](''));});}(0x6300,0xb79d5,Iii11l,0xc8),Iii11l)&&(version_=Iii11l);const ilIlil=$[il1lIi(0x2f7,'w#X2')]()?require('./sendNotify'):'',Ii1IiI=$[il1lIi(0x215,'CrRP')]()?require(il1lIi(0x46e,'R!2$')):'',IIll11=require(il1lIi(0x4b1,'QG*t')),ll1lIl=require(il1lIi(0x367,'F!^v')),I1IIl1=require(il1lIi(0x4b4,'DOuL'));let l1I1l1={},ll1lIi='',lIi1i='';$[il1lIi(0x378,'EgeF')]=![];let iIIIil=0x2,Ii1Ii1=![],IIll1I=[],liii1I='',lI1iIi='',lIi1l='';if($[il1lIi(0x333,'IY8a')]()){if(JSON[il1lIi(0x390,'YCI7')](process[il1lIi(0x2fb,'bFRn')])[il1lIi(0x4d7,'CrRP')](il1lIi(0x39a,'DOuL'))>-0x1)process[il1lIi(0x1a7,'xqZ1')](0x0);Object[il1lIi(0x1ae,'s2B@')](Ii1IiI)[il1lI
2023-07-28 10:10:43 +08:00
// 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"])