faker3/jd_txzj_sign_in.js

19 lines
60 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称签到有礼 · 收藏大师
活动链接https://txzj-isv.isvjcloud.com/sign_in/home?a=<活动id>
环境变量jd_sign_in_activityUrl // 活动链接
7 7 7 7 *
*/
const $ = new Env('签到有礼(收藏大师)')
const notify = $.isNode() ? require('./sendNotify') : ''
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
const getToken = require('./function/getToken')
var version_='jsjiami.com.v7';const l1iii1lI=I1IIIl;(function(I11iIl1l,Illiiii1,iIIilIl,I1l11ii,l111i111,iilIl1I1,ilI1l){return I11iIl1l=I11iIl1l>>0x2,iilIl1I1='hs',ilI1l='hs',function(i1iIIil1,lI1liIi1,lllIIliI,i1IiiiI1,llll1I11){const I1l1lIii=I1IIIl;i1IiiiI1='tfi',iilIl1I1=i1IiiiI1+iilIl1I1,llll1I11='up',ilI1l+=llll1I11,iilIl1I1=lllIIliI(iilIl1I1),ilI1l=lllIIliI(ilI1l),lllIIliI=0x0;const llIiIliI=i1iIIil1();while(!![]&&--I1l11ii+lI1liIi1){try{i1IiiiI1=-parseInt(I1l1lIii(0x3db))/0x1*(parseInt(I1l1lIii(0x1d5))/0x2)+-parseInt(I1l1lIii(0x334))/0x3+parseInt(I1l1lIii(0x3de))/0x4*(-parseInt(I1l1lIii(0x3bd))/0x5)+-parseInt(I1l1lIii(0x39c))/0x6*(-parseInt(I1l1lIii(0x1fa))/0x7)+-parseInt(I1l1lIii(0x316))/0x8*(parseInt(I1l1lIii(0x3a9))/0x9)+-parseInt(I1l1lIii(0x30d))/0xa+parseInt(I1l1lIii(0x2a5))/0xb;}catch(IilIilI){i1IiiiI1=lllIIliI;}finally{llll1I11=llIiIliI[iilIl1I1]();if(I11iIl1l<=I1l11ii)lllIIliI?l111i111?i1IiiiI1=llll1I11:l111i111=llll1I11:lllIIliI=llll1I11;else{if(lllIIliI==l111i111['replace'](/[rFkwRyIVSWgeUbLNxMlEq=]/g,'')){if(i1IiiiI1===lI1liIi1){llIiIliI['un'+iilIl1I1](llll1I11);break;}llIiIliI[ilI1l](llll1I11);}}}}}(iIIilIl,Illiiii1,function(l1iIil11,IlI11Il,ilI1iI1l,I1llli1l,lIi111ll,iiI1ii1,III1IIi1){return IlI11Il='\x73\x70\x6c\x69\x74',l1iIil11=arguments[0x0],l1iIil11=l1iIil11[IlI11Il](''),ilI1iI1l=`\x72\x65\x76\x65\x72\x73\x65`,l1iIil11=l1iIil11[ilI1iI1l]('\x76'),I1llli1l=`\x6a\x6f\x69\x6e`,(0x136804,l1iIil11[I1llli1l](''));});}(0x314,0xcbe15,IIlI1,0xc7),IIlI1)&&(version_=IIlI1);let lz_cookie={},activityCookie='',inviterNick='';$[l1iii1lI(0x3e7)]=![];let canHelp=![],cookiesArr=[],cookie='',message='',messageTitle='';if($[l1iii1lI(0x311)]()){if(process[l1iii1lI(0x3a7)][l1iii1lI(0x2d5)])activityUrl=process[l1iii1lI(0x3a7)][l1iii1lI(0x2d5)];if(JSON[l1iii1lI(0x26e)](process[l1iii1lI(0x3a7)])[l1iii1lI(0x2ba)](l1iii1lI(0x39f))>-0x1)process[l1iii1lI(0x337)](0x0);Object[l1iii1lI(0x3cb)](jdCookieNode)[l1iii1lI(0x39a)](i11li1iI=>{const lii1l1I=l1iii1lI;cookiesArr[lii1l1I(0x351)](jdCookieNode[i11li1iI]);});if(process[l1iii1lI(0x3a7)][l1iii1lI(0x2f4)]&&process[l1iii1lI(0x3a7)][l1iii1lI(0x2f4)]===l1iii1lI(0x307))console[l1iii1lI(0x313)]=()=>{};}else cookiesArr=[$[l1iii1lI(0x2d7)](l1iii1lI(0x24d)),$[l1iii1lI(0x2d7)](l1iii1lI(0x410)),...$[l1iii1lI(0x2a6)]($[l1iii1lI(0x2d7)](l1iii1lI(0x236))||'[]')[l1iii1lI(0x406)](li11l1iI=>li11l1iI[l1iii1lI(0x305)])][l1iii1lI(0x2df)](I11iIiII=>!!I11iIiII);let isGetCookie=typeof $request!==l1iii1lI(0x35b);isGetCookie&&(GetCookie(),$[l1iii1lI(0x268)]());if(activityUrl)activityId=getQueryString(''+activityUrl,'a'),$[l1iii1lI(0x301)]=activityUrl[l1iii1lI(0x331)](/https?:\/\/([^/]+)/)[0x1];else{console[l1iii1lI(0x313)](l1iii1lI(0x26f));return;}function I1IIIl(_0x47d5e7,_0x4ca764){const _0x4568f4=IIlI1();return I1IIIl=function(_0x51a7c4,_0x1bbbdb){_0x51a7c4=_0x51a7c4-0x1d4;let _0x5d930d=_0x4568f4[_0x51a7c4];if(I1IIIl['IzJwnj']===undefined){var _0x5a8d2f=function(_0x235f27){const _0x3d65b3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xe63e12='',_0x2518bb='';for(let _0x118ea4=0x0,_0x3a014f,_0x573f8b,_0x1f137d=0x0;_0x573f8b=_0x235f27['charAt'](_0x1f137d++);~_0x573f8b&&(_0x3a014f=_0x118ea4%0x4?_0x3a014f*0x40+_0x573f8b:_0x573f8b,_0x118ea4++%0x4)?_0xe63e12+=String['fromCharCode'](0xff&_0x3a014f>>(-0x2*_0x118ea4&0x6)):0x0){_0x573f8b=_0x3d65b3['indexOf'](_0x573f8b);}for(let _0x3f0830=0x0,_0x1272e6=_0xe63e12['length'];_0x3f0830<_0x1272e6;_0x3f0830++){_0x2518bb+='%'+('00'+_0xe63e12['charCodeAt'](_0x3f0830)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2518bb);};I1IIIl['SljAks']=_0x5a8d2f,_0x47d5e7=arguments,I1IIIl['IzJwnj']=!![];}const _0x308057=_0x4568f4[0x0],_0x45cb14=_0x51a7c4+_0x308057,_0x2845e4=_0x47d5e7[_0x45cb14];return!_0x2845e4?(_0x5d930d=I1IIIl['SljAks'](_0x5d930d),_0x47d5e7[_0x45cb14]=_0x5d930d):_0x5d930d=_0x2845e4,_0x5d930d;},I1IIIl(_0x47d5e7,_0x4ca764);}let domains=l1iii1lI(0x3d0)+$[l1iii1lI(0x301)];!(async()=>{const ii11lii=l1iii1lI,lIiIIIl1={'ggepf':function(i1IilIl,l1iiIiI1){return i1IilIl(l1iiIiI1);},'CjLlp':function(l1lll1,iiIiIlI1){return l1l
// 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"])