mirror of
https://github.com/hex-ci/smzdm_script.git
synced 2026-10-29 03:35:16 +08:00
feat(smzdm): 🚀 更新 App 版本并优化请求签名与风控对抗
* 升级 `APP_VERSION` 至 `11.1.95`,并同步更新 `APP_VERSION_REV`。
* 引入服务器时间同步机制:通过 `SERVER_TIME_URL` 获取服务端时间,解决本地时间偏差导致的签名失效问题。
* 优化签名算法:改进 `signFormData` 的实现,确保参数排序与空格处理符合最新 App 逻辑。
* 增强风控对抗能力:
* 引入 `waitHuman` 模拟人类行为的等待机制,替换原有的固定 `wait`。
* 在任务执行逻辑中加入随机打乱(Shuffle)机制,降低行为模式特征。
* 增加对 WAF/风控拦截(如 403/429 错误或 HTML 验证码页)的识别与处理逻辑。
* 完善功能细节:
* 支持 `SMZDM_COMMENT` 环境变量配置多条文案(使用 `|` 分隔),实现随机评论以降低风险。
* 修复签到逻辑,支持 `CREATE_CENTER_VIEW` 和 `IS_INSTALL_ZHANGDAMA` 等新增参数。
* 优化任务列表获取,增加对 `is_install_zhangdama` 字段的支持。
* 文档更新:在 `README.md` 中补充了新增任务类型及环境变量的使用说明。
This commit is contained in:
@@ -6,7 +6,14 @@ cron: 20 14 * * *
|
||||
*/
|
||||
|
||||
const Env = require('./env');
|
||||
const { requestApi, removeTags, getEnvCookies, wait } = require('./bot');
|
||||
const {
|
||||
requestApi,
|
||||
removeTags,
|
||||
getEnvCookies,
|
||||
wait,
|
||||
waitHuman,
|
||||
IS_INSTALL_ZHANGDAMA
|
||||
} = require('./bot');
|
||||
const notify = require('./sendNotify');
|
||||
const { SmzdmTaskBot } = require('./library_task');
|
||||
|
||||
@@ -25,21 +32,21 @@ class SmzdmNormalTaskBot extends SmzdmTaskBot {
|
||||
|
||||
const { tasks } = await this.getTaskList();
|
||||
|
||||
await wait(5, 10);
|
||||
await waitHuman(5, 10);
|
||||
|
||||
let notifyMsg = '';
|
||||
|
||||
notifyMsg = await this.doTasks(tasks);
|
||||
|
||||
$.log('查询是否有限时累计活动阶段奖励');
|
||||
await wait(5, 15);
|
||||
await waitHuman(5, 15);
|
||||
|
||||
// 领取活动奖励
|
||||
const { detail } = await this.getTaskList();
|
||||
|
||||
if (detail.cell_data && detail.cell_data.activity_reward_status == '1') {
|
||||
$.log('有奖励,领取奖励');
|
||||
await wait(5, 15);
|
||||
await waitHuman(5, 15);
|
||||
|
||||
const { isSuccess } = await this.receiveActivity(detail.cell_data);
|
||||
|
||||
@@ -56,7 +63,10 @@ class SmzdmNormalTaskBot extends SmzdmTaskBot {
|
||||
async getTaskList() {
|
||||
const { isSuccess, data, response } = await requestApi('https://user-api.smzdm.com/task/list_v2', {
|
||||
method: 'post',
|
||||
headers: this.getHeaders()
|
||||
headers: this.getHeaders(),
|
||||
data: {
|
||||
is_install_zhangdama: IS_INSTALL_ZHANGDAMA
|
||||
}
|
||||
});
|
||||
|
||||
if (isSuccess) {
|
||||
|
||||
Reference in New Issue
Block a user