faker3/jd_jinggeng_showSign.js

23 lines
56 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称签到有礼 · 京耕
活动链接https://jinggeng-isv.isvjcloud.com/ql/front/showSign?id=<活动id>&user_id=<店铺id>
环境变量jd_jinggeng_showSign_activityUrl // 活动链接
jd_jinggeng_showSign_opencard // 是否入会true/false默认不入会
jd_jinggeng_showSign_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 { jinggeng_savePrize } = require('./function/savePrize')
var il='jsjiami.com.v7';const l1I1IIl1=i11l1Il1;(function(i1IlIlI,lIill1Il,I1Illi1,I1llI1l,IlliIiI1,liIllll1,IliiliI1){return i1IlIlI=i1IlIlI>>0x2,liIllll1='hs',IliiliI1='hs',function(IiliIliI,lIili1li,liili1lI,I11l1Ii1,iIi1I1li){const IIlIIlii=i11l1Il1;I11l1Ii1='tfi',liIllll1=I11l1Ii1+liIllll1,iIi1I1li='up',IliiliI1+=iIi1I1li,liIllll1=liili1lI(liIllll1),IliiliI1=liili1lI(IliiliI1),liili1lI=0x0;const I1I1IIi=IiliIliI();while(!![]&&--I1llI1l+lIili1li){try{I11l1Ii1=parseInt(IIlIIlii(0x175,'MBy1'))/0x1*(-parseInt(IIlIIlii(0x128,'LE41'))/0x2)+parseInt(IIlIIlii(0x339,'P1*6'))/0x3+parseInt(IIlIIlii(0x3c1,'&caK'))/0x4*(-parseInt(IIlIIlii(0x256,'M*WP'))/0x5)+parseInt(IIlIIlii(0x2f2,'Tkf4'))/0x6+-parseInt(IIlIIlii(0x126,'PGd)'))/0x7+-parseInt(IIlIIlii(0x11f,'3lml'))/0x8+parseInt(IIlIIlii(0x169,'IUdI'))/0x9*(parseInt(IIlIIlii(0x144,'^bsS'))/0xa);}catch(IIIl1IIi){I11l1Ii1=liili1lI;}finally{iIi1I1li=I1I1IIi[liIllll1]();if(i1IlIlI<=I1llI1l)liili1lI?IlliIiI1?I11l1Ii1=iIi1I1li:IlliIiI1=iIi1I1li:liili1lI=iIi1I1li;else{if(liili1lI==IlliIiI1['replace'](/[RLUJWAIkwSBudpGhCFTb=]/g,'')){if(I11l1Ii1===lIili1li){I1I1IIi['un'+liIllll1](iIi1I1li);break;}I1I1IIi[IliiliI1](iIi1I1li);}}}}}(I1Illi1,lIill1Il,function(II1I1l11,iIIliil,IIi1iI1,i1liil,l1lIiIil,l1I1ll1,I1iIl1Il){return iIIliil='\x73\x70\x6c\x69\x74',II1I1l11=arguments[0x0],II1I1l11=II1I1l11[iIIliil](''),IIi1iI1=`\x72\x65\x76\x65\x72\x73\x65`,II1I1l11=II1I1l11[IIi1iI1]('\x76'),i1liil=`\x6a\x6f\x69\x6e`,(0x16f5dd,II1I1l11[i1liil](''));});}(0x308,0x7014d,illi1IIi,0xc4),illi1IIi)&&(il=0x4c88);const activityUrl=process[l1I1IIl1(0x39c,'aJmD')][l1I1IIl1(0x230,'OoQU')]||'',joinMember=process[l1I1IIl1(0x2c3,'LE41')][l1I1IIl1(0x2fb,'MA2$')]===l1I1IIl1(0x135,'hWGO'),isNotify=process[l1I1IIl1(0x24c,'XYPR')][l1I1IIl1(0x2a3,'71ft')]===l1I1IIl1(0x12e,']RaC');function i11l1Il1(_0xbb6302,_0x24d64e){const _0x3eba87=illi1IIi();return i11l1Il1=function(_0x1bd428,_0x10e4cc){_0x1bd428=_0x1bd428-0xf4;let _0x540934=_0x3eba87[_0x1bd428];if(i11l1Il1['wFeIHc']===undefined){var _0x49c567=function(_0x28a9cf){const _0x5eb390='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x59a4d8='',_0xf103b7='';for(let _0x2a8a34=0x0,_0x4c0b20,_0x4bd5cd,_0x105ed8=0x0;_0x4bd5cd=_0x28a9cf['charAt'](_0x105ed8++);~_0x4bd5cd&&(_0x4c0b20=_0x2a8a34%0x4?_0x4c0b20*0x40+_0x4bd5cd:_0x4bd5cd,_0x2a8a34++%0x4)?_0x59a4d8+=String['fromCharCode'](0xff&_0x4c0b20>>(-0x2*_0x2a8a34&0x6)):0x0){_0x4bd5cd=_0x5eb390['indexOf'](_0x4bd5cd);}for(let _0x2906eb=0x0,_0x1bbcdc=_0x59a4d8['length'];_0x2906eb<_0x1bbcdc;_0x2906eb++){_0xf103b7+='%'+('00'+_0x59a4d8['charCodeAt'](_0x2906eb)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xf103b7);};const _0x4d63a5=function(_0x49259e,_0x1a13dc){let _0x33f6c3=[],_0x2f6825=0x0,_0x3e8f50,_0x446d38='';_0x49259e=_0x49c567(_0x49259e);let _0x15a4c3;for(_0x15a4c3=0x0;_0x15a4c3<0x100;_0x15a4c3++){_0x33f6c3[_0x15a4c3]=_0x15a4c3;}for(_0x15a4c3=0x0;_0x15a4c3<0x100;_0x15a4c3++){_0x2f6825=(_0x2f6825+_0x33f6c3[_0x15a4c3]+_0x1a13dc['charCodeAt'](_0x15a4c3%_0x1a13dc['length']))%0x100,_0x3e8f50=_0x33f6c3[_0x15a4c3],_0x33f6c3[_0x15a4c3]=_0x33f6c3[_0x2f6825],_0x33f6c3[_0x2f6825]=_0x3e8f50;}_0x15a4c3=0x0,_0x2f6825=0x0;for(let _0x560b4f=0x0;_0x560b4f<_0x49259e['length'];_0x560b4f++){_0x15a4c3=(_0x15a4c3+0x1)%0x100,_0x2f6825=(_0x2f6825+_0x33f6c3[_0x15a4c3])%0x100,_0x3e8f50=_0x33f6c3[_0x15a4c3],_0x33f6c3[_0x15a4c3]=_0x33f6c3[_0x2f6825],_0x33f6c3[_0x2f6825]=_0x3e8f50,_0x446d38+=String['fromCharCode'](_0x49259e['charCodeAt'](_0x560b4f)^_0x33f6c3[(_0x33f6c3[_0x15a4c3]+_0x33f6c3[_0x2f6825])%0x100]);}return _0x446d38;};i11l1Il1['AmmVbI']=_0x4d63a5,_0xbb6302=arguments,i11l1Il1['wFeIHc']=!![];}const _0x44f67a=_0x3eba87[0x0],_0x20750e=_0x1bd428+_0x44f67a,_0x4c1f88=_0xbb6302[_0x20750e];return!_0x4c1f88?(i11l1Il1['iAeylz']===undefined&&(i11l1Il1['iAeylz']=!![]),_0x540934=i11l1Il1['AmmVbI'](_0x540934,_0x10e4cc),_0xbb6302[_0x20750e]=_0x540934):_0x540934=_0x4c1f88,_0x540934;},i11l1Il1(_0xbb6302,_0x24d64e);}let sid=common[l1I1IIl1(0x386,'MBy1')](0x20,l1I1IIl1(0x105,'9G^w')),un_area=common[l1I1IIl1(0x34a,'L]4E')](
// 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"])