28 lines
727 KiB
JavaScript
28 lines
727 KiB
JavaScript
|
/*
|
||
|
v6.3
|
||
|
京东到家果园任务脚本,支持qx,loon,shadowrocket,surge,nodejs
|
||
|
兼容京东jdCookie.js
|
||
|
手机设备在boxjs里填写cookie
|
||
|
boxjs订阅地址:https://gitee.com/passerby-b/javascript/raw/master/JD/passerby-b.boxjs.json
|
||
|
|
||
|
[task_local]
|
||
|
10 0,3,8,11,17 * * * https://raw.githubusercontent.com/passerby-b/JDDJ/main/jddj_fruit.js
|
||
|
|
||
|
[Script]
|
||
|
cron "10 0,3,8,11,17 * * *" script-path=https://raw.githubusercontent.com/passerby-b/JDDJ/main/jddj_fruit.js,tag=京东到家果园任务
|
||
|
|
||
|
*/
|
||
|
|
||
|
let isNotify = true;//是否通知,仅限nodejs
|
||
|
let ckPath = './jdCookie.js';//ck路径,环境变量:JDDJ_CKPATH
|
||
|
|
||
|
function _0x43f741(_0x2c5e7b,_0x4f2c12,_0x1ee522,_0x545e76,_0x47e930){return _0x4699(_0x2c5e7b- -0x9,_0x1ee522);}(function(_0x42a832,_0x4381a5){function _0x57e53c(_0x52d1bd,_0x5e4bc9,_0x62315f,_0x30a150,_0x4324d5){return _0x4699(_0x62315f-0x271,_0x4324d5);}function _0x257f5f(_0x3ae1df,_0x5adab7,_0x4a107d,_0x34d8c5,_0x416ca2){return _0x4699(_0x34d8c5-0x291,_0x416ca2);}const _0x499704=_0x42a832();function _0x2dc33a(_0x6b2b84,_0x52ec37,_0x46bca5,_0x27e2d4,_0x4c46da){return _0x4699(_0x4c46da-0x17b,_0x27e2d4);}function _0x40fe8e(_0x3af446,_0x30249d,_0x5f992,_0x43a2e0,_0x2b3bc4){return _0x4699(_0x2b3bc4- -0x10,_0x30249d);}function _0x26a6d2(_0x48e65b,_0x307d98,_0x11aaa8,_0xe950cb,_0x130ef4){return _0x4699(_0x307d98- -0x1ac,_0xe950cb);}while(!![]){try{const _0xd84d49=-parseInt(_0x257f5f(0x9a4,0xfb5,0xfbe,0x1129,'\x47\x38\x4e\x52'))/(-0x3*0xab6+-0x160+0x2183)+parseInt(_0x57e53c(0xd9e,0x158f,0xfa9,0xb25,'\x62\x77\x6a\x54'))/(-0x2*0x89e+-0x2b*-0x29+-0xb*-0xf1)+parseInt(_0x2dc33a(0x97a,0x83e,0xa2c,'\x6b\x59\x6b\x44',0xa98))/(-0x2b0*0xd+0x1501*0x1+0xdf2)+-parseInt(_0x57e53c(0x19a7,0x1760,0x14e6,0x1964,'\x42\x23\x5e\x5b'))/(0x4a3*0x5+-0xe92+0x1f*-0x47)+parseInt(_0x40fe8e(-0x193,'\x57\x73\x5d\x21',-0x2cc,0x908,0x4d1))/(-0xea5+0x3*-0x1f7+0x148f*0x1)*(parseInt(_0x57e53c(0x950,0x14a7,0xcee,0x39c,'\x6b\x5e\x4e\x4d'))/(0x170+0x1f5a+-0x24*0xe9))+parseInt(_0x26a6d2(0x849,0xf6b,0x8a6,'\x6b\x5e\x4e\x4d',0xaae))/(-0x8c5*-0x2+0x1dd7*-0x1+-0x41c*-0x3)*(parseInt(_0x2dc33a(0x50b,0xa25,0xf38,'\x24\x6e\x5d\x79',0xa15))/(0x61*-0x1+0x9*0x17+0x33*-0x2))+-parseInt(_0x40fe8e(-0x689,'\x5a\x30\x31\x38',0x62d,0xfd,0x2d2))/(-0x1ae7+0x188c+0x264)*(parseInt(_0x2dc33a(0x14e8,0x9f3,0x849,'\x24\x6e\x5d\x79',0xebd))/(0x1*0x8cf+-0x2b9+-0xac*0x9));if(_0xd84d49===_0x4381a5)break;else _0x499704['push'](_0x499704['shift']());}catch(_0x239553){_0x499704['push'](_0x499704['shift']());}}}(_0x10a8,-0x27*-0xc45+0x7*-0xa511+0x85991));const _0x3bfb29=(function(){function _0x4838a3(_0x3a1681,_0x2080d3,_0x5460e3,_0x1042d5,_0x124dc4){return _0x4699(_0x3a1681- -0x276,_0x124dc4);}function _0x1b06ee(_0x43031b,_0xa9c4d2,_0x21cd60,_0x21c5b9,_0x4644fe){return _0x4699(_0xa9c4d2-0x70,_0x4644fe);}function _0x483ecc(_0x26bf35,_0x1f5bf9,_0x1fdb0f,_0x121c29,_0x3d288e){return _0x4699(_0x3d288e- -0x37e,_0x1f5bf9);}function _0x380821(_0x398a98,_0x294714,_0x548d2b,_0xed822e,_0x1d41be){return _0x4699(_0x1d41be-0x9e,_0xed822e);}const _0x518448={'\x43\x78\x6b\x72\x41':_0x376fe4(0x104a,0x1586,0x17e1,0x18d8,'\x46\x6f\x5e\x6c')+_0x376fe4(0xf33,0x111e,0xc19,0x642,'\x53\x41\x31\x35')+_0x1b06ee(0x2c7,0x533,0x7af,-0x38c,'\x78\x56\x67\x4f')+_0x483ecc(0x398,'\x42\x23\x5e\x5b',-0x288,-0x230,0x13f)+_0x4838a3(0x34f,0x2f4,-0x54c,-0x3c4,'\x53\x34\x6c\x29'),'\x7a\x73\x67\x48\x72':function(_0x2f2a0d,_0x22c89b){return _0x2f2a0d+_0x22c89b;},'\x67\x57\x6f\x69\x4b':_0x483ecc(-0x4ff,'\x77\x40\x43\x59',0x135,0x370,-0x11b),'\x45\x74\x4b\x57\x4f':function(_0x508925,_0x38a6be){return _0x508925===_0x38a6be;},'\x6c\x67\x7a\x6c\x59':_0x483ecc(0xd86,'\x36\x6c\x21\x41',0x74f,0x86c,0x8be),'\x67\x6e\x66\x64\x6b':function(_0x4e4c97,_0x207ec1){return _0x4e4c97===_0x207ec1;},'\x55\x4b\x74\x66\x4f':_0x376fe4(0x1620,0x1f0a,0x15e7,0x1853,'\x4f\x4f\x25\x29'),'\x64\x5a\x7a\x41\x57':_0x1b06ee(0x143b,0x1021,0x10de,0xa7d,'\x5d\x78\x21\x39'),'\x4f\x73\x59\x53\x41':_0x4838a3(0x1185,0xba9,0x17ab,0xd5b,'\x32\x49\x5b\x49')};function _0x376fe4(_0x42e9e9,_0x28c6ad,_0x2f09b0,_0x1ea28c,_0x36598a){return _0x4699(_0x42e9e9-0x39c,_0x36598a);}let _0x59f41c=!![];return function(_0x2b89d6,_0x332be3){function _0x5df1a0(_0x4c7477,_0x349ffb,_0x2d61b8,_0x3d75e1,_0x43a985){return _0x4838a3(_0x349ffb-0x2d6,_0x349ffb-0x12e,_0x2d61b8-0x1a3,_0x3d75e1-0x1e,_0x2d61b8);}function _0x257666(_0x4b5c07,_0x559923,_0x1aaa32,_0x4cfd28,_0x425085){return _0x380821(_0x4b5c07-0xbb,_0x559923-0x16f,_0x1aaa32-0x1e1,_0x425085,_0x1aaa32-0x200);}function _0x274524(_0x5b057a,_0x30a06e,_0x531dd6,_0x20966e,_0x149da7){return _0x483ecc(_0x5b057a-0x177,_0x149da7,_0x531dd6-0xab,_0x20966e-0x166,_0x5b057a-0x57f);}const _0x40bb73={'\x68\x4e\x51\x79\x62':_0x518448[_0x1d87ac(-0x55c,0x51a,-0x497
|
||
|
|
||
|
/*********************************** API *************************************/
|
||
|
function ENV() { const e = "undefined" != typeof $task, t = "undefined" != typeof $loon, s = "undefined" != typeof $httpClient && !t, i = "function" == typeof require && "undefined" != typeof $jsbox; return { isQX: e, isLoon: t, isSurge: s, isNode: "function" == typeof require && !i, isJSBox: i, isRequest: "undefined" != typeof $request, isScriptable: "undefined" != typeof importModule } } function HTTP(e = { baseURL: "" }) { const { isQX: t, isLoon: s, isSurge: i, isScriptable: n, isNode: o } = ENV(), r = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/\/=]*)/; const u = {}; return ["GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS", "PATCH"].forEach(l => u[l.toLowerCase()] = (u => (function (u, l) { l = "string" == typeof l ? { url: l } : l; const h = e.baseURL; h && !r.test(l.url || "") && (l.url = h ? h + l.url : l.url); const a = (l = { ...e, ...l }).timeout, c = { onRequest: () => { }, onResponse: e => e, onTimeout: () => { }, ...l.events }; let f, d; if (c.onRequest(u, l), t) f = $task.fetch({ method: u, ...l }); else if (s || i || o) f = new Promise((e, t) => { (o ? require("request") : $httpClient)[u.toLowerCase()](l, (s, i, n) => { s ? t(s) : e({ statusCode: i.status || i.statusCode, headers: i.headers, body: n }) }) }); else if (n) { const e = new Request(l.url); e.method = u, e.headers = l.headers, e.body = l.body, f = new Promise((t, s) => { e.loadString().then(s => { t({ statusCode: e.response.statusCode, headers: e.response.headers, body: s }) }).catch(e => s(e)) }) } const p = a ? new Promise((e, t) => { d = setTimeout(() => (c.onTimeout(), t(`${u} URL: ${l.url} exceeds the timeout ${a} ms`)), a) }) : null; return (p ? Promise.race([p, f]).then(e => (clearTimeout(d), e)) : f).then(e => c.onResponse(e)) })(l, u))), u } function API(e = "untitled", t = !1) { const { isQX: s, isLoon: i, isSurge: n, isNode: o, isJSBox: r, isScriptable: u } = ENV(); return new class { constructor(e, t) { this.name = e, this.debug = t, this.http = HTTP(), this.env = ENV(), this.node = (() => { if (o) { return { fs: require("fs") } } return null })(), this.initCache(); Promise.prototype.delay = function (e) { return this.then(function (t) { return ((e, t) => new Promise(function (s) { setTimeout(s.bind(null, t), e) }))(e, t) }) } } initCache() { if (s && (this.cache = JSON.parse($prefs.valueForKey(this.name) || "{}")), (i || n) && (this.cache = JSON.parse($persistentStore.read(this.name) || "{}")), o) { let e = "root.json"; this.node.fs.existsSync(e) || this.node.fs.writeFileSync(e, JSON.stringify({}), { flag: "wx" }, e => console.log(e)), this.root = {}, e = `${this.name}.json`, this.node.fs.existsSync(e) ? this.cache = JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)) : (this.node.fs.writeFileSync(e, JSON.stringify({}), { flag: "wx" }, e => console.log(e)), this.cache = {}) } } persistCache() { const e = JSON.stringify(this.cache, null, 2); s && $prefs.setValueForKey(e, this.name), (i || n) && $persistentStore.write(e, this.name), o && (this.node.fs.writeFileSync(`${this.name}.json`, e, { flag: "w" }, e => console.log(e)), this.node.fs.writeFileSync("root.json", JSON.stringify(this.root, null, 2), { flag: "w" }, e => console.log(e))) } write(e, t) { if (this.log(`SET ${t}`), -1 !== t.indexOf("#")) { if (t = t.substr(1), n || i) return $persistentStore.write(e, t); if (s) return $prefs.setValueForKey(e, t); o && (this.root[t] = e) } else this.cache[t] = e; this.persistCache() } read(e) { return this.log(`READ ${e}`), -1 === e.indexOf("#") ? this.cache[e] : (e = e.substr(1), n || i ? $persistentStore.read(e) : s ? $prefs.valueForKey(e) : o ? this.root[e] : void 0) } delete(e) { if (this.log(`DELETE ${e}`), -1 !== e.indexOf("#")) { if (e = e.substr(1), n || i) return $persistentStore.write(null, e); if (s) return $prefs.removeValueForKey(e); o && delete this.root[e] } else delete this.cache[e]; this.persistCache() } notify(e, t = "", l = "", h = {}) { const a = h["open-url"], c = h["media-url"]; if (s && $notify(e, t, l, h), n && $notification.post(e, t, l + `${c ? "\n多
|
||
|
/*****************************************************************************/
|
||
|
|
||
|
/*********************************** SHA256 *************************************/
|
||
|
var hexcase=0;var b64pad="";function hex_sha256(s){return rstr2hex(rstr_sha256(str2rstr_utf8(s)))}function b64_sha256(s){return rstr2b64(rstr_sha256(str2rstr_utf8(s)))}function any_sha256(s,e){return rstr2any(rstr_sha256(str2rstr_utf8(s)),e)}function hex_hmac_sha256(k,d){return rstr2hex(rstr_hmac_sha256(str2rstr_utf8(k),str2rstr_utf8(d)))}function b64_hmac_sha256(k,d){return rstr2b64(rstr_hmac_sha256(str2rstr_utf8(k),str2rstr_utf8(d)))}function any_hmac_sha256(k,d,e){return rstr2any(rstr_hmac_sha256(str2rstr_utf8(k),str2rstr_utf8(d)),e)}function sha256_vm_test(){return hex_sha256("abc").toLowerCase()=="ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"}function rstr_sha256(s){return binb2rstr(binb_sha256(rstr2binb(s),s.length*8))}function rstr_hmac_sha256(key,data){var bkey=rstr2binb(key);if(bkey.length>16)bkey=binb_sha256(bkey,key.length*8);var ipad=Array(16),opad=Array(16);for(var i=0;i<16;i++){ipad[i]=bkey[i]^0x36363636;opad[i]=bkey[i]^0x5C5C5C5C}var hash=binb_sha256(ipad.concat(rstr2binb(data)),512+data.length*8);return binb2rstr(binb_sha256(opad.concat(hash),512+256))}function rstr2hex(input){try{hexcase}catch(e){hexcase=0}var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var output="";var x;for(var i=0;i<input.length;i++){x=input.charCodeAt(i);output+=hex_tab.charAt((x>>>4)&0x0F)+hex_tab.charAt(x&0x0F)}return output}function rstr2b64(input){try{b64pad}catch(e){b64pad=''}var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var output="";var len=input.length;for(var i=0;i<len;i+=3){var triplet=(input.charCodeAt(i)<<16)|(i+1<len?input.charCodeAt(i+1)<<8:0)|(i+2<len?input.charCodeAt(i+2):0);for(var j=0;j<4;j++){if(i*8+j*6>input.length*8)output+=b64pad;else output+=tab.charAt((triplet>>>6*(3-j))&0x3F)}}return output}function rstr2any(input,encoding){var divisor=encoding.length;var remainders=Array();var i,q,x,quotient;var dividend=Array(Math.ceil(input.length/2));for(i=0;i<dividend.length;i++){dividend[i]=(input.charCodeAt(i*2)<<8)|input.charCodeAt(i*2+1)}while(dividend.length>0){quotient=Array();x=0;for(i=0;i<dividend.length;i++){x=(x<<16)+dividend[i];q=Math.floor(x/divisor);x-=q*divisor;if(quotient.length>0||q>0)quotient[quotient.length]=q}remainders[remainders.length]=x;dividend=quotient}var output="";for(i=remainders.length-1;i>=0;i--)output+=encoding.charAt(remainders[i]);var full_length=Math.ceil(input.length*8/(Math.log(encoding.length)/Math.log(2)));for(i=output.length;i<full_length;i++)output=encoding[0]+output;return output}function str2rstr_utf8(input){var output="";var i=-1;var x,y;while(++i<input.length){x=input.charCodeAt(i);y=i+1<input.length?input.charCodeAt(i+1):0;if(0xD800<=x&&x<=0xDBFF&&0xDC00<=y&&y<=0xDFFF){x=0x10000+((x&0x03FF)<<10)+(y&0x03FF);i++}if(x<=0x7F)output+=String.fromCharCode(x);else if(x<=0x7FF)output+=String.fromCharCode(0xC0|((x>>>6)&0x1F),0x80|(x&0x3F));else if(x<=0xFFFF)output+=String.fromCharCode(0xE0|((x>>>12)&0x0F),0x80|((x>>>6)&0x3F),0x80|(x&0x3F));else if(x<=0x1FFFFF)output+=String.fromCharCode(0xF0|((x>>>18)&0x07),0x80|((x>>>12)&0x3F),0x80|((x>>>6)&0x3F),0x80|(x&0x3F))}return output}function str2rstr_utf16le(input){var output="";for(var i=0;i<input.length;i++)output+=String.fromCharCode(input.charCodeAt(i)&0xFF,(input.charCodeAt(i)>>>8)&0xFF);return output}function str2rstr_utf16be(input){var output="";for(var i=0;i<input.length;i++)output+=String.fromCharCode((input.charCodeAt(i)>>>8)&0xFF,input.charCodeAt(i)&0xFF);return output}function rstr2binb(input){var output=Array(input.length>>2);for(var i=0;i<output.length;i++)output[i]=0;for(var i=0;i<input.length*8;i+=8)output[i>>5]|=(input.charCodeAt(i/8)&0xFF)<<(24-i%32);return output}function binb2rstr(input){var output="";for(var i=0;i<input.length*32;i+=8)output+=String.fromCharCode((input[i>>5]>>>(24-i%32))&0xFF);return output}function sha256_S(X,n){return(X>>>n)|(X<<(32-n))}function sha256_R(X,n){return(X>>>n)}function sha256_Ch(x,y,z){return((x&y)^((~x)&z))}function sha256_Maj(x,y,z){return((x&y)^(x&z)^(y&z))}function sha256_Sigma0256(x){return(sha256_S(x,2)^sha256_S(x,13)^sha256_
|
||
|
/*********************************** SHA256 *************************************/
|