KR/jd_wxSign.js

29 lines
100 KiB
JavaScript
Raw Normal View History

2023-09-27 09:06:49 +08:00
/*
活动名称店铺签到 · 超级无线/超级会员
活动链接https://lzkj-isv.isvjd.com/sign/signActivity2?activityId=<活动id>
https://lzkj-isv.isvjd.com/sign/sevenDay/signActivity?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/sign/sevenDay/signActivity?activityId=<活动id>
环境变量jd_wxSign_sign_lzkj_Ids // 超级无线签到有礼活动id旧变量 LZKJ_SIGN
jd_wxSign_sevenDay_lzkj_Ids // 超级无线7日签到活动id旧变量 LZKJ_SEVENDAY
jd_wxSign_sign_cjhy_Ids // 超级会员签到有礼活动id旧变量 CJHY_SIGN
jd_wxSign_sevenDay_cjhy_Ids // 超级会员7日签到活动id旧变量 CJHY_SEVENDAY
jd_wxSign_lzkjInterval // 自定义超级无线活动签到间隔整数默认1秒
jd_wxSign_cjhyInterval // 自定义超级会员活动签到间隔整数默认1秒
jd_wxSign_lzkjFilter // 账号pin过滤跳过不跑多个用户名用@分割
jd_wxSign_cjhyFilter // 账号pin过滤跳过不跑多个用户名用@分割
jd_wxSign_Notify // 是否推送通知true/false默认不推送
不同环境变量对应不同链接类型注意区分环境变量所对应活动类型的排列顺序与链接的排列顺序一致如果有多个活动ID用英文逗号分割即可实现多活动签到
cron: 7 7 7 7 * jd_wxSign.js
*/
const $ = new Env('店铺签到(超级无线/超级会员)')
2023-11-06 13:40:18 +08:00
var version_='jsjiami.com.v7';const I111iI=iii1II;(function(l1Ilil,iIili,i11l1I,iil1Il,IlIll,liil,i11l11){return l1Ilil=l1Ilil>>0x7,liil='hs',i11l11='hs',function(IlIli,liIIIl,iliil1,i1i1ll,IIllI1){const iliilI=iii1II;i1i1ll='tfi',liil=i1i1ll+liil,IIllI1='up',i11l11+=IIllI1,liil=iliil1(liil),i11l11=iliil1(i11l11),iliil1=0x0;const lIl1iI=IlIli();while(!![]&&--iil1Il+liIIIl){try{i1i1ll=parseInt(iliilI(0x3a3,'s!vw'))/0x1*(parseInt(iliilI(0x361,'##mL'))/0x2)+parseInt(iliilI(0x41c,'TMi#'))/0x3*(parseInt(iliilI(0x23f,'lDaw'))/0x4)+-parseInt(iliilI(0x2ed,'R5Vr'))/0x5*(-parseInt(iliilI(0x4ee,'2e#r'))/0x6)+-parseInt(iliilI(0x59c,'PLyR'))/0x7+parseInt(iliilI(0x4ae,'C#5#'))/0x8*(parseInt(iliilI(0x3a4,'##mL'))/0x9)+-parseInt(iliilI(0x557,'@DHU'))/0xa*(parseInt(iliilI(0x1a4,'C#5#'))/0xb)+-parseInt(iliilI(0x35e,'BqAU'))/0xc;}catch(iil1II){i1i1ll=iliil1;}finally{IIllI1=lIl1iI[liil]();if(l1Ilil<=iil1Il)iliil1?IlIll?i1i1ll=IIllI1:IlIll=IIllI1:iliil1=IIllI1;else{if(iliil1==IlIll['replace'](/[rhlnStFQxfRNKywM=]/g,'')){if(i1i1ll===liIIIl){lIl1iI['un'+liil](IIllI1);break;}lIl1iI[i11l11](IIllI1);}}}}}(i11l1I,iIili,function(iii11I,IIil11,iI11iI,l1IliI,liIIIi,iIilI,liii){return IIil11='\x73\x70\x6c\x69\x74',iii11I=arguments[0x0],iii11I=iii11I[IIil11](''),iI11iI=`\x72\x65\x76\x65\x72\x73\x65`,iii11I=iii11I[iI11iI]('\x76'),l1IliI=`\x6a\x6f\x69\x6e`,(0x1463dc,iii11I[l1IliI](''));});}(0x6000,0x9b9d5,Iii11l,0xc2),Iii11l)&&(version_=I111iI(0x5ac,'lh^$'));const IIlI1I=require(I111iI(0x349,'lh^$')),llIIIi=require('./function/jdCommon'),IiIiIl=require(I111iI(0x36a,'C#5#')),I1Ilil=require(I111iI(0x3fd,'R5Vr')),{wuxian_savePrize:l1I1I1}=require(I111iI(0x388,'Ha#r')),I1Ilii=require('crypto-js'),l1Iii=process[I111iI(0x5b9,'[7tE')]['jd_wxSign_lzkjInterval']||'',l1Iil=process[I111iI(0x4e8,'lNgX')][I111iI(0x49d,'Gs3T')]||'',III1Ii=process[I111iI(0x29c,'!AS@')]['jd_wxSign_Notify']===I111iI(0x1e8,'##mL');let III1Il=(process['env'][I111iI(0x5bd,'#SYM')]||process[I111iI(0x4bb,'@DHU')][I111iI(0x4d8,'!YQY')]||'')[I111iI(0x4cd,'dnoJ')](','),iIIliI=(process[I111iI(0x5b9,'[7tE')][I111iI(0x53a,'Qh22')]||process[I111iI(0x34e,'C#5#')][I111iI(0x303,'qSzG')]||'')['split'](','),IiIil=(process['env'][I111iI(0x2f0,'HYnm')]||process[I111iI(0x268,'%poC')][I111iI(0x27d,'(]RJ')]||'')[I111iI(0x1b1,'2e#r')](','),IiIii=(process['env'][I111iI(0x4e1,'R5Vr')]||process['env'][I111iI(0x28d,'lh^$')]||'')[I111iI(0x460,'(]RJ')](','),iill1l=(process[I111iI(0x49a,'sqeg')][I111iI(0x245,'[7tE')]||'')[I111iI(0x418,'R5Vr')]('@'),IiIiII=(process[I111iI(0x439,'TMi#')][I111iI(0x38f,'%poC')]||'')['split']('@'),iill1i='',l1Il1={};function Iii11l(){const iIiil=(function(){return[...[version_,'KxhjrfsrjRyiFfaQMmtitf.lcxNwoRmynh.xNvS7==','8ycUVc/MGklLLjtOJ6JLVOlLRjxNIzWn','WPGdmCoEWOHw','WQFcG0ldHSox','yHldTHax','dmoqW70gca','ksJcJSkGxG','A8oaW64nWOWUkmkWngyFDWKrW4XwsZ9pnaO','8jA2Ko+5MmkI','WPicW6iNoG','W4JcJr9Mya','WROLW6umaW','W6ZdJmorgxm','FmocDCoPtW','smotwmoHEa','W4zKB8knCW','ddhdKCkNWP8','uZeaW4b1','57M35PY4WOaMl8oM','WQGDW5uJpq','W6iLzmkUDW','WOOjiSozWRfuW4u6h3a','WRycW4u6jftdIIW','W7/cHsy7wa','5BEy6k+f57YC6lEP6lYi6lYc6kc15B+m5yIs6lwZ5yY/dHRdU+I2LEE5JEs9KUwqJq','i8kJW6yiWQ8','W4HKE8kBDL0','W5dcUsGSwa','4P+cW5/NRRZLIAtNS6lLNQlVVyr4W5HmjhS0exKBxmkfBtOUws1dW6dVVyS','WPpdSCoEW4VcTW','W7BcMSk+WOVcTG','CCokwa','44oi5O+D56EQ44gs6k235yAd6i6H5y6PW4fPxCkHg8k1','WOVdUCoLW5JcJfNcHq','nSkFW6qrWPy','W6RdLZBcUqm','WQ8EW481nhNdGtLc','W7hcJbrvuW','dJLLWQddGSoUgbu','5P2R5lM75AEv77+25AAV5zo85BsA5yY+5A2C772z','qCk+sSkUAa','oCkSWQpcJSoN','dqxcN8kSySoYrmoZ','y8kDWPVcISk4','oc3cRmkTDa','WQxdImo6DqlcPINdPeyP','cx52','triuBSkbWRmuW7O','W4LgqCkyyq','WR7cLuRdLmoOsf0','vf4MWOPE','W7tcUa9HrSoqWQC','WQLFW7zWW6DL','W6quWQLHjrHHW4RcQCk/WRSGkHVcLCkBWRSnfCkCWP/dUSk1W4uHCCoSW7fpWQ/cQgqhySoBuCoyWQ7cJay','qSkWxdW3taldMCkWC8konCkvW7e','W5ddI8kvbL0','5yMr5Asb5y6C5AwS6lw9772x6k+g5Qck5PY6W5HdCmk3WPlMMzpLKyVOVkNMNRK','W7ydWRH3','WRCoWP3cPN4','5Roe5PYy5OIb5yIr6i+e5y2O5yQZ55sB5OMc5l6L5Oos','W4KyrmkpD8kpo8oQm8kzWPGWbCo5','u8k4sdCNtbW','g8kpW5xcJSoy','W49RWQWqW74','WPmVyG','WQpcNtxcMG','WPhdVSohwa','wMjg','WQBdSeCK','WPFcUJlcHhW','WRZdVhxdUbi
2023-10-26 23:05:34 +08:00
2023-09-27 09:06:49 +08:00
// prettier-ignore
2023-10-26 23:05:34 +08:00
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"])