mirror of https://github.com/KingRan/KR.git
20 lines
84 KiB
JavaScript
20 lines
84 KiB
JavaScript
|
/*
|
|||
|
活动名称:积分兑换京豆 · 超级会员
|
|||
|
活动链接:https://cjhy-isv.isvjcloud.com/mc/wxPointShopView/pointExgBeans?venderId=<店铺id>&giftId=<活动id>
|
|||
|
环境变量:
|
|||
|
jd_pointExgBeans_activityUrl // 活动链接
|
|||
|
JD_CJ_OPEN // 是否开启CJ活动运行,默认运行
|
|||
|
jd_pointExgBeans_blacklist // 黑名单 用&隔开 pin值
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#积分兑换京豆
|
|||
|
1 1 1 1 * jd_pointExgBeans.js, tag=积分兑换京豆, enabled=true
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('积分兑换京豆(超级会员)')
|
|||
|
var version_='jsjiami.com.v7';const iiIIli=iii1II;(function(llIi11,IIi11I,iiIIlI,IIl1II,iill,iiIIl1,llIi1I){return llIi11=llIi11>>0x3,iiIIl1='hs',llIi1I='hs',function(lIlIii,li1Ili,I11lil,Ili1li,lIlIil){const IIi11i=iii1II;Ili1li='tfi',iiIIl1=Ili1li+iiIIl1,lIlIil='up',llIi1I+=lIlIil,iiIIl1=I11lil(iiIIl1),llIi1I=I11lil(llIi1I),I11lil=0x0;const I11lii=lIlIii();while(!![]&&--IIl1II+li1Ili){try{Ili1li=parseInt(IIi11i(0x3b5,'@r%m'))/0x1+parseInt(IIi11i(0xd1,'FCyv'))/0x2*(parseInt(IIi11i(0x234,'xQRP'))/0x3)+-parseInt(IIi11i(0x362,'$!EC'))/0x4*(-parseInt(IIi11i(0x305,'7*xM'))/0x5)+-parseInt(IIi11i(0x1db,'AM7J'))/0x6+parseInt(IIi11i(0x137,'l!(#'))/0x7+parseInt(IIi11i(0x167,'@96L'))/0x8+parseInt(IIi11i(0x26d,'Okn%'))/0x9*(-parseInt(IIi11i(0x3bd,'ozys'))/0xa);}catch(li1Ill){Ili1li=I11lil;}finally{lIlIil=I11lii[iiIIl1]();if(llIi11<=IIl1II)I11lil?iill?Ili1li=lIlIil:iill=lIlIil:I11lil=lIlIil;else{if(I11lil==iill['replace'](/[nKqCrFXGNVwuphIWJfTUSHR=]/g,'')){if(Ili1li===li1Ili){I11lii['un'+iiIIl1](lIlIil);break;}I11lii[llIi1I](lIlIil);}}}}}(iiIIlI,IIi11I,function(Ili1ll,IIl1Il,l1Iili,IIi11l,l1Iill,iiiiIi,iiiiIl){return IIl1Il='\x73\x70\x6c\x69\x74',Ili1ll=arguments[0x0],Ili1ll=Ili1ll[IIl1Il](''),l1Iili='\x72\x65\x76\x65\x72\x73\x65',Ili1ll=Ili1ll[l1Iili]('\x76'),IIi11l='\x6a\x6f\x69\x6e',(0x13664a,Ili1ll[IIi11l](''));});}(0x638,0xa5494,Iii11l,0xc9),Iii11l)&&(version_=Iii11l);function iii1II(_0x133208,_0x2ae532){const _0x2a1228=Iii11l();return iii1II=function(_0x35875f,_0x342914){_0x35875f=_0x35875f-0xce;let _0x423d05=_0x2a1228[_0x35875f];if(iii1II['ZcdGVN']===undefined){var _0x275b44=function(_0xd2c72e){const _0x5df157='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3f23e3='',_0x9c40c7='';for(let _0x3c1b64=0x0,_0xaaeca,_0x4011ec,_0x3284db=0x0;_0x4011ec=_0xd2c72e['charAt'](_0x3284db++);~_0x4011ec&&(_0xaaeca=_0x3c1b64%0x4?_0xaaeca*0x40+_0x4011ec:_0x4011ec,_0x3c1b64++%0x4)?_0x3f23e3+=String['fromCharCode'](0xff&_0xaaeca>>(-0x2*_0x3c1b64&0x6)):0x0){_0x4011ec=_0x5df157['indexOf'](_0x4011ec);}for(let _0x1d339b=0x0,_0x28a0b9=_0x3f23e3['length'];_0x1d339b<_0x28a0b9;_0x1d339b++){_0x9c40c7+='%'+('00'+_0x3f23e3['charCodeAt'](_0x1d339b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x9c40c7);};const _0x20b75e=function(_0x204f06,_0x30b063){let _0x2ff990=[],_0x1e958c=0x0,_0x301425,_0x25af37='';_0x204f06=_0x275b44(_0x204f06);let _0x1c6e97;for(_0x1c6e97=0x0;_0x1c6e97<0x100;_0x1c6e97++){_0x2ff990[_0x1c6e97]=_0x1c6e97;}for(_0x1c6e97=0x0;_0x1c6e97<0x100;_0x1c6e97++){_0x1e958c=(_0x1e958c+_0x2ff990[_0x1c6e97]+_0x30b063['charCodeAt'](_0x1c6e97%_0x30b063['length']))%0x100,_0x301425=_0x2ff990[_0x1c6e97],_0x2ff990[_0x1c6e97]=_0x2ff990[_0x1e958c],_0x2ff990[_0x1e958c]=_0x301425;}_0x1c6e97=0x0,_0x1e958c=0x0;for(let _0x3cc920=0x0;_0x3cc920<_0x204f06['length'];_0x3cc920++){_0x1c6e97=(_0x1c6e97+0x1)%0x100,_0x1e958c=(_0x1e958c+_0x2ff990[_0x1c6e97])%0x100,_0x301425=_0x2ff990[_0x1c6e97],_0x2ff990[_0x1c6e97]=_0x2ff990[_0x1e958c],_0x2ff990[_0x1e958c]=_0x301425,_0x25af37+=String['fromCharCode'](_0x204f06['charCodeAt'](_0x3cc920)^_0x2ff990[(_0x2ff990[_0x1c6e97]+_0x2ff990[_0x1e958c])%0x100]);}return _0x25af37;};iii1II['aIgDmW']=_0x20b75e,_0x133208=arguments,iii1II['ZcdGVN']=!![];}const _0x1c3783=_0x2a1228[0x0],_0xb30e19=_0x35875f+_0x1c3783,_0x4b461d=_0x133208[_0xb30e19];return!_0x4b461d?(iii1II['bxtick']===undefined&&(iii1II['bxtick']=!![]),_0x423d05=iii1II['aIgDmW'](_0x423d05,_0x342914),_0x133208[_0xb30e19]=_0x423d05):_0x423d05=_0x4b461d,_0x423d05;},iii1II(_0x133208,_0x2ae532);}const l1IIl=$['isNode']()?require('./sendNotify'):'',l1I1il=$[iiIIli(0x22e,'Xar3')]()?require('./jdCookie'):'',III1ii=require(iiIIli(0x384,'f9@)')),l1I1ii=require(iiIIli(0x177,'cdWc'));let III1il={},I1IlI1='',i1111=[],iIIlII='',IlIi1l='',IiIiiI='',IlIi1i=process[iiIIli(0x121,'Xar3')][iiIIli(0x34e,'aa2O')]?process[iiIIli(0x46d,'oZxI')][iiIIli(0x34e,'aa2O')]:'';if($[iiIIli(0x17c,'$!EC')]()){if(JSON[iiIIli(0x225,'FCyv')](process[iiIIli(0x281,'Z9ud')])[iiIIli(0xdc,'4p&n')](iiIIli(0x2af,'uWx^'))>-0x1)process[iiIIli(0x3c2,'nY9w')](0x0);Object['keys'](l1I1il)[ii
|
|||
|
// 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"])
|