open_card/activity/jd_135.js

1853 lines
111 KiB
JavaScript
Raw Permalink Normal View History

2022-04-15 13:35:28 +08:00
/*
4.13~4.29 早鸟焕春 大牌惠聚 [gua_opencard132.js]
新增开卡脚本
一次性脚本
1.邀请一人10豆
2.开13张卡 成功开1张 有机会获得10豆
3.抽奖 (默认不抽奖 如需抽奖请设置环境变量[guaopencard_draw132]"3"
填写要抽奖的次数 不足已自身次数为准
guaopencard_draw132="3"
填非数字会全都抽奖
第一个账号助力作者 其他依次助力CK1
第一个CK失效会退出脚本
默认脚本不执行
如需执行脚本请设置环境变量
guaopencard132="true"
每个账号之间延迟 100=延迟100秒 0=延迟0秒会使用每3个账号延迟60秒
guaopenwait_All 所有
guaopenwait132="0"
All变量适用
入口[ 4.13~4.29 早鸟焕春 大牌惠聚 (https://lzdz1-isv.isvjcloud.com/dingzhi/april/manGod/activity?activityId=dz3fb7e0f64f21afa7ff66d3daf15b&shareUuid=e7eafa5ddd9d48a88dfdb9c63112cc89)]
请求太频繁会被黑ip
过10分钟再执行
cron:30 2 14-29/3 4 *
============Quantumultx===============
[task_local]
#4.13~4.29 早鸟焕春 大牌惠聚
30 2 14-29/3 4 * https://raw.githubusercontent.com/smiek2121/scripts/master/gua_opencard132.js, tag=4.13~4.29 早鸟焕春 大牌惠聚, enabled=true
*/
let guaopencard_addSku = "true";
let guaopencard = "true";
let guaopenwait = "0";
let guaopencard_draw = "0";
const $ = new Env("4.13~4.29 早鸟焕春 大牌惠聚");
const jdCookieNode = $.isNode() ? require("./jdCookie.js") : "";
const notify = $.isNode() ? require("./sendNotify") : "";
CryptoScripts();
$.CryptoJS = $.isNode() ? require("crypto-js") : CryptoJS;
let cleanCart = "";
if ($.isNode()) {
try {
const fs = require("fs");
if (fs.existsSync("./cleancart_activity.js")) {
cleanCart = require("./cleancart_activity");
}
} catch (e) {}
}
//IOS等用户直接用NobyDa的jd cookie
let cookiesArr = [],
cookie = "";
if ($.isNode()) {
Object.keys(jdCookieNode).forEach((item) => {
cookiesArr.push(jdCookieNode[item]);
});
if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false")
console.log = () => {};
} else {
cookiesArr = [
$.getdata("CookieJD"),
$.getdata("CookieJD2"),
...jsonParse($.getdata("CookiesJD") || "[]").map((item) => item.cookie),
].filter((item) => !!item);
}
guaopencard_addSku = $.isNode()
? process.env.guaopencard_addSku132
? process.env.guaopencard_addSku132
: `${guaopencard_addSku}`
: $.getdata("guaopencard_addSku132")
? $.getdata("guaopencard_addSku132")
: `${guaopencard_addSku}`;
guaopencard_addSku = $.isNode()
? process.env.guaopencard_addSku_All
? process.env.guaopencard_addSku_All
: `${guaopencard_addSku}`
: $.getdata("guaopencard_addSku_All")
? $.getdata("guaopencard_addSku_All")
: `${guaopencard_addSku}`;
guaopencard = $.isNode()
? process.env.guaopencard132
? process.env.guaopencard132
: `${guaopencard}`
: $.getdata("guaopencard132")
? $.getdata("guaopencard132")
: `${guaopencard}`;
guaopencard = $.isNode()
? process.env.guaopencard_All
? process.env.guaopencard_All
: `${guaopencard}`
: $.getdata("guaopencard_All")
? $.getdata("guaopencard_All")
: `${guaopencard}`;
guaopenwait = $.isNode()
? process.env.guaopenwait132
? process.env.guaopenwait132
: `${guaopenwait}`
: $.getdata("guaopenwait132")
? $.getdata("guaopenwait132")
: `${guaopenwait}`;
guaopenwait = $.isNode()
? process.env.guaopenwait_All
? process.env.guaopenwait_All
: `${guaopenwait}`
: $.getdata("guaopenwait_All")
? $.getdata("guaopenwait_All")
: `${guaopenwait}`;
guaopenwait = parseInt(guaopenwait, 10) || 0;
guaopencard_draw = $.isNode()
? process.env.guaopencard_draw132
? process.env.guaopencard_draw132
: guaopencard_draw
: $.getdata("guaopencard_draw132")
? $.getdata("guaopencard_draw132")
: guaopencard_draw;
guaopencard_draw = $.isNode()
? process.env.guaopencard_draw
? process.env.guaopencard_draw
: guaopencard_draw
: $.getdata("guaopencard_draw")
? $.getdata("guaopencard_draw")
: guaopencard_draw;
allMessage = "";
message = "";
$.hotFlag = false;
$.outFlag = false;
$.activityEnd = false;
let lz_jdpin_token_cookie = "";
let activityCookie = "";
!(async () => {
if ($.isNode()) {
if (guaopencard + "" != "true") {
console.log('如需执行脚本请设置环境变量[guaopencard132]为"true"');
}
if (guaopencard + "" != "true") {
return;
}
}
if (!cookiesArr[0]) {
$.msg(
$.name,
"【提示】请先获取cookie\n直接使用NobyDa的京东签到获取",
"https://bean.m.jd.com/",
{
"open-url": "https://bean.m.jd.com/",
}
);
return;
}
$.activityId = "dz934e1f764aa2accb14bd217c55ca";
$.shareUuid = "3ded1c185ffa4276b652335ba23bc03c";
console.log(
`入口:\nhttps://lzdz1-isv.isvjcloud.com/dingzhi/april/manGod/activity?activityId=${$.activityId}&shareUuid=${$.shareUuid}`
);
for (let i = 0; i < cookiesArr.length; i++) {
cookie = cookiesArr[i];
if (cookie) {
$.UserName = decodeURIComponent(
cookie.match(/pt_pin=([^; ]+)(?=;?)/) &&
cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]
);
$.index = i + 1;
message = "";
$.bean = 0;
$.hotFlag = false;
$.nickName = "";
console.log(
`\n\n******开始【京东账号${$.index}${
$.nickName || $.UserName
}*********\n`
);
await getUA();
await run();
if (i == 0 && !$.actorUuid) break;
if ($.outFlag || $.activityEnd) break;
}
}
if ($.outFlag) {
let msg = "此ip已被限制请过10分钟后再执行脚本";
$.msg($.name, ``, `${msg}`);
if ($.isNode()) await notify.sendNotify(`${$.name}`, `${msg}`);
}
if (allMessage) {
$.msg($.name, ``, `${allMessage}`);
// if ($.isNode()) await notify.sendNotify(`${$.name}`, `${allMessage}`);
}
})()
.catch((e) => $.logErr(e))
.finally(() => $.done());
async function run() {
try {
$.hasEnd = true;
$.endTime = 0;
lz_jdpin_token_cookie = "";
$.Token = "";
$.Pin = "";
let flag = false;
await takePostRequest("isvObfuscator");
if ($.Token == "") {
console.log("获取[token]失败!");
return;
}
await getCk();
if (activityCookie == "") {
console.log(`获取cookie失败`);
return;
}
if ($.activityEnd === true) {
console.log("活动结束");
return;
}
if ($.outFlag) {
console.log("此ip已被限制请过10分钟后再执行脚本\n");
return;
}
await takePostRequest("getSimpleActInfoVo");
await takePostRequest("getMyPing");
if (!$.Pin) {
console.log("获取[Pin]失败!");
return;
}
await takePostRequest("accessLogWithAD");
await takePostRequest("getUserInfo");
await takePostRequest("activityContent");
if ($.hotFlag) return;
if (!$.actorUuid) {
console.log("获取不到[actorUuid]退出执行,请重新执行");
return;
}
if ($.hasEnd === true || Date.now() > $.endTime) {
$.activityEnd = true;
console.log("活动结束");
return;
}
await takePostRequest("drawContent");
await $.wait(1000);
$.openList = [];
$.allOpenCard = false;
await takePostRequest("checkOpenCard");
// return
if ($.allOpenCard == false) {
console.log("开卡任务");
for (o of $.openList) {
$.openCard = false;
if (o.openStatus == false) {
flag = true;
$.shopactivityId = "";
$.joinVenderId = o.venderId;
await getshopactivityId();
for (let i = 0; i < Array(5).length; i++) {
if (i > 0) console.log(`${i}次 重新开卡`);
await joinShop();
if ($.errorJoinShop.indexOf("活动太火爆,请稍后再试") == -1) {
break;
}
}
if ($.errorJoinShop.indexOf("活动太火爆,请稍后再试") > -1) {
console.log("开卡失败❌ ,重新执行脚本");
allMessage += `【账号${$.index}】开卡失败❌ ,重新执行脚本\n`;
} else {
$.joinStatus = true;
}
await takePostRequest("activityContent");
await takePostRequest("drawContent");
await takePostRequest("checkOpenCard");
await $.wait(parseInt(Math.random() * 2000 + 3000, 10));
}
}
} else {
console.log("已全部开卡");
}
$.log("关注: " + $.followShop);
if (!$.followShop && !$.outFlag) {
flag = true;
await takePostRequest("followShops");
await $.wait(parseInt(Math.random() * 2000 + 3000, 10));
}
if (flag) {
await takePostRequest("activityContent");
}
console.log(`${$.score2}`);
if (guaopencard_draw + "" !== "0") {
$.runFalag = true;
let count = parseInt($.score2 / 100);
guaopencard_draw = parseInt(guaopencard_draw, 10);
if (count > guaopencard_draw) count = guaopencard_draw;
console.log(`抽奖次数为:${count}`);
for (m = 1; count--; m++) {
console.log(`${m}次抽奖`);
await takePostRequest("抽奖");
if ($.runFalag == false) break;
if (Number(count) <= 0) break;
if (m >= 10) {
console.log("抽奖太多次,多余的次数请再执行脚本");
break;
}
await $.wait(parseInt(Math.random() * 2000 + 2000, 10));
}
} else
console.log('如需抽奖请设置环境变量[guaopencard_draw132]为"3" 3为次数');
await $.wait(parseInt(Math.random() * 1000 + 2000, 10));
await takePostRequest("getDrawRecordHasCoupon");
await takePostRequest("getShareRecord");
if ($.outFlag) {
console.log("此ip已被限制请过10分钟后再执行脚本\n");
return;
}
console.log($.actorUuid);
console.log(`当前助力:${$.shareUuid}`);
if ($.index == 1) {
$.shareUuid = $.actorUuid;
console.log(`后面的号都会助力:${$.shareUuid}`);
}
await $.wait(parseInt(Math.random() * 1000 + 5000, 10));
if (flag) await $.wait(parseInt(Math.random() * 1000 + 10000, 10));
if (guaopenwait) {
if ($.index != cookiesArr.length) {
console.log(`等待${guaopenwait}`);
await $.wait(parseInt(guaopenwait, 10) * 1000);
}
} else {
if ($.index % 3 == 0) console.log("休息1分钟别被黑ip了\n可持续发展");
if ($.index % 3 == 0)
await $.wait(parseInt(Math.random() * 5000 + 60000, 10));
}
} catch (e) {
console.log(e);
}
}
async function takePostRequest(type) {
if ($.outFlag) return;
let domain = "https://lzdz1-isv.isvjcloud.com";
let body = ``;
let method = "POST";
let admJson = "";
switch (type) {
case "isvObfuscator":
url = `https://api.m.jd.com/client.action?functionId=isvObfuscator`;
body = `body=%7B%22url%22%3A%22https%3A//lzdz1-isv.isvjcloud.com%22%2C%22id%22%3A%22%22%7D&uuid=a64f31266e51024c13e6cfe1b90b4577f6eff91c&client=apple&clientVersion=10.1.4&st=1649830240108&sv=111&sign=ab44eeba153125038adb227f200d1b54`;
break;
case "getSimpleActInfoVo":
url = `${domain}/dz/common/getSimpleActInfoVo`;
body = `activityId=${$.activityId}`;
break;
case "getMyPing":
url = `${domain}/customer/getMyPing`;
body = `userId=${$.shopId || $.venderId || ""}&token=${
$.Token
}&fromType=APP`;
break;
case "accessLogWithAD":
url = `${domain}/common/accessLogWithAD`;
let pageurl = `${domain}/dingzhi/april/manGod/activity?activityId=${$.activityId}&shareUuid=${$.shareUuid}`;
body = `venderId=${
$.shopId || $.venderId || ""
}&code=99&pin=${encodeURIComponent($.Pin)}&activityId=${
$.activityId
}&pageUrl=${encodeURIComponent(pageurl)}&subType=app&adSource=`;
break;
case "getUserInfo":
url = `${domain}/wxActionCommon/getUserInfo`;
body = `pin=${encodeURIComponent($.Pin)}`;
break;
case "activityContent":
url = `${domain}/dingzhi/april/manGod/activityContent`;
body = `activityId=${$.activityId}&pin=${encodeURIComponent(
$.Pin
)}&pinImg=${encodeURIComponent($.attrTouXiang)}&nick=${encodeURIComponent(
$.nickname
)}&cjyxPin=&cjhyPin=&shareUuid=${$.shareUuid}`;
break;
case "drawContent":
url = `${domain}/dingzhi/taskact/common/drawContent`;
body = `activityId=${$.activityId}&pin=${encodeURIComponent($.Pin)}`;
break;
case "checkOpenCard":
url = `${domain}/dingzhi/april/manGod/initOpenCard`;
body = `activityId=${$.activityId}&pin=${encodeURIComponent(
$.Pin
)}&shareUuid=${$.shareUuid}`;
break;
case "info":
url = `${domain}/dingzhi/linkgame/task/opencard/info`;
body = `activityId=${$.activityId}&pin=${encodeURIComponent(
$.Pin
)}&actorUuid=${$.actorUuid}`;
break;
case "startDraw":
url = `${domain}/joint/order/draw`;
body = `activityId=${$.activityId}&pin=${encodeURIComponent(
$.Pin
)}&actorUuid=${$.actorUuid}&drawType=1`;
break;
case "followShop":
url = `${domain}/dingzhi/opencard/follow/shop`;
// url = `${domain}/dingzhi/dz/openCard/saveTask`;
body = `activityId=${$.activityId}&pin=${encodeURIComponent($.Pin)}`;
break;
case "sign":
case "addCart":
case "browseGoods":
url = `${domain}/dingzhi/opencard/${type}`;
body = `activityId=${$.activityId}&pin=${encodeURIComponent($.Pin)}`;
if (type == "browseGoods") body += `&value=${$.visitSkuValue}`;
break;
case "邀请":
case "助力":
if (type == "助力") {
url = `${domain}/dingzhi/linkgame/assist`;
} else {
url = `${domain}/dingzhi/linkgame/assist/status`;
}
body = `activityId=${$.activityId}&pin=${encodeURIComponent(
$.Pin
)}&shareUuid=${$.shareUuid}`;
break;
case "viewVideo":
case "visitSku":
case "toShop":
case "addSku":
case "followShops":
url = `${domain}/dingzhi/april/manGod/saveTask`;
let taskType = "";
let taskValue = "";
if (type == "viewVideo") {
taskType = 31;
taskValue = 31;
} else if (type == "visitSku") {
taskType = 5;
taskValue = $.visitSkuValue || 5;
} else if (type == "toShop") {
taskType = 14;
taskValue = $.toShopValue || 14;
} else if (type == "addSku") {
taskType = 2;
taskValue = $.addSkuValue || 2;
} else if (type == "followShops") {
taskType = 23;
taskValue = 23;
}
body = `activityId=${$.activityId}&pin=${encodeURIComponent(
$.Pin
)}&actorUuid=${
$.actorUuid
}&taskType=${taskType}&taskValue=${taskValue}&shareUuid=${$.shareUuid}`;
break;
case "getDrawRecordHasCoupon":
url = `${domain}/dingzhi/taskact/common/getDrawRecordHasCoupon`;
body = `activityId=${$.activityId}&pin=${encodeURIComponent(
$.Pin
)}&actorUuid=${$.actorUuid}`;
break;
case "getShareRecord":
url = `${domain}/dingzhi/taskact/common/getShareRecord`;
body = `activityId=${$.activityId}&pin=${encodeURIComponent(
$.Pin
)}&actorUuid=${$.actorUuid}`;
break;
case "抽奖":
url = `${domain}/dingzhi/april/manGod/draw`;
body = `activityId=${$.activityId}&pin=${encodeURIComponent($.Pin)}`;
break;
default:
console.log(`错误${type}`);
}
let myRequest = getPostRequest(url, body, method);
// console.log(myRequest)
return new Promise(async (resolve) => {
$.post(myRequest, (err, resp, data) => {
try {
setActivityCookie(resp);
if (err) {
if (resp && typeof resp.statusCode != "undefined") {
if (resp.statusCode == 493) {
console.log("此ip已被限制请过10分钟后再执行脚本\n");
$.outFlag = true;
}
}
console.log(`${$.toStr(err, err)}`);
console.log(`${type} API请求失败请检查网路重试`);
} else {
dealReturn(type, data);
}
} catch (e) {
// console.log(data);
console.log(e, resp);
} finally {
resolve();
}
});
});
}
async function dealReturn(type, data) {
let res = "";
try {
if (type != "accessLogWithAD" || type != "drawContent") {
if (data) {
res = JSON.parse(data);
}
}
} catch (e) {
console.log(`${type} 执行任务异常`);
console.log(data);
$.runFalag = false;
}
try {
switch (type) {
case "isvObfuscator":
if (typeof res == "object") {
if (res.errcode == 0) {
if (typeof res.token != "undefined") $.Token = res.token;
} else if (res.message) {
console.log(`isvObfuscator ${res.message || ""}`);
} else {
console.log(data);
}
} else {
console.log(data);
}
break;
case "getSimpleActInfoVo":
if (typeof res == "object") {
if (res.result && res.result === true) {
if (typeof res.data.shopId != "undefined")
$.shopId = res.data.shopId;
if (typeof res.data.venderId != "undefined")
$.venderId = res.data.venderId;
} else if (res.errorMessage) {
console.log(`${type} ${res.errorMessage || ""}`);
} else {
console.log(`${type} ${data}`);
}
} else {
console.log(`${type} ${data}`);
}
break;
case "getMyPing":
if (typeof res == "object") {
if (res.result && res.result === true) {
if (res.data && typeof res.data.secretPin != "undefined")
$.Pin = res.data.secretPin;
if (res.data && typeof res.data.nickname != "undefined")
$.nickname = res.data.nickname;
} else if (res.errorMessage) {
console.log(`${type} ${res.errorMessage || ""}`);
} else {
console.log(`${type} ${data}`);
}
} else {
console.log(`${type} ${data}`);
}
break;
case "getUserInfo":
if (typeof res == "object") {
if (res.result && res.result === true) {
if (res.data && typeof res.data.yunMidImageUrl != "undefined")
$.attrTouXiang =
res.data.yunMidImageUrl ||
"https://img10.360buyimg.com/imgzone/jfs/t1/7020/27/13511/6142/5c5138d8E4df2e764/5a1216a3a5043c5d.png";
} else if (res.errorMessage) {
console.log(`${type} ${res.errorMessage || ""}`);
} else {
console.log(`${type} ${data}`);
}
} else {
console.log(`${type} ${data}`);
}
break;
case "activityContent":
if (typeof res == "object") {
if (res.result && res.result === true) {
$.endTime =
res.data.endTime ||
(res.data.activityVo && res.data.activityVo.endTime) ||
res.data.activity.endTime ||
0;
$.hasEnd = res.data.isEnd || false;
$.score = res.data.score || 0;
$.score2 = res.data.score2 || 0;
$.actorUuid = res.data.actorUuid || "";
$.followShop = res.data.allFollowShop || "";
} else if (res.errorMessage) {
console.log(`${type} ${res.errorMessage || ""}`);
} else {
console.log(`${type} ${data}`);
}
} else {
console.log(`${type} ${data}`);
}
break;
case "info":
if (typeof res == "object") {
if (res.result && res.result === true) {
// $.drawCount = res.data.drawCount || 0
$.addCart = res.data.addCart || false;
// $.followShop = res.data.followShop || false
// $.sign = res.data.isSignStatus || false
// $.visitSku = res.data.visitSku || false
// $.visitSkuList = res.data.visitSkuList || []
} else if (res.errorMessage) {
console.log(`${type} ${res.errorMessage || ""}`);
} else {
console.log(`${type} ${data}`);
}
} else {
console.log(`${type} ${data}`);
}
break;
case "checkOpenCard":
if (typeof res == "object") {
if (res.result && res.result === true) {
let cardList1 = res.data.cardList1 || [];
let cardList2 = res.data.cardList2 || [];
let cardList = res.data.cardList || [];
let openInfo = res.data.openInfo || [];
$.openList = [...cardList, ...cardList1, ...cardList2, ...openInfo];
$.allOpenCard =
res.data.allOpenCard || res.data.isOpenCardStatus || false;
$.openCardScore1 = res.data.score1 || 0;
$.openCardScore2 = res.data.score2 || 0;
$.drawScore = res.data.drawScore || 0;
if (res.data.beans || res.data.addBeanNum)
console.log(
`开卡获得:${res.data.beans || res.data.addBeanNum}`
);
} else if (res.errorMessage) {
console.log(`${type} ${res.errorMessage || ""}`);
} else {
console.log(`${type} ${data}`);
}
} else {
console.log(`${type} ${data}`);
}
break;
case "startDraw":
case "followShop":
case "followShops":
case "viewVideo":
case "visitSku":
case "toShop":
case "addSku":
case "sign":
case "addCart":
case "browseGoods":
case "抽奖":
if (typeof res == "object") {
if (res.result && res.result === true) {
if (typeof res.data == "object") {
let msg = "";
let title = "抽奖";
if (res.data.addBeanNum) {
msg = `${res.data.addBeanNum}京豆`;
}
if (res.data.addPoint) {
msg += ` ${res.data.addPoint}游戏机会`;
}
if (type == "followShop" || type == "followShops") {
title = "关注";
if (res.data.beanNumMember && res.data.assistSendStatus) {
msg += ` 额外获得:${res.data.beanNumMember}京豆`;
}
} else if (type == "addSku" || type == "addCart") {
title = "加购";
} else if (type == "viewVideo") {
title = "热门文章";
} else if (type == "toShop") {
title = "浏览店铺";
} else if (type == "visitSku" || type == "browseGoods") {
title = "浏览商品";
} else if (type == "sign") {
title = "签到";
} else {
let drawData = res.data.wdsrvo || res.data;
msg = (drawData.drawOk == true && drawData.name) || "";
}
if (title == "抽奖" && msg && msg.indexOf("京豆") == -1) {
if ($.isNode())
await notify.sendNotify(
`${$.name}`,
`【京东账号${$.index}${
$.nickName || $.UserName
}\n${title}成功,获得 ${msg}`
);
}
if (!msg) {
msg = "空气💨";
}
console.log(`${title}获得:${msg || data}`);
} else {
console.log(`${type} ${data}`);
}
} else if (res.errorMessage) {
$.runFalag = false;
console.log(`${type} ${res.errorMessage || ""}`);
} else {
console.log(`${type} ${data}`);
}
} else {
console.log(`${type} ${data}`);
}
break;
case "getDrawRecordHasCoupon":
if (typeof res == "object") {
if (res.result && res.result === true) {
console.log(`我的奖品:`);
let num = 0;
let value = 0;
let jsonName = {
dayBeSharedBeans: "被邀请",
dayShareBeans: "邀请",
saveTaskBeans: "关注店铺/加购商品",
allOpenCardBeans: "开通所有卡",
opencardBeans: "开卡",
openCardBeans: "开卡",
"1a6ae4e695074d9cbdd9629e183a0d9b": "抽奖",
"9d338d90ec394403b6a4f797c6c4ac32": "开卡抽奖",
OneClickCoupon: "优惠券",
};
let dayShareTime = 0;
for (let i in res.data) {
let item = res.data[i];
if (item.drawId == "dayShareBeans") {
num++;
value = item.infoName.replace("京豆", "");
dayShareTime =
dayShareTime < item.createTime
? item.createTime
: dayShareTime;
} else {
console.log(
`${(jsonName[item.drawId] || item.drawId) + ":" || ""}${
item.infoName
}`
);
}
}
if (dayShareTime > 0)
console.log(
"最新邀请奖励时间:" +
$.time("yyyy-MM-dd HH:mm:ss", dayShareTime)
);
if (num > 0)
console.log(
`邀请好友(${num}):${num * parseInt(value, 10) || 30}京豆`
);
} else if (res.errorMessage) {
console.log(`${type} ${res.errorMessage || ""}`);
} else {
console.log(`${type} ${data}`);
}
} else {
console.log(`${type} ${data}`);
}
break;
case "getShareRecord":
if (typeof res == "object") {
if (res.result && res.result === true && res.data) {
$.ShareCount = res.data.length;
$.log(`=========== 你邀请了:${$.ShareCount}\n`);
} else if (res.errorMessage) {
console.log(`${type} ${res.errorMessage || ""}`);
} else {
console.log(`${type} ${data}`);
}
} else {
console.log(`${type} ${data}`);
}
break;
case "邀请":
case "助力":
// console.log(data)
if (typeof res == "object") {
if (res.data.status == 200) {
if (type == "助力") {
console.log("助力成功");
} else {
$.yaoqing = true;
}
} else if (res.data.status == 105) {
console.log("已经助力过");
} else if (res.data.status == 104) {
console.log("已经助力其他人");
} else if (res.data.status == 101) {
// console.log('已经助力过')
} else {
console.log(data);
}
} else {
console.log(`${type} ${data}`);
}
case "accessLogWithAD":
case "drawContent":
break;
default:
console.log(`${type}-> ${data}`);
}
if (typeof res == "object") {
if (res.errorMessage) {
if (res.errorMessage.indexOf("火爆") > -1) {
$.hotFlag = true;
}
}
}
} catch (e) {
console.log(e);
}
}
function getPostRequest(url, body, method = "POST") {
let headers = {
Accept: "application/json",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-cn",
Connection: "keep-alive",
"Content-Type": "application/x-www-form-urlencoded",
Cookie: cookie,
"User-Agent": $.UA,
"X-Requested-With": "XMLHttpRequest",
};
if (url.indexOf("https://lzdz1-isv.isvjcloud.com") > -1) {
headers[
"Referer"
] = `https://lzdz1-isv.isvjcloud.com/dingzhi/april/manGod/activity?activityId=${$.activityId}&shareUuid=${$.shareUuid}`;
headers["Cookie"] = `${
(lz_jdpin_token_cookie && lz_jdpin_token_cookie) || ""
}${($.Pin && "AUTH_C_USER=" + $.Pin + ";") || ""}${activityCookie}`;
}
// console.log(headers)
// console.log(headers.Cookie)
return {
url: url,
method: method,
headers: headers,
body: body,
timeout: 30000,
};
}
function getCk() {
return new Promise((resolve) => {
let get = {
url: `https://lzdz1-isv.isvjcloud.com/dingzhi/april/manGod/activity?activityId=${$.activityId}&shareUuid=${$.shareUuid}`,
followRedirect: false,
headers: {
"User-Agent": $.UA,
},
timeout: 30000,
};
$.get(get, async (err, resp, data) => {
try {
if (err) {
if (resp && typeof resp.statusCode != "undefined") {
if (resp.statusCode == 493) {
console.log("此ip已被限制请过10分钟后再执行脚本\n");
$.outFlag = true;
}
}
console.log(`${$.toStr(err)}`);
console.log(`${$.name} cookie API请求失败请检查网路重试`);
} else {
let end =
(data.match(/(活动已经结束)/) && data.match(/(活动已经结束)/)[1]) ||
"";
if (end) {
$.activityEnd = true;
console.log("活动已结束");
}
setActivityCookie(resp);
}
} catch (e) {
$.logErr(e, resp);
} finally {
resolve();
}
});
});
}
function setActivityCookie(resp) {
let LZ_TOKEN_KEY = "";
let LZ_TOKEN_VALUE = "";
let lz_jdpin_token = "";
let setcookies =
(resp &&
resp["headers"] &&
(resp["headers"]["set-cookie"] || resp["headers"]["Set-Cookie"] || "")) ||
"";
let setcookie = "";
if (setcookies) {
if (typeof setcookies != "object") {
setcookie = setcookies.split(",");
} else setcookie = setcookies;
for (let ck of setcookie) {
let name = ck.split(";")[0].trim();
if (name.split("=")[1]) {
// console.log(name.replace(/ /g,''))
if (name.indexOf("LZ_TOKEN_KEY=") > -1)
LZ_TOKEN_KEY = name.replace(/ /g, "") + ";";
if (name.indexOf("LZ_TOKEN_VALUE=") > -1)
LZ_TOKEN_VALUE = name.replace(/ /g, "") + ";";
if (name.indexOf("lz_jdpin_token=") > -1)
lz_jdpin_token = "" + name.replace(/ /g, "") + ";";
}
}
}
if (LZ_TOKEN_KEY && LZ_TOKEN_VALUE)
activityCookie = `${LZ_TOKEN_KEY} ${LZ_TOKEN_VALUE}`;
if (lz_jdpin_token) lz_jdpin_token_cookie = lz_jdpin_token;
}
async function getUA() {
$.UA = `jdapp;iPhone;10.1.4;13.1.2;${randomString(
40
)};network/wifi;model/iPhone8,1;addressid/2308460611;appBuild/167814;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1`;
}
function randomString(e) {
e = e || 32;
let t = "abcdef0123456789",
a = t.length,
n = "";
for (i = 0; i < e; i++) n += t.charAt(Math.floor(Math.random() * a));
return n;
}
async function joinShop() {
if (!$.joinVenderId) return;
return new Promise(async (resolve) => {
$.errorJoinShop = "活动太火爆,请稍后再试";
let activityId = ``;
if ($.shopactivityId) activityId = `,"activityId":${$.shopactivityId}`;
let body = `{"venderId":"${$.joinVenderId}","shopId":"${$.joinVenderId}","bindByVerifyCodeFlag":1,"registerExtend":{},"writeChildFlag":0${activityId},"channel":406}`;
let h5st = "undefined";
try {
h5st = (await h5stSign(body, "bindWithVender")) || "undefined";
} catch (e) {
h5st = "undefined";
}
const options = {
url: `https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=bindWithVender&body=${body}&clientVersion=9.2.0&client=H5&uuid=88888&h5st=${h5st}`,
headers: {
accept: "*/*",
"accept-encoding": "gzip, deflate, br",
"accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
cookie: cookie,
origin: "https://shopmember.m.jd.com/",
"user-agent": $.UA,
},
};
$.get(options, async (err, resp, data) => {
try {
data =
(data &&
data.match(/jsonp_.*?\((.*?)\);/) &&
data.match(/jsonp_.*?\((.*?)\);/)[1]) ||
data;
// console.log(data)
let res = $.toObj(data, data);
if (res && typeof res == "object") {
if (res && res.success === true) {
console.log(res.message);
$.errorJoinShop = res.message;
if (res.result && res.result.giftInfo) {
for (let i of res.result.giftInfo.giftList) {
console.log(
`入会获得:${i.discountString}${i.prizeName}${i.secondLineDesc}`
);
}
}
} else if (res && typeof res == "object" && res.message) {
$.errorJoinShop = res.message;
console.log(`${res.message || ""}`);
} else {
console.log(data);
}
} else {
console.log(data);
}
} catch (e) {
$.logErr(e, resp);
} finally {
resolve();
}
});
});
}
async function getshopactivityId() {
return new Promise(async (resolve) => {
let body = `{"venderId":"${$.joinVenderId}","channel":406,"payUpShop":true}`;
let h5st = "undefined";
try {
h5st = (await h5stSign(body, "getShopOpenCardInfo")) || "undefined";
} catch (e) {
h5st = "undefined";
}
const options = {
url: `https://api.m.jd.com/client.action?appid=jd_shop_member&functionId=getShopOpenCardInfo&body=${body}&clientVersion=9.2.0&client=H5&uuid=88888&h5st=${h5st}`,
headers: {
accept: "*/*",
"accept-encoding": "gzip, deflate, br",
"accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
cookie: cookie,
origin: "https://shopmember.m.jd.com/",
"user-agent": $.UA,
},
};
$.get(options, async (err, resp, data) => {
try {
data =
(data &&
data.match(/jsonp_.*?\((.*?)\);/) &&
data.match(/jsonp_.*?\((.*?)\);/)[1]) ||
data;
// console.log(data)
let res = $.toObj(data, data);
if (res && typeof res == "object") {
if (res && res.success == true) {
// console.log($.toStr(res.result))
console.log(
`入会:${res.result.shopMemberCardInfo.venderCardName || ""}`
);
$.shopactivityId =
(res.result.interestsRuleList &&
res.result.interestsRuleList[0] &&
res.result.interestsRuleList[0].interestsInfo &&
res.result.interestsRuleList[0].interestsInfo.activityId) ||
"";
}
} else {
console.log(data);
}
} catch (e) {
$.logErr(e, resp);
} finally {
resolve();
}
});
});
}
function jsonParse(str) {
if (typeof str == "string") {
try {
return JSON.parse(str);
} catch (e) {
console.log(e);
$.msg(
$.name,
"",
"请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie"
);
return [];
}
}
}
var _0xodL = "jsjiami.com.v6",
_0xodL_ = ["_0xodL"],
_0x43d5 = [
_0xodL,
"TX/Cnw==",
"wpbDiMKgAsKj",
"ZMOFKTbDrg==",
"SMKCH2l6",
"wrk1w6ZKwpk=",
"w6oFc8KUwqM=",
"wo4qwoTCkMOp",
"eWgAw7pj",
"cMOsw79AwpU=",
"w5rDjsOlQMON",
"w6/DpsOMQcOA",
"woIFwo7CiMOu",
"wq3Clk3DrcKz",
"ZcOtw4Vtwog=",
"H8O5RRDDvg==",
"w4EkQMK5wowkew==",
"wpEBwrUfwrY=",
"w5XDn8O4bA==",
"w57DqAVhw6w=",
"DcOwNsObw6M=",
"wqDCncKKH8OS",
"G8K+DcODw6U=",
"RcKlDg==",
"DT/CtMKs",
"wpx8HH3DoA==",
"HDvCs8KkKVo=",
"JRRMdsK0",
"XARBwp88",
"BCTCombCkA==",
"wrTDisKpO8KzwoTCucK7",
"XMOpFSHDkTXDgMOm",
"wp3CtEzDrMKc",
"P0zCtcKvw7I=",
"ORzDpsOVw5c=",
"wrPDm8KZIcKx",
"L8KmLsKSDg==",
"wrA5VA==",
"wqU1w7BlwqA=",
"wrnDsRTDv0U=",
"GzjCp8KVIg==",
"wqLClMOlw4fCtQ==",
"V3p5esOK",
"FSbCtg==",
"wrYJw7klwoc=",
"GyrDjsKew4BS",
"w4bDnsKCwrNK",
"HANTTcKEw4DDmng=",
"GsOvI8Ojw7DDqMKxwoI=",
"X8KlKnVZw78pw7c=",
"wovCoW7Do8KO",
"CQdsw6JKw707",
"wp3DnyDDg1w=",
"wo3CusOyw7TCosKLwq8Qw6IA",
"wpczw7dXwp4OwqZs",
"wr43SgnDisOF",
"GjXCjsK0NF7Dg3A=",
"woIiwobCg8OeLw==",
"wo8Qw6AmwrQ=",
"w4vDrw7DswTCrsK/Yw==",
"JsOuST7DqsK+",
"XMOpLTDDjQ==",
"w4xYNcK6w5Ju",
"OgBzccKU",
"QcKlEG8=",
"GgLCr0nCn8K6w5U=",
"Gx7CgMK7w40=",
"AMOBaT7Dpg==",
"DDPCs8KkEV7DmX/DgDDDkxDCh2s=",
"NDvCtsK4CQ==",
"KsKfeDXCtw==",
"wo/CsW/CtELDssOnM8KGSw==",
"NsKCA8OiwpkrO8KyIMOTfcOSw6VlUwMc",
"wr/Cv8K+w5TCv8OvwpRKw6xHwrjCtcKlMcKjwqrDh8ONTcOVw7otBQ==",
"XxRgwrc4eMOVOnUzwojDuTsdwr3CllA2fQvDskMzK0TCucOt",
"w5rDhcKdwqZXwoJtDMOncsORw6Uvwr1kecKaLMOnPMKrw5vDocOuw40/w4w9",
"wp1/CMOaw5E=",
"w4zDjAXDiCM=",
"w4fDtDPDpTU=",
"woXDmcK+L8KowoY=",
"DyPCkcKCAw==",
"RcKww7kqwr0=",
"wrkKwrLCksOe",
"Fz/Di8OJw6Iyw4o=",
"w5fDm8O7bsOdCQ==",
"EwVhw6RX",
"ARBEw4V3",
"w6PCjxEVw7w=",
"Oz3CssKBLw==",
"wpXCn17DosKv",
"O8ODCsOfw4M=",
"w77Dg8K+wpxo",
"SsORByLDsg==",
"wpXDr8KRPMKW",
"DBzDjMOpw7A=",
"wpMAwovCpcOV",
"FsOBB8O6w5Q=",
"DTh7w513",
"AzPCgMOVwpY=",
"G0t+w6JAw4E0wrFIwqDDmcO0w78oJsKbwrpPw53Cv8KhwrB+",
"w7JbPzbDig==",
"UUDDqVjCjsKYw5bDlcKFwp9iwrvDmsOf",
"w4LDnsKawqI=",
"wpZ0HC7CvA==",
"YsKww4tULA==",
"FsOxaSTDhQ==",
"w7xHFcKgw70=",
"w5jDuQXDtjw=",
"XMOCHgbDlA==",
"w7jDhwROw4Y=",
"AcKSVh/Cuw==",
"wpo+w6BSwro=",
"GsOvP8O1w6g=",
"ZMKcw6gHwpI=",
"JQPCosKew4TCrw==",
"wppcJWfDglta",
"wpTClMOmw6DChA==",
"w5HDtTDDpRPCtQ==",
"CD3Cs8Obwo/DrQ==",
"MMKaCcO2w5BtOMK/L8OVd8OKw60nHBEfwrdNwr3CisKfJRMxw6bDjsKLbsK7fQvCtcO1R05FwpzDnMODMsKyTsKywoRmLyPCjBdBQA==",
"w6/ClyU=",
"dcKwFW7Cv8O/MMOuEcOhw6kzV8K9Az0dDMKCRsKKXsOiw5ozwrzChiFXd1jDjsOUQMO/w4zCusKoAMO8IMKiw6zCt1rDisOpwptIwr4xGBzDimUDw4LDiMOJwopFBxbDrg==",
"TH7CksOmwpEeWsOdXcKo",
"5pWP6bme54Sh5puIw4Xlpa7niZLmgJPogbw=",
"wofCn1fDssKR",
"wqs+wo3ClMOx",
"WMKjA2Q=",
"TDVKXX4=",
"w7dCLAvDukFZw5E=",
"w4U0R8KZwookWsKaRcOV",
"AgLCksOUwrk=",
"O1DClcKJw7k=",
"w5HDpcKwwp1A",
"WMO0MwHDkw==",
"HQ7CnELCtg==",
"w7hzwphOTg==",
"w5tFFSjDlA==",
"AsKmbB4=",
"wr7DsMKfB8Kp",
"wpd0OsOww4E=",
"fcKMcsKNKcKA",
"wqF4PsOkw6dP",
"ZcKdw6cHwppkDxVa",
"B8KieA==",
"wpcswoTClcOa",
"LVfCicKWw7E=",
"b0MIw49L",
"wqDCucKKA8OLw6bCg8KvIcObc8KTwq3CnSXCmMK+w7XDiA==",
"w4pnw40kZg==",
"w4pyKRrDuQ==",
"KzPCt8OcwpE=",
"5pWW6bqf54WI5pqiVuWnoOeKneaDpOiDpA==",
"w4VywpVzd8O6",
"w4cxRMKEwoE=",
"ISrDuMOR",
"wo0Mw7kKwr7DnA==",
"IQrCpcKww4/CosKxDgXDjynCgR4=",
"w4A0WsKOwpEgccKdb8OF",
"wq/CpMO8w7nCgQ==",
"BDXCtMKu",
"FyPCpMK5C3rDiXPDnh3DkBnCkWoa",
"AjsRjkkBiBamNiUEPzxUz.cBom.v6==",
];
if (
((function (_0x52378d, _0x1a500f, _0x160a1a) {
function _0x5afa07(
_0x406488,
_0x1eb2cd,
_0x116a38,
_0x2e00ef,
_0x24b720,
_0x204fe6
) {
(_0x1eb2cd = _0x1eb2cd >> 0x8), (_0x24b720 = "po");
var _0x5e4594 = "shift",
_0x4727eb = "push",
_0x204fe6 = "";
if (_0x1eb2cd < _0x406488) {
while (--_0x406488) {
_0x2e00ef = _0x52378d[_0x5e4594]();
if (
_0x1eb2cd === _0x406488 &&
_0x204fe6 === "" &&
_0x204fe6["length"] === 0x1
) {
(_0x1eb2cd = _0x2e00ef), (_0x116a38 = _0x52378d[_0x24b720 + "p"]());
} else if (
_0x1eb2cd &&
_0x116a38["replace"](/[ARkkBBNUEPzxUzB=]/g, "") === _0x1eb2cd
) {
_0x52378d[_0x4727eb](_0x2e00ef);
}
}
_0x52378d[_0x4727eb](_0x52378d[_0x5e4594]());
}
return 0xde7f8;
}
return (_0x5afa07(++_0x1a500f, _0x160a1a) >> _0x1a500f) ^ _0x160a1a;
})(_0x43d5, 0x12d, 0x12d00),
_0x43d5)
) {
_0xodL_ = _0x43d5["length"] ^ 0x12d;
}
function _0x39f7(_0x40f17f, _0x53e585) {
_0x40f17f = ~~"0x"["concat"](_0x40f17f["slice"](0x1));
var _0x28ec5c = _0x43d5[_0x40f17f];
if (_0x39f7["FrXFlu"] === undefined) {
(function () {
var _0x54520e =
typeof window !== "undefined"
? window
: typeof process === "object" &&
typeof require === "function" &&
typeof global === "object"
? global
: this;
var _0x116397 =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
_0x54520e["atob"] ||
(_0x54520e["atob"] = function (_0x552a1a) {
var _0x3ab8d9 = String(_0x552a1a)["replace"](/=+$/, "");
for (
var _0x3b6775 = 0x0,
_0x5474dd,
_0x3489a8,
_0x5dd2ab = 0x0,
_0x20859b = "";
(_0x3489a8 = _0x3ab8d9["charAt"](_0x5dd2ab++));
~_0x3489a8 &&
((_0x5474dd =
_0x3b6775 % 0x4 ? _0x5474dd * 0x40 + _0x3489a8 : _0x3489a8),
_0x3b6775++ % 0x4)
? (_0x20859b += String["fromCharCode"](
0xff & (_0x5474dd >> ((-0x2 * _0x3b6775) & 0x6))
))
: 0x0
) {
_0x3489a8 = _0x116397["indexOf"](_0x3489a8);
}
return _0x20859b;
});
})();
function _0x11d503(_0x147b39, _0x53e585) {
var _0x349480 = [],
_0x287a1d = 0x0,
_0x151ad2,
_0x494e45 = "",
_0x490ced = "";
_0x147b39 = atob(_0x147b39);
for (
var _0xc58479 = 0x0, _0x4f9bbe = _0x147b39["length"];
_0xc58479 < _0x4f9bbe;
_0xc58479++
) {
_0x490ced +=
"%" +
("00" + _0x147b39["charCodeAt"](_0xc58479)["toString"](0x10))[
"slice"
](-0x2);
}
_0x147b39 = decodeURIComponent(_0x490ced);
for (var _0x128b0f = 0x0; _0x128b0f < 0x100; _0x128b0f++) {
_0x349480[_0x128b0f] = _0x128b0f;
}
for (_0x128b0f = 0x0; _0x128b0f < 0x100; _0x128b0f++) {
_0x287a1d =
(_0x287a1d +
_0x349480[_0x128b0f] +
_0x53e585["charCodeAt"](_0x128b0f % _0x53e585["length"])) %
0x100;
_0x151ad2 = _0x349480[_0x128b0f];
_0x349480[_0x128b0f] = _0x349480[_0x287a1d];
_0x349480[_0x287a1d] = _0x151ad2;
}
_0x128b0f = 0x0;
_0x287a1d = 0x0;
for (var _0xe838b4 = 0x0; _0xe838b4 < _0x147b39["length"]; _0xe838b4++) {
_0x128b0f = (_0x128b0f + 0x1) % 0x100;
_0x287a1d = (_0x287a1d + _0x349480[_0x128b0f]) % 0x100;
_0x151ad2 = _0x349480[_0x128b0f];
_0x349480[_0x128b0f] = _0x349480[_0x287a1d];
_0x349480[_0x287a1d] = _0x151ad2;
_0x494e45 += String["fromCharCode"](
_0x147b39["charCodeAt"](_0xe838b4) ^
_0x349480[(_0x349480[_0x128b0f] + _0x349480[_0x287a1d]) % 0x100]
);
}
return _0x494e45;
}
_0x39f7["ppVdpS"] = _0x11d503;
_0x39f7["BiUakt"] = {};
_0x39f7["FrXFlu"] = !![];
}
var _0xe78cb7 = _0x39f7["BiUakt"][_0x40f17f];
if (_0xe78cb7 === undefined) {
if (_0x39f7["enhknX"] === undefined) {
_0x39f7["enhknX"] = !![];
}
_0x28ec5c = _0x39f7["ppVdpS"](_0x28ec5c, _0x53e585);
_0x39f7["BiUakt"][_0x40f17f] = _0x28ec5c;
} else {
_0x28ec5c = _0xe78cb7;
}
return _0x28ec5c;
}
async function h5stSign(_0x29ab61, _0x21e9be) {
var _0x4399ec = {
LjZMR: _0x39f7("0", "nCOP"),
FiTFL: function (_0x1a78aa, _0x2da8a9) {
return _0x1a78aa + _0x2da8a9;
},
hDnqK: function (_0x1c4c20, _0x4a3dfd) {
return _0x1c4c20 + _0x4a3dfd;
},
ubzUd: _0x39f7("1", "ljW5"),
gCvPD: _0x39f7("2", "(kzS"),
LCocM: function (_0x596688, _0x54a9dc) {
return _0x596688 == _0x54a9dc;
},
cHfhQ: "bindWithVender",
ZiBiu: function (_0x3e8702, _0x14af77) {
return _0x3e8702 === _0x14af77;
},
LDGyF: _0x39f7("3", "&&94"),
oglpV: _0x39f7("4", "TtV*"),
PRJUx: "8adfb",
ESpxe: _0x39f7("5", "oa$K"),
TXYHi: _0x39f7("6", "OJOr"),
xyXai: function (_0x3fcb64, _0x44ec79) {
return _0x3fcb64 > _0x44ec79;
},
RSBhl: _0x39f7("7", "pZB["),
AcXML: _0x39f7("8", "2^Ea"),
GGSGY: function (_0x592782, _0x43d49b) {
return _0x592782 === _0x43d49b;
},
YxLnl: _0x39f7("9", "X^&m"),
kWnCw: function (_0x4a16e2) {
return _0x4a16e2();
},
KzVKS: function (_0x16ef8a, _0x4789db) {
return _0x16ef8a + _0x4789db;
},
cpFLa: function (_0xf9ec58, _0x3d1501) {
return _0xf9ec58 + _0x3d1501;
},
gAtOq: function (_0x4cd49a, _0x4f6612) {
return _0x4cd49a + _0x4f6612;
},
JFgQP: _0x39f7("a", "OJOr"),
tEMoP: function (_0x1afc1c, _0x5419a4) {
return _0x1afc1c * _0x5419a4;
},
MxLOB: _0x39f7("b", "(EWH"),
kdUXw: "jd_shop_member",
wHiJw: _0x39f7("c", "nWVZ"),
QRqHK: _0x39f7("d", "GiA*"),
sOflQ: _0x39f7("e", "sBTj"),
GMIyM: "9.2.0",
DcIjv: _0x39f7("f", "(EWH"),
juGYi: _0x39f7("10", "][#3"),
AtGSe: _0x39f7("11", "tJx9"),
XiiJW: _0x39f7("12", "tJx9"),
RlsHb: _0x39f7("13", "4Jnb"),
enMPk: function (_0x5efa27, _0x327787) {
return _0x5efa27(_0x327787);
},
};
$[_0x39f7("14", "YBh@")] = "";
if (
_0x4399ec[_0x39f7("15", "6WFk")](
_0x21e9be,
_0x4399ec[_0x39f7("16", "jZsm")]
)
) {
if (
_0x4399ec[_0x39f7("17", "IePq")](
_0x4399ec[_0x39f7("18", "(EWH")],
_0x4399ec[_0x39f7("19", "(kzS")]
)
) {
return "1";
} else {
$["appId"] = _0x4399ec["PRJUx"];
}
} else if (
_0x4399ec[_0x39f7("1a", "TtV*")](
_0x21e9be,
_0x4399ec[_0x39f7("1b", "]tv2")]
)
) {
$[_0x39f7("1c", "6utI")] = _0x4399ec[_0x39f7("1d", "6utI")];
} else {
_0x21e9be = _0x4399ec[_0x39f7("1e", "(kzS")];
$[_0x39f7("1f", "b#)w")] = _0x4399ec[_0x39f7("20", "]tv2")];
}
if (
_0x4399ec[_0x39f7("21", "krQV")](
new Date()[_0x39f7("22", "(EWH")](),
0x18079110440
)
) {
if (
_0x4399ec[_0x39f7("23", "8W&D")](_0x4399ec["RSBhl"], _0x4399ec["AcXML"])
) {
return _0x4399ec["LjZMR"];
} else {
return _0x4399ec["LjZMR"];
}
}
if (
_0x4399ec["GGSGY"](
$[_0x39f7("24", "6utI")]["indexOf"](_0x4399ec["YxLnl"]),
-0x1
)
)
return _0x4399ec["LjZMR"];
await _0x4399ec["kWnCw"](_0xebdf07);
_0x29ab61 = $["toObj"](_0x29ab61, _0x29ab61);
let _0x41331a = _0x4399ec[_0x39f7("25", "ZQUW")](
_0x4399ec[_0x39f7("26", "o@q6")](
_0x4399ec[_0x39f7("27", "oa$K")](
_0x4399ec[_0x39f7("28", "1YUF")],
Date[_0x39f7("29", "jZsm")]()
),
"_"
),
Math[_0x39f7("2a", "tJx9")](
_0x4399ec[_0x39f7("2b", "pQwC")](0x186a0, Math[_0x39f7("2c", "tJx9")]())
)
);
let _0x36c59e = [
{
key: _0x4399ec[_0x39f7("2d", "*z%w")],
value: _0x4399ec[_0x39f7("2e", "OJmE")],
},
{
key: _0x4399ec[_0x39f7("2f", "e7hp")],
value: $[_0x39f7("30", "YBh@")]
["SHA256"]($["toStr"](_0x29ab61, _0x29ab61))
[_0x39f7("31", "6WFk")](),
},
{ key: _0x4399ec[_0x39f7("32", "b#)w")], value: "H5" },
{
key: _0x4399ec[_0x39f7("33", "&&94")],
value: _0x4399ec[_0x39f7("34", "4Jnb")],
},
{ key: _0x4399ec[_0x39f7("35", "YBh@")], value: _0x21e9be },
{ key: _0x4399ec[_0x39f7("36", "dSR6")], value: _0x41331a },
];
let _0x1c0a5e = _0x36c59e[_0x39f7("37", "kn^J")](function (_0x83e880) {
return _0x4399ec[_0x39f7("38", "IePq")](
_0x4399ec[_0x39f7("39", "U8#$")](
_0x83e880[_0x4399ec[_0x39f7("3a", "tJx9")]],
":"
),
_0x83e880[_0x4399ec[_0x39f7("3b", "][#3")]]
);
})[_0x4399ec[_0x39f7("3c", "y(Mx")]]("&");
let _0x22f5dc = Date[_0x39f7("3d", "2^Ea")]();
let _0x1b8f72 = "";
let _0x215741 = $["time"](_0x4399ec[_0x39f7("3e", "GiA*")], _0x22f5dc);
_0x1b8f72 = $[_0x39f7("3f", "47j2")](
$[_0x39f7("40", "h3[a")],
$["fp"][_0x39f7("41", "*z%w")](),
_0x215741[_0x39f7("42", "o@q6")](),
$["appId"]["toString"](),
$["CryptoJS"]
)[_0x39f7("43", "jZsm")]();
if (
_0x4399ec[_0x39f7("44", "b#)w")](
$["name"][_0x39f7("45", "xcLD")](_0x4399ec["YxLnl"]),
-0x1
)
)
return _0x4399ec[_0x39f7("46", "U8#$")];
const _0x9b69ba = $["CryptoJS"]
[_0x39f7("47", "][#3")](_0x1c0a5e, _0x1b8f72["toString"]())
["toString"]();
let _0x3f17c6 = [
""["concat"](_0x215741[_0x39f7("48", "IePq")]()),
""[_0x39f7("49", "kn^J")]($["fp"][_0x39f7("4a", "tJx9")]()),
""[_0x39f7("4b", "(kzS")](
$[_0x39f7("4c", "GiA*")][_0x39f7("4d", "X^&m")]()
),
""[_0x39f7("4e", "aWOY")]($[_0x39f7("4f", "6WFk")]),
""[_0x39f7("50", "pOVg")](_0x9b69ba),
_0x4399ec[_0x39f7("51", "*z%w")],
""["concat"](_0x22f5dc),
][_0x39f7("52", "jZsm")](";");
if (
_0x4399ec["GGSGY"](
$["name"][_0x39f7("53", "e7hp")](_0x4399ec[_0x39f7("54", "sBTj")]),
-0x1
)
)
return _0x4399ec["LjZMR"];
return _0x4399ec[_0x39f7("55", "krQV")](
_0x4399ec["enMPk"](encodeURIComponent, _0x3f17c6),
"&jsonp=" + _0x41331a
);
}
async function _0xebdf07() {
var _0x5e6631 = {
FzmJp: _0x39f7("56", "tJx9"),
ilaYY: "8adfb",
yFgYK: function (_0x8ee50a) {
return _0x8ee50a();
},
rRlBP: function (_0x336a95, _0x41a6d8) {
return _0x336a95 !== _0x41a6d8;
},
SpNyN: _0x39f7("57", "tJx9"),
tDXSw: function (_0x1cea02, _0x4d15e8) {
return _0x1cea02 !== _0x4d15e8;
},
mUWdy: _0x39f7("58", "ljW5"),
QCuwu: function (_0x415b59) {
return _0x415b59();
},
PbXYB: _0x39f7("59", "X^&m"),
sLXOU: function (_0x21e8a0, _0x3118af) {
return _0x21e8a0 | _0x3118af;
},
xtnbC: function (_0x1f9c6c, _0xbf7f1d) {
return _0x1f9c6c * _0xbf7f1d;
},
ayLBE: function (_0x5f433c, _0x572696) {
return _0x5f433c + _0x572696;
},
UCzHA: function (_0x2dcc60, _0x2e6a54) {
return _0x2dcc60(_0x2e6a54);
},
XGZra: function (_0x4caba6, _0x38b205) {
return _0x4caba6 == _0x38b205;
},
fXAwQ: function (_0x3ca77b, _0x2cb095) {
return _0x3ca77b < _0x2cb095;
},
UgoAi: function (_0xa485aa, _0x9c13e9) {
return _0xa485aa + _0x9c13e9;
},
YycFx: function (_0x5a001a, _0x13e711) {
return _0x5a001a + _0x13e711;
},
LrWJL: function (_0x3a0b96, _0x1733e8) {
return _0x3a0b96(_0x1733e8);
},
bWAwQ: function (_0x20b788, _0x3eb5ad) {
return _0x20b788 + _0x3eb5ad;
},
UjkiD: function (_0xe293fb, _0x3c9fda) {
return _0xe293fb - _0x3c9fda;
},
rMcEj: "application/json",
xAwmV: _0x39f7("5a", "1YUF"),
mQsZE: _0x39f7("5b", "][#3"),
KzOdD: _0x39f7("5c", "OJmE"),
xzAgw: _0x39f7("5d", "h3[a"),
};
var _0x3a5200 = _0x5e6631[_0x39f7("5e", "n9rU")],
_0x3a009b = "",
_0xc69fe7 = _0x3a5200,
_0x58fbbf = _0x5e6631[_0x39f7("5f", "X^&m")](
_0x5e6631[_0x39f7("60", "X^&m")](Math[_0x39f7("61", "YBh@")](), 0xa),
0x0
);
do {
var _0x537359 = _0x5e6631[_0x39f7("62", "tJx9")](
_0x5e6631[_0x39f7("63", "nCOP")](_0x3b4566, {
size: 0x1,
customDict: _0xc69fe7,
}),
""
);
if (
_0x5e6631[_0x39f7("64", "(kzS")](
_0x3a009b[_0x39f7("65", "4Jnb")](_0x537359),
-0x1
)
)
_0x3a009b += _0x537359;
} while (_0x5e6631["fXAwQ"](_0x3a009b[_0x39f7("66", "6utI")], 0x3));
for (let _0x454174 of _0x3a009b[_0x39f7("67", "xcLD")]())
_0xc69fe7 = _0xc69fe7["replace"](_0x454174, "");
$["fp"] = _0x5e6631[_0x39f7("68", "xcLD")](
_0x5e6631[_0x39f7("69", "Hu7$")](
_0x5e6631[_0x39f7("69", "Hu7$")](
_0x5e6631[_0x39f7("6a", "tJx9")](
_0x5e6631[_0x39f7("6b", "b#)w")](
_0x5e6631[_0x39f7("6c", "o@q6")](_0x3b4566, {
size: _0x58fbbf,
customDict: _0xc69fe7,
}),
""
),
_0x3a009b
),
_0x5e6631[_0x39f7("6d", "h3[a")](_0x3b4566, {
size: _0x5e6631[_0x39f7("6e", "6WFk")](
_0x5e6631["UjkiD"](
0xe,
_0x5e6631[_0x39f7("6f", "YBh@")](_0x58fbbf, 0x3)
),
0x1
),
customDict: _0xc69fe7,
})
),
_0x58fbbf
),
""
);
let _0x104bfe = {
url: "https://cactus.jd.com/request_algo?g_ty=ajax",
headers: {
Accept: _0x5e6631[_0x39f7("70", "4Jnb")],
"Content-Type": _0x5e6631[_0x39f7("71", "(kzS")],
"Accept-Encoding": _0x5e6631[_0x39f7("72", "o@q6")],
"Accept-Language": _0x5e6631[_0x39f7("73", "xcLD")],
Origin: _0x5e6631["KzOdD"],
Referer: _0x5e6631[_0x39f7("74", "2^Ea")],
"user-agent": $["UA"],
},
body:
_0x39f7("75", "xcLD") +
$["fp"] +
"\x22,\x22appId\x22:\x22" +
$[_0x39f7("76", "pZB[")] +
_0x39f7("77", "e7hp") +
Date["now"]() +
",\x22platform\x22:\x22web\x22,\x22expandParams\x22:\x22\x22}",
};
return new Promise(async (_0xbfc056) => {
$[_0x39f7("78", "h3[a")](_0x104bfe, (_0x2ff1a1, _0x140ac1, _0x271b78) => {
var _0x10cdff = {
gyXqJ: _0x5e6631[_0x39f7("79", "1ipr")],
QuuiQ: _0x5e6631["ilaYY"],
ybDqV: function (_0x17a1fd) {
return _0x5e6631["yFgYK"](_0x17a1fd);
},
};
if (
_0x5e6631[_0x39f7("7a", "TElH")](
_0x5e6631[_0x39f7("7b", "aWOY")],
_0x5e6631[_0x39f7("7c", "pOVg")]
)
) {
functionId = _0x10cdff[_0x39f7("7d", "X^&m")];
$["appId"] = _0x10cdff["QuuiQ"];
} else {
try {
if (
_0x5e6631[_0x39f7("7e", "6WFk")](
_0x5e6631[_0x39f7("7f", "ZQUW")],
_0x5e6631[_0x39f7("80", "ljW5")]
)
) {
_0x10cdff[_0x39f7("81", "IePq")](_0xbfc056);
} else {
const {
ret,
msg,
data: { result } = {},
} = $[_0x39f7("82", "o@q6")](_0x271b78, _0x271b78);
$[_0x39f7("83", "nCOP")] = result["tk"];
$[_0x39f7("84", "sBTj")] = new Function(
_0x39f7("85", "pQwC") + result["algo"]
)();
}
} catch (_0x276443) {
$["logErr"](_0x276443, _0x140ac1);
} finally {
_0x5e6631[_0x39f7("86", "][#3")](_0xbfc056);
}
}
});
});
}
function _0x3b4566() {
var _0xf9972 = {
HnZWz: function (_0x3266b2, _0x37d757) {
return _0x3266b2 === _0x37d757;
},
KyjVF: function (_0x7a93c2, _0x54eee5) {
return _0x7a93c2 < _0x54eee5;
},
JsetN: function (_0x2c696b, _0x58d208) {
return _0x2c696b !== _0x58d208;
},
WrbSI: _0x39f7("87", "X^&m"),
yKSfX: function (_0x2bbb9c, _0x357351) {
return _0x2bbb9c == _0x357351;
},
WvgkV: _0x39f7("88", "2^Ea"),
wSFJZ: "alphabet",
cTYKd: _0x39f7("89", "1YUF"),
pruTp: _0x39f7("8a", "Hu7$"),
nbWnQ: _0x39f7("8b", "aWOY"),
docKq: _0x39f7("8c", "47j2"),
dnPQs: _0x39f7("8d", "(EWH"),
IHOLn: function (_0x46362c, _0x391bd3) {
return _0x46362c | _0x391bd3;
},
ZijsR: function (_0x231ed0, _0x486e05) {
return _0x231ed0 * _0x486e05;
},
nrIUy: function (_0x3f71dc, _0x2a87a0) {
return _0x3f71dc > _0x2a87a0;
},
};
var _0x268e41,
_0x3c60dd,
_0x141099 = _0xf9972["HnZWz"](
void 0x0,
(_0x29b3d0 = (_0x3c60dd =
_0xf9972[_0x39f7("8e", "b#)w")](0x0, arguments["length"]) &&
_0xf9972[_0x39f7("8f", "(kzS")](void 0x0, arguments[0x0])
? arguments[0x0]
: {})[_0x39f7("90", "jZsm")])
)
? 0xa
: _0x29b3d0,
_0x29b3d0 = _0xf9972[_0x39f7("91", "*5b6")](
void 0x0,
(_0x29b3d0 = _0x3c60dd[_0x39f7("92", "pZB[")])
)
? _0xf9972["WrbSI"]
: _0x29b3d0,
_0x381b57 = "";
if (
(_0x3c60dd = _0x3c60dd[_0x39f7("93", "(EWH")]) &&
_0xf9972[_0x39f7("94", "2^Ea")](_0xf9972["WvgkV"], typeof _0x3c60dd)
)
_0x268e41 = _0x3c60dd;
else
switch (_0x29b3d0) {
case _0xf9972[_0x39f7("95", "&&94")]:
_0x268e41 = _0xf9972[_0x39f7("96", "h3[a")];
break;
case _0xf9972[_0x39f7("97", "6WFk")]:
_0x268e41 = _0xf9972[_0x39f7("98", "e7hp")];
break;
case _0xf9972[_0x39f7("99", "OJOr")]:
default:
_0x268e41 = _0xf9972["docKq"];
}
if (
_0xf9972[_0x39f7("9a", "pZB[")](
$[_0x39f7("9b", "ljW5")]["indexOf"](_0xf9972["dnPQs"]),
-0x1
)
)
return "1";
for (; _0x141099--; )
_0x381b57 +=
_0x268e41[
_0xf9972[_0x39f7("9c", "YBh@")](
_0xf9972[_0x39f7("9d", "n9rU")](
Math[_0x39f7("9e", "Y&%a")](),
_0x268e41[_0x39f7("9f", "n9rU")]
),
0x0
)
];
if (_0xf9972["nrIUy"](new Date()["getTime"](), 0x18079110440)) {
return "1";
}
return _0x381b57;
}
_0xodL = "jsjiami.com.v6";
function CryptoScripts() {
// prettier-ignore
!function(t,e){"object"==typeof exports?module.exports=exports=e():"function"==typeof define&&define.amd?define([],e):t.CryptoJS=e()}(this,function(){var t,e,r,i,n,o,s,c,a,h,l,f,d,u,p,_,v,y,g,B,w,k,S,m,x,b,H,z,A,C,D,E,R,M,F,P,W,O,I,U,K,X,L,j,N,T,q,Z,V,G,J,$,Q,Y,tt,et,rt,it,nt,ot,st,ct,at,ht,lt,ft,dt,ut,pt,_t,vt,yt,gt,Bt,wt,kt,St,mt=mt||function(t){var e;if("undefined"!=typeof window&&window.crypto&&(e=window.crypto),!e&&"undefined"!=typeof window&&window.msCrypto&&(e=window.msCrypto),!e&&"undefined"!=typeof global&&global.crypto&&(e=global.crypto),!e&&"function"==typeof require)try{e=require("crypto")}catch(e){}function r(){if(e){if("function"==typeof e.getRandomValues)try{return e.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof e.randomBytes)try{return e.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")}var i=Object.create||function(t){var e;return n.prototype=t,e=new n,n.prototype=null,e};function n(){}var o={},s=o.lib={},c=s.Base={extend:function(t){var e=i(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),(e.init.prototype=e).$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=s.WordArray=c.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||l).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes,n=t.sigBytes;if(this.clamp(),i%4)for(var o=0;o<n;o++){var s=r[o>>>2]>>>24-o%4*8&255;e[i+o>>>2]|=s<<24-(i+o)%4*8}else for(o=0;o<n;o+=4)e[i+o>>>2]=r[o>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=c.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i<t;i+=4)e.push(r());return new a.init(e,t)}}),h=o.enc={},l=h.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var o=e[n>>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i+=2)r[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new a.init(r,e/2)}},f=h.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n<r;n++){var o=e[n>>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i<e;i++)r[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new a.init(r,e)}},d=h.Utf8={stringify:function(t){try{return decodeURIComponent(escape(f.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return f.parse(unescape(encodeURIComponent(t)))}},u=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=d.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,i=this._data,n=i.words,o=i.sigBytes,s=this.blockSize,c=o/(4*s),h=(c=e?t.ceil(c):t.max((0|c)-this._minBufferSize,0))*s,l=t.min(4*h,o);if(h){for(var f=0;f<h;f+=s)this._doProcessBlock(n,f);r=n.splice(0,h),i.sigBytes-=l}return new a.init(r,l)},clone:function(){var t=c.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),p=(s.Hasher=u.extend({cfg:c.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){u.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new p.HMAC.init(t,r).finalize(e)}}}),o.algo={});return o}(Math);function xt(t,e,r){return t^e^r}fu
}
// 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"])