mirror of https://github.com/6dylan6/jdpro.git
29 lines
179 KiB
JavaScript
29 lines
179 KiB
JavaScript
|
/*
|
|||
|
种豆得豆 脚本更新地址:jd_plantBean.js
|
|||
|
更新时间:2021-08-20
|
|||
|
活动入口:京东APP我的-更多工具-种豆得豆
|
|||
|
已支持IOS京东多账号,云端多京东账号
|
|||
|
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
|||
|
注:会自动关注任务中的店铺跟商品,介意者勿使用。
|
|||
|
互助码shareCode请先手动运行脚本查看打印可看到
|
|||
|
每个京东账号每天只能帮助3个人。多出的助力码将会助力失败。
|
|||
|
|
|||
|
=====================================Quantumult X=================================
|
|||
|
[task_local]
|
|||
|
22 7-21/2 * * * https://raw.githubusercontent.com/KingRan/JDJB/main/jd_plantBean.js, tag=种豆得豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzd.png, enabled=true
|
|||
|
|
|||
|
=====================================Loon================================
|
|||
|
[Script]
|
|||
|
cron "22 7-21/2 * * *" script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_plantBean.js,tag=京东种豆得豆
|
|||
|
|
|||
|
======================================Surge==========================
|
|||
|
京东种豆得豆 = type=cron,cronexp="22 7-21/2 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_plantBean.js
|
|||
|
|
|||
|
====================================小火箭=============================
|
|||
|
京东种豆得豆 = type=cron,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_plantBean.js, cronexpr="22 7-21/2 * * *", timeout=3600, enable=true
|
|||
|
|
|||
|
*/
|
|||
|
const $ = new Env('种豆得豆');
|
|||
|
var version_='jsjiami.com.v7';const _0x3d1615=_0x2b2b;(function(_0x351db4,_0x5d6330,_0x52ef04,_0x5d3249,_0x53a9a4,_0x852625,_0x336cff){return _0x351db4=_0x351db4>>0x9,_0x852625='hs',_0x336cff='hs',function(_0x39df65,_0x80cb0c,_0x4de81c,_0x2691a6,_0x2ea263){const _0x7750af=_0x2b2b;_0x2691a6='tfi',_0x852625=_0x2691a6+_0x852625,_0x2ea263='up',_0x336cff+=_0x2ea263,_0x852625=_0x4de81c(_0x852625),_0x336cff=_0x4de81c(_0x336cff),_0x4de81c=0x0;const _0x1e349a=_0x39df65();while(!![]&&--_0x5d3249+_0x80cb0c){try{_0x2691a6=parseInt(_0x7750af(0x461,'mud&'))/0x1+parseInt(_0x7750af(0x507,'S@qh'))/0x2*(-parseInt(_0x7750af(0x387,'yeE6'))/0x3)+-parseInt(_0x7750af(0x475,'sAS3'))/0x4*(parseInt(_0x7750af(0x1f8,'sAS3'))/0x5)+parseInt(_0x7750af(0x8fa,'9s!^'))/0x6*(parseInt(_0x7750af(0x39e,'JEfj'))/0x7)+parseInt(_0x7750af(0x2ef,'%Dtx'))/0x8*(-parseInt(_0x7750af(0x39b,'GVOd'))/0x9)+parseInt(_0x7750af(0x813,')PcQ'))/0xa*(parseInt(_0x7750af(0x25e,'%wTa'))/0xb)+parseInt(_0x7750af(0x2de,'Y2J&'))/0xc*(parseInt(_0x7750af(0x3c1,'dorw'))/0xd);}catch(_0x130387){_0x2691a6=_0x4de81c;}finally{_0x2ea263=_0x1e349a[_0x852625]();if(_0x351db4<=_0x5d3249)_0x4de81c?_0x53a9a4?_0x2691a6=_0x2ea263:_0x53a9a4=_0x2ea263:_0x4de81c=_0x2ea263;else{if(_0x4de81c==_0x53a9a4['replace'](/[kVPJtgwLATWxQqfUpOB=]/g,'')){if(_0x2691a6===_0x80cb0c){_0x1e349a['un'+_0x852625](_0x2ea263);break;}_0x1e349a[_0x336cff](_0x2ea263);}}}}}(_0x52ef04,_0x5d6330,function(_0x52c799,_0x50bddd,_0xc6c646,_0x381c30,_0x4e3989,_0x2b531a,_0x17f73d){return _0x50bddd='\x73\x70\x6c\x69\x74',_0x52c799=arguments[0x0],_0x52c799=_0x52c799[_0x50bddd](''),_0xc6c646=`\x72\x65\x76\x65\x72\x73\x65`,_0x52c799=_0x52c799[_0xc6c646]('\x76'),_0x381c30=`\x6a\x6f\x69\x6e`,(0x13b2a3,_0x52c799[_0x381c30](''));});}(0x19200,0x7afc0,_0x5aa4,0xcb),_0x5aa4)&&(version_=_0x5aa4);const _0x45ca27=(function(){const _0x50da79=_0x2b2b,_0x4fe50d={'PhrpJ':function(_0x5069f0,_0x51ca3f){return _0x5069f0!==_0x51ca3f;},'TDtbe':_0x50da79(0x8c0,'ac7G'),'eBYsP':_0x50da79(0x754,'dorw'),'GfTus':function(_0x1cf267,_0x53d15a){return _0x1cf267==_0x53d15a;},'Lejsx':function(_0x22e547,_0x28e498){return _0x22e547*_0x28e498;}};let _0x36a880=!![];return function(_0x3fdce5,_0x40fe8a){const _0x327de8={'QcRMk':function(_0x5b4cc0,_0x4929f7){const _0xf8c17=_0x2b2b;return _0x4fe50d[_0xf8c17(0x5ae,'X@Mh')](_0x5b4cc0,_0x4929f7);},'CvDrE':function(_0xe44fa2,_0x528eb3){const _0x370efe=_0x2b2b;return _0x4fe50d[_0x370efe(0x324,'dorw')](_0xe44fa2,_0x528eb3);}},_0xf32b1b=_0x36a880?function(){const _0x5afc56=_0x2b2b;if(_0x4fe50d[_0x5afc56(0x1d3,'ajBN')](_0x4fe50d[_0x5afc56(0x806,'heBf')],_0x4fe50d[_0x5afc56(0x8b1,'LTwR')])){if(_0x40fe8a){const _0x749f53=_0x40fe8a[_0x5afc56(0x484,'sAS3')](_0x3fdce5,arguments);return _0x40fe8a=null,_0x749f53;}}else{let _0x8356f3='';for(let _0x70d8b6 of _0x30c1cb){if(_0x327de8[_0x5afc56(0x1ed,'%Dtx')](_0x70d8b6,'x'))_0x8356f3+=_0x247df0[_0x5afc56(0x4b9,'S@qh')](_0x3d4472[_0x5afc56(0x4d1,'*%Np')](_0x327de8[_0x5afc56(0x1b4,'4B48')](_0x374e2b[_0x5afc56(0x268,'*%Np')](),_0x1d3960[_0x5afc56(0x3f5,'%Dtx')])));else _0x327de8[_0x5afc56(0x8b2,'mud&')](_0x70d8b6,'X')?_0x8356f3+=_0x5d313e[_0x5afc56(0x502,'UICr')](_0x4c7802[_0x5afc56(0x1a6,'UV%F')](_0x327de8[_0x5afc56(0x3f2,'4x7L')](_0x211d84[_0x5afc56(0x4ae,'HAv#')](),_0x3b0966[_0x5afc56(0x499,'aK5N')])))[_0x5afc56(0x1c8,'4x7L')]():_0x8356f3+=_0x70d8b6;}return _0x8356f3;}}:function(){};return _0x36a880=![],_0xf32b1b;};}()),_0xee57bf=_0x45ca27(this,function(){const _0x10845b=_0x2b2b,_0xe2302={'zzLQz':_0x10845b(0x7f4,'ajBN')};return _0xee57bf[_0x10845b(0x532,'*%Np')]()[_0x10845b(0x54c,'uD#w')](_0xe2302[_0x10845b(0x1b6,'GVOd')])[_0x10845b(0x841,'X@Mh')]()[_0x10845b(0x67a,'4x7L')](_0xee57bf)[_0x10845b(0x183,'dorw')](_0xe2302[_0x10845b(0x2b9,'JEfj')]);});_0xee57bf();let _0x92a5c4=!![],_0x2b06a4=[],_0x4288ac='',_0x11a334,_0x78150e,_0x479eda,_0x5b1538;ct=0x0;const _0x5a504=require(_0x3d1615(0x38e,'LK8a')),_0x96f4db=_0x3d1615(0x339,'*^d%'),_0x871d00=_0x3d1615(0x71c,'4ry&'),_0x2a8ee6=require(_0x3d1615(0x7cb,'Y2J&')),_0x25c537={'plantBeanIndex':_0x3d1615(0x582,'*^d%'),'receiveNutrients':_0x3d1615(0x7bc,'4ry&'),
|
|||
|
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.d
|