KR/jd_cash.js

25 lines
51 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
数钱领现金
活动入口京东APP搜索领现金进入
已支持IOS双京东账号,Node.js支持N个京东账号
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
============Quantumultx===============
[task_local]
#数钱领现金
2 7,18 * * * jd_cash.js, tag=数钱领现金, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
================Loon==============
[Script]
cron "2 7,18 * * *" script-path=jd_cash.js,tag=数钱领现金
===============Surge=================
数钱领现金 = type=cron,cronexp="2 7,18 * * *",wake-system=1,timeout=3600,script-path=jd_cash.js
============小火箭=========
数钱领现金 = type=cron,script-path=jd_cash.js, cronexpr="2 7,18 * * *", timeout=3600, enable=true
*/
const $ = new Env('数钱领现金');
var version_='jsjiami.com.v7';const ll1lii=iii1II;(function(lI1iil,lIilll,iIiiiI,ilI11i,ilI11l,li1I,IIliil){return lI1iil=lI1iil>>0x6,li1I='hs',IIliil='hs',function(ll1liI,lI1iiI,i11lII,iIIlli,ll1li1){const I1Illl=iii1II;iIIlli='tfi',li1I=iIIlli+li1I,ll1li1='up',IIliil+=ll1li1,li1I=i11lII(li1I),IIliil=i11lII(IIliil),i11lII=0x0;const iIIlll=ll1liI();while(!![]&&--ilI11i+lI1iiI){try{iIIlli=parseInt(I1Illl(0x2f6,'ZTZ*'))/0x1+-parseInt(I1Illl(0x1a1,'@Kvy'))/0x2+-parseInt(I1Illl(0x2b7,'Rf^S'))/0x3*(parseInt(I1Illl(0x311,'ZTZ*'))/0x4)+parseInt(I1Illl(0x1e7,'D3yi'))/0x5+-parseInt(I1Illl(0x22d,'cI@G'))/0x6*(-parseInt(I1Illl(0x1a8,')el&'))/0x7)+-parseInt(I1Illl(0x1f0,'14hg'))/0x8+-parseInt(I1Illl(0x24c,'@eix'))/0x9*(-parseInt(I1Illl(0x2c9,'D3yi'))/0xa);}catch(I1iiiI){iIIlli=i11lII;}finally{ll1li1=iIIlll[li1I]();if(lI1iil<=ilI11i)i11lII?ilI11l?iIIlli=ll1li1:ilI11l=ll1li1:i11lII=ll1li1;else{if(i11lII==ilI11l['replace'](/[bPMGYFxSNTyLkdJHIX=]/g,'')){if(iIIlli===lI1iiI){iIIlll['un'+li1I](ll1li1);break;}iIIlll[IIliil](ll1li1);}}}}}(iIiiiI,lIilll,function(iiI1il,iiI1ii,I1iii1,lilii1,iIiii1,ll1lil,IIlil1){return iiI1ii='\x73\x70\x6c\x69\x74',iiI1il=arguments[0x0],iiI1il=iiI1il[iiI1ii](''),I1iii1='\x72\x65\x76\x65\x72\x73\x65',iiI1il=iiI1il[I1iii1]('\x76'),lilii1='\x6a\x6f\x69\x6e',(0x1362e5,iiI1il[lilii1](''));});}(0x2f00,0x425fd,Iii11l,0xbe),Iii11l)&&(version_=Iii11l);const IllIl1=$[ll1lii(0x181,'6Kr^')]()?require(ll1lii(0x2f9,'QlKG')):'',ll1Ii=$[ll1lii(0x31a,'ZZbE')]()?require(ll1lii(0x19d,'or0d')):'',ll1Il=require(ll1lii(0x228,'nkfu')),iiIi11=require(ll1lii(0x1b7,'or0d')),ill1II=require(ll1lii(0x2c6,'@eix')),i1llil=process['env']['JD_SIGN_KRAPI']||'';let i1llii=!![],l1i1I1=[],llIIil='',llIIii;if($['isNode']()){Object['keys'](ll1Ii)[ll1lii(0x201,'nkfu')](iiIi1i=>{const li11=ll1lii;l1i1I1[li11(0x2ab,'7M*7')](ll1Ii[iiIi1i]);});if(process[ll1lii(0x1bd,'xu*c')][ll1lii(0x25c,'ZZbE')]&&process[ll1lii(0x2aa,'8Nru')][ll1lii(0x150,'Vf5D')]==='false')console[ll1lii(0x1eb,'OU87')]=()=>{};}else l1i1I1=[$[ll1lii(0x174,'ZZbE')]('CookieJD'),$['getdata']('CookieJD2'),...ili11l($[ll1lii(0x1c6,'iD04')](ll1lii(0x1cf,'paA*'))||'[]')[ll1lii(0x2ad,'8Nru')](liI1ll=>liI1ll['cookie'])]['filter'](ll1II=>!!ll1II);const Ii1I1i='https://api.m.jd.com/client.action';function Iii11l(){const lI1ill=(function(){return[version_,'yTSjLsjdFiSSamiSMN.kcIbToJmSJ.Ybvx7XGPxH==','WP43latcTq','WOfPW6JcMLSYjW','vCk4fq','qmkOqqr0WRS','ASozAmkroHi','WRhcSZ/dU8kTpW','W64kexGI','W6FdIWhdVCkSWRibWQHWWQZcOCokpq','W6H0WOSI','sZW9W7C6','W5lcHHLJ','bmoCW67cUNu','W4C9WPzjlG','C+IVIoMhN+AwPEEBI+w/JUIpS+woUW7cTSkLpCosW6qIWPz1WQ9yCXtdMKGmW6qlkSosW7KctLRdLZ95WP3cV2qTzcNcPCkrW5xdVmkjW6jSWPT6WOn0','W70DWPaqmb0','5O6Y5y2E6i2R5y2k5AEM6lA2776b6lEM6l2N','W53cHHPdW5aP','W6xcMbddRa','zmkWW61DW6u','hCkwFmoPxa','tSkUxa','WPO3msm','WQHdW7aeWOK','bCoky8oHW6RcJMBdKxxcIX7cVMyAW4VcPq','wSkkWPzswmkcWO8','W4KQWQ8','W5BdPCkMhSoF','q8od5lIx5yIRAG','WR7cP8kBWQ8iz20jgatcGgn5pcnzW4LIxSkKhZHyzJKkWOy8W6BcKSo5W5pdHmo/W5ZcN8kQWQWHcZtdK8o+W7qSW4xcNCobW4xdMmoQzSoMW7yyyrBdKSofAa8tW4GHW5xdNKxcNmoxW4y8nW','56+c5yUf5AsO6lwGFq','WPVcKCo7W7Wp','WO0ZzvRcImkgWOy','W7P0WPmQlG','qwjegh4','WPi1zq','F8oH5lUa5yUOjW','W53cMLpcOhm','WP80zKBcTmkBWPa','WP/NJ7dPHOi','FSkpW6jgW4BdLh0','Fmo4W6TH','5lQo5lUD5PY25yUO5zMV6k2J6zw55PAS5O6v5lUK56Mn77+56kYL5Qkq5P6b6iAH6lMg6k+F5AEX576w57Qk5Oog5yE5','W4FcV3xcSa','mhrzWPRcH8koiW','n8kdvmoVF8kGFfu','FSooWPBdImk2','c1PHymoCW68','W4KIWRe','W5WZmNSNamoUWOZdJ8oHW7S','W43cSSkWCmkDW7pcJ2ZcGIFdJG','WQKrbSocW7L9','WPa7B1e','ESkcWPJdQW','WRhcMH/dLCkp','uYiq','z3z/','W6DGWPK6ia','lJz9hNG','W5e0WQBdJW','WQxdSYFdU8kJiGLvW5NcGspcOSkPE8ocadGGW5OXWRa4W7BcRCk6E8oEWOlcRMi3W4XTdgVdUmkVW7ddNgRcUSkKyCkNeSoWjYBdG8obExNcHqafW7RcGG','WPvJW6NcQLyL','xSk7mWal','WOqas1FcTa','eSokWOjIv8kcWPnFWOxcLGn6W4uHW73dPwCwW5RcR3y','qCokW7v7cW','W7efWPvTgW','j8kvw8oJF8kUzvLoiq','W6KxnKyj','WPCDWP9EeWz+','FmoDB8kf','g8oYd3WWW6VdPCkiWQlcKgBcGq','bszih0Pnamo0','BSk3ACkpW5iCp8kHofH+W7ddQuxcQ8kMhSozW5f6WP9YW7RcLSkIkXGbhCoFW7rGEcPMWQBdOrDluqXijSkPWQhdGsBdQmkyWPupngPOd2acWPddNsjrW4PwW6fxWR11','W5/cKrfJAG','CCopvCklmGm','W4JcKXxdMCob','W5COWQxdN
// 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"])