From fa5ec465e8fd3616cb860cbb48159dd66ff16483 Mon Sep 17 00:00:00 2001 From: haptear Date: Mon, 10 Jan 2022 14:14:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BF=AB=E6=89=8B=20?= =?UTF-8?q?=E4=B8=AD=E9=9D=92=E7=9C=8B=E7=9C=8B=E4=BF=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=AF=8F=E6=AC=A1=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90body?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ks/ks_pro.js | 213 ++++++++++++++++------- zqjson/zq_today_score.js | 11 +- zqjson/zqkkzbody_gen.js | 363 +++++++++++++++++++++++---------------- zqjson/zqkkzrw.js | 95 ++++++++-- zqjson/zqreward1_pro.js | 27 ++- zqjson/中青.txt | 7 +- 6 files changed, 487 insertions(+), 229 deletions(-) diff --git a/ks/ks_pro.js b/ks/ks_pro.js index 1906ca2..35c1ba7 100644 --- a/ks/ks_pro.js +++ b/ks/ks_pro.js @@ -1,21 +1,15 @@ +//定时建议 */30 8-18/1 * * * /* 快手极速 -定时建议 10 7-16/1 * * * export kshd='cookie1@cookie2@cookie3' +//提现微信或支付宝 +export kspaymodel='wechat@alipay@wechat' cookie获取: 重写地址:https://nebula.kuaishou.com/rest/n/nebula/activity/earn/overview/basicInfo -mitm: nebula.kuaishou.com -api2.e.kuaishou.com -api.e.kuaishou.com - -自动获取不到的 手动抓 - -签到: kshd 整段cookie +mimt:nebula.kuaishou.com 广告获取: https://api.e.kuaishou.com/rest/e/v1/reward/ad -广告请求: ksggqqbody 整段body - */ const jsname = '快手极速' @@ -30,13 +24,15 @@ let notifyFlag=1 let kshd = ($.isNode() ? (process.env.kshd) : ($.getval('kshd'))) || ''; let kshdArr = [] - +let kspaymodel = ($.isNode() ? (process.env.kspaymodel) : ($.getval('kspaymodel'))) || ''; +let kspaymodelArr = [] let userIdx = 0 let kscookie='' let ksgjbody='' let waittime=1 +let paymodel='' const hour = new Date(new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000).getHours(); @@ -55,19 +51,24 @@ const minute = new Date(new Date().getTime() + new Date().getTimezoneOffset() * { if(!await CheckEnv()) return - //用来检测任务状态的cookie - kscookie=kshdArr[0] - await checktask(kscookie) - await $.wait(1000) - if(hour >=5 && hour<23 && minute < 30){ - for(userIdx=0; userIdx=5 && hour<23 && minute < 30){ console.log(`\n用户${userIdx+1} 开宝箱`) - kscookie=kshdArr[userIdx] await openbox(kscookie,userIdx) await $.wait(1000) - await userinfo(kscookie) + await userinfo(kscookie,userIdx) + if (hour==18) await checkwithdraw(kscookie,userIdx) } } + await tgrj() await $.wait(1000) await showmsg() @@ -92,7 +93,21 @@ async function CheckEnv() { console.log('没有找到kshd') return false } - + if(kspaymodel) { + if(kspaymodel.indexOf('@') > -1) { + let kspaymodels = kspaymodel.split('@') + for(let i=0; i-1){ + tmpwithdraw += withdrawlist[k]+'\t' + if (amount>=parseInt(withdrawlist[k]) && !result.data.isLimit ){ + console.log('开始提现'+withdrawlist[k]) + notifyStr += `开始提现${withdrawlist[k]}\n` + await withdraw(cookie,userIdx,withdrawlist[k]*100) + } + k--; + } + console.log('可提:'+tmpwithdraw) + } +} +//提现 +async function withdraw(cookie,userIdx,amount) { + let caller = PrintCaller() + let url = 'https://www.kuaishoupay.com/pay/account/h5/withdraw/apply' + let referer='https://www.kuaishoupay.com/kspay-v2/withdraw?accountGroupKey=NEBULA_CASH_ACCOUNT&withdrawAmount='+amount + let reqBody = 'account_group_key=NEBULA_CASH_ACCOUNT&mobile_code=&fen='+amount+'&provider='+paymodel+'&total_fen='+amount+'&commission_fen=0&attach=&biz_content=&session_id=' + let urlObject = PopulatePostUrl(url,reqBody) + urlObject.headers.Referer=referer + urlObject.headers.Origin='https://www.kuaishoupay.com' + urlObject.headers.Host='www.kuaishoupay.com' + await HttpPost(urlObject,caller) + let result = httpResult; + if(!result) return + + if (result.result == 'SUCCESS') { + console.log(result.title+result.msg) + notifyStr += `${result.title}${result.msg}\n` + }else console.log(`${JSON.stringify(result)}`); + +} //tasks 列表 -async function checktask(cookie) { +async function checktask(cookie,userIdx) { let caller = PrintCaller() let url = 'https://nebula.kuaishou.com/rest/n/nebula/activity/earn/overview/tasks?addressBookAccessStatus=true&pushNotificationStatus=false&imei=&oaid=' let urlObject = PopulateGetUrl(url) @@ -204,38 +270,33 @@ async function checktask(cookie) { if( tasksArr && Array.isArray(tasksArr)) { for (let i=0;i=5 && hour<17 && minute < 15){ console.log(`${tasksArr[i].name}--去完成`) console.log(`${tasksArr[i].desc}`) - for(userIdx=0; userIdx5 && hour<17 && minute < 20){ + }else if (taskid=='148' && taskstatus!=true){//逛街任务 + //if(hour >5 && hour<17 ){ console.log(`${tasksArr[i].name}--去完成\n`) console.log(`${tasksArr[i].desc}`) - for(userIdx=0; userIdx0) - console.log(`用户${userIdx+1}宝箱开启还需${opentime}`) + if (opentime>0){ + opentime=Math.floor(opentime/600)/100 + console.log(`用户${userIdx+1}宝箱开启还需${opentime}分钟`) + } else console.log(`用户${userIdx+1}:明日再来`) } }else console.log(`${result.message}`) @@ -298,7 +390,6 @@ async function openbox_double(cookie,spid,llsid,userIdx) { }else console.log(`${result.message}`) } //逛街 -//{"result":1,"message":"成功","data":{"amount":50},"host":"ad-rs6-bjmt2090.idcyz.hb1.kwaidc.com","traceId":"ELqAgIDQqY67ChiLDSDYotrx2C8op4O2nAM=","ts":1638768480734} async function ksgj(cookie,userIdx) { ksgjbody = cookie.split('client_key=')[1].split('&')[0] let caller = PrintCaller() @@ -369,7 +460,7 @@ function PopulatePostUrl(url,reqBody){ 'Connection': 'keep-alive', 'Content-Length': '1138', 'Content-Type': 'application/x-www-form-urlencoded', - 'Cookie': '' + kscookie + 'Cookie': kscookie }, body: reqBody, } @@ -384,7 +475,7 @@ function PopulateGetUrl(url){ 'Connection': 'keep-alive', 'Content-Length': '1138', 'Content-Type': 'application/x-www-form-urlencoded', - 'Cookie': '' + kscookie + 'Cookie': kscookie } } return urlObject; @@ -458,4 +549,4 @@ function randomNum(minNum, maxNum) { break; } } -function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } \ No newline at end of file +function Env(t, e) { 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } 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("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/zqjson/zq_today_score.js b/zqjson/zq_today_score.js index 56ebe26..344d87b 100644 --- a/zqjson/zq_today_score.js +++ b/zqjson/zq_today_score.js @@ -22,12 +22,12 @@ let zq_cookieArr = [] let zq_cookies = "" if (zq_cookie) { - if (zq_cookie.indexOf("@") == -1 && zq_cookie.indexOf("@") == -1) { + if (zq_cookie.indexOf("\n") == -1 && zq_cookie.indexOf("\n") == -1) { zq_cookieArr.push(zq_cookie) - } else if (zq_cookie.indexOf("@") > -1) { - zq_cookies = zq_cookie.split("@") - } else if (process.env.zq_cookie && process.env.zq_cookie.indexOf('@') > -1) { - zq_cookieArr = process.env.zq_cookie.split('@'); + } else if (zq_cookie.indexOf("\n") > -1) { + zq_cookies = zq_cookie.split("\n") + } else if (process.env.zq_cookie && process.env.zq_cookie.indexOf('\n') > -1) { + zq_cookieArr = process.env.zq_cookie.split('\n'); console.log(`您选择的是用"@"隔开\n`) } } else if($.isNode()){ @@ -166,6 +166,7 @@ function do_getOrderList() { for(let item of result.data) { if(item.description) { message+=`风险:${item.description} 评测时间:${item.add_time_str} \n` + console.log(`风险:${item.description} 评测时间:${item.add_time_str} \n`); } } } diff --git a/zqjson/zqkkzbody_gen.js b/zqjson/zqkkzbody_gen.js index 7b2c6d8..35c3efb 100644 --- a/zqjson/zqkkzbody_gen.js +++ b/zqjson/zqkkzbody_gen.js @@ -5,9 +5,12 @@ zqcookie必须包括uid,zqkey,zqkey_id json格式如下:zq_yilia.json json文件名可以export zqkd='./zq_yilia.json'定义 { - "user":"yilia", - "zqcookie":"" + "user":"yilia", + "zqcookie":"" } + +zqkkzbody_gen yanhua w //生成body,并把ids写入文件 +zqkkzbody_gen 9839 r //通过读取ids生成body */ const $ = new Env("中青看看赚生成body"); @@ -15,42 +18,41 @@ let logDebug = 0 const CryptoJS = require('./crypto-js') var fs = require("fs"); -const args = process.argv.slice(2); -if(args.length==0) -{ - console.log("请传入要生成数据的用户名称"); - return; -} -let filename=`./zq_${args[0]}.json`;;//(args.length>0?args[0]:undefined)||"./zqkkz_001.json"; -var kkzname=filename.replace(/.json/, "_kkz.txt"); +// const args = process.argv.slice(2); +// if (args.length == 0) { +// console.log("请传入要生成数据的用户名称"); +// return; +// } + +let idsModle = "w";//ids模式 w:写模式 r:对模式 +let userId='7627' +// if (args.length > 1) { +// idsModle = args[1]; +// } + +//通过黑号7627生成任务id列表 +let jsonSettingFileName = `./zq_7627.json`;;//(args.length>0?args[0]:undefined)||"./zqkkz_001.json"; +var kkzBodyFileName = jsonSettingFileName.replace(/.json/, "_kkz.txt"); +var kkzIdsFileName ="./zq_kkzids.txt"; +// let filename = "E:\\Works\\Git\\github\\autotask\\othenautojob\\zqjson\\" + `./zq_${args[0]}.json`;;//(args.length>0?args[0]:undefined)||"./zqkkz_001.json"; +// var kkzBodyFileName = "E:\\Works\\Git\\github\\autotask\\othenautojob\\zqjson\\" + `./zq_${args[0]}_kkz.txt` +// var kkzIdsFileName = "E:\\Works\\Git\\github\\autotask\\othenautojob\\zqjson\\" + "./zq_kkzids.txt"; let zqbody -let usernmae=""; +let usernmae = ""; let allCompFlag = 1, restNum = 0, kkzBodyArr = [], kkzCompArr = []; -let preBody,bodyTemplate,fakeSign,key,username,zqck='' +let preBody, bodyTemplate, fakeSign, key, username, zqck = '' !(async () => { - if(!(await checkEnvJson())) { - return - } - console.log(`开始生成${username}看看赚body文件`) - let validCount=0 - for (let i=2950;i<4520;i++){ - if (i %20==0){ - console.log(`------查询${i}~${i+20}------`) - await $.wait(2000) - } - // let body = await encodeUserBody(i) - let body=await encodeUserBody1(zqck,i); - let valid= await adlickstart(body, i); - if (valid==true){ - if (validCount==0)await writelog(kkzname,"w",`${body}\n`); - else await writelog(kkzname,"a",`${body}\n`); - validCount ++; - await $.wait(1000) - } - } - console.log(`共写入${validCount}条有效任务,输出文件为${kkzname}`) + if (!(await checkEnvJson())) { + return + } + console.log(`开始生成${username}看看赚body文件`) + if (idsModle == 'w') + await writeIdsModel(); + else + await readIdsModel(); + })() .catch((e) => { $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') @@ -59,34 +61,101 @@ let preBody,bodyTemplate,fakeSign,key,username,zqck='' $.done(); }) -async function encodeUserBody1(cookie,p1) { - let rndtime = Math.floor(new Date().getTime()/1000) +async function writeIdsModel () { + let validCount = 0 + for (let i = 2950; i < 4520; i++) { + if (i % 20 == 0) { + console.log(`------查询${i}~${i + 20}------`) + await $.wait(2000) + } + // let body = await encodeUserBody(i) + let body = await encodeUserBody1(zqck, i); + let valid = await adlickstart(body, i); + if (valid == true) { + if (validCount == 0) { + await writelog(kkzBodyFileName, "w", `${body}\n`); + if (idsModle == 'w') + await writelog(kkzIdsFileName, "w", `${i}\n`); + } + else { + await writelog(kkzBodyFileName, "a", `${body}\n`); + if (idsModle == 'w') + await writelog(kkzIdsFileName, "a", `${i}\n`); + } + validCount++; + await $.wait(1000) + } + } + console.log(`共写入${validCount}条有效任务,输出文件为${kkzBodyFileName}`) +} + +async function readIdsModel () { + let idsArr = []; + if (check_file_exist(kkzIdsFileName)) { + console.log(`找到看看赚IDS文本,选择读取文件模式\n`) + let kkzidsstr = fs.readFileSync(kkzIdsFileName, "utf8"); + if (kkzidsstr !== `undefined`) { + idsArr = kkzidsstr.split("\n"); + } + } + + let validCount = 0 + for (let i = 0; i < idsArr.length; i++) { + if (i % 20 == 0) { + console.log(`------查询${i}~${i + 20}------`) + await $.wait(2000) + } + if (idsArr[i] == "") + continue; + // let body = await encodeUserBody(i) + let body = await encodeUserBody1(zqck, idsArr[i]); + let valid = await adlickstart(body, idsArr[i]); + if (valid == true) { + if (validCount == 0) { + await writelog(kkzBodyFileName, "w", `${body}\n`); + if (idsModle == 'w') + await writelog(kkzIdsFileName, "w", `${i}\n`); + } + else { + await writelog(kkzBodyFileName, "a", `${body}\n`); + if (idsModle == 'w') + await writelog(kkzIdsFileName, "a", `${i}\n`); + } + validCount++; + await $.wait(1000) + } + } + console.log(`共写入${validCount}条有效任务,输出文件为${kkzBodyFileName}`) +} + +async function encodeUserBody1 (cookie, p1) { + let rndtime = Math.floor(new Date().getTime() / 1000) preBody = 'p=ycTMBiVxDAfc%3D' - bodyTemplate='access=WIFI&app-version=3.5.5&app_name=zqkd_app&app_version=3.5.5&' + bodyTemplate = 'access=WIFI&app-version=3.5.5&app_name=zqkd_app&app_version=3.5.5&' //bodyTemplate='access=WIFI&app-version=3.5.5&app_name=zqkd_app&app_version=3.5.5&channel=c1002&device_brand='+params["device_brand"]+'&device_id='+params["device_id"]+'&device_model='+params["device_model"]+'&device_platform=android&device_type=android&dpi='+params["dpi"]+'&inner_version='+params["inner_version"]+'&language=zh-CN&memory=3&mi=0&mobile_type=1&net_type=1&network_type=WIFI&openudid='+params["openudid"]+'&os_api='+params["os_api"]+'&os_version='+params["os_version"]+'&request_time='+rndtime+'&resolution='+params["resolution"]+'&rom_version='+params["rom_version"]+'&s_ad='+params["s_ad"]+'&s_im='+params["s_im"]+'&sm_device_id='+params["sm_device_id"]+'&storage='+params["storage"]+'&' //console.log(bodyTemplate) fakeSign = '&sign=573f59b726a9143335983661ca504101' - key='6HPjSZFH' - - replacedStr = bodyTemplate+ cookie + '&task_id=' +p1 + fakeSign - encodeBody = myFuncB(replacedStr) + key = '6HPjSZFH' + + replacedStr = bodyTemplate + cookie + '&task_id=' + p1 + fakeSign + encodeBody = myFuncB1(replacedStr) hexBody = CryptoJS.enc.Hex.parse(encodeBody) let base64Body = CryptoJS.enc.Base64.stringify(hexBody) replaceBody3 = base64Body.replace(/\+/g, '-') replaceBody4 = replaceBody3.replace(/\//g, '_') //finalBody = preBody + replaceBody4 - finalBody = preBody + encodeURIComponent(replaceBody4) + '==' + finalBody = preBody + encodeURIComponent(replaceBody4) + '==' return finalBody; - } +} -async function encodeUserBody2(p1) { - preBody='p=Y2JgR8oZr6IU%3D' - bodyTemplate='access=WIFI&app-version=3.5.5&app_name=zqkd_app&app_version=3.5.5&' - fakeSign='&sign=af34372b46624f9f7920493c58be47e5' - key='6HPjSZFH' - let replacedStr = bodyTemplate + zqck + fakeSign +async function encodeUserBody2 (p1) { + preBody = 'p=Y2JgR8oZr6IU%3D' + bodyTemplate = 'access=WIFI&app-version=3.5.5&app_name=zqkd_app&app_version=3.5.5&' + fakeSign = '&sign=af34372b46624f9f7920493c58be47e5' + key = '6HPjSZFH' + let replacedStr = bodyTemplate + zqck + fakeSign - replacedStr=replacedStr+'&task_id=' +p1 + replacedStr = replacedStr + '&task_id=' + p1 encodeBody = myFuncB1(replacedStr) hexBody = CryptoJS.enc.Hex.parse(encodeBody) let base64Body = CryptoJS.enc.Base64.stringify(hexBody) @@ -96,111 +165,111 @@ async function encodeUserBody2(p1) { return finalBody; } -function myFuncB1(data) { - var a19 = CryptoJS.enc.Utf8.parse(key), - b68 = CryptoJS.enc.Utf8.parse(key), - b69 = CryptoJS.enc.Utf8.parse(data); - return encrypted = CryptoJS.DES.encrypt(b69, a19, { - 'iv': b68, - 'mode': CryptoJS.mode.CBC, - 'padding': CryptoJS.pad.Pkcs7 - }), encrypted.ciphertext.toString(); +function myFuncB1 (data) { + var a19 = CryptoJS.enc.Utf8.parse(key), + b68 = CryptoJS.enc.Utf8.parse(key), + b69 = CryptoJS.enc.Utf8.parse(data); + return encrypted = CryptoJS.DES.encrypt(b69, a19, { + 'iv': b68, + 'mode': CryptoJS.mode.CBC, + 'padding': CryptoJS.pad.Pkcs7 + }), encrypted.ciphertext.toString(); } -function randomString(data = 0xc) { - let a18 = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM', - b74 = a18.length, - b75 = ''; - for(i = 0; i < data; i++) { - b75 += a18['charAt'](Math.floor(Math.random() * b74)); - } - return b75; +function randomString (data = 0xc) { + let a18 = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM', + b74 = a18.length, + b75 = ''; + for (i = 0; i < data; i++) { + b75 += a18['charAt'](Math.floor(Math.random() * b74)); + } + return b75; } //json读取 -async function checkEnvJson() { - - console.log(`您使用的是json文件模式\n`) - if (!check_file_exist(filename)){ - return false - } - zqbody = require(filename); - username=zqbody.user; - let zqcookie=zqbody.zqcookie; - let params =UrlParamHash(zqcookie); - zquid=params["uid"]; - zqkey = params["zqkey"]; - zqkey_id= params["zqkey_id"]; - zqck='uid='+zquid+'&zqkey='+zqkey+'&zqkey_id='+zqkey_id - if (!zqcookie){ - console.log('没有找到中青cookie,请先抓取') - return false - } - return true -} -async function adlickstart(lookStartBody,idx) { - let caller = printCaller() +async function checkEnvJson () { + + console.log(`您使用的是json文件模式\n`) + if (!check_file_exist(jsonSettingFileName)) { + return false + } + zqbody = require(jsonSettingFileName); + username = zqbody.user; + let zqcookie = zqbody.zqcookie; + let params = UrlParamHash(zqcookie); + zquid = params["uid"]; + zqkey = params["zqkey"]; + zqkey_id = params["zqkey_id"]; + zqck = 'uid=' + zquid + '&zqkey=' + zqkey + '&zqkey_id=' + zqkey_id + if (!zqcookie) { + console.log('没有找到中青cookie,请先抓取') + return false + } + return true +} +async function adlickstart (lookStartBody, idx) { + let caller = printCaller() let url = 'http://kandian.wkandian.com/v5/Nameless/adlickstart.json' - let urlObject = PopulatePostUrl(url,lookStartBody) - await HttpPost(urlObject,caller) + let urlObject = PopulatePostUrl(url, lookStartBody) + await HttpPost(urlObject, caller) let result = httpResult; - if(!result) return - - if(result.success == true) { + if (!result) return + + if (result.success == true) { let bannerId = result.items.banner_id - if(result.items.comtele_state == 0) { - allCompFlag = 0 - kkzCompArr.push(1); - kkzBodyArr.push(bannerId) - let readNum = result.items.see_num - result.items.read_num - if(readNum == 0) readNum=1 - restNum =readNum > restNum ? readNum : restNum - console.log('用户未完成看看赚[id:' +bannerId + '],还需阅读' + readNum + '次'); - }else{ - kkzCompArr.push(0) - console.log('用户已完成看看赚[id:' +bannerId + ']'); - } + if (result.items.comtele_state == 0) { + allCompFlag = 0 + kkzCompArr.push(1); + kkzBodyArr.push(bannerId) + let readNum = result.items.see_num - result.items.read_num + if (readNum == 0) readNum = 1 + restNum = readNum > restNum ? readNum : restNum + console.log('用户未完成看看赚[id:' + bannerId + '],还需阅读' + readNum + '次'); + } else { + kkzCompArr.push(0) + console.log('用户已完成看看赚[id:' + bannerId + ']'); + } } else { - console.log(`激活第${idx+1}个看看赚失败:${result.message}`) - return false + console.log(`激活第${idx + 1}个看看赚失败:${result.message}`) + return false } - return true + return true } -var _0xodF='jsjiami.com.v6',_0xodF_=['‮_0xodF'],_0x2003=[_0xodF,'wqDCusOJIhQ=','EsOafg==','woxSOA==','w7zCpsO9eg==','wqrCkWTCliE=','PXVDwq0=','w73CkMOdw6Rp','CznCtQ==','w6rCkcKxXUbDjyI=','wpnCslU=','ACpLw553','MyhYw4UlA8OyEzHDlg==','N8OMwrTCp8OyeCNT','woFKTWMhasO8w4BAwqZAw5bCnTE3w4vDn24sw6TDocKTZsOgw6VQw4Vdw4LDsMONwpXDpV7DksOCVkxXKkzDrMKkwqVWBV7CtEvCt1jDqCNnR8OLwovDvMOIw5I6wonDhmF9FA==','UcOAfMKhWzd7b8Kt','wpAUdzQYfsKTwq9mwrp7w4bCtRRiw5XDrQ==','SMO4w5cUAg==','aQ/Cj8O8W8KvCV7Dr8Krw50tw6HDhMK+w7xEVcKhDRMlwrPCoGwZwp09w57CoXxxw47CpMKswpghwqQ=','w590C8Kiew7CsGg=','Ll/DmcOyew==','TArDmsOzw4g=','wopjwrDDqD0=','VMOcw5A=','wqHDhsOxw7PDmcKP','wq3CuMO6wpsFWcOYw5UU','w5vCt8OrLg3CjWE=','PRnClsO3VMOxDQ==','jrnsSjXiIxDamiLLL.LceQoQqRml.v6=='];if(function(_0x57390b,_0x1b9a60,_0x4681af){function _0x1bbe35(_0x32c8ee,_0xfb2f57,_0x7f928,_0x5782ce,_0x56c00a,_0x21ac3b){_0xfb2f57=_0xfb2f57>>0x8,_0x56c00a='po';var _0x2e78aa='shift',_0x52c050='push',_0x21ac3b='‮';if(_0xfb2f57<_0x32c8ee){while(--_0x32c8ee){_0x5782ce=_0x57390b[_0x2e78aa]();if(_0xfb2f57===_0x32c8ee&&_0x21ac3b==='‮'&&_0x21ac3b['length']===0x1){_0xfb2f57=_0x5782ce,_0x7f928=_0x57390b[_0x56c00a+'p']();}else if(_0xfb2f57&&_0x7f928['replace'](/[rnSXIxDLLLLeQQqRl=]/g,'')===_0xfb2f57){_0x57390b[_0x52c050](_0x5782ce);}}_0x57390b[_0x52c050](_0x57390b[_0x2e78aa]());}return 0xc0263;};return _0x1bbe35(++_0x1b9a60,_0x4681af)>>_0x1b9a60^_0x4681af;}(_0x2003,0x1a2,0x1a200),_0x2003){_0xodF_=_0x2003['length']^0x1a2;};function _0x3ae7(_0x2e4e91,_0xa9e967){_0x2e4e91=~~'0x'['concat'](_0x2e4e91['slice'](0x1));var _0x1155e4=_0x2003[_0x2e4e91];if(_0x3ae7['JGEGEp']===undefined){(function(){var _0x8a7a14=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0x4c9f3d='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x8a7a14['atob']||(_0x8a7a14['atob']=function(_0x285baa){var _0x3f5eb1=String(_0x285baa)['replace'](/=+$/,'');for(var _0x1f0ebf=0x0,_0x52676f,_0x244513,_0x23d711=0x0,_0x3e8308='';_0x244513=_0x3f5eb1['charAt'](_0x23d711++);~_0x244513&&(_0x52676f=_0x1f0ebf%0x4?_0x52676f*0x40+_0x244513:_0x244513,_0x1f0ebf++%0x4)?_0x3e8308+=String['fromCharCode'](0xff&_0x52676f>>(-0x2*_0x1f0ebf&0x6)):0x0){_0x244513=_0x4c9f3d['indexOf'](_0x244513);}return _0x3e8308;});}());function _0x22cac6(_0xe8473,_0xa9e967){var _0x4e78b4=[],_0x5edc58=0x0,_0x49875a,_0x1c6ec3='',_0x267ea0='';_0xe8473=atob(_0xe8473);for(var _0x5dc716=0x0,_0x3b478a=_0xe8473['length'];_0x5dc716<_0x3b478a;_0x5dc716++){_0x267ea0+='%'+('00'+_0xe8473['charCodeAt'](_0x5dc716)['toString'](0x10))['slice'](-0x2);}_0xe8473=decodeURIComponent(_0x267ea0);for(var _0x2db02a=0x0;_0x2db02a<0x100;_0x2db02a++){_0x4e78b4[_0x2db02a]=_0x2db02a;}for(_0x2db02a=0x0;_0x2db02a<0x100;_0x2db02a++){_0x5edc58=(_0x5edc58+_0x4e78b4[_0x2db02a]+_0xa9e967['charCodeAt'](_0x2db02a%_0xa9e967['length']))%0x100;_0x49875a=_0x4e78b4[_0x2db02a];_0x4e78b4[_0x2db02a]=_0x4e78b4[_0x5edc58];_0x4e78b4[_0x5edc58]=_0x49875a;}_0x2db02a=0x0;_0x5edc58=0x0;for(var _0xcb02e3=0x0;_0xcb02e3<_0xe8473['length'];_0xcb02e3++){_0x2db02a=(_0x2db02a+0x1)%0x100;_0x5edc58=(_0x5edc58+_0x4e78b4[_0x2db02a])%0x100;_0x49875a=_0x4e78b4[_0x2db02a];_0x4e78b4[_0x2db02a]=_0x4e78b4[_0x5edc58];_0x4e78b4[_0x5edc58]=_0x49875a;_0x1c6ec3+=String['fromCharCode'](_0xe8473['charCodeAt'](_0xcb02e3)^_0x4e78b4[(_0x4e78b4[_0x2db02a]+_0x4e78b4[_0x5edc58])%0x100]);}return _0x1c6ec3;}_0x3ae7['uZTiBW']=_0x22cac6;_0x3ae7['nEWWwb']={};_0x3ae7['JGEGEp']=!![];}var _0x204951=_0x3ae7['nEWWwb'][_0x2e4e91];if(_0x204951===undefined){if(_0x3ae7['yvrOwv']===undefined){_0x3ae7['yvrOwv']=!![];}_0x1155e4=_0x3ae7['uZTiBW'](_0x1155e4,_0xa9e967);_0x3ae7['nEWWwb'][_0x2e4e91]=_0x1155e4;}else{_0x1155e4=_0x204951;}return _0x1155e4;};async function encodeUserBody(_0x308eb9){var _0x290a43={'yJdHr':_0x3ae7('‫0','x3&3'),'jokMV':function(_0x9b373f,_0x2874d3){return _0x9b373f+_0x2874d3;},'pAumx':_0x3ae7('‫1','G#cc'),'jPQIx':function(_0x52be91,_0x5147de){return _0x52be91(_0x5147de);},'Izqxy':function(_0x15afba,_0x1b4c70){return _0x15afba+_0x1b4c70;}};preBody=_0x3ae7('‫2','x3&3');bodyTemplate=_0x290a43[_0x3ae7('‮3','jX3e')];fakeSign=_0x3ae7('‫4','oQ))');key=_0x3ae7('‮5','Iq[4');replacedStr=_0x290a43[_0x3ae7('‮6','uTEu')](_0x290a43[_0x3ae7('‫7','9)to')](bodyTemplate,zqck),_0x290a43['pAumx'])+_0x308eb9+fakeSign;encodeBody=_0x290a43[_0x3ae7('‫8','5Cd*')](myFuncB,replacedStr);hexBody=CryptoJS['enc']['Hex']['parse'](encodeBody);let _0x3e0358=CryptoJS[_0x3ae7('‫9','jX3e')][_0x3ae7('‮a','SrD^')][_0x3ae7('‫b','xK@6')](hexBody);replaceBody3=_0x3e0358[_0x3ae7('‮c','hZn&')](/\+/g,'-');replaceBody4=replaceBody3[_0x3ae7('‫d','oQ))')](/\//g,'_');finalBody=_0x290a43[_0x3ae7('‫e','XCy$')](preBody,replaceBody4);return finalBody;}function myFuncB(_0xe20573){var _0x1718fa=CryptoJS[_0x3ae7('‫f','G#cc')]['Utf8']['parse'](key),_0x2e8c6d=CryptoJS[_0x3ae7('‮10','Iq[4')][_0x3ae7('‮11','hZn&')][_0x3ae7('‫12','TMga')](key),_0x20f93a=CryptoJS['enc'][_0x3ae7('‮13','7dcK')][_0x3ae7('‮14','KbRa')](_0xe20573);return encrypted=CryptoJS[_0x3ae7('‮15','oQ))')][_0x3ae7('‫16',']yY*')](_0x20f93a,_0x1718fa,{'iv':_0x2e8c6d,'mode':CryptoJS['mode'][_0x3ae7('‮17','TMga')],'padding':CryptoJS['pad'][_0x3ae7('‫18','5Vrt')]}),encrypted[_0x3ae7('‮19','5Vrt')][_0x3ae7('‫1a','yn@t')]();};_0xodF='jsjiami.com.v6'; +var _0xodF = 'jsjiami.com.v6', _0xodF_ = ['‮_0xodF'], _0x2003 = [_0xodF, 'wqDCusOJIhQ=', 'EsOafg==', 'woxSOA==', 'w7zCpsO9eg==', 'wqrCkWTCliE=', 'PXVDwq0=', 'w73CkMOdw6Rp', 'CznCtQ==', 'w6rCkcKxXUbDjyI=', 'wpnCslU=', 'ACpLw553', 'MyhYw4UlA8OyEzHDlg==', 'N8OMwrTCp8OyeCNT', 'woFKTWMhasO8w4BAwqZAw5bCnTE3w4vDn24sw6TDocKTZsOgw6VQw4Vdw4LDsMONwpXDpV7DksOCVkxXKkzDrMKkwqVWBV7CtEvCt1jDqCNnR8OLwovDvMOIw5I6wonDhmF9FA==', 'UcOAfMKhWzd7b8Kt', 'wpAUdzQYfsKTwq9mwrp7w4bCtRRiw5XDrQ==', 'SMO4w5cUAg==', 'aQ/Cj8O8W8KvCV7Dr8Krw50tw6HDhMK+w7xEVcKhDRMlwrPCoGwZwp09w57CoXxxw47CpMKswpghwqQ=', 'w590C8Kiew7CsGg=', 'Ll/DmcOyew==', 'TArDmsOzw4g=', 'wopjwrDDqD0=', 'VMOcw5A=', 'wqHDhsOxw7PDmcKP', 'wq3CuMO6wpsFWcOYw5UU', 'w5vCt8OrLg3CjWE=', 'PRnClsO3VMOxDQ==', 'jrnsSjXiIxDamiLLL.LceQoQqRml.v6==']; if (function (_0x57390b, _0x1b9a60, _0x4681af) { function _0x1bbe35 (_0x32c8ee, _0xfb2f57, _0x7f928, _0x5782ce, _0x56c00a, _0x21ac3b) { _0xfb2f57 = _0xfb2f57 >> 0x8, _0x56c00a = 'po'; var _0x2e78aa = 'shift', _0x52c050 = 'push', _0x21ac3b = '‮'; if (_0xfb2f57 < _0x32c8ee) { while (--_0x32c8ee) { _0x5782ce = _0x57390b[_0x2e78aa](); if (_0xfb2f57 === _0x32c8ee && _0x21ac3b === '‮' && _0x21ac3b['length'] === 0x1) { _0xfb2f57 = _0x5782ce, _0x7f928 = _0x57390b[_0x56c00a + 'p'](); } else if (_0xfb2f57 && _0x7f928['replace'](/[rnSXIxDLLLLeQQqRl=]/g, '') === _0xfb2f57) { _0x57390b[_0x52c050](_0x5782ce); } } _0x57390b[_0x52c050](_0x57390b[_0x2e78aa]()); } return 0xc0263; }; return _0x1bbe35(++_0x1b9a60, _0x4681af) >> _0x1b9a60 ^ _0x4681af; }(_0x2003, 0x1a2, 0x1a200), _0x2003) { _0xodF_ = _0x2003['length'] ^ 0x1a2; }; function _0x3ae7 (_0x2e4e91, _0xa9e967) { _0x2e4e91 = ~~'0x'['concat'](_0x2e4e91['slice'](0x1)); var _0x1155e4 = _0x2003[_0x2e4e91]; if (_0x3ae7['JGEGEp'] === undefined) { (function () { var _0x8a7a14 = typeof window !== 'undefined' ? window : typeof process === 'object' && typeof require === 'function' && typeof global === 'object' ? global : this; var _0x4c9f3d = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; _0x8a7a14['atob'] || (_0x8a7a14['atob'] = function (_0x285baa) { var _0x3f5eb1 = String(_0x285baa)['replace'](/=+$/, ''); for (var _0x1f0ebf = 0x0, _0x52676f, _0x244513, _0x23d711 = 0x0, _0x3e8308 = ''; _0x244513 = _0x3f5eb1['charAt'](_0x23d711++); ~_0x244513 && (_0x52676f = _0x1f0ebf % 0x4 ? _0x52676f * 0x40 + _0x244513 : _0x244513, _0x1f0ebf++ % 0x4) ? _0x3e8308 += String['fromCharCode'](0xff & _0x52676f >> (-0x2 * _0x1f0ebf & 0x6)) : 0x0) { _0x244513 = _0x4c9f3d['indexOf'](_0x244513); } return _0x3e8308; }); }()); function _0x22cac6 (_0xe8473, _0xa9e967) { var _0x4e78b4 = [], _0x5edc58 = 0x0, _0x49875a, _0x1c6ec3 = '', _0x267ea0 = ''; _0xe8473 = atob(_0xe8473); for (var _0x5dc716 = 0x0, _0x3b478a = _0xe8473['length']; _0x5dc716 < _0x3b478a; _0x5dc716++) { _0x267ea0 += '%' + ('00' + _0xe8473['charCodeAt'](_0x5dc716)['toString'](0x10))['slice'](-0x2); } _0xe8473 = decodeURIComponent(_0x267ea0); for (var _0x2db02a = 0x0; _0x2db02a < 0x100; _0x2db02a++) { _0x4e78b4[_0x2db02a] = _0x2db02a; } for (_0x2db02a = 0x0; _0x2db02a < 0x100; _0x2db02a++) { _0x5edc58 = (_0x5edc58 + _0x4e78b4[_0x2db02a] + _0xa9e967['charCodeAt'](_0x2db02a % _0xa9e967['length'])) % 0x100; _0x49875a = _0x4e78b4[_0x2db02a]; _0x4e78b4[_0x2db02a] = _0x4e78b4[_0x5edc58]; _0x4e78b4[_0x5edc58] = _0x49875a; } _0x2db02a = 0x0; _0x5edc58 = 0x0; for (var _0xcb02e3 = 0x0; _0xcb02e3 < _0xe8473['length']; _0xcb02e3++) { _0x2db02a = (_0x2db02a + 0x1) % 0x100; _0x5edc58 = (_0x5edc58 + _0x4e78b4[_0x2db02a]) % 0x100; _0x49875a = _0x4e78b4[_0x2db02a]; _0x4e78b4[_0x2db02a] = _0x4e78b4[_0x5edc58]; _0x4e78b4[_0x5edc58] = _0x49875a; _0x1c6ec3 += String['fromCharCode'](_0xe8473['charCodeAt'](_0xcb02e3) ^ _0x4e78b4[(_0x4e78b4[_0x2db02a] + _0x4e78b4[_0x5edc58]) % 0x100]); } return _0x1c6ec3; } _0x3ae7['uZTiBW'] = _0x22cac6; _0x3ae7['nEWWwb'] = {}; _0x3ae7['JGEGEp'] = !![]; } var _0x204951 = _0x3ae7['nEWWwb'][_0x2e4e91]; if (_0x204951 === undefined) { if (_0x3ae7['yvrOwv'] === undefined) { _0x3ae7['yvrOwv'] = !![]; } _0x1155e4 = _0x3ae7['uZTiBW'](_0x1155e4, _0xa9e967); _0x3ae7['nEWWwb'][_0x2e4e91] = _0x1155e4; } else { _0x1155e4 = _0x204951; } return _0x1155e4; }; async function encodeUserBody (_0x308eb9) { var _0x290a43 = { 'yJdHr': _0x3ae7('‫0', 'x3&3'), 'jokMV': function (_0x9b373f, _0x2874d3) { return _0x9b373f + _0x2874d3; }, 'pAumx': _0x3ae7('‫1', 'G#cc'), 'jPQIx': function (_0x52be91, _0x5147de) { return _0x52be91(_0x5147de); }, 'Izqxy': function (_0x15afba, _0x1b4c70) { return _0x15afba + _0x1b4c70; } }; preBody = _0x3ae7('‫2', 'x3&3'); bodyTemplate = _0x290a43[_0x3ae7('‮3', 'jX3e')]; fakeSign = _0x3ae7('‫4', 'oQ))'); key = _0x3ae7('‮5', 'Iq[4'); replacedStr = _0x290a43[_0x3ae7('‮6', 'uTEu')](_0x290a43[_0x3ae7('‫7', '9)to')](bodyTemplate, zqck), _0x290a43['pAumx']) + _0x308eb9 + fakeSign; encodeBody = _0x290a43[_0x3ae7('‫8', '5Cd*')](myFuncB, replacedStr); hexBody = CryptoJS['enc']['Hex']['parse'](encodeBody); let _0x3e0358 = CryptoJS[_0x3ae7('‫9', 'jX3e')][_0x3ae7('‮a', 'SrD^')][_0x3ae7('‫b', 'xK@6')](hexBody); replaceBody3 = _0x3e0358[_0x3ae7('‮c', 'hZn&')](/\+/g, '-'); replaceBody4 = replaceBody3[_0x3ae7('‫d', 'oQ))')](/\//g, '_'); finalBody = _0x290a43[_0x3ae7('‫e', 'XCy$')](preBody, replaceBody4); return finalBody; } function myFuncB (_0xe20573) { var _0x1718fa = CryptoJS[_0x3ae7('‫f', 'G#cc')]['Utf8']['parse'](key), _0x2e8c6d = CryptoJS[_0x3ae7('‮10', 'Iq[4')][_0x3ae7('‮11', 'hZn&')][_0x3ae7('‫12', 'TMga')](key), _0x20f93a = CryptoJS['enc'][_0x3ae7('‮13', '7dcK')][_0x3ae7('‮14', 'KbRa')](_0xe20573); return encrypted = CryptoJS[_0x3ae7('‮15', 'oQ))')][_0x3ae7('‫16', ']yY*')](_0x20f93a, _0x1718fa, { 'iv': _0x2e8c6d, 'mode': CryptoJS['mode'][_0x3ae7('‮17', 'TMga')], 'padding': CryptoJS['pad'][_0x3ae7('‫18', '5Vrt')] }), encrypted[_0x3ae7('‮19', '5Vrt')][_0x3ae7('‫1a', 'yn@t')](); }; _0xodF = 'jsjiami.com.v6'; //////////////////////////////////////////////////////////////////// -function PopulatePostUrl(url,reqBody){ - let rndtime = Math.floor(new Date().getTime()/1000) +function PopulatePostUrl (url, reqBody) { + let rndtime = Math.floor(new Date().getTime() / 1000) let urlObject = { url: url, headers: { 'User-Agent': 'okhttp/3.12.2', - 'Host' : 'kandian.wkandian.com', - 'device-platform' : 'android', - 'Connection' : 'keep-alive', + 'Host': 'kandian.wkandian.com', + 'device-platform': 'android', + 'Connection': 'keep-alive', }, body: reqBody } return urlObject; } -function PopulateGetUrl(url){ - let rndtime = Math.floor(new Date().getTime()/1000) +function PopulateGetUrl (url) { + let rndtime = Math.floor(new Date().getTime() / 1000) let urlObject = { url: url, headers: { 'User-Agent': 'okhttp/3.12.2', - 'Host' : 'kandian.wkandian.com', - 'device-platform' : 'android', - 'Connection' : 'keep-alive', + 'Host': 'kandian.wkandian.com', + 'device-platform': 'android', + 'Connection': 'keep-alive', } } return urlObject; } -async function HttpPost(url,caller) { +async function HttpPost (url, caller) { httpResult = null return new Promise((resolve) => { $.post(url, async (err, resp, data) => { @@ -211,8 +280,8 @@ async function HttpPost(url,caller) { $.logErr(err); } else { if (safeGet(data)) { - httpResult = JSON.parse(data,caller); - if(logDebug) console.log(httpResult); + httpResult = JSON.parse(data, caller); + if (logDebug) console.log(httpResult); } } } catch (e) { @@ -224,7 +293,7 @@ async function HttpPost(url,caller) { }); } -async function HttpGet(url,caller) { +async function HttpGet (url, caller) { httpResult = null return new Promise((resolve) => { $.get(url, async (err, resp, data) => { @@ -234,9 +303,9 @@ async function HttpGet(url,caller) { console.log(JSON.stringify(err)); $.logErr(err); } else { - if (safeGet(data,caller)) { + if (safeGet(data, caller)) { httpResult = JSON.parse(data); - if(logDebug) console.log(httpResult); + if (logDebug) console.log(httpResult); } } } catch (e) { @@ -248,7 +317,7 @@ async function HttpGet(url,caller) { }); } -function safeGet(data,caller) { +function safeGet (data, caller) { try { if (typeof JSON.parse(data) == "object") { return true; @@ -263,35 +332,35 @@ function safeGet(data,caller) { } } -function printCaller(){ +function printCaller () { return (new Error()).stack.split("\n")[2].trim().split(" ")[1] } //要写入的文件 要写入的内容 a追加|w写入(默认)|r(读取) 回调函数 -function writelog(filename,model,content){ - //console.log('模式:'+model); - fs.writeFile(filename,content,{flag:`${model}`},function (err) { - if(err){ - return console.log(err); - }else { - console.log(`写入${filename}成功,模式为:${model}`); - } - }) +function writelog (filename, model, content) { + //console.log('模式:'+model); + fs.writeFile(filename, content, { flag: `${model}` }, function (err) { + if (err) { + return console.log(err); + } else { + console.log(`写入${filename}成功,模式为:${model}`); + } + }) } //检查文件是否存在 -function check_file_exist(filename){ - try { - fs.accessSync(filename, fs.constants.R_OK); - return true; - } catch (err) { - console.error(`检测文件${filename}不存在`); - return false; - } +function check_file_exist (filename) { + try { + fs.accessSync(filename, fs.constants.R_OK); + return true; + } catch (err) { + console.error(`检测文件${filename}不存在`); + return false; + } } -function UrlParamHash(url) { +function UrlParamHash (url) { var params = [], h; - //var hash = url.slice(url.indexOf("?") + 1).split('&'); + //var hash = url.slice(url.indexOf("?") + 1).split('&'); var hash = url.split('&'); for (var i = 0; i < hash.length; i++) { @@ -302,4 +371,4 @@ function UrlParamHash(url) { return params; } // 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"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} +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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post (t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time (t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg (e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log (...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr (t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait (t) { return new Promise(e => setTimeout(e, t)) } done (t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/zqjson/zqkkzrw.js b/zqjson/zqkkzrw.js index 75a4d43..23d489d 100644 --- a/zqjson/zqkkzrw.js +++ b/zqjson/zqkkzrw.js @@ -23,7 +23,21 @@ json格式如下: //用户名自己写,searchdatas:搜索赚body,startdata "", "", "" - ] + ], + "device":{ //设备信息 + "carrier":"中国联通", + "device_brand":"honor",//设备品牌 + "device_id":"56122847", + "device_model":"FRD-AL10",//信号 + "device_platform":"android",//设备品牌 + "device_type":"android",//设备品牌 + "dpi":240,//设备品牌 + "inner_version":"202108181034",//软件的数据,不调整 + "openudid":"872e5e6fba572f6c",//安卓id android Id + "os_version":"FRD-AL10C00B396",//build id + "sm_device_id":"20211025130601d56f524bdb808de8936db94569c28b340110d2680e89602a", + "rom_version":"FRD-AL10C00B396" + } } 改写:jammy 改写主程序,改写支持安卓版,整合少林功夫猴搜索赚 @@ -45,6 +59,8 @@ let rndtime = "" //毫秒 let httpResult //global buffer var fs = require("fs"); +const CryptoJS = require('./crypto-js') + const HttpsProxyAgent = require("https-proxy-agent") const HttpProxyAgent = require("http-proxy-agent") @@ -54,12 +70,12 @@ const HttpProxyAgent = require("http-proxy-agent") // .task desi # 指定账号执行 task zqkkzrw.js desi zqjson 1 使用'zqjson'的第一个参数 多个可以写1-3 // debug -// process.env.zqjson = 'zq_9839' -// let filename = 'e:\\Works\\Git\\github\\autotask\\othenautojob\\zqjson\\zq_9839.json';;//`./${process.env.zqjson || "./zq_yilia"}.json`; -// let kkzname = 'e:\\Works\\Git\\github\\autotask\\othenautojob\\zqjson\\zq_9839_kkz.txt';// filename.replace(/.json/, "_kkz.txt"); +process.env.zqjson = 'zq_7627' +let filename = 'e:\\Works\\Git\\github\\autotask\\othenautojob\\zqjson\\zq_7627.json';;//`./${process.env.zqjson || "./zq_yilia"}.json`; +let kkzTaskIds = 'e:\\Works\\Git\\github\\autotask\\othenautojob\\zqjson\\zq_kkzids.txt';// filename.replace(/.json/, "_kkz.txt"); -let filename = `./${process.env.zqjson || "./zq_yilia"}.json`; -let kkzname = filename.replace(/.json/, "_kkz.txt"); +// let filename = `./${process.env.zqjson || "./zq_yilia"}.json`; +// let kkzTaskIds ="./zq_kkzids.txt";// filename.replace(/.json/, "_kkz.txt"); console.log(filename); let zqbody @@ -67,9 +83,11 @@ let startArr = [], lookArr = [], searchArr = [], jsonArr = []; let gainscore = 0, lookscore = 0, searchscore = 0, boxscore = 0; let StartBody = [], LookBody = [], searchBody = []; -let usernmae = "", zqjsons = "", gainbody = "", lookbody = "", zqcookie = "", kkzmodel = ""; +let usernmae = "", zqjsons = "", gainbody = "", lookbody = "", zqcookie = "", kkzmodel = "",zqck=""; let useProxy = undefined; -if (process.env.zqjson == "zq_9839") { + +//判断使用代理的账号 +if (process.env.zqproxy && process.env.zqproxy.indexOf(process.env.zqjson)>-1) { console.log("使用代理服务"); useProxy = process.env.zqjson; } @@ -137,12 +155,14 @@ async function checkEnvJson () { username = zqbody.user; zqcookie = zqbody.zqcookie; searchArr = zqbody.searchdatas; + zqck = getCk(zqbody.zqcookie); + //看看赚默认模式json格式,文件模式请设置为file kkzmodel = zqbody.kkzmodel ? zqbody.kkzmodel : 'file' - if (check_file_exist(kkzname) && kkzmodel != 'json') { + if (check_file_exist(kkzTaskIds) && kkzmodel != 'json') { console.log(`找到看看赚body文本,选择读取文件模式\n`) let kkzbodys = '' - kkzbody = fs.readFileSync(kkzname, "utf8"); + kkzbody = fs.readFileSync(kkzTaskIds, "utf8"); if (kkzbody !== `undefined`) { kkzbodys = kkzbody.split("\n"); } @@ -172,6 +192,29 @@ async function checkEnvJson () { return true } + +function getCk(zqcookie) +{ + let params = UrlParamHash(zqcookie); + let zquid = params["uid"]; + let zqkey = params["zqkey"]; + let zqkey_id = params["zqkey_id"]; + return 'uid=' + zquid + '&zqkey=' + zqkey + '&zqkey_id=' + zqkey_id +} + +function UrlParamHash (url) { + var params = [], h; + //var hash = url.slice(url.indexOf("?") + 1).split('&'); + + var hash = url.split('&'); + for (var i = 0; i < hash.length; i++) { + h = hash[i].split("="); + params.push(h[0]); + params[h[0]] = h[1]; + } + return params; +} + //处理ck格式 function replaceCookie (zqcookieItem) { if (zqcookieItem.indexOf('cookie=') == -1 && zqcookieItem.indexOf('zqkey=') > -1) { @@ -210,7 +253,7 @@ async function taskall () { notifyStr += `看看赚:共${lookArr.length}次任务,`; for (let k = 0; k < lookArr.length; k++) { if (lookArr[k]) { - lookbody = lookArr[k]; + lookbody =await encodeUserBody1(zqck,lookArr[k]);//生成看看赚的body $.log(`----------\n🏠开始中青看点看看赚第 ${k} ${$.index + 1}次任务`) } await lookStart(); @@ -481,6 +524,36 @@ async function end (timeout = 0) { } } +async function encodeUserBody1 (cookie, p1) { + let rndtime = Math.floor(new Date().getTime() / 1000) + preBody = 'p=ycTMBiVxDAfc%3D' + bodyTemplate = 'access=WIFI&app-version=3.5.5&app_name=zqkd_app&app_version=3.5.5&' + //bodyTemplate='access=WIFI&app-version=3.5.5&app_name=zqkd_app&app_version=3.5.5&channel=c1002&device_brand='+params["device_brand"]+'&device_id='+params["device_id"]+'&device_model='+params["device_model"]+'&device_platform=android&device_type=android&dpi='+params["dpi"]+'&inner_version='+params["inner_version"]+'&language=zh-CN&memory=3&mi=0&mobile_type=1&net_type=1&network_type=WIFI&openudid='+params["openudid"]+'&os_api='+params["os_api"]+'&os_version='+params["os_version"]+'&request_time='+rndtime+'&resolution='+params["resolution"]+'&rom_version='+params["rom_version"]+'&s_ad='+params["s_ad"]+'&s_im='+params["s_im"]+'&sm_device_id='+params["sm_device_id"]+'&storage='+params["storage"]+'&' + //console.log(bodyTemplate) + fakeSign = '&sign=573f59b726a9143335983661ca504101' + key = '6HPjSZFH' + + replacedStr = bodyTemplate + cookie + '&task_id=' + p1 + fakeSign + encodeBody = myFuncB1(replacedStr) + hexBody = CryptoJS.enc.Hex.parse(encodeBody) + let base64Body = CryptoJS.enc.Base64.stringify(hexBody) + replaceBody3 = base64Body.replace(/\+/g, '-') + replaceBody4 = replaceBody3.replace(/\//g, '_') + //finalBody = preBody + replaceBody4 + finalBody = preBody + encodeURIComponent(replaceBody4) + '==' + return finalBody; +} + +function myFuncB1 (data) { + var a19 = CryptoJS.enc.Utf8.parse(key), + b68 = CryptoJS.enc.Utf8.parse(key), + b69 = CryptoJS.enc.Utf8.parse(data); + return encrypted = CryptoJS.DES.encrypt(b69, a19, { + 'iv': b68, + 'mode': CryptoJS.mode.CBC, + 'padding': CryptoJS.pad.Pkcs7 + }), encrypted.ciphertext.toString(); +} //////////////////////////////////////////////////////////////////// function populatePostUrl (url, reqBody) { diff --git a/zqjson/zqreward1_pro.js b/zqjson/zqreward1_pro.js index d834a80..aa2bec5 100644 --- a/zqjson/zqreward1_pro.js +++ b/zqjson/zqreward1_pro.js @@ -11,6 +11,9 @@ let logDebug = 0 const CryptoJS = require('./crypto-js') var fs = require("fs"); let tsxx='' + +let filename = `./${process.env.zqjson || "./zq_yilia"}.json`; + let userCookie = ($.isNode() ? process.env.zqkdCookie : $.getdata('zqkdCookie')) || ''; let userCookieArr = [] @@ -19,6 +22,12 @@ let usernmae="",zqcookie=""; let preBody,bodyTemplate,fakeSign,key,zqck='' let params +let useProxy = undefined; +if (process.env.zqjson == "zq_9839") { + console.log("使用代理服务"); + useProxy = process.env.zqjson; +} + let reward=[ "first_share_article", "watch_video_reward", @@ -33,7 +42,7 @@ let reward=[ ] !(async () => { - if(!(await checkEnv())) { + if(!(await checkEnvJson())) { return } console.log(`开始领取奖励`) @@ -58,7 +67,21 @@ let reward=[ .finally(() => { $.done(); }) - + + //json读取 +async function checkEnvJson () { + + console.log(`您使用的是json文件模式\n`) + if (!check_file_exist(filename)) { + return false + } + zqbody = require(filename); + username = zqbody.user; + zqcookie = zqbody.zqcookie; + userCookieArr.push(replaceCookie(zqcookie)) + return true +} + async function checkEnv() { if(userCookie) { if(userCookie.indexOf('@') > -1) { diff --git a/zqjson/中青.txt b/zqjson/中青.txt index 71f32e9..fdbb632 100644 --- a/zqjson/中青.txt +++ b/zqjson/中青.txt @@ -1,6 +1,7 @@ +//使用涵微信 18349819839(1479632580yp) -17738167627 abcd1234 -13996362044 123456cy 安 -13880606191 a7896543 烟花 +17738167627 abcd1234 2021-12-27 已黑 +13996362044 123456cy 安 2021-12-24 提 +13880606191 a7896543 烟花 13194981230 a7896543 小1