This commit is contained in:
smallfawn
2025-01-25 16:33:53 +08:00
parent 8cbf0a2ca9
commit 745de23884
13 changed files with 5638 additions and 3124 deletions

715
wxapp/bawangchaji.js Normal file
View File

@@ -0,0 +1,715 @@
/*
霸王茶姬 v1.0.3
微信小程序-霸王茶姬
积分可以换券
授权注册后, 捉 webapi.qmai.cn 域名请求头里面的 Qm-User-Token, 填到变量 bwcjCookie 里面
多账号换行或@或&隔开
export bwcjCookie="G3YT33xad2xxxxxxxxxxxxxxxxxx"
cron: 46 8,20 * * *
const $ = new Env("霸王茶姬");
*/
//Sat Jan 25 2025 08:29:02 GMT+0000 (Coordinated Universal Time)
//Base:https://github.com/echo094/decode-js
//Modify:https://github.com/smallfawn/decode_action
const _0x22822c = _0x2fbb6b("霸王茶姬"),
_0x30bd4a = require("got"),
_0x411cd3 = "bwcj",
_0x4e95c6 = /[\n\&\@]/,
_0x25b427 = [_0x411cd3 + "Cookie"],
_0x182083 = 20000,
_0xe9ef74 = 3,
_0x34947f = 1.02,
_0x5edf7d = "bwcj",
_0x3a487f = "https://leafxcy.coding.net/api/user/leafxcy/project/validcode/shared-depot/validCode/git/blob/master/code.json",
_0x51003c = "https://leafxcy.coding.net/api/user/leafxcy/project/validcode/shared-depot/validCode/git/blob/master/" + _0x5edf7d + ".json",
_0x36a3ce = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.40(0x18002831) NetType/WIFI Language/zh_CN",
_0x1adc03 = "https://servicewechat.com/wxafec6f8422cb357b/87/page-frame.html",
_0x50be96 = "wxafec6f8422cb357b",
_0x1f020e = 5;
class _0x4c79d9 {
constructor() {
this.index = _0x22822c.userIdx++;
this.name = "";
this.valid = false;
const _0x16f1db = {
"limit": 0
},
_0x41e123 = {
"Connection": "keep-alive"
},
_0x24ef82 = {
"retry": _0x16f1db,
"timeout": _0x182083,
"followRedirect": false,
"headers": _0x41e123
};
this.got = _0x30bd4a.extend(_0x24ef82);
}
["log"](_0x131350, _0x4fad5a = {}) {
var _0x196077 = "",
_0x45fd52 = _0x22822c.userCount.toString().length;
this.index && (_0x196077 += "账号[" + _0x22822c.padStr(this.index, _0x45fd52) + "]");
this.name && (_0x196077 += "[" + this.name + "]");
_0x22822c.log(_0x196077 + _0x131350, _0x4fad5a);
}
async ["request"](_0x2c476b) {
const _0x15a3b6 = ["ECONNRESET", "EADDRINUSE", "ENOTFOUND", "EAI_AGAIN"],
_0x57c026 = ["TimeoutError"];
var _0x2d2118 = null,
_0x43077e = 0,
_0x1692ef = _0x2c476b.fn || _0x2c476b.url;
_0x2c476b.method = _0x2c476b?.["method"]?.["toUpperCase"]() || "GET";
let _0x15759f;
while (_0x43077e < _0xe9ef74) {
try {
_0x43077e++;
_0x15759f = null;
let _0x5a4ec4 = null,
_0x1952e1 = _0x2c476b?.["timeout"] || this.got?.["defaults"]?.["options"]?.["timeout"]?.["request"] || _0x182083,
_0x59ef9f = false;
await new Promise(async _0x421556 => {
setTimeout(() => {
_0x59ef9f = true;
_0x421556();
}, _0x1952e1);
await this.got(_0x2c476b).then(_0x1d84cb => {
_0x2d2118 = _0x1d84cb;
}, _0x12ec6e => {
_0x5a4ec4 = _0x12ec6e;
_0x2d2118 = _0x12ec6e.response;
_0x15759f = _0x5a4ec4?.["code"];
});
_0x421556();
});
if (_0x59ef9f) {
this.log("[" + _0x1692ef + "]请求超时(" + _0x1952e1 / 1000 + "秒),重试第" + _0x43077e + "次");
} else {
{
if (_0x57c026.includes(_0x5a4ec4?.["name"])) this.log("[" + _0x1692ef + "]请求超时(" + _0x5a4ec4.code + "),重试第" + _0x43077e + "次");else {
if (_0x15a3b6.includes(_0x5a4ec4?.["code"])) {
this.log("[" + _0x1692ef + "]请求错误(" + _0x5a4ec4.code + "),重试第" + _0x43077e + "次");
} else {
let _0x499f44 = _0x2d2118?.["statusCode"] || 999,
_0x487bac = _0x499f44 / 100 | 0;
_0x487bac > 3 && this.log("请求[" + _0x1692ef + "]返回[" + _0x499f44 + "]");
if (_0x487bac <= 4) {
break;
}
}
}
}
}
} catch (_0x553de8) {
_0x553de8.name == "TimeoutError" ? this.log("[" + _0x1692ef + "]请求超时,重试第" + _0x43077e + "次") : this.log("[" + _0x1692ef + "]请求错误(" + _0x553de8.message + "),重试第" + _0x43077e + "次");
}
}
if (_0x2d2118 == null) return Promise.resolve({
"statusCode": _0x15759f || -1,
"headers": null,
"result": null
});
let {
statusCode: _0x15e772,
headers: _0x2501a2,
body: _0x204398
} = _0x2d2118;
if (_0x204398) try {
_0x204398 = JSON.parse(_0x204398);
} catch {}
const _0x21a81f = {
"statusCode": _0x15e772,
"headers": _0x2501a2,
"result": _0x204398
};
return Promise.resolve(_0x21a81f);
}
}
let _0x133ad6 = new _0x4c79d9();
class _0x5026b8 extends _0x4c79d9 {
constructor(_0x23d65b) {
super();
this.token = _0x23d65b;
this.got = this.got.extend({
"cookieJar": this.cookieJar,
"headers": {
"User-Agent": _0x36a3ce,
"work-wechat-userid": "",
"multi-store-id": "",
"gdt-vid": "",
"qz-gtd": "",
"scene": "1006",
"Qm-From": "wechat",
"store-id": 49006,
"Qm-User-Token": this.token,
"channelCode": "",
"Qm-From-Type": "catering",
"promotion-code": "",
"work-staff-name": "",
"work-staff-id": "",
"Accept": "v=1.0",
"Accept-Encoding": "gzip,compress,br,deflate",
"Referer": _0x1adc03
}
});
}
async ["personal_info"](_0x598608 = {}) {
let _0x24397b = false;
try {
const _0x496d1a = {
"appid": _0x50be96
},
_0x18d4d1 = {
"fn": "personal_info",
"method": "get",
"url": "https://webapi.qmai.cn/web/catering/crm/personal-info",
"searchParams": _0x496d1a
};
let {
result: _0x19b336,
statusCode: _0xdca021
} = await this.request(_0x18d4d1),
_0x1de7e8 = _0x22822c.get(_0x19b336, "code", _0xdca021);
if (_0x1de7e8 == 0) {
{
_0x24397b = this.valid = true;
let {
mobilePhone: _0x419254,
name: _0x5ab967
} = _0x19b336?.["data"];
this.name = _0x419254;
this.userName = _0x5ab967;
}
} else {
let _0x1a9fa8 = _0x22822c.get(_0x19b336, "message", "");
this.log("登录失败: " + _0x1a9fa8);
}
} catch (_0x5cc7a1) {
console.log(_0x5cc7a1);
} finally {
return _0x24397b;
}
}
async ["sign_detail"](_0x12d61d = {}) {
try {
{
const _0x4f8226 = {
"appid": _0x50be96
},
_0x5bc0c4 = {
"fn": "sign_detail",
"method": "post",
"url": "https://webapi.qmai.cn/web/catering/integral/sign/detail",
"json": _0x4f8226
};
let {
result: _0xdbe43a,
statusCode: _0x8c7f96
} = await this.request(_0x5bc0c4),
_0x57fa7a = _0x22822c.get(_0xdbe43a, "code", _0x8c7f96);
if (_0x57fa7a == 0) {
{
let {
continuityTotal: _0x2f384b,
signInDateList: _0x5e7d20,
activityId: _0x403c0d
} = _0xdbe43a?.["data"],
_0x5928f0 = false,
_0x20dde1 = _0x22822c.time("yyyy-MM-dd");
_0x5e7d20?.["includes"](_0x20dde1) && (_0x5928f0 = true);
this.log("旧版签到今天" + (_0x5928f0 ? "已" : "未") + "签到, 已连续签到" + _0x2f384b + "天");
!_0x5928f0 && (await this.signIn(_0x403c0d));
}
} else {
let _0x4f3aad = _0x22822c.get(_0xdbe43a, "message", "");
this.log("查询旧版签到失败[" + _0x57fa7a + "]: " + _0x4f3aad);
}
}
} catch (_0xfd690) {
console.log(_0xfd690);
}
}
async ["signIn"](_0xc779dc, _0x4c2bd6 = {}) {
try {
const _0x36f663 = {
"activityId": _0xc779dc,
"mobilePhone": this.name,
"userName": this.userName,
"appid": _0x50be96
},
_0x4568f1 = {
"fn": "signIn",
"method": "post",
"url": "https://webapi.qmai.cn/web/catering/integral/sign/signIn",
"json": _0x36f663
};
let {
result: _0x3d114b,
statusCode: _0x48d383
} = await this.request(_0x4568f1),
_0x568177 = _0x22822c.get(_0x3d114b, "code", _0x48d383);
if (_0x568177 == 0) {
{
const _0x16c8af = {
"notify": true
};
this.log("旧版签到成功", _0x16c8af);
}
} else {
let _0x27ff9f = _0x22822c.get(_0x3d114b, "message", "");
this.log("旧版签到失败[" + _0x568177 + "]: " + _0x27ff9f);
}
} catch (_0x2ac68e) {
console.log(_0x2ac68e);
}
}
async ["userSignStatistics"](_0x4bab26 = {}) {
try {
const _0x3e6e34 = {
"activityId": "947079313798000641",
"appid": _0x50be96
},
_0x13122a = {
"fn": "userSignStatistics",
"method": "post",
"url": "https://webapi.qmai.cn/web/cmk-center/sign/userSignStatistics",
"json": _0x3e6e34
};
let {
result: _0x594c54,
statusCode: _0x27479a
} = await this.request(_0x13122a),
_0x20ca00 = _0x22822c.get(_0x594c54, "code", _0x27479a);
if (_0x20ca00 == 0) {
{
let {
signDays: _0x585f14,
signStatus: _0x22aedb
} = _0x594c54?.["data"],
_0x4fd81b = _0x22aedb == 1;
this.log("新版签到今天" + (_0x4fd81b ? "已" : "未") + "签到, 已连续签到" + _0x585f14 + "天");
!_0x4fd81b && (await this.takePartInSign());
}
} else {
let _0x310cbd = _0x22822c.get(_0x594c54, "message", "");
this.log("查询新版签到失败[" + _0x20ca00 + "]: " + _0x310cbd);
}
} catch (_0x20b0e4) {
console.log(_0x20b0e4);
}
}
async ["takePartInSign"](_0x48efd6 = {}) {
try {
const _0x44b325 = {
"activityId": "947079313798000641",
"appid": _0x50be96
},
_0x2733ab = {
"fn": "takePartInSign",
"method": "post",
"url": "https://webapi.qmai.cn/web/cmk-center/sign/takePartInSign",
"json": _0x44b325
};
let {
result: _0x285c82,
statusCode: _0x148e52
} = await this.request(_0x2733ab),
_0x4f6bec = _0x22822c.get(_0x285c82, "code", _0x148e52);
if (_0x4f6bec == 0) {
{
const _0x3a28c6 = {
"notify": true
};
this.log("新版签到成功", _0x3a28c6);
}
} else {
let _0x439e4a = _0x22822c.get(_0x285c82, "message", "");
this.log("新版签到失败[" + _0x4f6bec + "]: " + _0x439e4a);
}
} catch (_0x57f683) {
console.log(_0x57f683);
}
}
async ["points_info"](_0x11c245 = {}) {
try {
const _0x4418a9 = {
"appid": _0x50be96
},
_0x4a3968 = {
"fn": "points_info",
"method": "post",
"url": "https://webapi.qmai.cn/web/catering/crm/points-info",
"json": _0x4418a9
};
let {
result: _0x333894,
statusCode: _0x41c61b
} = await this.request(_0x4a3968),
_0x4ac555 = _0x22822c.get(_0x333894, "code", _0x41c61b);
if (_0x4ac555 == 0) {
let {
soonExpiredPoints: _0x1ee018,
totalPoints: _0x5d3ffb,
expiredTime: _0x271e92
} = _0x333894?.["data"];
const _0x36151a = {
"notify": true
};
this.log("积分: " + _0x5d3ffb, _0x36151a);
if (_0x1ee018) {
const _0x1b318e = {
"notify": true
};
this.log("有" + _0x1ee018 + "积分将于[" + _0x271e92 + "]过期", _0x1b318e);
}
} else {
{
let _0x4f796a = _0x22822c.get(_0x333894, "message", "");
this.log("查询积分失败[" + _0x4ac555 + "]: " + _0x4f796a);
}
}
} catch (_0x333089) {
console.log(_0x333089);
}
}
async ["userTask"](_0x585f25 = {}) {
if (!(await this.personal_info())) {
return;
}
await this.sign_detail();
await this.userSignStatistics();
await this.points_info();
}
}
!(async () => {
_0x22822c.read_env(_0x5026b8);
for (let _0x481d4c of _0x22822c.userList) {
await _0x481d4c.userTask();
}
})().catch(_0x40193d => _0x22822c.log(_0x40193d)).finally(() => _0x22822c.exitNow());
async function _0x1300b9(_0x13b3c8 = 0) {
let _0x24ed10 = false;
try {
const _0x5742b3 = {
"fn": "auth",
"method": "get",
"url": _0x3a487f,
"timeout": 20000
};
let {
statusCode: _0xca4918,
result: _0x23869e
} = await _0x133ad6.request(_0x5742b3);
if (_0xca4918 != 200) {
_0x13b3c8++ < _0x1f020e && (_0x24ed10 = await _0x1300b9(_0x13b3c8));
return _0x24ed10;
}
if (_0x23869e?.["code"] == 0) {
_0x23869e = JSON.parse(_0x23869e.data.file.data);
if (_0x23869e?.["commonNotify"] && _0x23869e.commonNotify.length > 0) {
const _0x556cf9 = {
"notify": true
};
_0x22822c.log(_0x23869e.commonNotify.join("\n") + "\n", _0x556cf9);
}
_0x23869e?.["commonMsg"] && _0x23869e.commonMsg.length > 0 && _0x22822c.log(_0x23869e.commonMsg.join("\n") + "\n");
if (_0x23869e[_0x5edf7d]) {
{
let _0xf08380 = _0x23869e[_0x5edf7d];
_0xf08380.status == 0 ? _0x34947f >= _0xf08380.version ? (_0x24ed10 = true, _0x22822c.log(_0xf08380.msg[_0xf08380.status]), _0x22822c.log(_0xf08380.updateMsg), _0x22822c.log("现在运行的脚本版本是:" + _0x34947f + ",最新脚本版本:" + _0xf08380.latestVersion)) : _0x22822c.log(_0xf08380.versionMsg) : _0x22822c.log(_0xf08380.msg[_0xf08380.status]);
}
} else {
_0x22822c.log(_0x23869e.errorMsg);
}
} else _0x13b3c8++ < _0x1f020e && (_0x24ed10 = await _0x1300b9(_0x13b3c8));
} catch (_0xcd516c) {
_0x22822c.log(_0xcd516c);
} finally {
return _0x24ed10;
}
}
async function _0x449e65() {
let _0x2a3f7c = false;
try {
const _0x289fd7 = {
"fn": "auth",
"method": "get",
"url": _0x51003c
};
let {
statusCode: _0x5b19e8,
result: _0x5420a0
} = await _0x133ad6.request(_0x289fd7);
if (_0x5b19e8 != 200) {
return Promise.resolve();
}
if (_0x5420a0?.["code"] == 0) {
_0x5420a0 = JSON.parse(_0x5420a0.data.file.data);
ownerId = _0x5420a0?.["ownerId"] || ownerId;
share_app = _0x5420a0?.["share_app"] || share_app;
for (let _0x2a6212 of _0x5420a0.chdTask.simple) {
!task_chd_simple_list.filter(_0x2d0f4f => _0x2d0f4f.missionDefId == _0x2a6212.missionDefId && _0x2d0f4f.missionCollectionId == _0x2a6212.missionCollectionId).length && task_chd_simple_list.push(_0x2a6212);
}
for (let _0x323d3b of _0x5420a0.chdTask.pageview) {
!task_chd_pageview_list.filter(_0x5f5151 => _0x5f5151.missionDefId == _0x323d3b.missionDefId && _0x5f5151.missionCollectionId == _0x323d3b.missionCollectionId).length && task_chd_pageview_list.push(_0x323d3b);
}
for (let _0x55488a of _0x5420a0.tkjTask.simple) {
!task_tkj_simple_list.filter(_0x5c1c82 => _0x5c1c82.missionDefId == _0x55488a.missionDefId && _0x5c1c82.missionCollectionId == _0x55488a.missionCollectionId).length && task_tkj_simple_list.push(_0x55488a);
}
for (let _0x3a0b02 of _0x5420a0.tkjTask.pageview) {
!task_tkj_pageview_list.filter(_0x676cd6 => _0x676cd6.missionDefId == _0x3a0b02.missionDefId && _0x676cd6.missionCollectionId == _0x3a0b02.missionCollectionId).length && task_tkj_pageview_list.push(_0x3a0b02);
}
}
} catch (_0x2f90c3) {
_0x22822c.log(_0x2f90c3);
} finally {
return Promise.resolve(_0x2a3f7c);
}
}
function _0x2fbb6b(_0x5a60f2) {
return new class {
constructor(_0x550e45) {
this.name = _0x550e45;
this.startTime = Date.now();
const _0x5da069 = {
"time": true
};
this.log("[" + this.name + "]开始运行\n", _0x5da069);
this.notifyStr = [];
this.notifyFlag = true;
this.userIdx = 0;
this.userList = [];
this.userCount = 0;
this.default_timestamp_len = 13;
this.default_wait_interval = 1000;
this.default_wait_limit = 3600000;
this.default_wait_ahead = 0;
}
["log"](_0x5dd587, _0x28ad17 = {}) {
const _0xa88ce4 = {
"console": true
};
Object.assign(_0xa88ce4, _0x28ad17);
if (_0xa88ce4.time) {
let _0x4b5660 = _0xa88ce4.fmt || "hh:mm:ss";
_0x5dd587 = "[" + this.time(_0x4b5660) + "]" + _0x5dd587;
}
_0xa88ce4.notify && this.notifyStr.push(_0x5dd587);
_0xa88ce4.console && console.log(_0x5dd587);
}
["get"](_0xde4086, _0x22838d, _0x2abb13 = "") {
{
let _0x40cf9a = _0x2abb13;
_0xde4086?.["hasOwnProperty"](_0x22838d) && (_0x40cf9a = _0xde4086[_0x22838d]);
return _0x40cf9a;
}
}
["pop"](_0x4b85cf, _0x3962d5, _0x1069d0 = "") {
let _0x28a076 = _0x1069d0;
_0x4b85cf?.["hasOwnProperty"](_0x3962d5) && (_0x28a076 = _0x4b85cf[_0x3962d5], delete _0x4b85cf[_0x3962d5]);
return _0x28a076;
}
["copy"](_0x396bf8) {
return Object.assign({}, _0x396bf8);
}
["read_env"](_0x2e93f3) {
{
let _0x381a6b = _0x25b427.map(_0x47ab17 => process.env[_0x47ab17]);
for (let _0x43c049 of _0x381a6b.filter(_0x1285c3 => !!_0x1285c3)) {
for (let _0x46a19a of _0x43c049.split(_0x4e95c6).filter(_0x1a9a0b => !!_0x1a9a0b)) {
if (this.userList.includes(_0x46a19a)) continue;
this.userList.push(new _0x2e93f3(_0x46a19a));
}
}
this.userCount = this.userList.length;
if (!this.userCount) {
const _0x3608c4 = {
"notify": true
};
this.log("未找到变量,请检查变量" + _0x25b427.map(_0x357aa2 => "[" + _0x357aa2 + "]").join("或"), _0x3608c4);
return false;
}
this.log("共找到" + this.userCount + "个账号");
return true;
}
}
["time"](_0x3f533b, _0x4227ff = null) {
{
let _0x2c9a96 = _0x4227ff ? new Date(_0x4227ff) : new Date(),
_0x2f82c8 = {
"M+": _0x2c9a96.getMonth() + 1,
"d+": _0x2c9a96.getDate(),
"h+": _0x2c9a96.getHours(),
"m+": _0x2c9a96.getMinutes(),
"s+": _0x2c9a96.getSeconds(),
"q+": Math.floor((_0x2c9a96.getMonth() + 3) / 3),
"S": this.padStr(_0x2c9a96.getMilliseconds(), 3)
};
/(y+)/.test(_0x3f533b) && (_0x3f533b = _0x3f533b.replace(RegExp.$1, (_0x2c9a96.getFullYear() + "").substr(4 - RegExp.$1.length)));
for (let _0x58d9a1 in _0x2f82c8) new RegExp("(" + _0x58d9a1 + ")").test(_0x3f533b) && (_0x3f533b = _0x3f533b.replace(RegExp.$1, 1 == RegExp.$1.length ? _0x2f82c8[_0x58d9a1] : ("00" + _0x2f82c8[_0x58d9a1]).substr(("" + _0x2f82c8[_0x58d9a1]).length)));
return _0x3f533b;
}
}
async ["showmsg"]() {
{
if (!this.notifyFlag) return;
if (!this.notifyStr.length) return;
var _0x29aa8f = require("./sendNotify");
this.log("\n============== 推送 ==============");
await _0x29aa8f.sendNotify(this.name, this.notifyStr.join("\n"));
}
}
["padStr"](_0x3e358a, _0x3981da, _0x180e22 = {}) {
let _0x498d14 = _0x180e22.padding || "0",
_0x5623a2 = _0x180e22.mode || "l",
_0x6ddb3f = String(_0x3e358a),
_0xc35a53 = _0x3981da > _0x6ddb3f.length ? _0x3981da - _0x6ddb3f.length : 0,
_0x240fce = "";
for (let _0x4d8451 = 0; _0x4d8451 < _0xc35a53; _0x4d8451++) {
_0x240fce += _0x498d14;
}
_0x5623a2 == "r" ? _0x6ddb3f = _0x6ddb3f + _0x240fce : _0x6ddb3f = _0x240fce + _0x6ddb3f;
return _0x6ddb3f;
}
["json2str"](_0x69c92d, _0x3f4b18, _0x5a0d0f = false) {
let _0x4db271 = [];
for (let _0x1dda5e of Object.keys(_0x69c92d).sort()) {
{
let _0x428726 = _0x69c92d[_0x1dda5e];
_0x428726 && _0x5a0d0f && (_0x428726 = encodeURIComponent(_0x428726));
_0x4db271.push(_0x1dda5e + "=" + _0x428726);
}
}
return _0x4db271.join(_0x3f4b18);
}
["str2json"](_0x4ef120, _0x5116b7 = false) {
let _0x3ff4b1 = {};
for (let _0x2c2c0d of _0x4ef120.split("&")) {
if (!_0x2c2c0d) continue;
let _0x3f58d7 = _0x2c2c0d.indexOf("=");
if (_0x3f58d7 == -1) {
continue;
}
let _0x5c0461 = _0x2c2c0d.substr(0, _0x3f58d7),
_0x324223 = _0x2c2c0d.substr(_0x3f58d7 + 1);
_0x5116b7 && (_0x324223 = decodeURIComponent(_0x324223));
_0x3ff4b1[_0x5c0461] = _0x324223;
}
return _0x3ff4b1;
}
["randomPattern"](_0x16140f, _0x213ac1 = "abcdef0123456789") {
let _0x16b674 = "";
for (let _0xc4493c of _0x16140f) {
{
if (_0xc4493c == "x") _0x16b674 += _0x213ac1.charAt(Math.floor(Math.random() * _0x213ac1.length));else {
_0xc4493c == "X" ? _0x16b674 += _0x213ac1.charAt(Math.floor(Math.random() * _0x213ac1.length)).toUpperCase() : _0x16b674 += _0xc4493c;
}
}
}
return _0x16b674;
}
["randomUuid"]() {
return this.randomPattern("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
}
["randomString"](_0x3b342b, _0xb68c8b = "abcdef0123456789") {
let _0x5555ab = "";
for (let _0xcaef55 = 0; _0xcaef55 < _0x3b342b; _0xcaef55++) {
_0x5555ab += _0xb68c8b.charAt(Math.floor(Math.random() * _0xb68c8b.length));
}
return _0x5555ab;
}
["randomList"](_0x470a5f) {
let _0x411d03 = Math.floor(Math.random() * _0x470a5f.length);
return _0x470a5f[_0x411d03];
}
["wait"](_0x5c7c0c) {
return new Promise(_0x3351a0 => setTimeout(_0x3351a0, _0x5c7c0c));
}
async ["exitNow"]() {
await this.showmsg();
let _0x18decd = Date.now(),
_0x430aef = (_0x18decd - this.startTime) / 1000;
this.log("");
const _0xd410dc = {
"time": true
};
this.log("[" + this.name + "]运行结束,共运行了" + _0x430aef + "秒", _0xd410dc);
console.log("=>=>=>=>____来自 By 幼稚园小妹妹 (顶级插件售后服务951584089)丨Autman订阅源:Lxg-021002丨期待为您服务<=<=<=<=");
console.log("=>=>=>=>____来自 By 幼稚园小妹妹 (顶级插件售后服务951584089)丨Autman订阅源:Lxg-021002丨期待为您服务<=<=<=<=");
console.log("=>=>=>=>____来自 By 幼稚园小妹妹 (顶级插件售后服务951584089)丨Autman订阅源:Lxg-021002丨期待为您服务<=<=<=<=");
console.log("=>=>=>=>____来自 By 幼稚园小妹妹 (顶级插件售后服务951584089)丨Autman订阅源:Lxg-021002丨期待为您服务<=<=<=<=");
console.log("=>=>=>=>____来自 By 幼稚园小妹妹 (顶级插件售后服务951584089)丨Autman订阅源:Lxg-021002丨期待为您服务<=<=<=<=");
console.log("=>=>=>=>____来自 By 幼稚园小妹妹 (顶级插件售后服务951584089)丨Autman订阅源:Lxg-021002丨期待为您服务<=<=<=<=");
console.log("=>=>=>=>____来自 By 幼稚园小妹妹 (顶级插件售后服务951584089)丨Autman订阅源:Lxg-021002丨期待为您服务<=<=<=<=");
console.log("=>=>=>=>____来自 By 幼稚园小妹妹 (顶级插件售后服务951584089)丨Autman订阅源:Lxg-021002丨期待为您服务<=<=<=<=");
console.log("=>=>=>=>____来自 By 幼稚园小妹妹 (顶级插件售后服务951584089)丨Autman订阅源:Lxg-021002丨期待为您服务<=<=<=<=");
console.log("=>=>=>=>____来自 By 幼稚园小妹妹 (顶级插件售后服务951584089)丨Autman订阅源:Lxg-021002丨期待为您服务<=<=<=<=");
process.exit(0);
}
["normalize_time"](_0x22f45c, _0x55a4f8 = {}) {
{
let _0x264a22 = _0x55a4f8.len || this.default_timestamp_len;
_0x22f45c = _0x22f45c.toString();
let _0x552842 = _0x22f45c.length;
while (_0x552842 < _0x264a22) {
_0x22f45c += "0";
}
_0x552842 > _0x264a22 && (_0x22f45c = _0x22f45c.slice(0, 13));
return parseInt(_0x22f45c);
}
}
async ["wait_until"](_0xe30940, _0x5833a2 = {}) {
let _0x417d24 = _0x5833a2.logger || this,
_0x4d19f9 = _0x5833a2.interval || this.default_wait_interval,
_0x126ddf = _0x5833a2.limit || this.default_wait_limit,
_0x852c0e = _0x5833a2.ahead || this.default_wait_ahead;
if (typeof _0xe30940 == "string" && _0xe30940.includes(":")) {
{
if (_0xe30940.includes("-")) _0xe30940 = new Date(_0xe30940).getTime();else {
let _0x4bd7fc = this.time("yyyy-MM-dd ");
_0xe30940 = new Date(_0x4bd7fc + _0xe30940).getTime();
}
}
}
let _0x5de99b = this.normalize_time(_0xe30940) - _0x852c0e,
_0x2a58dd = this.time("hh:mm:ss.S", _0x5de99b),
_0x3d2ee4 = Date.now();
_0x3d2ee4 > _0x5de99b && (_0x5de99b += 86400000);
let _0x5f0c85 = _0x5de99b - _0x3d2ee4;
if (_0x5f0c85 > _0x126ddf) {
const _0x48e0d9 = {
"time": true
};
_0x417d24.log("离目标时间[" + _0x2a58dd + "]大于" + _0x126ddf / 1000 + "秒,不等待", _0x48e0d9);
} else {
{
const _0x2536f0 = {
"time": true
};
_0x417d24.log("离目标时间[" + _0x2a58dd + "]还有" + _0x5f0c85 / 1000 + "秒,开始等待", _0x2536f0);
while (_0x5f0c85 > 0) {
{
let _0x138b1c = Math.min(_0x5f0c85, _0x4d19f9);
await this.wait(_0x138b1c);
_0x3d2ee4 = Date.now();
_0x5f0c85 = _0x5de99b - _0x3d2ee4;
}
}
const _0x6e1051 = {
"time": true
};
_0x417d24.log("已完成等待", _0x6e1051);
}
}
}
async ["wait_gap_interval"](_0x5f35a4, _0x3c7f4a) {
{
let _0x52cef1 = Date.now() - _0x5f35a4;
_0x52cef1 < _0x3c7f4a && (await this.wait(_0x3c7f4a - _0x52cef1));
}
}
}(_0x5a60f2);
}

481
wxapp/植白说.js Normal file
View File

@@ -0,0 +1,481 @@
/**
* 植白说v1.0
* const $ = new Env("植白说");
* cron 10 6,15 * * * 植白说.js
*
* ========= 青龙--配置文件 ===========
* # 项目名称
* export zbsxcx='X-Dts-Token'
* 抓包请求 https://zbs.20171026.com/demo/取出X-Dts-Token
* 多账号换行、@ 或 & 隔开
* 说明根据群友Maric提示恢复脚本貌似是随着时间token有效期会越来越长
* 奖励:签到/分享 牛奶活动
* 注册入口:#小程序://植白说/cIiT4iMItmJ1EZi
* ====================================
*
*/
//Sat Jan 25 2025 08:30:22 GMT+0000 (Coordinated Universal Time)
//Base:https://github.com/echo094/decode-js
//Modify:https://github.com/smallfawn/decode_action
const _0x3065e9 = new _0x14a79b("植白说");
let _0x594a0a = "zbsxcx",
_0x1ad327 = ["\n", "&", "@"],
_0x5d9ea2 = (_0x3065e9.isNode() ? process.env[_0x594a0a] : _0x3065e9.getdata(_0x594a0a)) || "",
_0x23139a = [],
_0x5845aa = 0;
class _0x4f7def {
constructor(_0x44f7e1) {
this.index = ++_0x5845aa;
this.valid = false;
this.activedAuthToken = _0x44f7e1;
}
async ["taskApi"](_0x8df8fd, _0x52db04, _0x5ede90, _0x1961e6) {
let _0x11a1db = null;
try {
let _0x19ca83 = {
"url": _0x5ede90,
"headers": {
"X-DTS-Token": this.activedAuthToken,
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/8237",
"xweb_xhr": "1"
},
"timeout": 60000,
"rejectUnauthorized": false
};
if (_0x1961e6) {
_0x19ca83.body = _0x1961e6;
_0x19ca83.headers["Content-Length"] = _0x1961e6?.["length"];
}
await _0x2ef80e(_0x52db04, _0x19ca83).then(async _0xe0f650 => {
{
if (_0xe0f650.resp?.["statusCode"] == 200) {
if (_0xe0f650.resp?.["body"]) _0x11a1db = JSON.parse(_0xe0f650.resp.body);else {}
} else console.log("账号[" + this.index + "]调用" + _0x52db04 + "[" + _0x8df8fd + "]出错,返回状态码[" + (_0xe0f650.resp?.["statusCode"] || "") + "]", "返回结果:", _0xe0f650.resp?.["body"]);
}
});
} catch (_0x4fad44) {
console.log(_0x4fad44);
} finally {
return Promise.resolve(_0x11a1db);
}
}
async ["Sign"]() {
try {
{
let _0x4a533a = "Sign",
_0x420ae1 = "get",
_0x1fbcef = "https://zbs.20171026.com/demo/wx/home/signDay",
_0x1c108f = "";
return await this.taskApi(_0x4a533a, _0x420ae1, _0x1fbcef, _0x1c108f).then(async _0x136d6b => {
{
if (_0x136d6b?.["errno"] === 0) return console.log("账号[" + this.index + "] 签到成功,签到次数:" + _0x136d6b?.["data"]?.["signCount"] + ",积分余额: " + _0x136d6b?.["data"]?.["integral"]), this.valid = true, true;else _0x3065e9.logAndNotify("账号[" + this.index + "] - 积分签到失败:" + (_0x136d6b?.["errmsg"] || JSON.stringify(_0x136d6b))), this.valid = false;
}
});
}
} catch (_0x396548) {
console.log(_0x396548);
}
}
async ["Share"]() {
try {
let _0x33e5b6 = "Share",
_0x2bff16 = "get",
_0x3f4521 = "https://zbs.20171026.com/demo/wx/user/addIntegralByShare",
_0x4d3189 = "";
return await this.taskApi(_0x33e5b6, _0x2bff16, _0x3f4521, _0x4d3189).then(async _0x5d0bf3 => {
{
if (_0x5d0bf3?.["errno"] === 0) {
console.log("账号[" + this.index + "] 分享成功,增加 1 积分");
return true;
} else {
_0x3065e9.logAndNotify("账号[" + this.index + "] - 分享失败:" + (_0x5d0bf3?.["errmsg"] || JSON.stringify(_0x5d0bf3)));
}
}
});
} catch (_0x1f98fa) {
console.log(_0x1f98fa);
}
}
async ["doTask"]() {
try {
console.log("\n============= 账号[" + this.index + "] 开始执行 分享任务=============");
await _0x3065e9.wait(Math.random() * 200);
for (let _0x50253a = 0; _0x50253a < 3; _0x50253a++) {
await this.Share();
await _0x3065e9.wait(Math.random() * 1000);
}
} catch (_0x2b25f0) {
console.log(_0x2b25f0);
}
}
}
!(async () => {
if (typeof $request !== "undefined") await _0x1b91d9();else {
if (!(await _0x2f2542())) return;
console.log("\n================ 开始执行 ================");
for (let _0x19ed95 of _0x23139a) {
console.log("----------- 执行 第 [" + _0x19ed95.index + "] 个账号 -----------");
await _0x19ed95.Sign();
await _0x3065e9.wait(Math.random() * 200);
}
let _0x7fb3c1 = _0x23139a.filter(_0x2bd556 => _0x2bd556.valid);
if (_0x7fb3c1.length > 0) {
console.log("\n================ 任务队列构建完毕 ================");
for (let _0x249a61 of _0x7fb3c1) {
console.log("----------- 账号[" + _0x249a61.index + "] -----------");
await _0x249a61.doTask();
}
} else {
console.log("\n====幻生提示:无可用账号,请检查配置============ 任务结束 ================");
}
await _0x3065e9.showmsg();
}
})().catch(_0x3de5ae => console.log(_0x3de5ae)).finally(() => _0x3065e9.done());
async function _0x1b91d9() {}
async function _0x2f2542() {
if (_0x5d9ea2) {
{
let _0x506c52 = _0x1ad327[0];
for (let _0x16a0d0 of _0x1ad327) {
if (_0x5d9ea2.indexOf(_0x16a0d0) > -1) {
{
_0x506c52 = _0x16a0d0;
break;
}
}
}
for (let _0x2460f4 of _0x5d9ea2.split(_0x506c52)) {
{
if (_0x2460f4) _0x23139a.push(new _0x4f7def(_0x2460f4));
}
}
userCount = _0x23139a.length;
}
} else {
console.log("未找到 配置信息,请检查是否配置 变量:", _0x594a0a);
return;
}
console.log("共找到" + userCount + "个账号");
return true;
}
async function _0x2ef80e(_0x22e525, _0xf7da77) {
httpErr = null;
httpReq = null;
httpResp = null;
return new Promise(_0x1e7c15 => {
_0x3065e9.send(_0x22e525, _0xf7da77, async (_0x1a63ab, _0x304b42, _0x47c7a2) => {
httpErr = _0x1a63ab;
httpReq = _0x304b42;
httpResp = _0x47c7a2;
_0x1e7c15({
"err": _0x1a63ab,
"req": _0x304b42,
"resp": _0x47c7a2
});
});
});
}
function _0x14a79b(_0x4038d3, _0x4c648e) {
"undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
return new class {
constructor(_0xc41156, _0x297ded) {
this.name = _0xc41156;
this.notifyStr = "";
this.startTime = new Date().getTime();
Object.assign(this, _0x297ded);
console.log(this.name + " 开始运行:\n");
}
["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;
}
["getdata"](_0x1c89dc) {
let _0x5f3c83 = this.getval(_0x1c89dc);
if (/^@/.test(_0x1c89dc)) {
const [, _0x4b7142, _0x5ba969] = /^@(.*?)\.(.*?)$/.exec(_0x1c89dc),
_0x45f3e6 = _0x4b7142 ? this.getval(_0x4b7142) : "";
if (_0x45f3e6) try {
const _0x1de99b = JSON.parse(_0x45f3e6);
_0x5f3c83 = _0x1de99b ? this.lodash_get(_0x1de99b, _0x5ba969, "") : _0x5f3c83;
} catch (_0xb8b62e) {
_0x5f3c83 = "";
}
}
return _0x5f3c83;
}
["setdata"](_0x90cff, _0x59643e) {
{
let _0x28ca60 = false;
if (/^@/.test(_0x59643e)) {
const [, _0x38c422, _0x26c375] = /^@(.*?)\.(.*?)$/.exec(_0x59643e),
_0x14a0cc = this.getval(_0x38c422),
_0x10f203 = _0x38c422 ? "null" === _0x14a0cc ? null : _0x14a0cc || "{}" : "{}";
try {
const _0x1b9f14 = JSON.parse(_0x10f203);
this.lodash_set(_0x1b9f14, _0x26c375, _0x90cff);
_0x28ca60 = this.setval(JSON.stringify(_0x1b9f14), _0x38c422);
} catch (_0x4ce4bd) {
const _0x4defda = {};
this.lodash_set(_0x4defda, _0x26c375, _0x90cff);
_0x28ca60 = this.setval(JSON.stringify(_0x4defda), _0x38c422);
}
} else {
_0x28ca60 = this.setval(_0x90cff, _0x59643e);
}
return _0x28ca60;
}
}
["getval"](_0x4e2aac) {
return this.isSurge() || this.isLoon() ? $persistentStore.read(_0x4e2aac) : this.isQuanX() ? $prefs.valueForKey(_0x4e2aac) : this.isNode() ? (this.data = this.loaddata(), this.data[_0x4e2aac]) : this.data && this.data[_0x4e2aac] || null;
}
["setval"](_0x4901e5, _0xdb3502) {
return this.isSurge() || this.isLoon() ? $persistentStore.write(_0x4901e5, _0xdb3502) : this.isQuanX() ? $prefs.setValueForKey(_0x4901e5, _0xdb3502) : this.isNode() ? (this.data = this.loaddata(), this.data[_0xdb3502] = _0x4901e5, this.writedata(), true) : this.data && this.data[_0xdb3502] || null;
}
["send"](_0x528a53, _0x1062b7, _0x3a681d = () => {}) {
{
if (_0x528a53 != "get" && _0x528a53 != "post" && _0x528a53 != "put" && _0x528a53 != "delete") {
console.log("无效的http方法" + _0x528a53);
return;
}
if (_0x528a53 == "get" && _0x1062b7.headers) delete _0x1062b7.headers["Content-Type"], delete _0x1062b7.headers["Content-Length"];else {
if (_0x1062b7.body && _0x1062b7.headers) {
{
if (!_0x1062b7.headers["Content-Type"]) _0x1062b7.headers["Content-Type"] = "application/x-www-form-urlencoded";
}
}
}
if (this.isSurge() || this.isLoon()) {
this.isSurge() && this.isNeedRewrite && (_0x1062b7.headers = _0x1062b7.headers || {}, Object.assign(_0x1062b7.headers, {
"X-Surge-Skip-Scripting": false
}));
let _0x55f76d = {
"method": _0x528a53,
"url": _0x1062b7.url,
"headers": _0x1062b7.headers,
"timeout": _0x1062b7.timeout,
"data": _0x1062b7.body
};
if (_0x528a53 == "get") delete _0x55f76d.data;
$axios(_0x55f76d).then(_0x3f3966 => {
const {
status: _0x29a846,
request: _0x2ad2aa,
headers: _0x5cc4bd,
data: _0x161f35
} = _0x3f3966;
_0x3a681d(null, _0x2ad2aa, {
"statusCode": _0x29a846,
"headers": _0x5cc4bd,
"body": _0x161f35
});
}).catch(_0x238377 => console.log(_0x238377));
} else {
if (this.isQuanX()) _0x1062b7.method = _0x528a53.toUpperCase(), this.isNeedRewrite && (_0x1062b7.opts = _0x1062b7.opts || {}, Object.assign(_0x1062b7.opts, {
"hints": false
})), $task.fetch(_0x1062b7).then(_0x3b8bbe => {
const {
statusCode: _0x2fc1ac,
request: _0x5f6740,
headers: _0x34d4ad,
body: _0x37fbc7
} = _0x3b8bbe;
_0x3a681d(null, _0x5f6740, {
"statusCode": _0x2fc1ac,
"headers": _0x34d4ad,
"body": _0x37fbc7
});
}, _0x361920 => _0x3a681d(_0x361920));else {
if (this.isNode()) {
this.got = this.got ? this.got : require("got");
const {
url: _0x325d9c,
..._0xf7af76
} = _0x1062b7;
this.instance = this.got.extend({
"followRedirect": false
});
this.instance[_0x528a53](_0x325d9c, _0xf7af76).then(_0x18383d => {
const {
statusCode: _0xf07db0,
request: _0x532d1a,
headers: _0x1dc0d4,
body: _0x4984e8
} = _0x18383d;
_0x3a681d(null, _0x532d1a, {
"statusCode": _0xf07db0,
"headers": _0x1dc0d4,
"body": _0x4984e8
});
}, _0x2e49ed => {
const {
message: _0x2df36f,
request: _0x5340cf,
response: _0xdeebdf
} = _0x2e49ed;
_0x3a681d(_0x2df36f, _0x5340cf, _0xdeebdf);
});
}
}
}
}
}
["time"](_0x4ddd19, _0x3d004a = null) {
{
let _0x3d0303 = _0x3d004a ? new Date(_0x3d004a) : new Date(),
_0x1c5845 = {
"M+": _0x3d0303.getMonth() + 1,
"d+": _0x3d0303.getDate(),
"h+": _0x3d0303.getHours(),
"m+": _0x3d0303.getMinutes(),
"s+": _0x3d0303.getSeconds(),
"q+": Math.floor((_0x3d0303.getMonth() + 3) / 3),
"S": _0x3d0303.getMilliseconds()
};
/(y+)/.test(_0x4ddd19) && (_0x4ddd19 = _0x4ddd19.replace(RegExp.$1, (_0x3d0303.getFullYear() + "").substr(4 - RegExp.$1.length)));
for (let _0x4df8e7 in _0x1c5845) new RegExp("(" + _0x4df8e7 + ")").test(_0x4ddd19) && (_0x4ddd19 = _0x4ddd19.replace(RegExp.$1, 1 == RegExp.$1.length ? _0x1c5845[_0x4df8e7] : ("00" + _0x1c5845[_0x4df8e7]).substr(("" + _0x1c5845[_0x4df8e7]).length)));
return _0x4ddd19;
}
}
async ["showmsg"]() {
{
if (!this.notifyStr) return;
let _0x3d3a83 = this.name + " 运行通知\n\n" + this.notifyStr;
if (_0x3065e9.isNode()) {
{
var _0x3a245e = require("./sendNotify");
console.log("\n============== 推送 ==============");
await _0x3a245e.sendNotify(this.name, _0x3d3a83);
}
} else this.msg(_0x3d3a83);
}
}
["logAndNotify"](_0x58012f) {
console.log(_0x58012f);
this.notifyStr += _0x58012f;
this.notifyStr += "\n";
}
["logAndNotifyWithTime"](_0xeaf4b1) {
let _0x414567 = "[" + this.time("hh:mm:ss.S") + "]" + _0xeaf4b1;
console.log(_0x414567);
this.notifyStr += _0x414567;
this.notifyStr += "\n";
}
["logWithTime"](_0x5291da) {
console.log("[" + this.time("hh:mm:ss.S") + "]" + _0x5291da);
}
["msg"](_0x51fea4 = t, _0x215cb5 = "", _0x474402 = "", _0x42a5dd) {
const _0x3d6f7a = _0x163e67 => {
{
if (!_0x163e67) return _0x163e67;
if ("string" == typeof _0x163e67) return this.isLoon() ? _0x163e67 : this.isQuanX() ? {
"open-url": _0x163e67
} : this.isSurge() ? {
"url": _0x163e67
} : undefined;
if ("object" == typeof _0x163e67) {
if (this.isLoon()) {
let _0x2d5c4a = _0x163e67.openUrl || _0x163e67.url || _0x163e67["open-url"],
_0x12a18e = _0x163e67.mediaUrl || _0x163e67["media-url"];
return {
"openUrl": _0x2d5c4a,
"mediaUrl": _0x12a18e
};
}
if (this.isQuanX()) {
let _0x1e62a6 = _0x163e67["open-url"] || _0x163e67.url || _0x163e67.openUrl,
_0x5c34e8 = _0x163e67["media-url"] || _0x163e67.mediaUrl;
return {
"open-url": _0x1e62a6,
"media-url": _0x5c34e8
};
}
if (this.isSurge()) {
let _0x178770 = _0x163e67.url || _0x163e67.openUrl || _0x163e67["open-url"];
return {
"url": _0x178770
};
}
}
}
};
this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(_0x51fea4, _0x215cb5, _0x474402, _0x3d6f7a(_0x42a5dd)) : this.isQuanX() && $notify(_0x51fea4, _0x215cb5, _0x474402, _0x3d6f7a(_0x42a5dd)));
let _0x15ca2e = ["", "============== 系统通知 =============="];
_0x15ca2e.push(_0x51fea4);
_0x215cb5 && _0x15ca2e.push(_0x215cb5);
_0x474402 && _0x15ca2e.push(_0x474402);
console.log(_0x15ca2e.join("\n"));
}
["getMin"](_0x434bc7, _0x32c083) {
return _0x434bc7 < _0x32c083 ? _0x434bc7 : _0x32c083;
}
["getMax"](_0x4d3798, _0x166dff) {
return _0x4d3798 < _0x166dff ? _0x166dff : _0x4d3798;
}
["padStr"](_0x163393, _0x4fb87b, _0x56aecc = "0") {
{
let _0x5cdeb2 = String(_0x163393),
_0xd26033 = _0x4fb87b > _0x5cdeb2.length ? _0x4fb87b - _0x5cdeb2.length : 0,
_0x111cf7 = "";
for (let _0x5ebe0b = 0; _0x5ebe0b < _0xd26033; _0x5ebe0b++) {
_0x111cf7 += _0x56aecc;
}
_0x111cf7 += _0x5cdeb2;
return _0x111cf7;
}
}
["json2str"](_0x5eff15, _0x47bb6a, _0x2a6962 = false) {
let _0x59e08a = [];
for (let _0x4817da of Object.keys(_0x5eff15).sort()) {
{
let _0xf5e3d8 = _0x5eff15[_0x4817da];
if (_0xf5e3d8 && _0x2a6962) _0xf5e3d8 = encodeURIComponent(_0xf5e3d8);
_0x59e08a.push(_0x4817da + "=" + _0xf5e3d8);
}
}
return _0x59e08a.join(_0x47bb6a);
}
["str2json"](_0x31a48d, _0x36c2e8 = false) {
let _0x2cde0e = {};
for (let _0x5b6e8d of _0x31a48d.split("&")) {
if (!_0x5b6e8d) continue;
let _0x5742d9 = _0x5b6e8d.indexOf("=");
if (_0x5742d9 == -1) continue;
let _0x2f6ff9 = _0x5b6e8d.substr(0, _0x5742d9),
_0x2f8540 = _0x5b6e8d.substr(_0x5742d9 + 1);
if (_0x36c2e8) _0x2f8540 = decodeURIComponent(_0x2f8540);
_0x2cde0e[_0x2f6ff9] = _0x2f8540;
}
return _0x2cde0e;
}
["randomString"](_0x1826b2, _0x2926dc = "abcdef0123456789") {
let _0x11a90c = "";
for (let _0x1ed771 = 0; _0x1ed771 < _0x1826b2; _0x1ed771++) {
_0x11a90c += _0x2926dc.charAt(Math.floor(Math.random() * _0x2926dc.length));
}
return _0x11a90c;
}
["randomList"](_0x3808ec) {
let _0x129ec9 = Math.floor(Math.random() * _0x3808ec.length);
return _0x3808ec[_0x129ec9];
}
["wait"](_0x41414e) {
return new Promise(_0x310013 => setTimeout(_0x310013, _0x41414e));
}
["done"](_0x5aad77 = {}) {
const _0x2634cb = new Date().getTime(),
_0x53d433 = (_0x2634cb - this.startTime) / 1000;
console.log("\n" + this.name + " 运行结束,共运行了 " + _0x53d433 + " 秒!");
if (this.isSurge() || this.isQuanX() || this.isLoon()) $done(_0x5aad77);
}
}(_0x4038d3, _0x4c648e);
}

570
wxapp/海尔-卡萨帝.js Normal file
View File

@@ -0,0 +1,570 @@
/**
* 海尔 - 卡萨帝小程序 签到、抽奖
* cron 10 8 * * * 海尔-卡萨帝.js
*
* ========= 青龙--配置文件 ===========
* # 项目名称
* export ksd='你抓包的UserToken#请求Body里的openId'
* 自己抓包 /user/userCenter/saveUserSource请求协议头上的MK-U-User-Token
* 请求数据里的 openId
* 用 # 连接
* 多账号换行或&隔开
* 奖励:现金红包
*
* ====================================
*
*/
//Sat Jan 25 2025 08:32:06 GMT+0000 (Coordinated Universal Time)
//Base:https://github.com/echo094/decode-js
//Modify:https://github.com/smallfawn/decode_action
const $ = new Env("卡萨帝小程序");
let envParams = "ksd",
envSplitor = ["\n", "&"],
authorizationToken = ($.isNode() ? process.env[envParams] : $.getdata(envParams)) || "",
initedJobForTokens = [],
currentUserIndex = 0,
contentType = "application/json;charset=UTF-8",
defaultUA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/6945",
Referer = "https://yx.jsh.com/game/signInIndex?employeeId=&playId=20";
const https = require("https");
class JobTask {
constructor(_0x55d5be) {
this.index = ++currentUserIndex;
this.points = 0;
this.valid = false;
try {
[this.activedAuthToken, this.openId] = _0x55d5be?.["split"]("#");
} catch (_0x5cde09) {
this.activedAuthToken = _0x55d5be;
}
}
async ["taskApi"](_0x53ede5, _0x2127bc, _0x2c79b5, _0x31d84a, _0x232dd9 = {}) {
let _0x41e367 = null;
try {
let _0x235e01 = _0x2c79b5.replace("//", "/").split("/")[1],
_0x49cb17 = {
"url": _0x2c79b5,
"headers": {
"Accept": "application/json, text/plain, */*",
"Authorization": this.activedAuthToken,
"Host": _0x235e01,
"Connection": "keep-alive",
"Content-Type": contentType,
"User-Agent": defaultUA,
"Referer": Referer,
"MK-Source-Code": "casarte",
"MK-U-App-Code": "gUsb9sx0eXEdMuc",
"MK-U-User-Token": this.activedAuthToken,
..._0x232dd9
},
"timeout": 60000
};
if (_0x31d84a) {
_0x49cb17.body = _0x31d84a;
}
await httpRequest(_0x2127bc, _0x49cb17).then(async _0x591ac9 => {
if (_0x591ac9.resp?.["statusCode"] == 200) {
_0x591ac9.resp?.["body"] ? _0x41e367 = JSON.parse(_0x591ac9.resp.body) : console.log("账号[" + this.index + "]调用" + _0x2127bc + "[" + _0x53ede5 + "]出错,返回为空");
} else console.log("账号[" + this.index + "]调用" + _0x2127bc + "[" + _0x53ede5 + "]出错,返回状态码[" + (_0x591ac9.resp?.["statusCode"] || "") + "]");
});
} catch (_0x38b370) {
console.log(_0x38b370);
} finally {
return Promise.resolve(_0x41e367);
}
}
async ["GetUserInfo"]() {
try {
{
let _0x1ed441 = "GetUserInfo",
_0x201f80 = "post",
_0x5e3710 = "https://mk-gift.haier.net/qy/customer/api/redEnvelope/queryRedEnvelopeWallet",
_0x5ade36 = "{\"redSource\":\"\"}";
await this.taskApi(_0x1ed441, _0x201f80, _0x5e3710, _0x5ade36, {
"Content-Type": "application/json"
}).then(async _0x29ca70 => {
console.log("result:", _0x29ca70);
_0x29ca70.code === 200 ? (this.valid = true, this.points = Number(_0x29ca70.data.cash_available), console.log("账号[" + this.index + "] 登录成功"), console.log("账号[" + this.index + "] 当前余额: " + this.points)) : $.logAndNotify("账号[" + this.index + "]查询余额失败,可能帐号无效");
});
}
} catch (_0x670981) {
console.log(_0x670981);
} finally {
return Promise.resolve(1);
}
}
async ["SignInDaily"]() {
try {
{
let _0x226da3 = "SignInDaily",
_0x79792e = "post",
_0xb36903 = "https://yx.jsh.com/customer/api/user/playingMethod/game/saveClockInInfoByUserId",
_0x541af5 = "{\"playId\":\"20\",\"employeeId\":\"\",\"mobile\":\"\",\"openId\":\"" + this.openId + "\",\"parentUserId\":\"\",\"userId\":\"\"}";
await this.taskApi(_0x226da3, _0x79792e, _0xb36903, _0x541af5).then(async _0x25b135 => {
console.log("result:", _0x25b135);
_0x25b135.code === 200 ? (console.log("账号[" + this.index + "] 签到成功,获得" + _0x25b135.data / 100 + "元"), _0x25b135.data && (this.points += _0x25b135.data / 100)) : console.log("账号[" + this.index + "] 签到失败:" + _0x25b135?.["message"]);
});
}
} catch (_0x1aa259) {
console.log(_0x1aa259);
} finally {
return Promise.resolve(1);
}
}
async ["LuckDraw"]() {
try {
let _0x1bb47d = "LuckDraw",
_0x343437 = "post",
_0x46ba8d = "https://yx.jsh.com/customer/api/user/client/luckDraw",
_0x13a4ce = "{\"gameId\":\"174464962928279552\"}";
await this.taskApi(_0x1bb47d, _0x343437, _0x46ba8d, _0x13a4ce).then(async _0x108d75 => {
{
console.log("result:", _0x108d75);
if (_0x108d75.code === 200) console.log("账号[" + this.index + "] 抽奖成功,获得" + _0x108d75.data?.["prizeName"] + "积分");else {
console.log("账号[" + this.index + "] 抽奖失败:" + _0x108d75?.["message"]);
}
}
});
} catch (_0x5f4c99) {
console.log(_0x5f4c99);
} finally {
return Promise.resolve(1);
}
}
async ["TiXian"]() {
try {
{
let _0x5a32ee = "TiXian",
_0x46df13 = "post",
_0x4bbbc6 = "https://marketing-api.haier.net/api/marketing-assemble/api/cashcenter/user/wallet/withdrawalCash",
_0x3e492d = encodeURIComponent("data={\"type\":\"1\",\"withdrawFee\":\"" + this.points + "\"}&signData={\"key\":\"userRed100000003\",\"secret\":\"88800de360b7308cdba924b865507a92\"}");
await this.taskApi(_0x5a32ee, _0x46df13, _0x4bbbc6, _0x3e492d, {
"Authorization": "Bearer " + this.activedAuthToken,
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
"Content-Type": "application/x-www-form-urlencoded",
"X-Requested-With": "com.tencent.mm",
"plantform-channel": "PLAT_FORM_WECHAT"
}).then(async _0x48a4c5 => {
_0x48a4c5.code === 200 ? console.log("账号[" + this.index + "] 提现成功,获得" + _0x48a4c5.data?.["prizeName"] + "现金") : console.log("账号[" + this.index + "] 提现失败:" + JSON.parse(_0x48a4c5));
});
}
} catch (_0x5dcea4) {
console.log(_0x5dcea4);
} finally {
return Promise.resolve(1);
}
}
async ["doTask"]() {
try {
console.log("\n============= 账号[" + this.index + "] 开始签到=============");
await this.SignInDaily();
await waitSomeTime();
await this.LuckDraw();
console.log("\n----待提现的金额:", this.points);
this.points && !Number.isNaN(this.points) && this.points >= 1 && (await waitSomeTime(), await this.TiXian());
} catch (_0x3b27c2) {
console.log(_0x3b27c2);
}
}
}
!(async () => {
if (typeof $request !== "undefined") {
await GetRewrite();
} else {
{
if (!(await checkEnv())) return;
console.log("\n================ 开始执行 ================");
for (let _0x37bc9f of initedJobForTokens) {
console.log("----------- 执行 第 [" + _0x37bc9f.index + "] 个账号 -----------");
await _0x37bc9f.GetUserInfo();
}
let _0x56f6f9 = initedJobForTokens.filter(_0x308e9f => _0x308e9f.valid);
if (initedJobForTokens.length > 0) {
console.log("\n================ 任务队列构建完毕 ================");
for (let _0x22bb86 of _0x56f6f9) {
console.log("----------- 账号[" + _0x22bb86.index + "] -----------");
await _0x22bb86.doTask();
}
}
await $.showmsg();
}
}
})().catch(_0x570c59 => console.log(_0x570c59)).finally(() => $.done());
async function waitSomeTime(_0x395b52 = 3000) {
console.log("----------- 延迟 " + _0x395b52 / 1000 + " s请稍等 -----------");
return await new Promise(_0x203071 => setTimeout(_0x203071, _0x395b52));
}
async function GetRewrite() {}
async function checkEnv() {
if (authorizationToken) {
{
let _0x15962f = envSplitor[0];
for (let _0x3a119f of envSplitor) {
{
if (authorizationToken.indexOf(_0x3a119f) > -1) {
_0x15962f = _0x3a119f;
break;
}
}
}
for (let _0x167f1c of authorizationToken.split(_0x15962f)) {
{
if (_0x167f1c) initedJobForTokens.push(new JobTask(_0x167f1c));
}
}
userCount = initedJobForTokens.length;
}
} else {
console.log("未找到 配置信息,请检查是否配置 变量:", envParams);
return;
}
console.log("共找到" + userCount + "个账号");
return true;
}
async function httpRequest(_0x315fde, _0x43498a) {
httpErr = null;
httpReq = null;
httpResp = null;
return new Promise(_0x15e577 => {
$.send(_0x315fde, _0x43498a, async (_0x46ab79, _0x54af7f, _0x326c5c) => {
httpErr = _0x46ab79;
httpReq = _0x54af7f;
httpResp = _0x326c5c;
_0x15e577({
"err": _0x46ab79,
"req": _0x54af7f,
"resp": _0x326c5c
});
});
});
}
function Env(_0x145f6d, _0x2ad434) {
"undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
return new class {
constructor(_0x2c6ae3, _0x15c3de) {
{
this.name = _0x2c6ae3;
this.notifyStr = "";
this.startTime = new Date().getTime();
Object.assign(this, _0x15c3de);
console.log(this.name + " 开始运行:\n");
}
}
["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;
}
["getdata"](_0x4fac12) {
let _0x34b166 = this.getval(_0x4fac12);
if (/^@/.test(_0x4fac12)) {
{
const [, _0x4a384a, _0x163012] = /^@(.*?)\.(.*?)$/.exec(_0x4fac12),
_0x4d5996 = _0x4a384a ? this.getval(_0x4a384a) : "";
if (_0x4d5996) try {
const _0xea2094 = JSON.parse(_0x4d5996);
_0x34b166 = _0xea2094 ? this.lodash_get(_0xea2094, _0x163012, "") : _0x34b166;
} catch (_0x178f4b) {
_0x34b166 = "";
}
}
}
return _0x34b166;
}
["setdata"](_0x2f9735, _0x5a4907) {
{
let _0x1da6cb = false;
if (/^@/.test(_0x5a4907)) {
const [, _0x8150c9, _0x441dcb] = /^@(.*?)\.(.*?)$/.exec(_0x5a4907),
_0x31d092 = this.getval(_0x8150c9),
_0x2dc4c1 = _0x8150c9 ? "null" === _0x31d092 ? null : _0x31d092 || "{}" : "{}";
try {
const _0x4cde78 = JSON.parse(_0x2dc4c1);
this.lodash_set(_0x4cde78, _0x441dcb, _0x2f9735);
_0x1da6cb = this.setval(JSON.stringify(_0x4cde78), _0x8150c9);
} catch (_0x39e26e) {
{
const _0x302ef5 = {};
this.lodash_set(_0x302ef5, _0x441dcb, _0x2f9735);
_0x1da6cb = this.setval(JSON.stringify(_0x302ef5), _0x8150c9);
}
}
} else _0x1da6cb = this.setval(_0x2f9735, _0x5a4907);
return _0x1da6cb;
}
}
["getval"](_0x17b0b5) {
return this.isSurge() || this.isLoon() ? $persistentStore.read(_0x17b0b5) : this.isQuanX() ? $prefs.valueForKey(_0x17b0b5) : this.isNode() ? (this.data = this.loaddata(), this.data[_0x17b0b5]) : this.data && this.data[_0x17b0b5] || null;
}
["setval"](_0x1a4b9a, _0x5989f1) {
return this.isSurge() || this.isLoon() ? $persistentStore.write(_0x1a4b9a, _0x5989f1) : this.isQuanX() ? $prefs.setValueForKey(_0x1a4b9a, _0x5989f1) : this.isNode() ? (this.data = this.loaddata(), this.data[_0x5989f1] = _0x1a4b9a, this.writedata(), true) : this.data && this.data[_0x5989f1] || null;
}
["send"](_0x390a5f, _0x55dfcf, _0x53ea18 = () => {}) {
{
if (_0x390a5f != "get" && _0x390a5f != "post" && _0x390a5f != "put" && _0x390a5f != "delete") {
{
console.log("无效的http方法" + _0x390a5f);
return;
}
}
if (_0x390a5f == "get" && _0x55dfcf.headers) delete _0x55dfcf.headers["Content-Type"], delete _0x55dfcf.headers["Content-Length"];else {
if (_0x55dfcf.body && _0x55dfcf.headers) {
{
if (!_0x55dfcf.headers["Content-Type"]) _0x55dfcf.headers["Content-Type"] = "application/x-www-form-urlencoded";
}
}
}
if (this.isSurge() || this.isLoon()) {
{
if (this.isSurge() && this.isNeedRewrite) {
_0x55dfcf.headers = _0x55dfcf.headers || {};
Object.assign(_0x55dfcf.headers, {
"X-Surge-Skip-Scripting": false
});
}
let _0x41a6ce = {
"method": _0x390a5f,
"url": _0x55dfcf.url,
"headers": _0x55dfcf.headers,
"timeout": _0x55dfcf.timeout,
"data": _0x55dfcf.body
};
if (_0x390a5f == "get") delete _0x41a6ce.data;
$axios(_0x41a6ce).then(_0x33377e => {
{
const {
status: _0x2065f2,
request: _0x23f3a5,
headers: _0x4e5d89,
data: _0xd40200
} = _0x33377e;
_0x53ea18(null, _0x23f3a5, {
"statusCode": _0x2065f2,
"headers": _0x4e5d89,
"body": _0xd40200
});
}
}).catch(_0x30a337 => console.log(_0x30a337));
}
} else {
if (this.isQuanX()) {
_0x55dfcf.method = _0x390a5f.toUpperCase();
this.isNeedRewrite && (_0x55dfcf.opts = _0x55dfcf.opts || {}, Object.assign(_0x55dfcf.opts, {
"hints": false
}));
$task.fetch(_0x55dfcf).then(_0x4fc46b => {
{
const {
statusCode: _0x3adacc,
request: _0x4c9fac,
headers: _0x465d4c,
body: _0x1c0160
} = _0x4fc46b;
_0x53ea18(null, _0x4c9fac, {
"statusCode": _0x3adacc,
"headers": _0x465d4c,
"body": _0x1c0160
});
}
}, _0x39ac1f => _0x53ea18(_0x39ac1f));
} else {
if (this.isNode()) {
this.got = this.got ? this.got : require("got");
const {
url: _0x17922a,
..._0x2092f9
} = _0x55dfcf;
this.instance = this.got.extend({
"followRedirect": false
});
this.instance[_0x390a5f](_0x17922a, _0x2092f9).then(_0x36703e => {
const {
statusCode: _0x23a6f5,
request: _0xc061b3,
headers: _0x1e25f8,
body: _0x15c804
} = _0x36703e;
_0x53ea18(null, _0xc061b3, {
"statusCode": _0x23a6f5,
"headers": _0x1e25f8,
"body": _0x15c804
});
}, _0x2b4fca => {
{
const {
message: _0x5baa3b,
request: _0x1400de,
response: _0x20be40
} = _0x2b4fca;
_0x53ea18(_0x5baa3b, _0x1400de, _0x20be40);
}
});
}
}
}
}
}
["time"](_0x518b14, _0x4cec02 = null) {
let _0x91d015 = _0x4cec02 ? new Date(_0x4cec02) : new Date(),
_0xc32e0 = {
"M+": _0x91d015.getMonth() + 1,
"d+": _0x91d015.getDate(),
"h+": _0x91d015.getHours(),
"m+": _0x91d015.getMinutes(),
"s+": _0x91d015.getSeconds(),
"q+": Math.floor((_0x91d015.getMonth() + 3) / 3),
"S": _0x91d015.getMilliseconds()
};
/(y+)/.test(_0x518b14) && (_0x518b14 = _0x518b14.replace(RegExp.$1, (_0x91d015.getFullYear() + "").substr(4 - RegExp.$1.length)));
for (let _0x74d676 in _0xc32e0) new RegExp("(" + _0x74d676 + ")").test(_0x518b14) && (_0x518b14 = _0x518b14.replace(RegExp.$1, 1 == RegExp.$1.length ? _0xc32e0[_0x74d676] : ("00" + _0xc32e0[_0x74d676]).substr(("" + _0xc32e0[_0x74d676]).length)));
return _0x518b14;
}
async ["showmsg"]() {
if (!this.notifyStr) return;
let _0x49b71e = this.name + " 运行通知\n\n" + this.notifyStr;
if ($.isNode()) {
var _0x15c32f = require("./sendNotify");
console.log("\n============== 推送 ==============");
await _0x15c32f.sendNotify(this.name, _0x49b71e);
} else this.msg(_0x49b71e);
}
["logAndNotify"](_0x411ee5) {
console.log(_0x411ee5);
this.notifyStr += _0x411ee5;
this.notifyStr += "\n";
}
["logAndNotifyWithTime"](_0x265752) {
{
let _0x29cff9 = "[" + this.time("hh:mm:ss.S") + "]" + _0x265752;
console.log(_0x29cff9);
this.notifyStr += _0x29cff9;
this.notifyStr += "\n";
}
}
["logWithTime"](_0x35d90e) {
console.log("[" + this.time("hh:mm:ss.S") + "]" + _0x35d90e);
}
["msg"](_0x36b3bc = t, _0x277707 = "", _0x416e8b = "", _0x487038) {
const _0x1a3fa6 = _0x4e2159 => {
{
if (!_0x4e2159) return _0x4e2159;
if ("string" == typeof _0x4e2159) return this.isLoon() ? _0x4e2159 : this.isQuanX() ? {
"open-url": _0x4e2159
} : this.isSurge() ? {
"url": _0x4e2159
} : undefined;
if ("object" == typeof _0x4e2159) {
{
if (this.isLoon()) {
{
let _0x1d32d6 = _0x4e2159.openUrl || _0x4e2159.url || _0x4e2159["open-url"],
_0x1c6203 = _0x4e2159.mediaUrl || _0x4e2159["media-url"];
return {
"openUrl": _0x1d32d6,
"mediaUrl": _0x1c6203
};
}
}
if (this.isQuanX()) {
let _0x5a7300 = _0x4e2159["open-url"] || _0x4e2159.url || _0x4e2159.openUrl,
_0x425900 = _0x4e2159["media-url"] || _0x4e2159.mediaUrl;
return {
"open-url": _0x5a7300,
"media-url": _0x425900
};
}
if (this.isSurge()) {
let _0x40d0df = _0x4e2159.url || _0x4e2159.openUrl || _0x4e2159["open-url"];
return {
"url": _0x40d0df
};
}
}
}
}
};
this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(_0x36b3bc, _0x277707, _0x416e8b, _0x1a3fa6(_0x487038)) : this.isQuanX() && $notify(_0x36b3bc, _0x277707, _0x416e8b, _0x1a3fa6(_0x487038)));
let _0x32161e = ["", "============== 系统通知 =============="];
_0x32161e.push(_0x36b3bc);
_0x277707 && _0x32161e.push(_0x277707);
_0x416e8b && _0x32161e.push(_0x416e8b);
console.log(_0x32161e.join("\n"));
}
["getMin"](_0x3e6cad, _0x1ce183) {
return _0x3e6cad < _0x1ce183 ? _0x3e6cad : _0x1ce183;
}
["getMax"](_0x939b39, _0xc0287e) {
return _0x939b39 < _0xc0287e ? _0xc0287e : _0x939b39;
}
["padStr"](_0x371ca0, _0x558a10, _0x50b7d9 = "0") {
let _0x23ddbe = String(_0x371ca0),
_0x5c77da = _0x558a10 > _0x23ddbe.length ? _0x558a10 - _0x23ddbe.length : 0,
_0x41ed35 = "";
for (let _0x232913 = 0; _0x232913 < _0x5c77da; _0x232913++) {
_0x41ed35 += _0x50b7d9;
}
_0x41ed35 += _0x23ddbe;
return _0x41ed35;
}
["json2str"](_0x3344e, _0x14c262, _0x39f0d1 = false) {
let _0x41049d = [];
for (let _0x59f8b1 of Object.keys(_0x3344e).sort()) {
let _0x492abf = _0x3344e[_0x59f8b1];
if (_0x492abf && _0x39f0d1) _0x492abf = encodeURIComponent(_0x492abf);
_0x41049d.push(_0x59f8b1 + "=" + _0x492abf);
}
return _0x41049d.join(_0x14c262);
}
["str2json"](_0x27a7e5, _0x562ec0 = false) {
{
let _0x21bc24 = {};
for (let _0x5a43be of _0x27a7e5.split("&")) {
if (!_0x5a43be) continue;
let _0x16b706 = _0x5a43be.indexOf("=");
if (_0x16b706 == -1) continue;
let _0x5c1005 = _0x5a43be.substr(0, _0x16b706),
_0x5bd991 = _0x5a43be.substr(_0x16b706 + 1);
if (_0x562ec0) _0x5bd991 = decodeURIComponent(_0x5bd991);
_0x21bc24[_0x5c1005] = _0x5bd991;
}
return _0x21bc24;
}
}
["randomString"](_0x3fd6b4, _0x227d42 = "abcdef0123456789") {
{
let _0x4a0db9 = "";
for (let _0x11b627 = 0; _0x11b627 < _0x3fd6b4; _0x11b627++) {
_0x4a0db9 += _0x227d42.charAt(Math.floor(Math.random() * _0x227d42.length));
}
return _0x4a0db9;
}
}
["randomList"](_0x3ac336) {
{
let _0x5b9b88 = Math.floor(Math.random() * _0x3ac336.length);
return _0x3ac336[_0x5b9b88];
}
}
["wait"](_0x3e1e6c) {
return new Promise(_0x342340 => setTimeout(_0x342340, _0x3e1e6c));
}
["done"](_0x39fc39 = {}) {
{
const _0x43cece = new Date().getTime(),
_0x11ce01 = (_0x43cece - this.startTime) / 1000;
console.log("\n" + this.name + " 运行结束,共运行了 " + _0x11ce01 + " 秒!");
if (this.isSurge() || this.isQuanX() || this.isLoon()) $done(_0x39fc39);
}
}
}(_0x145f6d, _0x2ad434);
}

516
wxapp/草莓台.js Normal file
View File

@@ -0,0 +1,516 @@
/**
* 草莓台小程序签到v0.03
* cron 10 12 * * * 草莓台.js
*
* ========= 青龙--配置文件 ===========
* # 项目名称
* export caomeitai_token='你抓包的openid#你的userId'
* 自己抓包协议头上的Cookie
* 多账号换行或&隔开
* 奖励:签到草莓币
* const $ = new Env("草莓台")
* ====================================
*
*/
//Sat Jan 25 2025 08:33:12 GMT+0000 (Coordinated Universal Time)
//Base:https://github.com/echo094/decode-js
//Modify:https://github.com/smallfawn/decode_action
const $ = new Env("草莓台小程序签到");
let envParams = "caomeitai_token",
envSplitor = ["\n", "&"],
authorizationToken = ($.isNode() ? process.env[envParams] : $.getdata(envParams)) || "",
initedJobForTokens = [],
currentUserIndex = 0;
class JobTask {
constructor(_0x2a8b2b) {
this.index = ++currentUserIndex;
this.points = 0;
this.valid = false;
this.userId = "";
[this.openid, this.userId] = _0x2a8b2b?.["split"]("#");
this.activedAuthToken = "";
}
async ["taskApi"](_0x47ec4f, _0x4e5aeb, _0x574064, _0x2d47eb) {
let _0x4541cc = null;
try {
{
let _0x12da9e = {
"url": _0x574064,
"headers": {
"Accept": "*/*",
"Accept-Language": "zh-CN,zh",
"Connection": "keep-alive",
"Content-Type": "application/json",
"Host": "cmtv.xmay.cc",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "cross-site",
"referer": "https://servicewechat.com/wxc2a56f3a7492b8c4/145/page-frame.html",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/6945",
"xweb_xhr": "1"
},
"timeout": 60000
};
this.activedAuthToken && (_0x12da9e.headers.Authorization = "Bearer " + this.activedAuthToken);
if (_0x2d47eb) {
_0x12da9e.body = _0x2d47eb;
_0x12da9e.headers["Content-Length"] = _0x2d47eb?.["length"];
}
await httpRequest(_0x4e5aeb, _0x12da9e).then(async _0x5cd31a => {
{
if (_0x5cd31a.resp?.["statusCode"] == 200) {
if (_0x5cd31a.resp?.["body"]) _0x4541cc = JSON.parse(_0x5cd31a.resp.body);else {}
} else console.log("账号[" + this.index + "]调用" + _0x4e5aeb + "[" + _0x47ec4f + "]出错,返回状态码[" + (_0x5cd31a.resp?.["statusCode"] || "") + "]", "返回结果:", _0x5cd31a.resp?.["body"]);
}
});
}
} catch (_0x24afeb) {
console.log(_0x24afeb);
} finally {
return Promise.resolve(_0x4541cc);
}
}
async ["LoginIn"]() {
try {
let _0x329bf1 = "LoginIn",
_0x168fa7 = "post",
_0x13d94a = "https://cmtv.xmay.cc/api/WX/login2",
_0x444be0 = "{\"id\":\"" + this.userId + "\",\"openid\":\"" + this.openid + "\"}";
await this.taskApi(_0x329bf1, _0x168fa7, _0x13d94a, _0x444be0).then(async _0x257d58 => {
{
if (_0x257d58?.["token"]) {
this.activedAuthToken = _0x257d58?.["token"];
this.valid = true;
this.points = _0x257d58?.["user"]["chbeanNum"] / 100;
this.userId = _0x257d58?.["user"]["id"];
console.log("账号[" + this.index + "] 登录成功,昵称:" + _0x257d58?.["user"]["nickname"] + ",草莓币:" + _0x257d58?.["user"]["chbeanNum"] / 100);
} else console.log("账号[" + this.index + "] 登录失败", _0x257d58), this.valid = false;
}
});
} catch (_0x28cd9b) {
console.log(_0x28cd9b);
} finally {
return Promise.resolve(1);
}
}
async ["GetUserTask"]() {
try {
{
let _0x45d636 = "GetUserTask",
_0x413c1c = "get",
_0x1e2fea = "https://cmtv.xmay.cc/api/registerInfo/checkRegister?userId=" + this.userId,
_0x29a6c7 = "";
return await this.taskApi(_0x45d636, _0x413c1c, _0x1e2fea, _0x29a6c7).then(async _0x335edf => {
if (_0x335edf) {
if (!_0x335edf.isAfter) return console.log("账号[" + this.index + "] " + this.userId + " - 已经签到了,无需签到"), false;
console.log("账号[" + this.index + "] " + this.userId + " - 检测到还未签到");
return true;
} else $.logAndNotify("账号[" + this.index + "] " + this.userId + " - 查询草莓币失败,可能帐号无效:" + JSON.stringify(_0x335edf));
});
}
} catch (_0x519874) {
console.log(_0x519874);
}
}
async ["SignInDaily"]() {
try {
let _0x3c8847 = "SignInDaily",
_0x43fe4c = "post",
_0x27aa7e = "https://cmtv.xmay.cc/api/registerInfo",
_0x20f926 = "{\"userId\":\"" + this.userId + "\"}";
await this.taskApi(_0x3c8847, _0x43fe4c, _0x27aa7e, _0x20f926).then(async _0x3bb44f => {
{
if (_0x3bb44f?.["id"]) console.log("账号[" + this.index + "] 签到成功,获得" + _0x3bb44f.cmb + "草莓币,当前草莓币:" + (this.points + _0x3bb44f.cmb));else {
console.log("账号[" + this.index + "] 签到失败");
}
}
});
} catch (_0xe65438) {
console.log(_0xe65438);
} finally {
return Promise.resolve(1);
}
}
async ["doTask"]() {
try {
console.log("\n============= 账号[" + this.index + "] 开始签到=============");
(await this.GetUserTask()) && (await this.SignInDaily());
} catch (_0x208f28) {
console.log(_0x208f28);
}
}
}
!(async () => {
if (typeof $request !== "undefined") await GetRewrite();else {
if (!(await checkEnv())) return;
console.log("\n================ 开始执行 ================");
for (let _0x13b5ec of initedJobForTokens) {
console.log("----------- 执行 第 [" + _0x13b5ec.index + "] 个账号 -----------");
await _0x13b5ec.LoginIn();
}
let _0x183d17 = initedJobForTokens.filter(_0x57aa60 => _0x57aa60.valid);
if (_0x183d17.length > 0) {
{
console.log("\n================ 任务队列构建完毕 ================");
for (let _0x50ca01 of _0x183d17) {
console.log("----------- 账号[" + _0x50ca01.index + "] -----------");
await _0x50ca01.doTask();
}
}
} else {
console.log("\n====幻生提示:无可用账号,请检查配置============ 任务结束 ================");
}
await $.showmsg();
}
})().catch(_0x337032 => console.log(_0x337032)).finally(() => $.done());
async function GetRewrite() {}
async function checkEnv() {
if (authorizationToken) {
let _0x1a5c2c = envSplitor[0];
for (let _0x3bab5c of envSplitor) {
if (authorizationToken.indexOf(_0x3bab5c) > -1) {
_0x1a5c2c = _0x3bab5c;
break;
}
}
for (let _0x2df51d of authorizationToken.split(_0x1a5c2c)) {
{
if (_0x2df51d) initedJobForTokens.push(new JobTask(_0x2df51d));
}
}
userCount = initedJobForTokens.length;
} else {
console.log("未找到 配置信息,请检查是否配置 变量:", envParams);
return;
}
console.log("共找到" + userCount + "个账号");
return true;
}
async function httpRequest(_0xc08f76, _0x506aa0) {
httpErr = null;
httpReq = null;
httpResp = null;
return new Promise(_0x31994f => {
$.send(_0xc08f76, _0x506aa0, async (_0x22f513, _0x1d7338, _0x2845eb) => {
httpErr = _0x22f513;
httpReq = _0x1d7338;
httpResp = _0x2845eb;
_0x31994f({
"err": _0x22f513,
"req": _0x1d7338,
"resp": _0x2845eb
});
});
});
}
function Env(_0x513ce9, _0x3f5b80) {
"undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
return new class {
constructor(_0xe1e102, _0x737bae) {
this.name = _0xe1e102;
this.notifyStr = "";
this.startTime = new Date().getTime();
Object.assign(this, _0x737bae);
console.log(this.name + " 开始运行:\n");
}
["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;
}
["getdata"](_0x4af141) {
let _0xf083dc = this.getval(_0x4af141);
if (/^@/.test(_0x4af141)) {
const [, _0x40f7e0, _0x1886d5] = /^@(.*?)\.(.*?)$/.exec(_0x4af141),
_0x13b49e = _0x40f7e0 ? this.getval(_0x40f7e0) : "";
if (_0x13b49e) try {
const _0x3fbd1c = JSON.parse(_0x13b49e);
_0xf083dc = _0x3fbd1c ? this.lodash_get(_0x3fbd1c, _0x1886d5, "") : _0xf083dc;
} catch (_0x35b1b7) {
_0xf083dc = "";
}
}
return _0xf083dc;
}
["setdata"](_0x28bfb3, _0x322236) {
let _0x1d16d8 = false;
if (/^@/.test(_0x322236)) {
{
const [, _0x1d300b, _0x4d0d99] = /^@(.*?)\.(.*?)$/.exec(_0x322236),
_0x201be5 = this.getval(_0x1d300b),
_0x549465 = _0x1d300b ? "null" === _0x201be5 ? null : _0x201be5 || "{}" : "{}";
try {
const _0x76924e = JSON.parse(_0x549465);
this.lodash_set(_0x76924e, _0x4d0d99, _0x28bfb3);
_0x1d16d8 = this.setval(JSON.stringify(_0x76924e), _0x1d300b);
} catch (_0x463f8b) {
const _0x4c1fab = {};
this.lodash_set(_0x4c1fab, _0x4d0d99, _0x28bfb3);
_0x1d16d8 = this.setval(JSON.stringify(_0x4c1fab), _0x1d300b);
}
}
} else {
_0x1d16d8 = this.setval(_0x28bfb3, _0x322236);
}
return _0x1d16d8;
}
["getval"](_0x57c252) {
return this.isSurge() || this.isLoon() ? $persistentStore.read(_0x57c252) : this.isQuanX() ? $prefs.valueForKey(_0x57c252) : this.isNode() ? (this.data = this.loaddata(), this.data[_0x57c252]) : this.data && this.data[_0x57c252] || null;
}
["setval"](_0x134051, _0x4faa57) {
return this.isSurge() || this.isLoon() ? $persistentStore.write(_0x134051, _0x4faa57) : this.isQuanX() ? $prefs.setValueForKey(_0x134051, _0x4faa57) : this.isNode() ? (this.data = this.loaddata(), this.data[_0x4faa57] = _0x134051, this.writedata(), true) : this.data && this.data[_0x4faa57] || null;
}
["send"](_0x1c870b, _0x5a3c06, _0x42ea8e = () => {}) {
{
if (_0x1c870b != "get" && _0x1c870b != "post" && _0x1c870b != "put" && _0x1c870b != "delete") {
console.log("无效的http方法" + _0x1c870b);
return;
}
if (_0x1c870b == "get" && _0x5a3c06.headers) delete _0x5a3c06.headers["Content-Type"], delete _0x5a3c06.headers["Content-Length"];else {
if (_0x5a3c06.body && _0x5a3c06.headers) {
{
if (!_0x5a3c06.headers["Content-Type"]) _0x5a3c06.headers["Content-Type"] = "application/x-www-form-urlencoded";
}
}
}
if (this.isSurge() || this.isLoon()) {
this.isSurge() && this.isNeedRewrite && (_0x5a3c06.headers = _0x5a3c06.headers || {}, Object.assign(_0x5a3c06.headers, {
"X-Surge-Skip-Scripting": false
}));
let _0x4a58cf = {
"method": _0x1c870b,
"url": _0x5a3c06.url,
"headers": _0x5a3c06.headers,
"timeout": _0x5a3c06.timeout,
"data": _0x5a3c06.body
};
if (_0x1c870b == "get") delete _0x4a58cf.data;
$axios(_0x4a58cf).then(_0x376e23 => {
{
const {
status: _0x2633d7,
request: _0x1ee9f,
headers: _0x5588d1,
data: _0x56dfa3
} = _0x376e23;
_0x42ea8e(null, _0x1ee9f, {
"statusCode": _0x2633d7,
"headers": _0x5588d1,
"body": _0x56dfa3
});
}
}).catch(_0x48f466 => console.log(_0x48f466));
} else {
if (this.isQuanX()) _0x5a3c06.method = _0x1c870b.toUpperCase(), this.isNeedRewrite && (_0x5a3c06.opts = _0x5a3c06.opts || {}, Object.assign(_0x5a3c06.opts, {
"hints": false
})), $task.fetch(_0x5a3c06).then(_0x24a32b => {
{
const {
statusCode: _0x2ce309,
request: _0x553dee,
headers: _0x47ad1d,
body: _0x1d51d4
} = _0x24a32b;
_0x42ea8e(null, _0x553dee, {
"statusCode": _0x2ce309,
"headers": _0x47ad1d,
"body": _0x1d51d4
});
}
}, _0x2b68b9 => _0x42ea8e(_0x2b68b9));else {
if (this.isNode()) {
{
this.got = this.got ? this.got : require("got");
const {
url: _0x535b9e,
..._0x16a812
} = _0x5a3c06;
this.instance = this.got.extend({
"followRedirect": false
});
this.instance[_0x1c870b](_0x535b9e, _0x16a812).then(_0x1b5a14 => {
{
const {
statusCode: _0x2b7984,
request: _0x24596f,
headers: _0x17cbfd,
body: _0x18ca69
} = _0x1b5a14;
_0x42ea8e(null, _0x24596f, {
"statusCode": _0x2b7984,
"headers": _0x17cbfd,
"body": _0x18ca69
});
}
}, _0x56154e => {
{
const {
message: _0x88f437,
request: _0x261d64,
response: _0x2cc23c
} = _0x56154e;
_0x42ea8e(_0x88f437, _0x261d64, _0x2cc23c);
}
});
}
}
}
}
}
}
["time"](_0x1b4234, _0x2e33d8 = null) {
let _0x13f44e = _0x2e33d8 ? new Date(_0x2e33d8) : new Date(),
_0xd1abb3 = {
"M+": _0x13f44e.getMonth() + 1,
"d+": _0x13f44e.getDate(),
"h+": _0x13f44e.getHours(),
"m+": _0x13f44e.getMinutes(),
"s+": _0x13f44e.getSeconds(),
"q+": Math.floor((_0x13f44e.getMonth() + 3) / 3),
"S": _0x13f44e.getMilliseconds()
};
/(y+)/.test(_0x1b4234) && (_0x1b4234 = _0x1b4234.replace(RegExp.$1, (_0x13f44e.getFullYear() + "").substr(4 - RegExp.$1.length)));
for (let _0x12593f in _0xd1abb3) new RegExp("(" + _0x12593f + ")").test(_0x1b4234) && (_0x1b4234 = _0x1b4234.replace(RegExp.$1, 1 == RegExp.$1.length ? _0xd1abb3[_0x12593f] : ("00" + _0xd1abb3[_0x12593f]).substr(("" + _0xd1abb3[_0x12593f]).length)));
return _0x1b4234;
}
async ["showmsg"]() {
if (!this.notifyStr) return;
let _0x44fa77 = this.name + " 运行通知\n\n" + this.notifyStr;
if ($.isNode()) {
var _0x2a2ac8 = require("./sendNotify");
console.log("\n============== 推送 ==============");
await _0x2a2ac8.sendNotify(this.name, _0x44fa77);
} else this.msg(_0x44fa77);
}
["logAndNotify"](_0x147484) {
console.log(_0x147484);
this.notifyStr += _0x147484;
this.notifyStr += "\n";
}
["logAndNotifyWithTime"](_0x445549) {
{
let _0xb8cb7b = "[" + this.time("hh:mm:ss.S") + "]" + _0x445549;
console.log(_0xb8cb7b);
this.notifyStr += _0xb8cb7b;
this.notifyStr += "\n";
}
}
["logWithTime"](_0x3ee709) {
console.log("[" + this.time("hh:mm:ss.S") + "]" + _0x3ee709);
}
["msg"](_0x2fbece = t, _0x54b688 = "", _0x3bcc34 = "", _0x224c9d) {
const _0x1a3f75 = _0x250b42 => {
{
if (!_0x250b42) return _0x250b42;
if ("string" == typeof _0x250b42) return this.isLoon() ? _0x250b42 : this.isQuanX() ? {
"open-url": _0x250b42
} : this.isSurge() ? {
"url": _0x250b42
} : undefined;
if ("object" == typeof _0x250b42) {
if (this.isLoon()) {
let _0x207cc8 = _0x250b42.openUrl || _0x250b42.url || _0x250b42["open-url"],
_0x5139ba = _0x250b42.mediaUrl || _0x250b42["media-url"];
return {
"openUrl": _0x207cc8,
"mediaUrl": _0x5139ba
};
}
if (this.isQuanX()) {
let _0x49efdc = _0x250b42["open-url"] || _0x250b42.url || _0x250b42.openUrl,
_0x3e3764 = _0x250b42["media-url"] || _0x250b42.mediaUrl;
return {
"open-url": _0x49efdc,
"media-url": _0x3e3764
};
}
if (this.isSurge()) {
let _0x260a6d = _0x250b42.url || _0x250b42.openUrl || _0x250b42["open-url"];
return {
"url": _0x260a6d
};
}
}
}
};
this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(_0x2fbece, _0x54b688, _0x3bcc34, _0x1a3f75(_0x224c9d)) : this.isQuanX() && $notify(_0x2fbece, _0x54b688, _0x3bcc34, _0x1a3f75(_0x224c9d)));
let _0x1ab4e9 = ["", "============== 系统通知 =============="];
_0x1ab4e9.push(_0x2fbece);
_0x54b688 && _0x1ab4e9.push(_0x54b688);
_0x3bcc34 && _0x1ab4e9.push(_0x3bcc34);
console.log(_0x1ab4e9.join("\n"));
}
["getMin"](_0x111e23, _0x5d49a3) {
return _0x111e23 < _0x5d49a3 ? _0x111e23 : _0x5d49a3;
}
["getMax"](_0x57a5cf, _0x4b6479) {
return _0x57a5cf < _0x4b6479 ? _0x4b6479 : _0x57a5cf;
}
["padStr"](_0x1330d0, _0x447e5a, _0x1ce3d8 = "0") {
let _0x74cf55 = String(_0x1330d0),
_0x475acb = _0x447e5a > _0x74cf55.length ? _0x447e5a - _0x74cf55.length : 0,
_0x5dc5de = "";
for (let _0x3735bb = 0; _0x3735bb < _0x475acb; _0x3735bb++) {
_0x5dc5de += _0x1ce3d8;
}
_0x5dc5de += _0x74cf55;
return _0x5dc5de;
}
["json2str"](_0x2e906e, _0x548b9d, _0x156871 = false) {
let _0x485825 = [];
for (let _0xafaf11 of Object.keys(_0x2e906e).sort()) {
let _0x593dc4 = _0x2e906e[_0xafaf11];
if (_0x593dc4 && _0x156871) _0x593dc4 = encodeURIComponent(_0x593dc4);
_0x485825.push(_0xafaf11 + "=" + _0x593dc4);
}
return _0x485825.join(_0x548b9d);
}
["str2json"](_0x55e93e, _0x170529 = false) {
{
let _0x806c53 = {};
for (let _0x5bc7b3 of _0x55e93e.split("&")) {
if (!_0x5bc7b3) continue;
let _0x2887cc = _0x5bc7b3.indexOf("=");
if (_0x2887cc == -1) continue;
let _0x4fc7f5 = _0x5bc7b3.substr(0, _0x2887cc),
_0x33ebe3 = _0x5bc7b3.substr(_0x2887cc + 1);
if (_0x170529) _0x33ebe3 = decodeURIComponent(_0x33ebe3);
_0x806c53[_0x4fc7f5] = _0x33ebe3;
}
return _0x806c53;
}
}
["randomString"](_0xc6b621, _0x555c1b = "abcdef0123456789") {
let _0x447945 = "";
for (let _0x5b26e3 = 0; _0x5b26e3 < _0xc6b621; _0x5b26e3++) {
_0x447945 += _0x555c1b.charAt(Math.floor(Math.random() * _0x555c1b.length));
}
return _0x447945;
}
["randomList"](_0x39e14e) {
{
let _0x30db5e = Math.floor(Math.random() * _0x39e14e.length);
return _0x39e14e[_0x30db5e];
}
}
["wait"](_0x39530a) {
return new Promise(_0x40404a => setTimeout(_0x40404a, _0x39530a));
}
["done"](_0x38e142 = {}) {
const _0x3168b5 = new Date().getTime(),
_0xd54e2e = (_0x3168b5 - this.startTime) / 1000;
console.log("\n" + this.name + " 运行结束,共运行了 " + _0xd54e2e + " 秒!");
if (this.isSurge() || this.isQuanX() || this.isLoon()) $done(_0x38e142);
}
}(_0x513ce9, _0x3f5b80);
}