mirror of https://github.com/KingRan/KR.git
23 lines
84 KiB
JavaScript
23 lines
84 KiB
JavaScript
|
/*
|
|||
|
活动名称:完善信息有礼 · 超级无线
|
|||
|
活动地址:https://cjhy-isv.isvjcloud.com/wx/completeInfoActivity/view/activity?activityId=<活动id>&venderId=<店铺id>
|
|||
|
|
|||
|
必须条件:配置文件或者环境变量中添加变量:
|
|||
|
## CJ完善有礼-jd_completeInfoActivity.js
|
|||
|
//export jd_completeInfoActivity_activityUrl // 活动链接
|
|||
|
//export jd_completeInfoActivity_openCard //是否开卡,需要开卡变量值为 true,默认不开卡
|
|||
|
//export JD_CJ_OPEN="false" //关闭CJ相关活动运行
|
|||
|
//export jd_completeInfoActivity_blacklist //黑名单 用&隔开 pin值
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#CJ完善有礼-加密
|
|||
|
1 1 1 1 * jd_completeInfoActivity.js, tag=CJ完善有礼-加密, enabled=true
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('完善信息有礼(超级会员)')
|
|||
|
var version_='jsjiami.com.v7';const lIlIli=iii1II;(function(iiI1l,Ili1lI,lIlIl1,ilIIi,IiII1l,IiII1i,Ii11Ii){return iiI1l=iiI1l>>0x5,IiII1i='hs',Ii11Ii='hs',function(Ii11Il,lIlIlI,iiIIll,I1li1l,I11li1){const iiI11=iii1II;I1li1l='tfi',IiII1i=I1li1l+IiII1i,I11li1='up',Ii11Ii+=I11li1,IiII1i=iiIIll(IiII1i),Ii11Ii=iiIIll(Ii11Ii),iiIIll=0x0;const lIIIi=Ii11Il();while(!![]&&--ilIIi+lIlIlI){try{I1li1l=parseInt(iiI11(0x3f3,'gibC'))/0x1*(-parseInt(iiI11(0x47c,'wVoi'))/0x2)+parseInt(iiI11(0x3c0,'&PR0'))/0x3*(-parseInt(iiI11(0x3c4,'96(H'))/0x4)+parseInt(iiI11(0x3a4,'rcy3'))/0x5*(parseInt(iiI11(0x204,'fwIc'))/0x6)+-parseInt(iiI11(0x399,']qp9'))/0x7*(-parseInt(iiI11(0x2b9,'66zx'))/0x8)+-parseInt(iiI11(0x26a,'8xVC'))/0x9+parseInt(iiI11(0x37d,'66zx'))/0xa*(-parseInt(iiI11(0x462,'ud8y'))/0xb)+-parseInt(iiI11(0x200,'&z4i'))/0xc*(-parseInt(iiI11(0x354,'sw)8'))/0xd);}catch(iiI1I){I1li1l=iiIIll;}finally{I11li1=lIIIi[IiII1i]();if(iiI1l<=ilIIi)iiIIll?IiII1l?I1li1l=I11li1:IiII1l=I11li1:iiIIll=I11li1;else{if(iiIIll==IiII1l['replace'](/[wgtOHAqlNubKSeYILP=]/g,'')){if(I1li1l===lIlIlI){lIIIi['un'+IiII1i](I11li1);break;}lIIIi[Ii11Ii](I11li1);}}}}}(lIlIl1,Ili1lI,function(lIIIl,ilIII,IiII1I,IIl1I1,I1li1i,IIi111,Ii11II){return ilIII='\x73\x70\x6c\x69\x74',lIIIl=arguments[0x0],lIIIl=lIIIl[ilIII](''),IiII1I='\x72\x65\x76\x65\x72\x73\x65',lIIIl=lIIIl[IiII1I]('\x76'),IIl1I1='\x6a\x6f\x69\x6e',(0x13666d,lIIIl[IIl1I1](''));});}(0x17a0,0x204bd,Iii11l,0xbf),Iii11l)&&(version_=Iii11l);const iIIlIl=$[lIlIli(0x428,'7iTY')]()?require(lIlIli(0x390,'&PR0')):'',iIIlIi=$['isNode']()?require('./jdCookie'):'',iilIll=require(lIlIli(0x535,'F6km')),iilIli=require(lIlIli(0x4b0,'Tn5L')),IlIi1I=require(lIlIli(0x243,'Tn5L'));let i111I={},llIiiI='';$[lIlIli(0x3a8,'wVoi')]=![],$['selectByIds']=![];let IiIilI=[],lIiIl1='',iilIl1='',l1II1='',III1i1=process[lIlIli(0x43b,'9o1q')][lIlIli(0x40d,'ud8y')]===lIlIli(0x2ca,'Twd)')?!![]:![],IlI1=process['env'][lIlIli(0x1cd,'66zx')]?process[lIlIli(0x538,'Ehw]')][lIlIli(0x431,'h)dn')]:'';if($['isNode']()){if(JSON['stringify'](process[lIlIli(0x448,'IuJB')])['indexOf'](lIlIli(0x25d,'Tn5L'))>-0x1)process[lIlIli(0x266,'*5^@')](0x0);Object[lIlIli(0x319,'fSJl')](iIIlIi)['forEach'](l1I1il=>{IiIilI['push'](iIIlIi[l1I1il]);});if(process[lIlIli(0x468,'h)dn')][lIlIli(0x4a7,'*5^@')]&&process[lIlIli(0x52c,'Lr9z')]['JD_DEBUG']===lIlIli(0x26f,']qp9'))console[lIlIli(0x30d,'r2W0')]=()=>{};}else IiIilI=[$['getdata'](lIlIli(0x3fc,'jB#W')),$[lIlIli(0x22c,'6sKi')](lIlIli(0x373,'BONT')),...$[lIlIli(0x1f9,'R##*')]($[lIlIli(0x53c,'sw)8')](lIlIli(0x47e,'XCV4'))||'[]')['map'](III1ii=>III1ii['cookie'])][lIlIli(0x2b1,'F6km')](l1I1ii=>!!l1I1ii);let I1IlIl=typeof $request!==lIlIli(0x2f8,'8xVC');I1IlIl&&(GetCookie(),$[lIlIli(0x51c,'vM7C')]());let l1I1i1=process[lIlIli(0x531,'$&Pb')]['JD_CJ_OPEN']?process[lIlIli(0x293,'GYhv')][lIlIli(0x438,'$&Pb')]:lIlIli(0x315,'R##*'),I1IlIi='',l1ll1i='';$['whitelist']=process['env'][lIlIli(0x4d5,'*5^@')]||I1IlIi,$[lIlIli(0x534,'sw)8')]=process['env'][lIlIli(0x3da,'XCV4')]||l1ll1i,lIlliI(),IiIiii();if(IlI1)activityId=l1IIl(''+IlI1,'activityId'),venderId=l1IIl(''+IlI1,lIlIli(0x21c,'jB#W')),$[lIlIli(0x2d2,'66zx')]=IlI1['match'](/https?:\/\/([^/]+)/)[0x1];else{console['log'](lIlIli(0x458,'BONT'));return;}let IiIil1=lIlIli(0x4cb,'ud8y')+$[lIlIli(0x427,'t1Za')];!(async()=>{const ilII1=lIlIli,III1il={'xHKxd':function(I1IlI1,i1111){return I1IlI1+i1111;},'CjfjF':ilII1(0x339,'jB#W'),'zlfaq':function(iIIlII){return iIIlII();},'FjVKE':function(IlIi1l,IiIiiI){return IlIi1l===IiIiiI;},'rlCXE':ilII1(0x4ee,'GYhv'),'BOezN':ilII1(0x4c0,'8xVC'),'ZfSAm':ilII1(0x3cd,'GYhv'),'oyfvq':ilII1(0x544,'6!UY'),'AKbNO':function(IlIi1i,lIllii){return IlIi1i+lIllii;},'mIyEc':ilII1(0x441,'F6km'),'twZlg':ilII1(0x4a6,'96(H'),'MYPGv':'https://bean.m.jd.com/','lqnzT':function(l1il1,IIiI){return l1il1<IIiI;},'FDMnB':ilII1(0x3db,'gibC'),'KyiQv':ilII1(0x20e,'F6km'),'nfBPg':function(l1iil1,iiiIiI){return l1iil1!==iiiIiI;},'GyCma':ilII1(0x34a,'GYhv'),'vVmkG':ilII1(0x49b,'gibC'),'DQQcU':function(Ill1i1,illl1I){return Ill1i1(illl1I);},'PDeaW':function(lillI,Il11i){return lillI+Il11i
|
|||
|
// 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"])
|