Compare commits

..

31 Commits

Author SHA1 Message Date
DLmaster
f45dc3a34c chore(utils): 修改代理优先级 2025-02-04 22:47:26 +08:00
DLmaster
1c17f3d878 Merge branch 'dev' 2025-02-04 22:36:34 +08:00
DLmaster
75e4d2b290 fix(utils): 修复更新器异常并覆盖版本 2025-02-04 22:34:17 +08:00
DLmaster
32fe941735 Merge branch 'dev' 2025-02-04 21:52:20 +08:00
DLmaster
27633b1017 Merge branch 'DLMS_dev' into dev 2025-02-04 18:56:27 +08:00
DLmaster
c34ca0dea9 fix(utils): 更新代理镜像 2025-02-04 18:56:09 +08:00
DLmaster
0574e9c6cb fix(gui): 调整部分选项文案 2025-02-04 18:48:58 +08:00
DLmaster
b7f09141f1 feat(core): 添加更新类别可选项 2025-02-04 18:27:19 +08:00
DLmaster
022e59e65c fix(gha): pr时不再自动发版 2025-02-04 15:56:21 +08:00
DLmaster
a0731331a8 fix(gui): 修复高级MAA配置序号错位;修复高级用户无法配置问题 2025-02-04 15:17:15 +08:00
DLmaster
4b01222648 Merge branch 'dev' into DLMS_dev 2025-02-04 14:16:07 +08:00
DLmaster
cae4b26c89 Merge branch 'dev' of https://github.com/DLmaster361/AUTO_MAA into dev 2025-02-04 14:08:27 +08:00
DLmaster
427c2332f5 chore: 补充版本信息 2025-02-04 14:08:13 +08:00
heziziziscool
6f0aec329b 新增代理成功消息推送渠道Server酱与企业微信群机器人推送 2025-02-04 14:07:45 +08:00
DLmaster
4e4d1d068f chore: 补充版本信息 2025-02-03 20:12:19 +08:00
DLmaster
074f4f2ca9 Merge branch 'hz_dev' into dev 2025-02-03 20:05:34 +08:00
heziziziscool
c51f9ad901 新增代理成功消息推送渠道Server酱与企业微信群机器人推送 2025-02-03 19:22:36 +08:00
heziziziscool
792452c048 Revert "revert 提交到main"
This reverts commit 662eb0bc7f.
2025-02-03 19:00:01 +08:00
heziziziscool
662eb0bc7f revert 提交到main 2025-02-03 18:57:40 +08:00
heziziziscool
94a9bdbb93 Revert "- 新增Server酱与企业微信群机器人推送代理成功渠道。"
This reverts commit df96183f42.
2025-02-03 18:54:09 +08:00
heziziziscool
df96183f42 - 新增Server酱与企业微信群机器人推送代理成功渠道。 2025-02-03 18:49:46 +08:00
DLmaster
a5b4f6f59f fix(gui): 修复主调度台运行时选项变动问题 2025-02-03 16:20:26 +08:00
DLmaster
6f7497cbe9 fix(utils): 修复更新器文件夹定位问题 2025-02-03 09:47:10 +08:00
DLmaster
dbdc2144b7 Merge branch 'dev' 2025-02-02 09:26:20 +08:00
DLmaster
e34106f857 Merge branch 'fix_inf_dev' into dev 2025-02-02 01:20:01 +08:00
DLmaster
c3c07804cd fix(core): 修复自定义基建无法正常使用的问题
feat(core): 添加用户每日代理次数上限功能
2025-02-02 01:19:46 +08:00
DLmaster
0b5ac6bb6e Merge branch 'dev' 2025-01-31 22:03:03 +08:00
DLmaster
ea87eefb9b doc: 修复部分图片位置 2025-01-31 22:02:51 +08:00
DLmaster
20dc4656dc Merge branch 'dev' 2025-01-31 21:52:57 +08:00
DLmaster
3f0f1612e3 doc: README同步至v4.2.2版本 2025-01-31 21:52:31 +08:00
DLmaster
e92b6ecfe6 fix(maa): 修正人工排查文案 2025-01-29 10:24:03 +08:00
16 changed files with 362 additions and 157 deletions

View File

@@ -26,11 +26,6 @@ on:
paths-ignore: paths-ignore:
- '**.md' - '**.md'
- 'LICENSE' - 'LICENSE'
pull_request:
branches: [ "main" ]
paths-ignore:
- '**.md'
- 'LICENSE'
permissions: permissions:
contents: read contents: read

View File

@@ -26,11 +26,6 @@ on:
paths-ignore: paths-ignore:
- '**.md' - '**.md'
- 'LICENSE' - 'LICENSE'
pull_request:
branches: [ "dev" ]
paths-ignore:
- '**.md'
- 'LICENSE'
permissions: permissions:
contents: read contents: read

View File

@@ -32,7 +32,8 @@ MAA多账号管理与自动化软件
### 优势 ### 优势
- **节省运行开销:** 只需要一份MAA软件与一个模拟器无需多开就能完成多账号代理羸弱的电脑也能代理日常。 - **节省运行开销:** 只需要一份MAA软件与一个模拟器无需多开就能完成多账号代理羸弱的电脑也能代理日常。
- **自定义空间大:** 依靠高级用户配置模式支持MAA几乎所有设置选项自定义同时保留对模拟器多开的支持 - **自定义空间大:** 依靠高级用户配置模式支持MAA几乎所有设置选项自定义支持模拟器多开。
- **调度方法自由:** 通过调度队列功能自由实现MAA多开等多种调度方式。
- **一键代理无忧:** 无须中途手动修改MAA配置将繁琐交给AUTO_MAA把游戏留给自己。 - **一键代理无忧:** 无须中途手动修改MAA配置将繁琐交给AUTO_MAA把游戏留给自己。
- **代理结果复核:** 通过人工排查功能核实各用户代理情况,堵住自动代理的最后一丝风险。 - **代理结果复核:** 通过人工排查功能核实各用户代理情况,堵住自动代理的最后一丝风险。
@@ -44,8 +45,7 @@ MAA多账号管理与自动化软件
- **使用:** AUTO_MAA使用者可以按自己的意愿自由使用本软件。依据GPL对于由此可能产生的损失AUTO_MAA项目组不负任何责任。 - **使用:** AUTO_MAA使用者可以按自己的意愿自由使用本软件。依据GPL对于由此可能产生的损失AUTO_MAA项目组不负任何责任。
- **分发:** AUTO_MAA允许任何人自由分发本软件包括进行商业活动牟利。若为直接分发本软件必须遵循GPL向接收者提供本软件项目地址、完整的软件源码与GPL协议原文若为修改软件后进行分发必须遵循GPL向接收者提供本软件项目地址、修改前的完整软件源码副本与GPL协议原文违反者可能会被追究法律责任。 - **分发:** AUTO_MAA允许任何人自由分发本软件包括进行商业活动牟利。若为直接分发本软件必须遵循GPL向接收者提供本软件项目地址、完整的软件源码与GPL协议原文若为修改软件后进行分发必须遵循GPL向接收者提供本软件项目地址、修改前的完整软件源码副本与GPL协议原文违反者可能会被追究法律责任。
- **传播:** AUTO_MAA原则上允许传播者自由传播本软件但无论在何种传播过程中不得删除项目作者与开发者所留版权声明不得隐瞒项目作者与相关开发者的存在。由于软件性质项目组不希望发现任何人在明日方舟官方媒体包括官方媒体账号与森空岛社区等或明日方舟游戏相关内容包括同好群、线下活动与游戏内容讨论等下提及AUTO_MAA或MAA希望各位理解。 - **传播:** AUTO_MAA原则上允许传播者自由传播本软件但无论在何种传播过程中不得删除项目作者与开发者所留版权声明不得隐瞒项目作者与相关开发者的存在。由于软件性质项目组不希望发现任何人在明日方舟官方媒体包括官方媒体账号与森空岛社区等或明日方舟游戏相关内容包括同好群、线下活动与游戏内容讨论等下提及AUTO_MAA或MAA希望各位理解。
- **衍生:** AUTO_MAA允许任何人对软件本体或软件部分代码进行二次开发或利用。但依据GPL相关成果也必须使用GPL开源。 - **衍生:** AUTO_MAA允许任何人对软件本体或软件部分代码进行二次开发或利用。但依据GPL相关成果再次分发时也必须使用GPL或兼容的协议开源。
- **授权:** 如果希望在使用AUTO_MAA的相关成果后仍保持自己的项目闭源请在Issues中说明来意。得到项目组认可后我们可以提供另一份使用不同协议的代码此协议主要内容如下被授权者可以自由使用该代码并维持闭源被授权者必须定期为AUTO_MAA作出贡献。
- **贡献:** 不论是直接参与软件的维护编写或是撰写文档、测试、反馈BUG、给出建议、参与讨论都为AUTO_MAA项目的发展完善做出了不可忽视的贡献。项目组提倡各位贡献者遵照GitHub开源社区惯例发布Issues参与项目。避免私信或私发邮件安全性漏洞或敏感问题除外以帮助更多用户。 - **贡献:** 不论是直接参与软件的维护编写或是撰写文档、测试、反馈BUG、给出建议、参与讨论都为AUTO_MAA项目的发展完善做出了不可忽视的贡献。项目组提倡各位贡献者遵照GitHub开源社区惯例发布Issues参与项目。避免私信或私发邮件安全性漏洞或敏感问题除外以帮助更多用户。
以上细则是本项目对GPL的相关补充与强调。未提及的以GPL为准发生冲突的以本细则为准。如有不清楚的部分请发Issues询问。若发生纠纷相关内容也没有在Issues上提及的项目组拥有最终解释权。 以上细则是本项目对GPL的相关补充与强调。未提及的以GPL为准发生冲突的以本细则为准。如有不清楚的部分请发Issues询问。若发生纠纷相关内容也没有在Issues上提及的项目组拥有最终解释权。
@@ -67,13 +67,11 @@ MAA多账号管理与自动化软件
### 下载MAA ### 下载MAA
- 什么是MAA [官网](https://maa.plus/)/[GitHub](https://github.com/MaaAssistantArknights/MaaAssistantArknights) - 什么是MAA [官网](https://maa.plus/)/[GitHub](https://github.com/MaaAssistantArknights/MaaAssistantArknights)
- MAA下载地址 [GitHub下载](https://github.com/MaaAssistantArknights/MaaAssistantArknights/releases) - MAA下载地址 [GitHub下载](https://github.com/MaaAssistantArknights/MaaAssistantArknights/releases)
### 安装MAA ### 安装MAA
- 将MAA压缩包解压至任意普通文件夹即可。 - 将MAA压缩包解压至任意普通文件夹即可。
- 若为首次安装MAA请双击`MAA.exe`启动MAA程序以生成MAA配置文件。 - 若为首次安装MAA请双击`MAA.exe`启动MAA程序以生成MAA配置文件。
### 下载AUTO_MAA [![](https://img.shields.io/github/downloads/DLmaster361/AUTO_MAA/total?color=66ccff)](https://github.com/DLmaster361/AUTO_MAA/releases) ### 下载AUTO_MAA [![](https://img.shields.io/github/downloads/DLmaster361/AUTO_MAA/total?color=66ccff)](https://github.com/DLmaster361/AUTO_MAA/releases)
@@ -95,58 +93,46 @@ MAA多账号管理与自动化软件
首次启动时会要求设置管理密钥。 首次启动时会要求设置管理密钥。
管理密钥是解密用户密码的唯一凭证,与数据库绑定。 管理密钥是解密用户密码的唯一凭证,与用户数据库绑定。
密钥丢失或data/key/目录下任一文件损坏都将导致解密无法正常进行。 密钥丢失或data/key/目录下任一文件损坏都将导致解密无法正常进行。
本项目采用自主开发的混合加密模式项目组也无法找回您的管理密钥或修复data/key/目录下的文件。 本项目采用自主开发的混合加密模式项目组也无法找回您的管理密钥或修复data/key/目录下的文件。
如果不幸的事发生建议您删除data/key/目录与data/data.db文件后重新录入信息。 如果不幸的事发生建议您删除data/key目录与config目录后重新录入信息。
``` ```
### 配置信息 ### 配置信息
#### 设置MAA #### 设置脚本实例
1. 通过`浏览`绑定MAA后单击`设置MAA`进行MAA全局设置 1. 单击`+`并选择`MAA`以添加MAA脚本实例
2.`MAA目录`选项卡中通过`选择文件夹`打开MAA软件目录以绑定MAA。
2. 在打开的MAA界面完成`性能设置``游戏设置``连接设置``启动设置``界面设置``软件更新`等基本配置以及代理任务的详细配置。 3. `MAA全局配置`选项卡中通过`设置`进行MAA全局设置。在打开的MAA界面完成`性能设置``游戏设置``连接设置``启动设置``界面设置``软件更新`等基本配置以及代理任务的详细配置。
4. 完成基本配置后关闭MAA页面AUTO_MAA会自动保存您的配置。
3. 完成基本配置后关闭MAA页面AUTO_MAA会自动保存您的配置。
- 注意在MAA的设置过程中若MAA要求`立刻重启应用更改`,请选择`稍后`。否则MAA重启后的一切更改都不会被程序记录。 - 注意在MAA的设置过程中若MAA要求`立刻重启应用更改`,请选择`稍后`。否则MAA重启后的一切更改都不会被程序记录。
- 特别的,您需要确保自己: - 特别的,在设置MAA过程中您需要确保自己:
-`切换配置`选项卡中选择了`Default`项。
- 取消勾选`开机自启动MAA` - 取消勾选`开机自启动MAA`
- 配置自己模拟器所在的位置并根据实际情况填写`等待模拟器启动时间`建议预留10s以防意外 - 配置自己模拟器所在的位置并根据实际情况填写`等待模拟器启动时间`建议预留10s以防意外
- 如果是模拟器多开用户,还需要填写`附加命令`,具体填写值参见多开模拟器对应快捷方式路径(如`-v 1`)。 - 如果是模拟器多开用户,还需要填写`附加命令`,具体填写值参见多开模拟器对应快捷方式路径(如`-v 1`)。
![MAA配置](https://github.com/DLmaster361/AUTO_MAA/blob/main/resources/images/README/MAA配置.png "MAA配置") ![MAA配置](https://github.com/DLmaster361/AUTO_MAA/blob/main/resources/images/README/MAA配置.png "MAA配置")
#### 设置AUTO_MAA
本项目已基本完成GUI开发您可以直接在设置页配置AUTO_MAA相关信息页面简介如下
- `MAA路径`该项无法直接编辑仅用于展示当前程序所绑定MAA的路径。
- `浏览`选择MAA文件夹。
- `设置MAA`编辑MAA全局配置具体使用方法参见前文。
- `日常限制`执行自动代理的日常部分时的超时阈值当MAA日志无变化时间超过阈值时视为超时。
- `剿灭限制`执行自动代理的剿灭部分时的超时阈值当MAA日志无变化时间超过阈值时视为超时。
- `运行失败重试次数上限`:对于每一用户,若超过该次数限制仍未完成代理,视为代理失败。
- `开机自动启动AUTO_MAA`实现AUTO_MAA的自启动。
- `AUTO_MAA启动时禁止电脑休眠`:仅阻止电脑自动休眠,不会影响屏幕是否熄灭。
- `启动AUTO_MAA后直接代理`在AUTO_MAA启动后立即执行代理任务。
- `通过邮件通知结果`在AUTO_MAA完成任务后将结果发送至用户指定邮箱。
- `检查版本更新`从GitHub镜像源获取版本更新信息并调起更新器完成程序更新更新器已支持多个代理地址。
- `修改管理密钥`:修改管理密钥,当用户列表中无用户时,将跳过验证旧管理密钥。
#### 设置用户配置 #### 设置用户配置
本项目已基本完成GUI开发您可以直接在用户管理页配置用户相关信息,页面简介如下: 每一个脚本实例都有独立的用户数据库,您可以直接在`用户列表`选项卡配置用户相关信息,页面简介如下:
- `新建``删除`:新建一个用户到当前用户配置列表、删除当前所选第一行所对应的用户。 - `新建用户``删除用户`:新建一个用户到当前用户配置列表、删除当前所选第一行所对应的用户。
- `转为高级/简洁`:将当前所选第一行所对应的用户转为高级/简洁配置模式 - `向上移动``向下移动`:移动用户位置,用户位置即代理顺序
- `模式转换`:将当前所选第一行所对应的用户转为高级/简洁配置模式。
- `用户选项配置`:选择用户与对应配置项目,执行对应配置流程。
- `自定义基建`:选择自定义基建配置文件。
- `日常``剿灭`打开MAA界面进行设置设置方法与MAA全局配置相同。
- `显示密码`:输入管理密钥以显示用户密码,仅当管理密钥正确时能够修改`密码栏目` - `显示密码`:输入管理密钥以显示用户密码,仅当管理密钥正确时能够修改`密码栏目`
- `刷新`:清除临时保存的管理密钥。
- `简洁用户配置列表`仅支持核心代理选项的设置其它设置选项沿用MAA的全局设置部分代理核心功能选项由程序托管。 - `简洁用户配置列表`仅支持核心代理选项的设置其它设置选项沿用MAA的全局设置部分代理核心功能选项由程序托管。
- `高级用户配置列表`:支持几乎所有代理选项的设置,通过`修改配置`进行MAA自定义仅部分代理核心功能选项由程序托管。 - `高级用户配置列表`:支持几乎所有代理选项的设置,通过`用户选项配置`进行MAA自定义仅部分代理核心功能选项由程序托管。
- `用户配置列表栏目`详解如下: - `用户配置列表栏目`详解如下:
- `用户名`:展示在执行界面的用户名,用于区分不同用户。 - `用户名`:展示在执行界面的用户名,用于区分不同用户。
- `账号ID`MAA进行账号切换所需的凭据官服用户请输入手机号码、B服请输入B站ID。 - `账号ID`MAA进行账号切换所需的凭据官服用户请输入手机号码、B服请输入B站ID。
- `服务器`当前支持官服、B服。 - `服务器`当前支持官服、B服。
@@ -167,42 +153,45 @@ MAA多账号管理与自动化软件
![gameid](https://github.com/DLmaster361/AUTO_MAA/blob/main/resources/images/README/gameid.png "gameid") ![gameid](https://github.com/DLmaster361/AUTO_MAA/blob/main/resources/images/README/gameid.png "gameid")
#### 设置调度队列
- 单个调度队列可包含至多10个定时与至多10个任务实例。
- 调度队列状态为关闭时,将不会定时启动该调度队列,但仍能在主调度台直接运行该调度队列。
- 同一调度队列内任务实例被依次挨个调起运行,非同一调度队列内的不同任务实例可被同时调起。
- 同一时间内,任何脚本实例或调度队列都不会被重复调起,若某一任务运行时发现同一任务已在运行,将自动跳过。
#### 设置AUTO_MAA
- 详见软件中对应选项卡的注解。
## 运行代理任务 ## 运行代理任务
### 直接运行 ### 直接运行
-执行页单击`立即执行`直接运行 -`调度中心``主调度台`选择对应任务与`自动代理`模式,单击`开始任务`即可开始代理
### 定时运行 ### 定时运行
- 在执行页的`定时执行`栏设置时间。 - 将调度队列状态设为开启,并在`定时`选项卡设置定时启动时间。
- 保持软件开启,软件会在设定的时间自动运行。
- 保持软件打开,软件会在设定的时间自动运行。
## 人工排查代理结果 ## 人工排查代理结果
### 直接开始人工排查 ### 直接开始人工排查
-执行页单击`开始排查`启动排查进程 -`调度中心``主调度台`选择对应任务与`人工排查`模式,单击`开始任务`即可开始人工排查
- 软件将调起MAA依次登录各用户的账号。 - 软件将调起MAA依次登录各用户的账号。
- 完成PRTS登录后请人工检查代理情况可以手动完成未代理的任务。 - 完成PRTS登录后请人工检查代理情况可以手动完成未代理的任务。
- 在对话框中单击对应账号的代理情况。 - 在对话框中单击对应账号的代理情况。
- 结束人工排查后,相应排查情况将被写入用户管理页的`备注栏目` - 结束人工排查后,相应排查情况将被写入用户管理页的`备注栏目`
--- ---
# 关于 # 关于
## 未来开发方向 ## 项目开发情况
- [ ] 尝试接入更多开源社区成果 可在[《AUTO_MAA开发者协作文档》](https://docs.qq.com/aio/DQ3Z5eHNxdmxFQmZX)的`开发任务`页面中查看开发进度。
- [ ] 支持对MAA运行状况的进一步识别
- [x] 添加更多通知手段
- [ ] GUI界面美化
## 贡献者 ## 贡献者
@@ -224,7 +213,7 @@ MAA多账号管理与自动化软件
欢迎加入AUTO_MAA项目组欢迎反馈bug 欢迎加入AUTO_MAA项目组欢迎反馈bug
- QQ群[957750551](https://qm.qq.com/cgi-bin/qm/qr?k=EET-OL_o52KPlDLEmbzaNkKUXuyQ4WZY&jump_from=webapi&authKey=6NxGwEu9JAOLHqfdEmNfrZy4tUvC/3ar2j5+Go7Hgf3j+ntAK1VS6SUOLOjYVKTt) - QQ群[957750551](https://qm.qq.com/q/bd9fISNoME)
--- ---

View File

@@ -39,6 +39,8 @@ from qfluentwidgets import (
FolderValidator, FolderValidator,
BoolValidator, BoolValidator,
RangeValidator, RangeValidator,
OptionsValidator,
qconfig,
) )
@@ -125,6 +127,15 @@ class AppConfig:
self.queue_config = QueueConfig() self.queue_config = QueueConfig()
self.maa_config = MaaConfig() self.maa_config = MaaConfig()
config_list = self.search_config()
for config in config_list:
if config[0] == "Maa":
qconfig.load(config[1], self.maa_config)
self.maa_config.save()
elif config[0] == "Queue":
qconfig.load(config[1], self.queue_config)
self.queue_config.save()
logger.info("配置类初始化完成") logger.info("配置类初始化完成")
def init_database(self, mode: str) -> None: def init_database(self, mode: str) -> None:
@@ -378,6 +389,22 @@ class AppConfig:
db.close() db.close()
logger.info("数据文件版本更新完成") logger.info("数据文件版本更新完成")
def search_config(self) -> list:
"""搜索所有子配置文件"""
config_list = []
if (self.app_path / "config/MaaConfig").exists():
for subdir in (self.app_path / "config/MaaConfig").iterdir():
if subdir.is_dir():
config_list.append(["Maa", subdir / "config.json"])
if (self.app_path / "config/QueueConfig").exists():
for json_file in (self.app_path / "config/QueueConfig").glob("*.json"):
config_list.append(["Queue", json_file])
return config_list
def open_database(self, mode: str, index: str = None) -> None: def open_database(self, mode: str, index: str = None) -> None:
"""打开数据库""" """打开数据库"""
@@ -459,6 +486,7 @@ class AppConfig:
self.maa_config.set(self.maa_config.MaaSet_Name, "") self.maa_config.set(self.maa_config.MaaSet_Name, "")
self.maa_config.set(self.maa_config.MaaSet_Path, ".") self.maa_config.set(self.maa_config.MaaSet_Path, ".")
self.maa_config.set(self.maa_config.RunSet_ProxyTimesLimit, 0)
self.maa_config.set(self.maa_config.RunSet_AnnihilationTimeLimit, 40) self.maa_config.set(self.maa_config.RunSet_AnnihilationTimeLimit, 40)
self.maa_config.set(self.maa_config.RunSet_RoutineTimeLimit, 10) self.maa_config.set(self.maa_config.RunSet_RoutineTimeLimit, 10)
self.maa_config.set(self.maa_config.RunSet_RunTimesLimit, 3) self.maa_config.set(self.maa_config.RunSet_RunTimesLimit, 3)
@@ -529,8 +557,21 @@ class GlobalConfig(QConfig):
"Notify", "IfSendErrorOnly", False, BoolValidator() "Notify", "IfSendErrorOnly", False, BoolValidator()
) )
notify_MailAddress = ConfigItem("Notify", "MailAddress", "") notify_MailAddress = ConfigItem("Notify", "MailAddress", "")
notify_IfServerChan = ConfigItem("Notify", "IfServerChan", False, BoolValidator())
notify_ServerChanKey = ConfigItem("Notify", "ServerChanKey", "")
notify_ServerChanChannel = ConfigItem("Notify", "ServerChanChannel", "")
notify_ServerChanTag = ConfigItem("Notify", "ServerChanTag", "")
notify_IfCompanyWebHookBot = ConfigItem(
"Notify", "IfCompanyWebHookBot", False, BoolValidator()
)
notify_CompanyWebHookBotUrl = ConfigItem("Notify", "CompanyWebHookBotUrl", "")
notify_IfPushDeer = ConfigItem("Notify", "IfPushDeer", False, BoolValidator())
notify_IfPushDeerKey = ConfigItem("Notify", "PushDeerKey", "")
update_IfAutoUpdate = ConfigItem("Update", "IfAutoUpdate", False, BoolValidator()) update_IfAutoUpdate = ConfigItem("Update", "IfAutoUpdate", False, BoolValidator())
update_UpdateType = OptionsConfigItem(
"Update", "UpdateType", "main", OptionsValidator(["main", "dev"])
)
class QueueConfig(QConfig): class QueueConfig(QConfig):
@@ -587,6 +628,9 @@ class MaaConfig(QConfig):
MaaSet_Name = ConfigItem("MaaSet", "Name", "") MaaSet_Name = ConfigItem("MaaSet", "Name", "")
MaaSet_Path = ConfigItem("MaaSet", "Path", ".", FolderValidator()) MaaSet_Path = ConfigItem("MaaSet", "Path", ".", FolderValidator())
RunSet_ProxyTimesLimit = RangeConfigItem(
"RunSet", "ProxyTimesLimit", 0, RangeValidator(0, 1024)
)
RunSet_AnnihilationTimeLimit = RangeConfigItem( RunSet_AnnihilationTimeLimit = RangeConfigItem(
"RunSet", "AnnihilationTimeLimit", 40, RangeValidator(1, 1024) "RunSet", "AnnihilationTimeLimit", 40, RangeValidator(1, 1024)
) )

View File

@@ -217,10 +217,10 @@ class TaskManager(QObject):
lambda logs: self.remove_task(name, logs) lambda logs: self.remove_task(name, logs)
) )
if "窗口" in mode: if "调度台" in mode:
self.create_gui.emit(self.task_list[name]) self.create_gui.emit(self.task_list[name])
elif "窗口" in mode: elif "调度台" in mode:
self.connect_gui.emit(self.task_list[name]) self.connect_gui.emit(self.task_list[name])
self.task_list[name].start() self.task_list[name].start()

View File

@@ -81,7 +81,7 @@ class MainTimer(QWidget):
): ):
logger.info(f"定时任务:{name}") logger.info(f"定时任务:{name}")
Task_manager.add_task("自动代理_新窗口", name, info) Task_manager.add_task("自动代理_新调度台", name, info)
def set_silence(self): def set_silence(self):
"""设置静默模式""" """设置静默模式"""

View File

@@ -113,13 +113,15 @@ class MaaManager(QObject):
return None return None
# 整理用户数据,筛选需代理的用户 # 整理用户数据,筛选需代理的用户
self.data = sorted(self.data, key=lambda x: (-len(x[15]), x[16])) if "设置MAA" not in self.mode:
user_list: List[List[str, str, int]] = [
[_[0], "等待", index] self.data = sorted(self.data, key=lambda x: (-len(x[15]), x[16]))
for index, _ in enumerate(self.data) user_list: List[List[str, str, int]] = [
if (_[3] != 0 and _[4] == "y") [_[0], "等待", index]
] for index, _ in enumerate(self.data)
self.create_user_list.emit(user_list) if (_[3] != 0 and _[4] == "y")
]
self.create_user_list.emit(user_list)
# 自动代理模式 # 自动代理模式
if self.mode == "自动代理": if self.mode == "自动代理":
@@ -137,8 +139,16 @@ class MaaManager(QObject):
if self.isInterruptionRequested: if self.isInterruptionRequested:
break break
user[1] = "运行" if (
self.update_user_list.emit(user_list) self.set["RunSet"]["ProxyTimesLimit"] == 0
or self.data[user[2]][14] < self.set["RunSet"]["ProxyTimesLimit"]
):
user[1] = "运行"
self.update_user_list.emit(user_list)
else:
user[1] = "跳过"
self.update_user_list.emit(user_list)
continue
# 初始化代理情况记录和模式替换记录 # 初始化代理情况记录和模式替换记录
run_book = [False for _ in range(2)] run_book = [False for _ in range(2)]
@@ -400,7 +410,7 @@ class MaaManager(QObject):
if run_book[0] and not self.isInterruptionRequested: if run_book[0] and not self.isInterruptionRequested:
if self.push_question( if self.push_question(
"操作提示", "请检查用户代理情况,是否将该用户标记为异常" "操作提示", "请检查用户代理情况,该用户是否正确完成代理任务"
): ):
run_book[1] = True run_book[1] = True
@@ -520,6 +530,14 @@ class MaaManager(QObject):
f"{self.mode[:4]}任务报告", f"{self.mode[:4]}任务报告",
f"{end_log}\n\nAUTO_MAA 敬上\n\n我们根据您在 AUTO_MAA 中的设置发送了这封电子邮件,本邮件无需回复\n", f"{end_log}\n\nAUTO_MAA 敬上\n\n我们根据您在 AUTO_MAA 中的设置发送了这封电子邮件,本邮件无需回复\n",
) )
Notify.ServerChanPush(
f"{self.mode[:4]}任务报告",
f"{end_log}\n\nAUTO_MAA 敬上",
)
Notify.CompanyWebHookBotPush(
f"{self.mode[:4]}任务报告",
f"{end_log}AUTO_MAA 敬上",
)
self.accomplish.emit({"Time": begin_time, "History": end_log}) self.accomplish.emit({"Time": begin_time, "History": end_log})
@@ -851,7 +869,10 @@ class MaaManager(QObject):
] = "False" # 自定义基建配置文件只读 ] = "False" # 自定义基建配置文件只读
data["Configurations"]["Default"][ data["Configurations"]["Default"][
"Infrast.CustomInfrastFile" "Infrast.CustomInfrastFile"
] = f"{self.config_path}/simple/{self.data[index][16]}/infrastructure/infrastructure.json" # 自定义基建配置文件地址 ] = str(
self.config_path
/ f"simple/{self.data[index][16]}/infrastructure/infrastructure.json"
) # 自定义基建配置文件地址
# 人工排查配置 # 人工排查配置
elif "人工排查" in mode: elif "人工排查" in mode:

View File

@@ -24,13 +24,16 @@ AUTO_MAA通知服务
v4.2 v4.2
作者DLmaster_361 作者DLmaster_361
""" """
import requests
from loguru import logger
from plyer import notification from plyer import notification
import smtplib import smtplib
from email.mime.text import MIMEText from email.mime.text import MIMEText
from email.header import Header from email.header import Header
from email.utils import formataddr from email.utils import formataddr
from serverchan_sdk import sc_send
from app.core import Config from app.core import Config
@@ -96,5 +99,62 @@ class Notification:
finally: finally:
smtpObj.quit() smtpObj.quit()
def ServerChanPush(self, title, content):
"""使用Server酱推送通知"""
if Config.global_config.get(Config.global_config.notify_IfServerChan):
send_key = Config.global_config.get(Config.global_config.notify_ServerChanKey)
option = {}
is_valid = lambda s: s == "" or (s == '|'.join(s.split('|')) and (s.count('|') == 0 or all(s.split('|'))))
"""
is_valid => True, 如果启用的话需要正确设置Tag和Channel。
允许空的Tag和Channel即不启用但不允许例如a||b|a|ba|b|||||
"""
send_tag = Config.global_config.get(Config.global_config.notify_ServerChanTag)
send_channel = Config.global_config.get(Config.global_config.notify_ServerChanChannel)
if is_valid(send_tag):
option['tags'] = send_tag
else:
option['tags'] = ''
logger.warning('请正确设置Auto_MAA中ServerChan的Tag。')
if is_valid(send_channel):
option['channel'] = send_channel
else:
option['channel'] = ''
logger.warning('请正确设置Auto_MAA中ServerChan的Channel。')
response = sc_send(send_key, title, content, option)
if response["code"] == 0:
logger.info("Server酱推送通知成功")
return True
else:
logger.info("Server酱推送通知失败")
logger.error(response)
return f'使用Server酱推送通知时出错\n{response["data"]['error']}'
def CompanyWebHookBotPush(self, title, content):
"""使用企业微信群机器人推送通知"""
if Config.global_config.get(Config.global_config.notify_IfCompanyWebHookBot):
content = f'{title}\n{content}'
data = {
"msgtype": "text",
"text": {
"content": content
}
}
response = requests.post(
url=Config.global_config.get(Config.global_config.notify_CompanyWebHookBotUrl),
json=data
)
if response.json()["errcode"] == 0:
logger.info("企业微信群机器人推送通知成功")
return True
else:
logger.info("企业微信群机器人推送通知失败")
logger.error(response.json())
return f'使用企业微信群机器人推送通知时出错:\n{response.json()["errmsg"]}'
Notify = Notification() Notify = Notification()

View File

@@ -77,7 +77,6 @@ class DispatchCenter(QWidget):
onClick=self.update_top_bar, onClick=self.update_top_bar,
icon=FluentIcon.CAFE, icon=FluentIcon.CAFE,
) )
self.update_top_bar()
self.Layout.addWidget(self.pivot, 0, Qt.AlignHCenter) self.Layout.addWidget(self.pivot, 0, Qt.AlignHCenter)
self.Layout.addWidget(self.stackedWidget) self.Layout.addWidget(self.stackedWidget)
@@ -120,6 +119,12 @@ class DispatchCenter(QWidget):
def connect_main_board(self, task: Task) -> None: def connect_main_board(self, task: Task) -> None:
"""连接主调度台""" """连接主调度台"""
self.script_list["主调度台"].top_bar.Lable.setText(
f"{task.name} - {task.mode.replace("_主调度台","")}模式"
)
self.script_list["主调度台"].top_bar.Lable.show()
self.script_list["主调度台"].top_bar.object.hide()
self.script_list["主调度台"].top_bar.mode.hide()
self.script_list["主调度台"].top_bar.button.clicked.disconnect() self.script_list["主调度台"].top_bar.button.clicked.disconnect()
self.script_list["主调度台"].top_bar.button.setText("中止任务") self.script_list["主调度台"].top_bar.button.setText("中止任务")
self.script_list["主调度台"].top_bar.button.clicked.connect( self.script_list["主调度台"].top_bar.button.clicked.connect(
@@ -145,6 +150,9 @@ class DispatchCenter(QWidget):
def disconnect_main_board(self, name: str) -> None: def disconnect_main_board(self, name: str) -> None:
"""断开主调度台""" """断开主调度台"""
self.script_list["主调度台"].top_bar.Lable.hide()
self.script_list["主调度台"].top_bar.object.show()
self.script_list["主调度台"].top_bar.mode.show()
self.script_list["主调度台"].top_bar.button.clicked.disconnect() self.script_list["主调度台"].top_bar.button.clicked.disconnect()
self.script_list["主调度台"].top_bar.button.setText("开始任务") self.script_list["主调度台"].top_bar.button.setText("开始任务")
self.script_list["主调度台"].top_bar.button.clicked.connect( self.script_list["主调度台"].top_bar.button.clicked.connect(
@@ -170,6 +178,8 @@ class DispatchCenter(QWidget):
self.script_list["主调度台"].top_bar.object.clear() self.script_list["主调度台"].top_bar.object.clear()
self.script_list["主调度台"].top_bar.object.addItems(list) self.script_list["主调度台"].top_bar.object.addItems(list)
self.script_list["主调度台"].top_bar.object.setCurrentIndex(-1)
self.script_list["主调度台"].top_bar.mode.setCurrentIndex(-1)
class DispatchBox(QWidget): class DispatchBox(QWidget):
@@ -208,17 +218,18 @@ class DispatchBox(QWidget):
if name == "主调度台": if name == "主调度台":
self.Lable = SubtitleLabel("", self)
self.Lable.hide()
self.object = ComboBox() self.object = ComboBox()
self.object.setCurrentIndex(-1)
self.object.setPlaceholderText("请选择调度对象") self.object.setPlaceholderText("请选择调度对象")
self.mode = ComboBox() self.mode = ComboBox()
self.mode.addItems(["自动代理", "人工排查"]) self.mode.addItems(["自动代理", "人工排查"])
self.mode.setCurrentIndex(-1)
self.mode.setPlaceholderText("请选择调度模式") self.mode.setPlaceholderText("请选择调度模式")
self.button = PushButton("开始任务") self.button = PushButton("开始任务")
self.button.clicked.connect(self.start_task) self.button.clicked.connect(self.start_task)
Layout.addWidget(self.Lable)
Layout.addWidget(self.object) Layout.addWidget(self.object)
Layout.addWidget(self.mode) Layout.addWidget(self.mode)
Layout.addStretch(1) Layout.addStretch(1)
@@ -265,7 +276,7 @@ class DispatchBox(QWidget):
info = json.load(f) info = json.load(f)
logger.info(f"用户添加任务:{name}") logger.info(f"用户添加任务:{name}")
Task_manager.add_task(f"{self.mode.currentText()}_主窗口", name, info) Task_manager.add_task(f"{self.mode.currentText()}_主调度台", name, info)
elif self.object.currentText().split(" - ")[0] == "实例": elif self.object.currentText().split(" - ")[0] == "实例":
@@ -275,7 +286,7 @@ class DispatchBox(QWidget):
logger.info(f"用户添加任务:{name}") logger.info(f"用户添加任务:{name}")
Task_manager.add_task( Task_manager.add_task(
f"{self.mode.currentText()}_主窗口", "用户自定义队列", info f"{self.mode.currentText()}_主调度台", "用户自定义队列", info
) )
class DispatchInfoCard(HeaderCardWidget): class DispatchInfoCard(HeaderCardWidget):

View File

@@ -182,6 +182,7 @@ class AUTO_MAA(MSFluentWindow):
# 加载配置 # 加载配置
qconfig.load(Config.config_path, Config.global_config) qconfig.load(Config.config_path, Config.global_config)
Config.global_config.save()
# 检查密码 # 检查密码
self.setting.check_PASSWORD() self.setting.check_PASSWORD()

View File

@@ -578,6 +578,14 @@ class MaaSettingBox(QWidget):
widget = QWidget() widget = QWidget()
Layout = QVBoxLayout(widget) Layout = QVBoxLayout(widget)
self.ProxyTimesLimit = SpinBoxSettingCard(
(0, 1024),
FluentIcon.PAGE_RIGHT,
"用户单日代理次数上限",
"当用户本日代理成功次数超过该阈值时跳过代理阈值为“0”时视为无代理次数上限",
Config.maa_config.RunSet_ProxyTimesLimit,
)
self.AnnihilationTimeLimit = SpinBoxSettingCard( self.AnnihilationTimeLimit = SpinBoxSettingCard(
(1, 1024), (1, 1024),
FluentIcon.PAGE_RIGHT, FluentIcon.PAGE_RIGHT,
@@ -602,6 +610,7 @@ class MaaSettingBox(QWidget):
Config.maa_config.RunSet_RunTimesLimit, Config.maa_config.RunSet_RunTimesLimit,
) )
Layout.addWidget(self.ProxyTimesLimit)
Layout.addWidget(self.AnnihilationTimeLimit) Layout.addWidget(self.AnnihilationTimeLimit)
Layout.addWidget(self.RoutineTimeLimit) Layout.addWidget(self.RoutineTimeLimit)
Layout.addWidget(self.RunTimesLimit) Layout.addWidget(self.RunTimesLimit)
@@ -674,6 +683,7 @@ class MaaSettingBox(QWidget):
Config.cur.execute("SELECT * FROM adminx WHERE True") Config.cur.execute("SELECT * FROM adminx WHERE True")
data = Config.cur.fetchall() data = Config.cur.fetchall()
data = sorted(data, key=lambda x: (-len(x[15]), x[16]))
if self.user_list.pivot.currentRouteKey() == f"{self.name}_简洁用户列表": if self.user_list.pivot.currentRouteKey() == f"{self.name}_简洁用户列表":
@@ -707,7 +717,7 @@ class MaaSettingBox(QWidget):
shutil.copy( shutil.copy(
file_path, file_path,
Config.app_path Config.app_path
/ f"config/MaaConfig/{self.name}/simple/{choice.input[0].currentIndex()}/infrastructure", / f"config/MaaConfig/{self.name}/simple/{choice.input[0].currentIndex()}/infrastructure/infrastructure.json",
) )
else: else:
logger.warning("未选择自定义基建文件") logger.warning("未选择自定义基建文件")
@@ -867,6 +877,9 @@ class MaaSettingBox(QWidget):
self.user_list_simple.itemChanged.connect( self.user_list_simple.itemChanged.connect(
lambda item: self.change_user_Item(item, "simple") lambda item: self.change_user_Item(item, "simple")
) )
self.user_list_beta.itemChanged.connect(
lambda item: self.change_user_Item(item, "beta")
)
self.stackedWidget.addWidget(self.user_list_simple) self.stackedWidget.addWidget(self.user_list_simple)
self.pivot.addItem( self.pivot.addItem(
@@ -963,11 +976,9 @@ class MaaSettingBox(QWidget):
elif j == 5: elif j == 5:
curdate = server_date() curdate = server_date()
if curdate != value: if curdate != value:
item = QTableWidgetItem("今日未代理") item = QTableWidgetItem("未代理")
else: else:
item = QTableWidgetItem( item = QTableWidgetItem(f"已代理{data_simple[i][14]}")
f"今日已代理{data_simple[i][14]}"
)
item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled) item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
elif j == 12: elif j == 12:
if Config.PASSWORD == "": if Config.PASSWORD == "":
@@ -1032,11 +1043,9 @@ class MaaSettingBox(QWidget):
elif j == 5: elif j == 5:
curdate = server_date() curdate = server_date()
if curdate != value: if curdate != value:
item = QTableWidgetItem("今日未代理") item = QTableWidgetItem("未代理")
else: else:
item = QTableWidgetItem( item = QTableWidgetItem(f"已代理{data_beta[i][14]}")
f"今日已代理{data_beta[i][14]}"
)
item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled) item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
elif j == 12: elif j == 12:
if Config.PASSWORD == "": if Config.PASSWORD == "":
@@ -1348,6 +1357,10 @@ class MaaSettingBox(QWidget):
return None return None
if row == 0: if row == 0:
logger.warning("向上移动用户时已到达最上端")
MainInfoBar.push_info_bar(
"warning", "已经是第一个用户", "无法向上移动", 5000
)
return None return None
Config.cur.execute( Config.cur.execute(
@@ -1445,6 +1458,10 @@ class MaaSettingBox(QWidget):
return None return None
if row == current_numb - 1: if row == current_numb - 1:
logger.warning("向下移动用户时已到达最下端")
MainInfoBar.push_info_bar(
"warning", "已经是最后一个用户", "无法向下移动", 5000
)
return None return None
Config.cur.execute( Config.cur.execute(

View File

@@ -42,6 +42,7 @@ from qfluentwidgets import (
SwitchSettingCard, SwitchSettingCard,
ExpandGroupSettingCard, ExpandGroupSettingCard,
PushSettingCard, PushSettingCard,
ComboBoxSettingCard,
) )
from datetime import datetime from datetime import datetime
import json import json
@@ -207,7 +208,7 @@ class Setting(QWidget):
for _ in range(3): for _ in range(3):
try: try:
response = requests.get( response = requests.get(
"https://gitee.com/DLmaster_361/AUTO_MAA/raw/main/resources/version.json" f"https://gitee.com/DLmaster_361/AUTO_MAA/raw/{Config.global_config.get(Config.global_config.update_UpdateType)}/resources/version.json"
) )
version_remote = response.json() version_remote = response.json()
break break
@@ -249,7 +250,7 @@ class Setting(QWidget):
for _ in range(3): for _ in range(3):
try: try:
response = requests.get( response = requests.get(
"https://gitee.com/DLmaster_361/AUTO_MAA/raw/main/resources/version.json" f"https://gitee.com/DLmaster_361/AUTO_MAA/raw/{Config.global_config.get(Config.global_config.update_UpdateType)}/resources/version.json"
) )
version_remote = response.json() version_remote = response.json()
break break
@@ -390,24 +391,19 @@ class FunctionSettingCard(HeaderCardWidget):
def __init__(self, parent=None): def __init__(self, parent=None):
super().__init__(parent) super().__init__(parent)
self.setTitle("功能") self.setTitle("功能")
Layout = QVBoxLayout()
self.card_IfAllowSleep = SwitchSettingCard( self.card_IfAllowSleep = SwitchSettingCard(
icon=FluentIcon.PAGE_RIGHT, icon=FluentIcon.PAGE_RIGHT,
title="启动时阻止系统休眠", title="启动时阻止系统休眠",
content="仅阻止电脑自动休眠,不会影响屏幕是否熄灭", content="仅阻止电脑自动休眠,不会影响屏幕是否熄灭",
configItem=Config.global_config.function_IfAllowSleep, configItem=Config.global_config.function_IfAllowSleep,
) )
self.card_IfSilence = self.SilenceSettingCard(self) self.card_IfSilence = self.SilenceSettingCard(self)
# 添加各组到设置卡中 Layout = QVBoxLayout()
Layout.addWidget(self.card_IfAllowSleep) Layout.addWidget(self.card_IfAllowSleep)
Layout.addWidget(self.card_IfSilence) Layout.addWidget(self.card_IfSilence)
self.viewLayout.addLayout(Layout) self.viewLayout.addLayout(Layout)
class SilenceSettingCard(ExpandGroupSettingCard): class SilenceSettingCard(ExpandGroupSettingCard):
@@ -420,16 +416,12 @@ class FunctionSettingCard(HeaderCardWidget):
parent, parent,
) )
widget = QWidget()
Layout = QVBoxLayout(widget)
self.card_IfSilence = SwitchSettingCard( self.card_IfSilence = SwitchSettingCard(
icon=FluentIcon.PAGE_RIGHT, icon=FluentIcon.PAGE_RIGHT,
title="静默模式", title="静默模式",
content="是否启用静默模式", content="是否启用静默模式",
configItem=Config.global_config.function_IfSilence, configItem=Config.global_config.function_IfSilence,
) )
self.card_BossKey = LineEditSettingCard( self.card_BossKey = LineEditSettingCard(
text="请输入安卓模拟器老版键", text="请输入安卓模拟器老版键",
icon=FluentIcon.PAGE_RIGHT, icon=FluentIcon.PAGE_RIGHT,
@@ -438,13 +430,12 @@ class FunctionSettingCard(HeaderCardWidget):
configItem=Config.global_config.function_BossKey, configItem=Config.global_config.function_BossKey,
) )
widget = QWidget()
Layout = QVBoxLayout(widget)
Layout.addWidget(self.card_IfSilence) Layout.addWidget(self.card_IfSilence)
Layout.addWidget(self.card_BossKey) Layout.addWidget(self.card_BossKey)
# 调整内部布局
self.viewLayout.setContentsMargins(0, 0, 0, 0) self.viewLayout.setContentsMargins(0, 0, 0, 0)
self.viewLayout.setSpacing(0) self.viewLayout.setSpacing(0)
self.addGroupWidget(widget) self.addGroupWidget(widget)
@@ -452,18 +443,14 @@ class StartSettingCard(HeaderCardWidget):
def __init__(self, parent=None): def __init__(self, parent=None):
super().__init__(parent) super().__init__(parent)
self.setTitle("启动") self.setTitle("启动")
Layout = QVBoxLayout()
self.card_IfSelfStart = SwitchSettingCard( self.card_IfSelfStart = SwitchSettingCard(
icon=FluentIcon.PAGE_RIGHT, icon=FluentIcon.PAGE_RIGHT,
title="开机时自动启动", title="开机时自动启动",
content="将AUTO_MAA添加到开机启动项", content="将AUTO_MAA添加到开机启动项",
configItem=Config.global_config.start_IfSelfStart, configItem=Config.global_config.start_IfSelfStart,
) )
self.card_IfRunDirectly = SwitchSettingCard( self.card_IfRunDirectly = SwitchSettingCard(
icon=FluentIcon.PAGE_RIGHT, icon=FluentIcon.PAGE_RIGHT,
title="启动后直接运行", title="启动后直接运行",
@@ -471,12 +458,9 @@ class StartSettingCard(HeaderCardWidget):
configItem=Config.global_config.start_IfRunDirectly, configItem=Config.global_config.start_IfRunDirectly,
) )
# 添加各组到设置卡中 Layout = QVBoxLayout()
Layout.addWidget( Layout.addWidget(self.card_IfSelfStart)
self.card_IfSelfStart,
)
Layout.addWidget(self.card_IfRunDirectly) Layout.addWidget(self.card_IfRunDirectly)
self.viewLayout.addLayout(Layout) self.viewLayout.addLayout(Layout)
@@ -484,18 +468,14 @@ class UiSettingCard(HeaderCardWidget):
def __init__(self, parent=None): def __init__(self, parent=None):
super().__init__(parent) super().__init__(parent)
self.setTitle("界面") self.setTitle("界面")
Layout = QVBoxLayout()
self.card_IfShowTray = SwitchSettingCard( self.card_IfShowTray = SwitchSettingCard(
icon=FluentIcon.PAGE_RIGHT, icon=FluentIcon.PAGE_RIGHT,
title="显示托盘图标", title="显示托盘图标",
content="常态显示托盘图标", content="常态显示托盘图标",
configItem=Config.global_config.ui_IfShowTray, configItem=Config.global_config.ui_IfShowTray,
) )
self.card_IfToTray = SwitchSettingCard( self.card_IfToTray = SwitchSettingCard(
icon=FluentIcon.PAGE_RIGHT, icon=FluentIcon.PAGE_RIGHT,
title="最小化到托盘", title="最小化到托盘",
@@ -503,10 +483,9 @@ class UiSettingCard(HeaderCardWidget):
configItem=Config.global_config.ui_IfToTray, configItem=Config.global_config.ui_IfToTray,
) )
# 添加各组到设置卡中 Layout = QVBoxLayout()
Layout.addWidget(self.card_IfShowTray) Layout.addWidget(self.card_IfShowTray)
Layout.addWidget(self.card_IfToTray) Layout.addWidget(self.card_IfToTray)
self.viewLayout.addLayout(Layout) self.viewLayout.addLayout(Layout)
@@ -517,20 +496,28 @@ class NotifySettingCard(HeaderCardWidget):
self.setTitle("通知") self.setTitle("通知")
Layout = QVBoxLayout() self.card_IfSendErrorOnly = SwitchSettingCard(
icon=FluentIcon.PAGE_RIGHT,
title="仅推送异常信息",
content="仅在任务出现异常时推送通知",
configItem=Config.global_config.notify_IfSendErrorOnly,
)
self.card_IfPushPlyer = SwitchSettingCard( self.card_IfPushPlyer = SwitchSettingCard(
icon=FluentIcon.PAGE_RIGHT, icon=FluentIcon.PAGE_RIGHT,
title="推送系统通知", title="推送系统通知",
content="推送系统级通知,不会在通知中心停留", content="推送系统级通知,不会在通知中心停留",
configItem=Config.global_config.notify_IfPushPlyer, configItem=Config.global_config.notify_IfPushPlyer,
) )
self.card_SendMail = self.SendMailSettingCard(self) self.card_SendMail = self.SendMailSettingCard(self)
self.card_ServerChan = self.ServerChanSettingCard(self)
self.card_CompanyWebhookBot = self.CompanyWechatPushSettingCard(self)
Layout = QVBoxLayout()
Layout.addWidget(self.card_IfSendErrorOnly)
Layout.addWidget(self.card_IfPushPlyer) Layout.addWidget(self.card_IfPushPlyer)
Layout.addWidget(self.card_SendMail) Layout.addWidget(self.card_SendMail)
Layout.addWidget(self.card_ServerChan)
Layout.addWidget(self.card_CompanyWebhookBot)
self.viewLayout.addLayout(Layout) self.viewLayout.addLayout(Layout)
class SendMailSettingCard(ExpandGroupSettingCard): class SendMailSettingCard(ExpandGroupSettingCard):
@@ -543,17 +530,13 @@ class NotifySettingCard(HeaderCardWidget):
parent, parent,
) )
widget = QWidget()
Layout = QVBoxLayout(widget)
self.card_IfSendMail = SwitchSettingCard( self.card_IfSendMail = SwitchSettingCard(
icon=FluentIcon.PAGE_RIGHT, icon=FluentIcon.PAGE_RIGHT,
title="推送邮件通知", title="推送邮件通知",
content="是否启用邮件通知功能", content="是否启用邮件通知功能",
configItem=Config.global_config.notify_IfSendMail, configItem=Config.global_config.notify_IfSendMail,
) )
self.card_MailAddress = LineEditSettingCard(
self.MailAddress = LineEditSettingCard(
text="请输入邮箱地址", text="请输入邮箱地址",
icon=FluentIcon.PAGE_RIGHT, icon=FluentIcon.PAGE_RIGHT,
title="邮箱地址", title="邮箱地址",
@@ -561,21 +544,90 @@ class NotifySettingCard(HeaderCardWidget):
configItem=Config.global_config.notify_MailAddress, configItem=Config.global_config.notify_MailAddress,
) )
self.card_IfSendErrorOnly = SwitchSettingCard( widget = QWidget()
icon=FluentIcon.PAGE_RIGHT, Layout = QVBoxLayout(widget)
title="仅推送异常信息",
content="仅在任务出现异常时推送通知",
configItem=Config.global_config.notify_IfSendErrorOnly,
)
Layout.addWidget(self.card_IfSendMail) Layout.addWidget(self.card_IfSendMail)
Layout.addWidget(self.MailAddress) Layout.addWidget(self.card_MailAddress)
Layout.addWidget(self.card_IfSendErrorOnly)
# 调整内部布局
self.viewLayout.setContentsMargins(0, 0, 0, 0) self.viewLayout.setContentsMargins(0, 0, 0, 0)
self.viewLayout.setSpacing(0) self.viewLayout.setSpacing(0)
self.addGroupWidget(widget)
class ServerChanSettingCard(ExpandGroupSettingCard):
def __init__(self, parent=None):
super().__init__(
FluentIcon.SETTING,
"推送ServerChan通知",
"通过ServerChan通知推送任务结果",
parent,
)
self.card_IfServerChan = SwitchSettingCard(
icon=FluentIcon.PAGE_RIGHT,
title="推送SeverChan通知",
content="是否启用SeverChan通知功能",
configItem=Config.global_config.notify_IfServerChan,
)
self.card_ServerChanKey = LineEditSettingCard(
text="请输入SendKey",
icon=FluentIcon.PAGE_RIGHT,
title="SendKey",
content="Server酱的SendKeySC3与SCT都可以",
configItem=Config.global_config.notify_ServerChanKey,
)
self.card_ServerChanChannel = LineEditSettingCard(
text="请输入需要推送的Channel代码SCT生效",
icon=FluentIcon.PAGE_RIGHT,
title="ServerChanChannel代码",
content="可以留空,留空则默认。可以多个,请使用“|”隔开",
configItem=Config.global_config.notify_ServerChanChannel,
)
self.card_ServerChanTag = LineEditSettingCard(
text="请输入加入推送的TagSC3生效",
icon=FluentIcon.PAGE_RIGHT,
title="Tag内容",
content="可以留空,留空则默认。可以多个,请使用“|”隔开",
configItem=Config.global_config.notify_ServerChanTag,
)
widget = QWidget()
Layout = QVBoxLayout(widget)
Layout.addWidget(self.card_IfServerChan)
Layout.addWidget(self.card_ServerChanKey)
Layout.addWidget(self.card_ServerChanChannel)
Layout.addWidget(self.card_ServerChanTag)
self.viewLayout.setContentsMargins(0, 0, 0, 0)
self.viewLayout.setSpacing(0)
self.addGroupWidget(widget)
class CompanyWechatPushSettingCard(ExpandGroupSettingCard):
def __init__(self, parent=None):
super().__init__(
FluentIcon.SETTING,
"推送企业微信机器人通知",
"通过企业微信机器人Webhook通知推送任务结果",
parent,
)
self.card_IfCompanyWechat = SwitchSettingCard(
icon=FluentIcon.PAGE_RIGHT,
title="推送企业微信机器人通知",
content="是否启用企业微信机器人通知功能",
configItem=Config.global_config.notify_IfCompanyWebHookBot,
)
self.card_CompanyWebHookBotUrl = LineEditSettingCard(
text="请输入Webhook的Url",
icon=FluentIcon.PAGE_RIGHT,
title="WebhookUrl",
content="企业微信群机器人的Webhook地址",
configItem=Config.global_config.notify_CompanyWebHookBotUrl,
)
widget = QWidget()
Layout = QVBoxLayout(widget)
Layout.addWidget(self.card_IfCompanyWechat)
Layout.addWidget(self.card_CompanyWebHookBotUrl)
self.viewLayout.setContentsMargins(0, 0, 0, 0)
self.viewLayout.setSpacing(0)
self.addGroupWidget(widget) self.addGroupWidget(widget)
@@ -583,11 +635,8 @@ class SecuritySettingCard(HeaderCardWidget):
def __init__(self, parent=None): def __init__(self, parent=None):
super().__init__(parent) super().__init__(parent)
self.setTitle("安全") self.setTitle("安全")
Layout = QVBoxLayout()
self.card_changePASSWORD = PushSettingCard( self.card_changePASSWORD = PushSettingCard(
text="修改", text="修改",
icon=FluentIcon.VPN, icon=FluentIcon.VPN,
@@ -595,8 +644,8 @@ class SecuritySettingCard(HeaderCardWidget):
content="修改用于解密用户密码的管理密钥", content="修改用于解密用户密码的管理密钥",
) )
Layout = QVBoxLayout()
Layout.addWidget(self.card_changePASSWORD) Layout.addWidget(self.card_changePASSWORD)
self.viewLayout.addLayout(Layout) self.viewLayout.addLayout(Layout)
@@ -604,18 +653,21 @@ class UpdaterSettingCard(HeaderCardWidget):
def __init__(self, parent=None): def __init__(self, parent=None):
super().__init__(parent) super().__init__(parent)
self.setTitle("更新") self.setTitle("更新")
Layout = QVBoxLayout()
self.card_IfAutoUpdate = SwitchSettingCard( self.card_IfAutoUpdate = SwitchSettingCard(
icon=FluentIcon.PAGE_RIGHT, icon=FluentIcon.PAGE_RIGHT,
title="自动检查更新", title="自动检查更新",
content="将在启动时自动检查AUTO_MAA是否有新版本", content="将在启动时自动检查AUTO_MAA是否有新版本",
configItem=Config.global_config.update_IfAutoUpdate, configItem=Config.global_config.update_IfAutoUpdate,
) )
self.card_UpdateType = ComboBoxSettingCard(
configItem=Config.global_config.update_UpdateType,
icon=FluentIcon.PAGE_RIGHT,
title="版本更新类别",
content="选择AUTO_MAA的更新类别",
texts=["稳定版", "公测版"],
)
self.card_CheckUpdate = PushSettingCard( self.card_CheckUpdate = PushSettingCard(
text="检查更新", text="检查更新",
icon=FluentIcon.UPDATE, icon=FluentIcon.UPDATE,
@@ -623,9 +675,10 @@ class UpdaterSettingCard(HeaderCardWidget):
content="检查AUTO_MAA是否有新版本", content="检查AUTO_MAA是否有新版本",
) )
Layout = QVBoxLayout()
Layout.addWidget(self.card_IfAutoUpdate) Layout.addWidget(self.card_IfAutoUpdate)
Layout.addWidget(self.card_UpdateType)
Layout.addWidget(self.card_CheckUpdate) Layout.addWidget(self.card_CheckUpdate)
self.viewLayout.addLayout(Layout) self.viewLayout.addLayout(Layout)
@@ -633,7 +686,6 @@ class OtherSettingCard(HeaderCardWidget):
def __init__(self, parent=None): def __init__(self, parent=None):
super().__init__(parent) super().__init__(parent)
self.setTitle("其他") self.setTitle("其他")
self.card_Notice = PushSettingCard( self.card_Notice = PushSettingCard(
@@ -642,10 +694,18 @@ class OtherSettingCard(HeaderCardWidget):
title="公告", title="公告",
content="查看AUTO_MAA的最新公告", content="查看AUTO_MAA的最新公告",
) )
self.card_UserDocs = HyperlinkCard(
url="https://docs.qq.com/aio/DQ2NwUHRiWGtMWHBy",
text="查看使用指南",
icon=FluentIcon.PAGE_RIGHT,
title="使用指南",
content="查看AUTO_MAA的使用教程和文档",
)
self.card_Association = self.AssociationSettingCard() self.card_Association = self.AssociationSettingCard()
Layout = QVBoxLayout() Layout = QVBoxLayout()
Layout.addWidget(self.card_Notice) Layout.addWidget(self.card_Notice)
Layout.addWidget(self.card_UserDocs)
Layout.addWidget(self.card_Association) Layout.addWidget(self.card_Association)
self.viewLayout.addLayout(Layout) self.viewLayout.addLayout(Layout)

View File

@@ -230,7 +230,7 @@ class UpdateProcess(QThread):
"https://gh.llkk.cc/", "https://gh.llkk.cc/",
"https://github.akams.cn/", "https://github.akams.cn/",
"https://www.ghproxy.cn/", "https://www.ghproxy.cn/",
"https://ghp.ci/", "https://ghfast.top/",
] ]
time.sleep(1) time.sleep(1)
@@ -319,7 +319,7 @@ class AUTO_MAA_Updater(QApplication):
if __name__ == "__main__": if __name__ == "__main__":
# 获取软件自身的路径 # 获取软件自身的路径
app_path = Path.cwd() app_path = Path(sys.argv[0]).resolve().parent
# 从本地版本信息文件获取当前版本信息 # 从本地版本信息文件获取当前版本信息
if (app_path / "resources/version.json").exists(): if (app_path / "resources/version.json").exists():
@@ -333,11 +333,22 @@ if __name__ == "__main__":
else: else:
main_version_current = [0, 0, 0, 0] main_version_current = [0, 0, 0, 0]
# 从本地配置文件获取更新类型
if (app_path / "config/config.json").exists():
with (app_path / "config/config.json").open(mode="r", encoding="utf-8") as f:
config = json.load(f)
if "Update" in config and "UpdateType" in config["Update"]:
update_type = config["Update"]["UpdateType"]
else:
update_type = "main"
else:
update_type = "main"
# 从远程服务器获取最新版本信息 # 从远程服务器获取最新版本信息
for _ in range(3): for _ in range(3):
try: try:
response = requests.get( response = requests.get(
"https://gitee.com/DLmaster_361/AUTO_MAA/raw/main/resources/version.json" f"https://gitee.com/DLmaster_361/AUTO_MAA/raw/{update_type}/resources/version.json"
) )
version_remote = response.json() version_remote = response.json()
main_version_remote = list( main_version_remote = list(

View File

@@ -8,4 +8,5 @@ pywin32
pyautogui pyautogui
pycryptodome pycryptodome
requests requests
serverchan_sdk
nuitka==2.6 nuitka==2.6

View File

@@ -9,6 +9,6 @@
"https://gh.llkk.cc/", "https://gh.llkk.cc/",
"https://github.akams.cn/", "https://github.akams.cn/",
"https://www.ghproxy.cn/", "https://www.ghproxy.cn/",
"https://ghp.ci/" "https://ghfast.top/"
] ]
} }

View File

@@ -1,7 +1,7 @@
{ {
"main_version": "4.2.2.0", "main_version": "4.2.2.2",
"updater_version": "1.1.1.0", "updater_version": "1.1.1.3",
"announcement": "\n## 新增功能\n- 调度队列上线支持MAA多开 #12\n- 公告系统上线\n## 修复BUG\n- 修复手机号码不全时引发的混乱\n- 添加了一堆BUG确信\n## 程序优化\n- 界面重构,引入`QFluentWidgets`美化界面", "announcement": "\n## 新增功能\n- 添加用户每日代理次数上限功能 #15\n- 新增代理成功消息推送渠道Server酱与企业微信群机器人推送\n- 添加更新类别可选项\n## 修复BUG\n- 修复自定义基建无法正常使用的问题\n- 修正人工排查文案\n- 修复高级MAA配置序号错位\n- 修复高级用户列表无法配置问题\n- 修复主调度台选项乱动问题\n- 修复更新器文件夹定位问题\n## 程序优化\n- 无",
"proxy_list": [ "proxy_list": [
"", "",
"https://gitproxy.click/", "https://gitproxy.click/",
@@ -9,6 +9,6 @@
"https://gh.llkk.cc/", "https://gh.llkk.cc/",
"https://github.akams.cn/", "https://github.akams.cn/",
"https://www.ghproxy.cn/", "https://www.ghproxy.cn/",
"https://ghp.ci/" "https://ghfast.top/"
] ]
} }