Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae10d69839 | ||
| 482ca752c3 | |||
|
|
d6067c03c6 | ||
|
|
c27816a4c8 | ||
|
|
861b2ff7bd | ||
|
|
3aec54efdd | ||
|
|
434b362513 | ||
|
|
85f08ce902 | ||
|
|
76fef3f252 | ||
|
|
e805aa87c6 | ||
|
|
3bb3d530ae | ||
|
|
364731a1a5 | ||
|
|
1357e9fe03 | ||
|
|
d532b3b201 | ||
| c60903321b | |||
| 1dd3b6d298 | |||
|
|
6e3d4b263c | ||
|
|
bb8f05f983 | ||
|
|
885304599d | ||
|
|
571f995462 | ||
|
|
436ac27fb3 | ||
|
|
59659df50c | ||
|
|
ece9defad3 | ||
|
|
888f60edb8 | ||
|
|
9277f141b4 | ||
|
|
32a582344d | ||
|
|
cccc84c8b9 | ||
|
|
5888f1edbb | ||
|
|
2ef3c6fbc3 | ||
|
|
9c1992e512 | ||
|
|
cc7f23feaa | ||
|
|
797fd733d7 | ||
|
|
bede11e423 | ||
|
|
f6beb74ebe | ||
| 57b895dbfc | |||
|
|
808bbe2c1e | ||
|
|
1615673595 | ||
|
|
14d66f2d05 | ||
|
|
28eda1c63b | ||
|
|
57a102e264 | ||
|
|
e70b94c3d6 | ||
|
|
42e232d1d1 | ||
|
|
631fe3f354 | ||
|
|
0f3598cd98 | ||
|
|
2f607ceac8 | ||
|
|
b96132f63e | ||
|
|
4b9a211ef0 | ||
|
|
2c085e288b |
158
.github/workflows/python-app.yml
vendored
158
.github/workflows/python-app.yml
vendored
@@ -1,158 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
name: Build AUTO_MAA
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'LICENSE'
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'LICENSE'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
pre_check:
|
||||
name: Pre Checks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Repo Check
|
||||
id: repo_check
|
||||
run: |
|
||||
if [[ "$GITHUB_REPOSITORY" != "DLmaster361/AUTO_MAA" ]]; then
|
||||
echo "When forking this repository to make your own builds, you have to adjust this check."
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
build_AUTO_MAA:
|
||||
runs-on: windows-latest
|
||||
needs: pre_check
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Python 3.12
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8 pytest
|
||||
pip install -r requirements.txt
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Package
|
||||
id: package
|
||||
run: |
|
||||
copy app\utils\package.py .\
|
||||
python package.py
|
||||
- name: Read version
|
||||
id: read_version
|
||||
run: |
|
||||
$MAIN_VERSION=(Get-Content -Path "version_info.txt" -TotalCount 1).Trim()
|
||||
"AUTO_MAA_version=$MAIN_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||
$UPDATER_VERSION=(Get-Content -Path "version_info.txt" -TotalCount 2 | Select-Object -Index 1).Trim()
|
||||
"updater_version=$UPDATER_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||
- name: Create Zip
|
||||
id: create_zip
|
||||
run: |
|
||||
Compress-Archive -Path app,resources,main.py,AUTO_MAA.exe,requirements.txt,README.md,LICENSE -DestinationPath AUTO_MAA_${{ env.AUTO_MAA_version }}.zip
|
||||
Compress-Archive -Path Updater.exe -DestinationPath Updater_${{ env.updater_version }}.zip
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: AUTO_MAA_${{ env.AUTO_MAA_version }}
|
||||
path: |
|
||||
AUTO_MAA_${{ env.AUTO_MAA_version }}.zip
|
||||
Updater_${{ env.updater_version }}.zip
|
||||
- name: Upload Version_Info Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: version_info
|
||||
path: version_info.txt
|
||||
publish_release:
|
||||
name: Publish release
|
||||
needs: build_AUTO_MAA
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: AUTO_MAA_*
|
||||
merge-multiple: true
|
||||
path: artifacts
|
||||
- name: Download Version_Info
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: version_info
|
||||
path: ./
|
||||
- name: Check if release exists
|
||||
id: check_if_release_exists
|
||||
run: |
|
||||
release_id=$(gh release view $(sed 's/\r$//g' <(head -n 1 version_info.txt)) --json id --jq .id || true)
|
||||
if [[ -z $release_id ]]; then
|
||||
echo "release_exists=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "release_exists=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
|
||||
- name: Create release
|
||||
id: create_release
|
||||
if: steps.check_if_release_exists.outputs.release_exists == 'false'
|
||||
run: |
|
||||
set -xe
|
||||
shopt -s nullglob
|
||||
NAME="$(sed 's/\r$//g' <(head -n 1 version_info.txt))"
|
||||
TAGNAME="$(sed 's/\r$//g' <(head -n 1 version_info.txt))"
|
||||
NOTES_MAIN="$(sed 's/\r$//g' <(tail -n +3 version_info.txt))"
|
||||
NOTES_TAIL="\`\`\`本release通过GitHub Actions自动构建\`\`\`"
|
||||
NOTES="$NOTES_MAIN<br><br>$NOTES_TAIL"
|
||||
gh release create "$TAGNAME" --target "main" --title "$NAME" --notes "$NOTES" artifacts/*
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
|
||||
- name: Update release
|
||||
id: update_release
|
||||
if: steps.check_if_release_exists.outputs.release_exists == 'true'
|
||||
run: |
|
||||
set -xe
|
||||
shopt -s nullglob
|
||||
NAME="$(sed 's/\r$//g' <(head -n 1 version_info.txt))"
|
||||
TAGNAME="$(sed 's/\r$//g' <(head -n 1 version_info.txt))"
|
||||
NOTES_MAIN="$(sed 's/\r$//g' <(tail -n +3 version_info.txt))"
|
||||
NOTES_TAIL="\`\`\`本release通过GitHub Actions自动构建\`\`\`"
|
||||
NOTES="$NOTES_MAIN<br><br>$NOTES_TAIL"
|
||||
gh release delete "$TAGNAME" --yes
|
||||
gh release create "$TAGNAME" --target "main" --title "$NAME" --notes "$NOTES" artifacts/*
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
|
||||
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
__pycache__/
|
||||
config/
|
||||
data/
|
||||
debug/
|
||||
history/
|
||||
script/
|
||||
resources/notice.json
|
||||
resources/theme_image.json
|
||||
resources/images/Home/BannerTheme.jpg
|
||||
234
README.md
234
README.md
@@ -1,233 +1,15 @@
|
||||
# AUTO_MAA
|
||||
# AUTO_MAA服务分支
|
||||
|
||||
MAA多账号管理与自动化软件
|
||||
## 服务项目
|
||||
|
||||

|
||||
### 下载器信息
|
||||
|
||||
---
|
||||
为下载器提供应用列表、代理与下载站地址指引
|
||||
|
||||
</h1>
|
||||
### 活动主题
|
||||
|
||||
[](https://github.com/DLmaster361/AUTO_MAA/stargazers)
|
||||
[](https://github.com/DLmaster361/AUTO_MAA/network)
|
||||
[](https://github.com/DLmaster361/AUTO_MAA/issues)
|
||||
[](https://github.com/DLmaster361/AUTO_MAA/graphs/contributors)
|
||||
[](https://github.com/DLmaster361/AUTO_MAA/blob/main/LICENSE)
|
||||
</div>
|
||||
发布活动主题图片下载链接
|
||||
|
||||
## 软件介绍
|
||||
### 公告
|
||||
|
||||
### 性质
|
||||
|
||||
本软件是明日方舟第三方软件`MAA`的第三方工具,即第3<sup>3</sup>方软件。旨在优化MAA多账号功能体验,并通过一些方法解决MAA项目未能解决的部分问题,提高代理的稳定性。
|
||||
|
||||
### 原理
|
||||
|
||||
本软件可以存储多个明日方舟账号数据,并通过以下流程实现代理功能:
|
||||
|
||||
1. **配置:** 根据对应用户的配置信息,生成配置文件并将其导入MAA。
|
||||
2. **监测:** 在MAA开始代理后,持续读取MAA的日志以判断其运行状态。当软件认定MAA出现异常时,通过重启MAA使之仍能继续完成任务。
|
||||
3. **循环:** 重复上述步骤,使MAA依次完成各个用户的日常代理任务。
|
||||
|
||||
### 优势
|
||||
|
||||
- **节省运行开销:** 只需要一份MAA软件与一个模拟器,无需多开就能完成多账号代理,羸弱的电脑也能代理日常。
|
||||
- **自定义空间大:** 依靠高级用户配置模式,支持MAA几乎所有设置选项自定义,同时保留对模拟器多开的支持。
|
||||
- **一键代理无忧:** 无须中途手动修改MAA配置,将繁琐交给AUTO_MAA,把游戏留给自己。
|
||||
- **代理结果复核:** 通过人工排查功能核实各用户代理情况,堵住日常代理的最后一丝风险。
|
||||
|
||||
## 重要声明
|
||||
|
||||
本开发团队承诺,不会修改明日方舟游戏本体与相关配置文件。本项目使用GPL开源,相关细则如下:
|
||||
|
||||
- **作者:** AUTO_MAA软件作者为DLmaster、DLmaster361或DLmaster_361,以上均指代同一人。
|
||||
- **使用:** AUTO_MAA使用者可以按自己的意愿自由使用本软件。依据GPL,对于由此可能产生的损失,AUTO_MAA项目组不负任何责任。
|
||||
- **分发:** AUTO_MAA允许任何人自由分发本软件,包括进行商业活动牟利。若为直接分发本软件,必须遵循GPL向接收者提供本软件项目地址、完整的软件源码与GPL协议原文(件);若为修改软件后进行分发,必须遵循GPL向接收者提供本软件项目地址、修改前的完整软件源码副本与GPL协议原文(件),违反者可能会被追究法律责任。
|
||||
- **传播:** AUTO_MAA原则上允许传播者自由传播本软件,但无论在何种传播过程中,不得删除项目作者与开发者所留版权声明,不得隐瞒项目作者与相关开发者的存在。由于软件性质,项目组不希望发现任何人在明日方舟官方媒体(包括官方媒体账号与森空岛社区等)或明日方舟游戏相关内容(包括同好群、线下活动与游戏内容讨论等)下提及AUTO_MAA或MAA,希望各位理解。
|
||||
- **衍生:** AUTO_MAA允许任何人对软件本体或软件部分代码进行二次开发或利用。但依据GPL,相关成果也必须使用GPL开源。
|
||||
- **授权:** 如果希望在使用AUTO_MAA的相关成果后仍保持自己的项目闭源,请在Issues中说明来意。得到项目组认可后,我们可以提供另一份使用不同协议的代码,此协议主要内容如下:被授权者可以自由使用该代码并维持闭源;被授权者必须定期为AUTO_MAA作出贡献。
|
||||
- **贡献:** 不论是直接参与软件的维护编写,或是撰写文档、测试、反馈BUG、给出建议、参与讨论,都为AUTO_MAA项目的发展完善做出了不可忽视的贡献。项目组提倡各位贡献者遵照GitHub开源社区惯例,发布Issues参与项目。避免私信或私发邮件(安全性漏洞或敏感问题除外),以帮助更多用户。
|
||||
|
||||
以上细则是本项目对GPL的相关补充与强调。未提及的以GPL为准,发生冲突的以本细则为准。如有不清楚的部分,请发Issues询问。若发生纠纷,相关内容也没有在Issues上提及的,项目组拥有最终解释权。
|
||||
|
||||
**注意**
|
||||
|
||||
- 由于本软件有修改其它目录JSON文件等行为,使用前请将AUTO_MAA添加入Windows Defender信任区以及防病毒软件的信任区或开发者目录,避免被误杀。
|
||||
|
||||
---
|
||||
|
||||
# 使用方法
|
||||
|
||||
## 安装软件
|
||||
|
||||
```
|
||||
本软件是MAA的外部工具,需要安装MAA后才能使用。
|
||||
```
|
||||
|
||||
### 下载MAA
|
||||
|
||||
- 什么是MAA? [官网](https://maa.plus/)/[GitHub](https://github.com/MaaAssistantArknights/MaaAssistantArknights)
|
||||
|
||||
- MAA下载地址 [GitHub下载](https://github.com/MaaAssistantArknights/MaaAssistantArknights/releases)
|
||||
|
||||
### 安装MAA
|
||||
|
||||
- 将MAA压缩包解压至任意普通文件夹即可。
|
||||
|
||||
- 若为首次安装MAA,请双击`MAA.exe`启动MAA程序以生成MAA配置文件。
|
||||
|
||||
### 下载AUTO_MAA [](https://github.com/DLmaster361/AUTO_MAA/releases)
|
||||
|
||||
- GitHub下载地址 [GitHub下载](https://github.com/DLmaster361/AUTO_MAA/releases)
|
||||
|
||||
### 安装AUTO_MAA
|
||||
|
||||
- 将AUTO_MAA压缩包解压至任意普通文件夹即可。
|
||||
|
||||
## 配置AUTO_MAA
|
||||
|
||||
### 启动AUTO_MAA
|
||||
|
||||
- 双击`AUTO_MAA.exe`以启动软件。
|
||||
|
||||
```
|
||||
注意:
|
||||
|
||||
首次启动时会要求设置管理密钥。
|
||||
|
||||
管理密钥是解密用户密码的唯一凭证,与数据库绑定。
|
||||
密钥丢失或data/key/目录下任一文件损坏都将导致解密无法正常进行。
|
||||
|
||||
本项目采用自主开发的混合加密模式,项目组也无法找回您的管理密钥或修复data/key/目录下的文件。
|
||||
如果不幸的事发生,建议您删除data/key/目录与data/data.db文件后重新录入信息。
|
||||
```
|
||||
|
||||
### 配置信息
|
||||
|
||||
#### 设置MAA
|
||||
|
||||
1. 通过`浏览`绑定MAA后,单击`设置MAA`进行MAA全局设置。
|
||||
|
||||
2. 在打开的MAA界面完成`性能设置`、`游戏设置`、`连接设置`、`启动设置`、`界面设置`、`软件更新`等基本配置以及代理任务的详细配置。
|
||||
|
||||
3. 完成基本配置后,关闭MAA页面,AUTO_MAA会自动保存您的配置。
|
||||
|
||||
- 注意:在MAA的设置过程中,若MAA要求`立刻重启应用更改`,请选择`稍后`。否则,MAA重启后的一切更改都不会被程序记录。
|
||||
|
||||
- 特别的,您需要确保自己:
|
||||
- 取消勾选`开机自启动MAA`。
|
||||
- 配置自己模拟器所在的位置并根据实际情况填写`等待模拟器启动时间`(建议预留10s以防意外)。
|
||||
- 如果是模拟器多开用户,还需要填写`附加命令`,具体填写值参见多开模拟器对应快捷方式路径(如`-v 1`)。
|
||||
|
||||

|
||||
|
||||
#### 设置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自定义,仅部分代理核心功能选项由程序托管。
|
||||
- `用户配置列表栏目`:详解如下:
|
||||
- `用户名`:展示在执行界面的用户名,用于区分不同用户。
|
||||
- `账号ID`:MAA进行账号切换所需的凭据,官服用户请输入手机号码、B服请输入B站ID。
|
||||
- `服务器`:当前支持官服、B服。
|
||||
- `代理天数`:剩余需要进行代理的天数,输入`任意负数`可设置为无限代理天数,当剩余天数为0时不再代理或排查。
|
||||
- `状态`:用户的状态,禁用时将不再对其进行代理或排查。
|
||||
- `执行情况`:当日执行情况,不可编辑。
|
||||
- `关卡`、`备选关卡-1`、`备选关卡-2`:关卡号。
|
||||
- `日常`:单独设定是否进行日常代理的日常部分,可进一步配置MAA的具体代理任务,该配置与全局MAA配置相互独立。
|
||||
- `剿灭`:单独设定是否进行日常代理的剿灭部分,高级配置模式下可进一步配置MAA的具体代理任务,该配置与全局MAA配置相互独立。
|
||||
- `自定义基建`:是否启用自定义基建功能,需要进一步配置自定义基建文件,该配置与其他用户相互独立。
|
||||
- `密码`:仅用于登记用户的密码,可留空。
|
||||
- `备注`:用于备注用户信息。
|
||||
|
||||
- 特别的:
|
||||
- 对于`简洁用户配置列表的关卡、备选关卡-1、备选关卡-2栏目`您可以自定义关卡号替换方案。
|
||||
- 程序会读取`data/gameid.txt`中的数据,依据此进行关卡号的替换,便于常用关卡的使用。
|
||||
- `gameid.txt`会在程序首次运行时生成,其中将预置一些常用资源本的替换方案。
|
||||
|
||||

|
||||
|
||||
## 运行代理任务
|
||||
|
||||
### 直接运行
|
||||
|
||||
- 在执行页单击`立即执行`直接运行。
|
||||
|
||||
### 定时运行
|
||||
|
||||
- 在执行页的`定时执行`栏设置时间。
|
||||
|
||||
- 保持软件打开,软件会在设定的时间自动运行。
|
||||
|
||||
## 人工排查代理结果
|
||||
|
||||
### 直接开始人工排查
|
||||
|
||||
- 在执行页单击`开始排查`启动排查进程。
|
||||
|
||||
- 软件将调起MAA,依次登录各用户的账号。
|
||||
|
||||
- 完成PRTS登录后,请人工检查代理情况,可以手动完成未代理的任务。
|
||||
|
||||
- 在对话框中单击对应账号的代理情况。
|
||||
|
||||
- 结束人工排查后,相应排查情况将被写入用户管理页的`备注栏目`。
|
||||
|
||||
---
|
||||
|
||||
# 关于
|
||||
|
||||
## 未来开发方向
|
||||
|
||||
- [ ] 尝试接入更多开源社区成果
|
||||
- [ ] 支持对MAA运行状况的进一步识别
|
||||
- [x] 添加更多通知手段
|
||||
- [ ] GUI界面美化
|
||||
|
||||
## 贡献者
|
||||
|
||||
感谢以下贡献者对本项目做出的贡献
|
||||
|
||||
<a href="https://github.com/DLmaster361/AUTO_MAA/graphs/contributors">
|
||||
|
||||
<img src="https://contrib.rocks/image?repo=DLmaster361/AUTO_MAA" />
|
||||
|
||||
</a>
|
||||
|
||||

|
||||
|
||||
## Star History
|
||||
|
||||
[](https://star-history.com/#DLmaster361/AUTO_MAA&Date)
|
||||
|
||||
## 交流与赞助
|
||||
|
||||
欢迎加入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)
|
||||
|
||||
---
|
||||
|
||||
如果喜欢这个项目的话,给作者来杯咖啡吧!
|
||||
|
||||

|
||||
发布AUTO_MAA公告
|
||||
@@ -1,46 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA主程序包
|
||||
v4.2
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
__version__ = "4.2.0"
|
||||
__author__ = "DLmaster361 <DLmaster_361@163.com>"
|
||||
__license__ = "GPL-3.0 license"
|
||||
|
||||
from .config import AppConfig
|
||||
from .models import MaaManager
|
||||
from .services import Notification, CryptoHandler
|
||||
from .ui import AUTO_MAA
|
||||
from .utils import Updater, version_text
|
||||
|
||||
__all__ = [
|
||||
"AppConfig",
|
||||
"MaaManager",
|
||||
"Notification",
|
||||
"CryptoHandler",
|
||||
"AUTO_MAA",
|
||||
"Updater",
|
||||
"version_text",
|
||||
]
|
||||
240
app/config.py
240
app/config.py
@@ -1,240 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA配置管理
|
||||
v4.2
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
import sqlite3
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Dict, Union
|
||||
|
||||
|
||||
class AppConfig:
|
||||
|
||||
def __init__(self) -> None:
|
||||
|
||||
self.app_path = Path.cwd() # 获取软件根目录
|
||||
self.app_path_sys = os.path.realpath(sys.argv[0]) # 获取软件自身的路径
|
||||
self.app_name = os.path.basename(self.app_path) # 获取软件自身的名称
|
||||
|
||||
self.database_path = self.app_path / "data/data.db"
|
||||
self.config_path = self.app_path / "config/gui.json"
|
||||
self.key_path = self.app_path / "data/key"
|
||||
self.gameid_path = self.app_path / "data/gameid.txt"
|
||||
self.version_path = self.app_path / "resources/version.json"
|
||||
|
||||
# 检查文件完整性
|
||||
self.initialize()
|
||||
|
||||
def initialize(self) -> None:
|
||||
"""初始化程序的配置文件"""
|
||||
|
||||
# 检查目录
|
||||
(self.app_path / "config").mkdir(parents=True, exist_ok=True)
|
||||
(self.app_path / "data/MAAconfig/simple").mkdir(parents=True, exist_ok=True)
|
||||
(self.app_path / "data/MAAconfig/beta").mkdir(parents=True, exist_ok=True)
|
||||
(self.app_path / "data/MAAconfig/Default").mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# 生成版本信息文件
|
||||
if not self.version_path.exists():
|
||||
version = {
|
||||
"main_version": "0.0.0.0",
|
||||
"updater_version": "0.0.0.0",
|
||||
}
|
||||
with self.version_path.open(mode="w", encoding="utf-8") as f:
|
||||
json.dump(version, f, indent=4)
|
||||
|
||||
# 生成配置文件
|
||||
if not self.config_path.exists():
|
||||
config = {"Default": {}}
|
||||
with self.config_path.open(mode="w", encoding="utf-8") as f:
|
||||
json.dump(config, f, indent=4)
|
||||
|
||||
# 生成预设gameid替换方案文件
|
||||
if not self.gameid_path.exists():
|
||||
self.gameid_path.write_text(
|
||||
"龙门币:CE-6\n技能:CA-5\n红票:AP-5\n经验:LS-6\n剿灭模式:Annihilation",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
self.check_config()
|
||||
self.check_database()
|
||||
|
||||
def check_config(self) -> None:
|
||||
"""检查配置文件字段完整性并补全"""
|
||||
|
||||
config_list = [
|
||||
["TimeSet.set1", "False"],
|
||||
["TimeSet.run1", "00:00"],
|
||||
["TimeSet.set2", "False"],
|
||||
["TimeSet.run2", "00:00"],
|
||||
["TimeSet.set3", "False"],
|
||||
["TimeSet.run3", "00:00"],
|
||||
["TimeSet.set4", "False"],
|
||||
["TimeSet.run4", "00:00"],
|
||||
["TimeSet.set5", "False"],
|
||||
["TimeSet.run5", "00:00"],
|
||||
["TimeSet.set6", "False"],
|
||||
["TimeSet.run6", "00:00"],
|
||||
["TimeSet.set7", "False"],
|
||||
["TimeSet.run7", "00:00"],
|
||||
["TimeSet.set8", "False"],
|
||||
["TimeSet.run8", "00:00"],
|
||||
["TimeSet.set9", "False"],
|
||||
["TimeSet.run9", "00:00"],
|
||||
["TimeSet.set10", "False"],
|
||||
["TimeSet.run10", "00:00"],
|
||||
["MaaSet.path", ""],
|
||||
["TimeLimit.routine", 10],
|
||||
["TimeLimit.annihilation", 40],
|
||||
["TimesLimit.run", 3],
|
||||
["SelfSet.IfSelfStart", "False"],
|
||||
["SelfSet.IfSleep", "False"],
|
||||
["SelfSet.IfProxyDirectly", "False"],
|
||||
["SelfSet.IfSendMail", "False"],
|
||||
["SelfSet.MailAddress", ""],
|
||||
["SelfSet.IfSendMail.OnlyError", "False"],
|
||||
["SelfSet.IfSilence", "False"],
|
||||
["SelfSet.BossKey", ""],
|
||||
["SelfSet.IfToTray", "False"],
|
||||
["SelfSet.UIsize", "1200x700"],
|
||||
["SelfSet.UIlocation", "100x100"],
|
||||
["SelfSet.UImaximized", "False"],
|
||||
["SelfSet.MainIndex", 2],
|
||||
]
|
||||
|
||||
# 导入配置文件
|
||||
with self.config_path.open(mode="r", encoding="utf-8") as f:
|
||||
config = json.load(f)
|
||||
|
||||
# 检查并补充缺失的字段
|
||||
for i in range(len(config_list)):
|
||||
if not config_list[i][0] in config["Default"]:
|
||||
config["Default"][config_list[i][0]] = config_list[i][1]
|
||||
|
||||
# 初始化配置信息
|
||||
self.content: Dict[str, Dict[str, Union[str, int]]] = config
|
||||
|
||||
# 导出配置文件
|
||||
self.save_config()
|
||||
|
||||
def check_database(self) -> None:
|
||||
"""检查用户数据库文件并处理数据库版本更新"""
|
||||
|
||||
# 生成用户数据库
|
||||
if not self.database_path.exists():
|
||||
db = sqlite3.connect(self.database_path)
|
||||
cur = db.cursor()
|
||||
cur.execute(
|
||||
"CREATE TABLE adminx(admin text,id text,server text,day int,status text,last date,game text,game_1 text,game_2 text,routine text,annihilation text,infrastructure text,password byte,notes text,numb int,mode text,uid int)"
|
||||
)
|
||||
cur.execute("CREATE TABLE version(v text)")
|
||||
cur.execute("INSERT INTO version VALUES(?)", ("v1.3",))
|
||||
db.commit()
|
||||
cur.close()
|
||||
db.close()
|
||||
|
||||
# 数据库版本更新
|
||||
db = sqlite3.connect(self.database_path)
|
||||
cur = db.cursor()
|
||||
cur.execute("SELECT * FROM version WHERE True")
|
||||
version = cur.fetchall()
|
||||
# v1.0-->v1.1
|
||||
if version[0][0] == "v1.0":
|
||||
cur.execute("SELECT * FROM adminx WHERE True")
|
||||
data = cur.fetchall()
|
||||
cur.execute("DROP TABLE IF EXISTS adminx")
|
||||
cur.execute(
|
||||
"CREATE TABLE adminx(admin text,id text,server text,day int,status text,last date,game text,game_1 text,game_2 text,routines text,annihilation text,infrastructure text,password byte,notes text,numb int,mode text,uid int)"
|
||||
)
|
||||
for i in range(len(data)):
|
||||
cur.execute(
|
||||
"INSERT INTO adminx VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
|
||||
(
|
||||
data[i][0], # 0 0 0
|
||||
data[i][1], # 1 1 -
|
||||
"Official", # 2 2 -
|
||||
data[i][2], # 3 3 1
|
||||
data[i][3], # 4 4 2
|
||||
data[i][4], # 5 5 3
|
||||
data[i][5], # 6 6 -
|
||||
data[i][6], # 7 7 -
|
||||
data[i][7], # 8 8 -
|
||||
"y", # 9 - 4
|
||||
data[i][8], # 10 9 5
|
||||
data[i][9], # 11 10 -
|
||||
data[i][10], # 12 11 6
|
||||
data[i][11], # 13 12 7
|
||||
data[i][12], # 14 - -
|
||||
"simple", # 15 - -
|
||||
data[i][13], # 16 - -
|
||||
),
|
||||
)
|
||||
cur.execute("DELETE FROM version WHERE v = ?", ("v1.0",))
|
||||
cur.execute("INSERT INTO version VALUES(?)", ("v1.1",))
|
||||
db.commit()
|
||||
# v1.1-->v1.2
|
||||
if version[0][0] == "v1.1":
|
||||
cur.execute("SELECT * FROM adminx WHERE True")
|
||||
data = cur.fetchall()
|
||||
for i in range(len(data)):
|
||||
cur.execute(
|
||||
"UPDATE adminx SET infrastructure = 'n' WHERE mode = ? AND uid = ?",
|
||||
(
|
||||
data[i][15],
|
||||
data[i][16],
|
||||
),
|
||||
)
|
||||
cur.execute("DELETE FROM version WHERE v = ?", ("v1.1",))
|
||||
cur.execute("INSERT INTO version VALUES(?)", ("v1.2",))
|
||||
db.commit()
|
||||
# v1.2-->v1.3
|
||||
if version[0][0] == "v1.2":
|
||||
cur.execute("ALTER TABLE adminx RENAME COLUMN routines TO routine")
|
||||
cur.execute("DELETE FROM version WHERE v = ?", ("v1.2",))
|
||||
cur.execute("INSERT INTO version VALUES(?)", ("v1.3",))
|
||||
db.commit()
|
||||
cur.close()
|
||||
db.close()
|
||||
|
||||
def open_database(self) -> None:
|
||||
"""打开数据库"""
|
||||
|
||||
self.db = sqlite3.connect(self.database_path)
|
||||
self.cur = self.db.cursor()
|
||||
|
||||
def close_database(self) -> None:
|
||||
"""关闭数据库"""
|
||||
|
||||
self.cur.close()
|
||||
self.db.close()
|
||||
|
||||
def save_config(self) -> None:
|
||||
"""保存配置文件"""
|
||||
|
||||
with self.config_path.open(mode="w", encoding="utf-8") as f:
|
||||
json.dump(self.content, f, indent=4)
|
||||
1035
app/models/MAA.py
1035
app/models/MAA.py
File diff suppressed because it is too large
Load Diff
@@ -1,34 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA模组包
|
||||
v4.2
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
__version__ = "4.2.0"
|
||||
__author__ = "DLmaster361 <DLmaster_361@163.com>"
|
||||
__license__ = "GPL-3.0 license"
|
||||
|
||||
from .MAA import MaaManager
|
||||
|
||||
__all__ = ["MaaManager"]
|
||||
@@ -1,35 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA服务包
|
||||
v4.2
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
__version__ = "4.2.0"
|
||||
__author__ = "DLmaster361 <DLmaster_361@163.com>"
|
||||
__license__ = "GPL-3.0 license"
|
||||
|
||||
from .notification import Notification
|
||||
from .security import CryptoHandler
|
||||
|
||||
__all__ = ["Notification", "CryptoHandler"]
|
||||
@@ -1,95 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA通知服务
|
||||
v4.2
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
from plyer import notification
|
||||
import smtplib
|
||||
from email.mime.text import MIMEText
|
||||
from email.header import Header
|
||||
from email.utils import formataddr
|
||||
import os
|
||||
|
||||
from app import AppConfig
|
||||
|
||||
|
||||
class Notification:
|
||||
|
||||
def __init__(self, config: AppConfig):
|
||||
|
||||
self.config = config
|
||||
|
||||
def push_notification(self, title, message, ticker, t):
|
||||
"""推送系统通知"""
|
||||
|
||||
notification.notify(
|
||||
title=title,
|
||||
message=message,
|
||||
app_name="AUTO_MAA",
|
||||
app_icon=str(self.config.app_path / "resources/icons/AUTO_MAA.ico"),
|
||||
timeout=t,
|
||||
ticker=ticker,
|
||||
toast=True,
|
||||
)
|
||||
|
||||
return True
|
||||
|
||||
def send_mail(self, title, content):
|
||||
"""使用官方专用邮箱推送邮件通知"""
|
||||
|
||||
# 声明:此邮箱为AUTO_MAA项目组资产,未经授权不得私自使用
|
||||
# 注意:此声明注释只有使用者更换发信邮箱时才能删除,本条规则优先级高于GPLv3
|
||||
|
||||
# 第三方 SMTP 服务配置
|
||||
mail_host = "smtp.163.com" # 设置服务器
|
||||
mail_sender = "AUTO_MAA_server@163.com" # 用户名
|
||||
mail_key = "SYrq87nDLD4RNB5T" # 授权码 24/11/15
|
||||
|
||||
# 定义邮件正文
|
||||
message = MIMEText(content, "plain", "utf-8")
|
||||
message["From"] = formataddr(
|
||||
(Header("AUTO_MAA通知服务", "utf-8").encode(), "AUTO_MAA_server@163.com")
|
||||
) # 发件人显示的名字
|
||||
message["To"] = formataddr(
|
||||
(
|
||||
Header("AUTO_MAA用户", "utf-8").encode(),
|
||||
self.config.content["Default"]["SelfSet.MailAddress"],
|
||||
)
|
||||
) # 收件人显示的名字
|
||||
message["Subject"] = Header(title, "utf-8")
|
||||
|
||||
try:
|
||||
smtpObj = smtplib.SMTP_SSL(mail_host, 465) # 465为SMTP_SSL默认端口
|
||||
smtpObj.login(mail_sender, mail_key)
|
||||
smtpObj.sendmail(
|
||||
mail_sender,
|
||||
self.config.content["Default"]["SelfSet.MailAddress"],
|
||||
message.as_string(),
|
||||
)
|
||||
return True
|
||||
except smtplib.SMTPException as e:
|
||||
return f"发送邮件时出错:\n{e}"
|
||||
finally:
|
||||
smtpObj.quit()
|
||||
@@ -1,167 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA主程序
|
||||
v4.2
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
import os
|
||||
import hashlib
|
||||
import random
|
||||
import secrets
|
||||
from Crypto.Cipher import AES
|
||||
from Crypto.PublicKey import RSA
|
||||
from Crypto.Cipher import PKCS1_OAEP
|
||||
from Crypto.Util.Padding import pad, unpad
|
||||
|
||||
from app import AppConfig
|
||||
|
||||
|
||||
class CryptoHandler:
|
||||
|
||||
def __init__(self, config: AppConfig):
|
||||
|
||||
self.config = config
|
||||
|
||||
def get_PASSWORD(self, PASSWORD: str) -> None:
|
||||
"""配置管理密钥"""
|
||||
|
||||
# 生成目录
|
||||
self.config.key_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# 生成RSA密钥对
|
||||
key = RSA.generate(2048)
|
||||
public_key_local = key.publickey()
|
||||
private_key = key
|
||||
# 保存RSA公钥
|
||||
(self.config.app_path / "data/key/public_key.pem").write_bytes(
|
||||
public_key_local.exportKey()
|
||||
)
|
||||
# 生成密钥转换与校验随机盐
|
||||
PASSWORD_salt = secrets.token_hex(random.randint(32, 1024))
|
||||
(self.config.app_path / "data/key/PASSWORDsalt.txt").write_text(
|
||||
PASSWORD_salt,
|
||||
encoding="utf-8",
|
||||
)
|
||||
verify_salt = secrets.token_hex(random.randint(32, 1024))
|
||||
(self.config.app_path / "data/key/verifysalt.txt").write_text(
|
||||
verify_salt,
|
||||
encoding="utf-8",
|
||||
)
|
||||
# 将管理密钥转化为AES-256密钥
|
||||
AES_password = hashlib.sha256(
|
||||
(PASSWORD + PASSWORD_salt).encode("utf-8")
|
||||
).digest()
|
||||
# 生成AES-256密钥校验哈希值并保存
|
||||
AES_password_verify = hashlib.sha256(
|
||||
AES_password + verify_salt.encode("utf-8")
|
||||
).digest()
|
||||
(self.config.app_path / "data/key/AES_password_verify.bin").write_bytes(
|
||||
AES_password_verify
|
||||
)
|
||||
# AES-256加密RSA私钥并保存密文
|
||||
AES_key = AES.new(AES_password, AES.MODE_ECB)
|
||||
private_key_local = AES_key.encrypt(pad(private_key.exportKey(), 32))
|
||||
(self.config.app_path / "data/key/private_key.bin").write_bytes(
|
||||
private_key_local
|
||||
)
|
||||
|
||||
def encryptx(self, note: str) -> bytes:
|
||||
"""加密数据"""
|
||||
|
||||
# 读取RSA公钥
|
||||
public_key_local = RSA.import_key(
|
||||
(self.config.app_path / "data/key/public_key.pem").read_bytes()
|
||||
)
|
||||
# 使用RSA公钥对数据进行加密
|
||||
cipher = PKCS1_OAEP.new(public_key_local)
|
||||
encrypted = cipher.encrypt(note.encode("utf-8"))
|
||||
return encrypted
|
||||
|
||||
def decryptx(self, note: bytes, PASSWORD: str) -> str:
|
||||
"""解密数据"""
|
||||
|
||||
# 读入RSA私钥密文、盐与校验哈希值
|
||||
private_key_local = (
|
||||
(self.config.app_path / "data/key/private_key.bin").read_bytes().strip()
|
||||
)
|
||||
PASSWORD_salt = (
|
||||
(self.config.app_path / "data/key/PASSWORDsalt.txt")
|
||||
.read_text(encoding="utf-8")
|
||||
.strip()
|
||||
)
|
||||
verify_salt = (
|
||||
(self.config.app_path / "data/key/verifysalt.txt")
|
||||
.read_text(encoding="utf-8")
|
||||
.strip()
|
||||
)
|
||||
AES_password_verify = (
|
||||
(self.config.app_path / "data/key/AES_password_verify.bin")
|
||||
.read_bytes()
|
||||
.strip()
|
||||
)
|
||||
# 将管理密钥转化为AES-256密钥并验证
|
||||
AES_password = hashlib.sha256(
|
||||
(PASSWORD + PASSWORD_salt).encode("utf-8")
|
||||
).digest()
|
||||
AES_password_SHA = hashlib.sha256(
|
||||
AES_password + verify_salt.encode("utf-8")
|
||||
).digest()
|
||||
if AES_password_SHA != AES_password_verify:
|
||||
return "管理密钥错误"
|
||||
else:
|
||||
# AES解密RSA私钥
|
||||
AES_key = AES.new(AES_password, AES.MODE_ECB)
|
||||
private_key_pem = unpad(AES_key.decrypt(private_key_local), 32)
|
||||
private_key = RSA.import_key(private_key_pem)
|
||||
# 使用RSA私钥解密数据
|
||||
decrypter = PKCS1_OAEP.new(private_key)
|
||||
note = decrypter.decrypt(note)
|
||||
return note.decode("utf-8")
|
||||
|
||||
def change_PASSWORD(self, data: list, PASSWORD_old: str, PASSWORD_new: str) -> None:
|
||||
"""修改管理密钥"""
|
||||
|
||||
# 使用旧管理密钥解密
|
||||
new_data = []
|
||||
for i in range(len(data)):
|
||||
new_data.append(self.decryptx(data[i][12], PASSWORD_old))
|
||||
# 使用新管理密钥重新加密
|
||||
self.get_PASSWORD(PASSWORD_new)
|
||||
for i in range(len(data)):
|
||||
self.config.cur.execute(
|
||||
"UPDATE adminx SET password = ? WHERE mode = ? AND uid = ?",
|
||||
(
|
||||
self.encryptx(new_data[i]),
|
||||
data[i][15],
|
||||
data[i][16],
|
||||
),
|
||||
)
|
||||
self.config.db.commit(),
|
||||
new_data[i] = None
|
||||
del new_data
|
||||
|
||||
def check_PASSWORD(self, PASSWORD: str) -> bool:
|
||||
"""验证管理密钥"""
|
||||
|
||||
return bool(self.decryptx(self.encryptx(""), PASSWORD) != "管理密钥错误")
|
||||
@@ -1,34 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA图形化界面包
|
||||
v4.2
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
__version__ = "4.2.0"
|
||||
__author__ = "DLmaster361 <DLmaster_361@163.com>"
|
||||
__license__ = "GPL-3.0 license"
|
||||
|
||||
from .gui import AUTO_MAA
|
||||
|
||||
__all__ = ["AUTO_MAA"]
|
||||
1823
app/ui/gui.py
1823
app/ui/gui.py
File diff suppressed because it is too large
Load Diff
@@ -1,343 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA更新器
|
||||
v1.1
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import zipfile
|
||||
import requests
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
from PySide6.QtWidgets import (
|
||||
QApplication,
|
||||
QDialog,
|
||||
QVBoxLayout,
|
||||
)
|
||||
from qfluentwidgets import ProgressBar, BodyLabel
|
||||
from PySide6.QtGui import QIcon
|
||||
from PySide6.QtCore import QObject, QThread, Signal
|
||||
|
||||
from .version import version_text
|
||||
|
||||
|
||||
class UpdateProcess(QThread):
|
||||
|
||||
info = Signal(str)
|
||||
progress = Signal(int, int, int)
|
||||
accomplish = Signal()
|
||||
|
||||
def __init__(
|
||||
self, app_path: Path, name: str, main_version: list, updater_version: list
|
||||
) -> None:
|
||||
super(UpdateProcess, self).__init__()
|
||||
|
||||
self.app_path = app_path
|
||||
self.name = name
|
||||
self.main_version = main_version
|
||||
self.updater_version = updater_version
|
||||
self.download_path = app_path / "AUTO_MAA_Update.zip" # 临时下载文件的路径
|
||||
self.version_path = app_path / "resources/version.json"
|
||||
|
||||
def run(self) -> None:
|
||||
|
||||
# 清理可能存在的临时文件
|
||||
try:
|
||||
os.remove(self.download_path)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
self.info.emit("正在获取下载链接")
|
||||
url_list = self.get_download_url()
|
||||
|
||||
# 验证下载地址并获取文件大小
|
||||
for i in range(len(url_list)):
|
||||
try:
|
||||
self.info.emit(f"正在验证下载地址:{url_list[i]}")
|
||||
response = requests.get(url_list[i], stream=True)
|
||||
if response.status_code != 200:
|
||||
self.info.emit(
|
||||
f"连接失败,错误代码 {response.status_code} ,正在切换代理({i+1}/{len(url_list)})"
|
||||
)
|
||||
time.sleep(1)
|
||||
continue
|
||||
file_size = response.headers.get("Content-Length")
|
||||
break
|
||||
except requests.RequestException:
|
||||
self.info.emit(f"请求超时,正在切换代理({i+1}/{len(url_list)})")
|
||||
time.sleep(1)
|
||||
else:
|
||||
self.info.emit(f"连接失败,已尝试所有{len(url_list)}个代理")
|
||||
return None
|
||||
|
||||
if file_size is None:
|
||||
file_size = 1
|
||||
else:
|
||||
file_size = int(file_size)
|
||||
|
||||
try:
|
||||
# 下载文件
|
||||
with open(self.download_path, "wb") as f:
|
||||
|
||||
downloaded_size = 0
|
||||
last_download_size = 0
|
||||
speed = 0
|
||||
last_time = time.time()
|
||||
|
||||
for chunk in response.iter_content(chunk_size=8192):
|
||||
|
||||
# 写入已下载数据
|
||||
f.write(chunk)
|
||||
downloaded_size += len(chunk)
|
||||
|
||||
# 计算下载速度
|
||||
if time.time() - last_time >= 1.0:
|
||||
speed = (
|
||||
(downloaded_size - last_download_size)
|
||||
/ (time.time() - last_time)
|
||||
/ 1024
|
||||
)
|
||||
last_download_size = downloaded_size
|
||||
last_time = time.time()
|
||||
|
||||
# 更新下载进度
|
||||
if speed >= 1024:
|
||||
self.info.emit(
|
||||
f"正在下载:{self.name} 已下载:{downloaded_size / 1048576:.2f}/{file_size / 1048576:.2f} MB ({downloaded_size / file_size * 100:.2f}%) 下载速度:{speed / 1024:.2f} MB/s",
|
||||
)
|
||||
else:
|
||||
self.info.emit(
|
||||
f"正在下载:{self.name} 已下载:{downloaded_size / 1048576:.2f}/{file_size / 1048576:.2f} MB ({downloaded_size / file_size * 100:.2f}%) 下载速度:{speed:.2f} KB/s",
|
||||
)
|
||||
self.progress.emit(0, 100, int(downloaded_size / file_size * 100))
|
||||
|
||||
except Exception as e:
|
||||
e = str(e)
|
||||
e = "\n".join([e[_ : _ + 75] for _ in range(0, len(e), 75)])
|
||||
self.info.emit(f"下载{self.name}时出错:\n{e}")
|
||||
return None
|
||||
|
||||
# 解压
|
||||
try:
|
||||
|
||||
while True:
|
||||
try:
|
||||
self.info.emit("正在解压更新文件")
|
||||
self.progress.emit(0, 0, 0)
|
||||
with zipfile.ZipFile(self.download_path, "r") as zip_ref:
|
||||
zip_ref.extractall(self.app_path)
|
||||
break
|
||||
except PermissionError:
|
||||
self.info.emit("解压出错:AUTO_MAA正在运行,正在等待其关闭")
|
||||
time.sleep(1)
|
||||
|
||||
self.info.emit("正在删除临时文件")
|
||||
self.progress.emit(0, 0, 0)
|
||||
os.remove(self.download_path)
|
||||
|
||||
self.info.emit(f"{self.name}更新成功!")
|
||||
self.progress.emit(0, 100, 100)
|
||||
|
||||
except Exception as e:
|
||||
|
||||
e = str(e)
|
||||
e = "\n".join([e[_ : _ + 75] for _ in range(0, len(e), 75)])
|
||||
self.info.emit(f"解压更新时出错:\n{e}")
|
||||
return None
|
||||
|
||||
# 更新version文件
|
||||
with open(self.version_path, "r", encoding="utf-8") as f:
|
||||
version_info = json.load(f)
|
||||
if self.name == "AUTO_MAA更新器":
|
||||
version_info["updater_version"] = ".".join(map(str, self.updater_version))
|
||||
elif self.name == "AUTO_MAA主程序":
|
||||
version_info["main_version"] = ".".join(map(str, self.main_version))
|
||||
with open(self.version_path, "w", encoding="utf-8") as f:
|
||||
json.dump(version_info, f, indent=4)
|
||||
|
||||
# 主程序更新完成后打开AUTO_MAA
|
||||
if self.name == "AUTO_MAA主程序":
|
||||
subprocess.Popen(
|
||||
str(self.app_path / "AUTO_MAA.exe"),
|
||||
shell=True,
|
||||
creationflags=subprocess.CREATE_NO_WINDOW,
|
||||
)
|
||||
|
||||
self.accomplish.emit()
|
||||
|
||||
def get_download_url(self) -> list:
|
||||
"""获取下载链接"""
|
||||
|
||||
try_num = 3
|
||||
for i in range(try_num):
|
||||
try:
|
||||
response = requests.get(
|
||||
"https://gitee.com/DLmaster_361/AUTO_MAA/raw/main/resources/version.json"
|
||||
)
|
||||
if response.status_code != 200:
|
||||
self.info.emit(
|
||||
f"连接失败,错误代码 {response.status_code} ,正在重试({i+1}/{try_num})"
|
||||
)
|
||||
time.sleep(0.1)
|
||||
continue
|
||||
version_remote = response.json()
|
||||
PROXY_list = version_remote["proxy_list"]
|
||||
break
|
||||
except requests.RequestException:
|
||||
self.info.emit(f"请求超时,正在重试({i+1}/{try_num})")
|
||||
time.sleep(0.1)
|
||||
except KeyError:
|
||||
self.info.emit(f"未找到远端代理网址项,正在重试({i+1}/{try_num})")
|
||||
time.sleep(0.1)
|
||||
else:
|
||||
self.info.emit("获取远端代理信息失败,将使用默认代理地址")
|
||||
PROXY_list = [
|
||||
"",
|
||||
"https://gitproxy.click/",
|
||||
"https://cdn.moran233.xyz/",
|
||||
"https://gh.llkk.cc/",
|
||||
"https://github.akams.cn/",
|
||||
"https://www.ghproxy.cn/",
|
||||
"https://ghp.ci/",
|
||||
]
|
||||
time.sleep(1)
|
||||
|
||||
url_list = []
|
||||
if self.name == "AUTO_MAA主程序":
|
||||
url_list.append(
|
||||
f"https://gitee.com/DLmaster_361/AUTO_MAA/releases/download/{version_text(self.main_version)}/AUTO_MAA_{version_text(self.main_version)}.zip"
|
||||
)
|
||||
for i in range(len(PROXY_list)):
|
||||
url_list.append(
|
||||
f"{PROXY_list[i]}https://github.com/DLmaster361/AUTO_MAA/releases/download/{version_text(self.main_version)}/AUTO_MAA_{version_text(self.main_version)}.zip"
|
||||
)
|
||||
elif self.name == "AUTO_MAA更新器":
|
||||
url_list.append(
|
||||
f"https://gitee.com/DLmaster_361/AUTO_MAA/releases/download/{version_text(self.main_version)}/Updater_{version_text(self.updater_version)}.zip"
|
||||
)
|
||||
for i in range(len(PROXY_list)):
|
||||
url_list.append(
|
||||
f"{PROXY_list[i]}https://github.com/DLmaster361/AUTO_MAA/releases/download/{version_text(self.main_version)}/Updater_{version_text(self.updater_version)}.zip"
|
||||
)
|
||||
return url_list
|
||||
|
||||
|
||||
class Updater(QObject):
|
||||
|
||||
def __init__(
|
||||
self, app_path: Path, name: str, main_version: list, updater_version: list
|
||||
) -> None:
|
||||
super().__init__()
|
||||
|
||||
self.ui = QDialog()
|
||||
self.ui.setWindowTitle("AUTO_MAA更新器")
|
||||
self.ui.resize(700, 70)
|
||||
self.ui.setWindowIcon(
|
||||
QIcon(str(app_path / "resources/icons/AUTO_MAA_Updater.ico"))
|
||||
)
|
||||
|
||||
# 创建垂直布局
|
||||
self.Layout_v = QVBoxLayout(self.ui)
|
||||
|
||||
self.info = BodyLabel("正在初始化", self.ui)
|
||||
self.Layout_v.addWidget(self.info)
|
||||
|
||||
self.progress = ProgressBar(self.ui)
|
||||
self.progress.setRange(0, 0)
|
||||
self.Layout_v.addWidget(self.progress)
|
||||
|
||||
self.update_process = UpdateProcess(
|
||||
app_path, name, main_version, updater_version
|
||||
)
|
||||
|
||||
self.update_process.info.connect(self.update_info)
|
||||
self.update_process.progress.connect(self.update_progress)
|
||||
|
||||
self.update_process.start()
|
||||
|
||||
def update_info(self, text: str) -> None:
|
||||
self.info.setText(text)
|
||||
|
||||
def update_progress(self, begin: int, end: int, current: int) -> None:
|
||||
self.progress.setRange(begin, end)
|
||||
self.progress.setValue(current)
|
||||
|
||||
|
||||
class AUTO_MAA_Updater(QApplication):
|
||||
def __init__(
|
||||
self, app_path: Path, name: str, main_version: list, updater_version: list
|
||||
) -> None:
|
||||
super().__init__()
|
||||
|
||||
self.main = Updater(app_path, name, main_version, updater_version)
|
||||
self.main.ui.show()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
# 获取软件自身的路径
|
||||
app_path = Path.cwd()
|
||||
|
||||
# 从本地版本信息文件获取当前版本信息
|
||||
if (app_path / "resources/version.json").exists():
|
||||
with (app_path / "resources/version.json").open(
|
||||
mode="r", encoding="utf-8"
|
||||
) as f:
|
||||
version_current = json.load(f)
|
||||
main_version_current = list(
|
||||
map(int, version_current["main_version"].split("."))
|
||||
)
|
||||
else:
|
||||
main_version_current = [0, 0, 0, 0]
|
||||
|
||||
# 从远程服务器获取最新版本信息
|
||||
for _ in range(3):
|
||||
try:
|
||||
response = requests.get(
|
||||
"https://gitee.com/DLmaster_361/AUTO_MAA/raw/main/resources/version.json"
|
||||
)
|
||||
version_remote = response.json()
|
||||
main_version_remote = list(
|
||||
map(int, version_remote["main_version"].split("."))
|
||||
)
|
||||
break
|
||||
except Exception as e:
|
||||
err = e
|
||||
time.sleep(0.1)
|
||||
else:
|
||||
sys.exit(f"获取版本信息时出错:\n{err}")
|
||||
|
||||
# 启动更新线程
|
||||
if main_version_remote > main_version_current:
|
||||
app = AUTO_MAA_Updater(
|
||||
app_path,
|
||||
"AUTO_MAA主程序",
|
||||
main_version_remote,
|
||||
[],
|
||||
)
|
||||
sys.exit(app.exec())
|
||||
@@ -1,35 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA工具包
|
||||
v4.2
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
__version__ = "4.2.0"
|
||||
__author__ = "DLmaster361 <DLmaster_361@163.com>"
|
||||
__license__ = "GPL-3.0 license"
|
||||
|
||||
from .Updater import Updater
|
||||
from .version import version_text
|
||||
|
||||
__all__ = ["Updater", "version_text"]
|
||||
@@ -1,107 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA打包程序
|
||||
v4.2
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
import os
|
||||
import json
|
||||
import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
from app import version_text
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
root_path = Path.cwd()
|
||||
|
||||
with (root_path / "resources/version.json").open(mode="r", encoding="utf-8") as f:
|
||||
version = json.load(f)
|
||||
|
||||
main_version_numb = list(map(int, version["main_version"].split(".")))
|
||||
updater_version_numb = list(map(int, version["updater_version"].split(".")))
|
||||
|
||||
print("Packaging AUTO_MAA main program ...")
|
||||
|
||||
result = subprocess.run(
|
||||
f"powershell -Command nuitka --standalone --onefile --mingw64"
|
||||
f" --enable-plugins=pyside6 --windows-console-mode=disable"
|
||||
f" --windows-icon-from-ico=resources\\icons\\AUTO_MAA.ico"
|
||||
f" --company-name='AUTO_MAA Team' --product-name=AUTO_MAA"
|
||||
f" --file-version={version["main_version"]}"
|
||||
f" --product-version={version["main_version"]}"
|
||||
f" --file-description='AUTO_MAA Component'"
|
||||
f" --copyright='Copyright © 2024 DLmaster361'"
|
||||
f" --assume-yes-for-downloads --output-filename=AUTO_MAA"
|
||||
f" --remove-output main.py",
|
||||
shell=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
|
||||
print(result.stdout)
|
||||
print(result.stderr)
|
||||
print("AUTO_MAA main program packaging completed !")
|
||||
|
||||
shutil.copy(root_path / "app/utils/Updater.py", root_path)
|
||||
|
||||
file_content = (root_path / "Updater.py").read_text(encoding="utf-8")
|
||||
|
||||
(root_path / "Updater.py").write_text(
|
||||
file_content.replace(
|
||||
"from .version import version_text", "from app import version_text"
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
print("Packaging AUTO_MAA update program ...")
|
||||
|
||||
result = subprocess.run(
|
||||
f"powershell -Command nuitka --standalone --onefile --mingw64"
|
||||
f" --enable-plugins=pyside6 --windows-console-mode=disable"
|
||||
f" --windows-icon-from-ico=resources\\icons\\AUTO_MAA_Updater.ico"
|
||||
f" --company-name='AUTO_MAA Team' --product-name=AUTO_MAA"
|
||||
f" --file-version={version["updater_version"]}"
|
||||
f" --product-version={version["main_version"]}"
|
||||
f" --file-description='AUTO_MAA Component'"
|
||||
f" --copyright='Copyright © 2024 DLmaster361'"
|
||||
f" --assume-yes-for-downloads --output-filename=Updater"
|
||||
f" --remove-output Updater.py",
|
||||
shell=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
|
||||
print(result.stdout)
|
||||
print(result.stderr)
|
||||
print("AUTO_MAA update program packaging completed !")
|
||||
|
||||
os.remove(root_path / "Updater.py")
|
||||
|
||||
(root_path / "version_info.txt").write_text(
|
||||
f"{version_text(main_version_numb)}\n{version_text(updater_version_numb)}{version["announcement"]}",
|
||||
encoding="utf-8",
|
||||
)
|
||||
@@ -1,38 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA版本号工具
|
||||
v4.2
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
|
||||
def version_text(version_numb: list) -> str:
|
||||
"""将版本号列表转为可读的文本信息"""
|
||||
|
||||
if version_numb[3] == 0:
|
||||
version = f"v{'.'.join(str(_) for _ in version_numb[0:3])}"
|
||||
else:
|
||||
version = (
|
||||
f"v{'.'.join(str(_) for _ in version_numb[0:3])}-beta.{version_numb[3]}"
|
||||
)
|
||||
return version
|
||||
12
apps_info.json
Normal file
12
apps_info.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"MaaAssistantArknights 「明日方舟助手」": {
|
||||
"rid": "MAA",
|
||||
"os": "win",
|
||||
"arch": "x64"
|
||||
},
|
||||
"ZenlessZoneZero-OneDragon 「绝区零一条龙」": {
|
||||
"rid": "ZZZ-OneDragon",
|
||||
"os": "",
|
||||
"arch": ""
|
||||
}
|
||||
}
|
||||
12
download_info.json
Normal file
12
download_info.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"proxy_list": [
|
||||
"https://gitproxy.click/",
|
||||
"https://gh.llkk.cc/",
|
||||
"https://github.akams.cn/",
|
||||
"https://ghfast.top/",
|
||||
"https://github.tbedu.top/"
|
||||
],
|
||||
"download_dict": {
|
||||
"官方下载站": "http://221.236.27.82:10197/d/AUTO_MAA/"
|
||||
}
|
||||
}
|
||||
42
main.py
42
main.py
@@ -1,42 +0,0 @@
|
||||
# <AUTO_MAA:A MAA Multi Account Management and Automation Tool>
|
||||
# Copyright © <2024> <DLmaster361>
|
||||
|
||||
# This file is part of AUTO_MAA.
|
||||
|
||||
# AUTO_MAA is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License,
|
||||
# or (at your option) any later version.
|
||||
|
||||
# AUTO_MAA is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
# the GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# DLmaster_361@163.com
|
||||
|
||||
"""
|
||||
AUTO_MAA
|
||||
AUTO_MAA主程序
|
||||
v4.2
|
||||
作者:DLmaster_361
|
||||
"""
|
||||
|
||||
from PySide6.QtWidgets import QApplication
|
||||
import sys
|
||||
|
||||
from app import AppConfig, Notification, CryptoHandler, AUTO_MAA
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
config = AppConfig()
|
||||
notify = Notification(config)
|
||||
crypto = CryptoHandler(config)
|
||||
|
||||
application = QApplication(sys.argv)
|
||||
window = AUTO_MAA(config=config, notify=notify, crypto=crypto)
|
||||
window.main.check_PASSWORD()
|
||||
sys.exit(application.exec())
|
||||
13
notice.json
Normal file
13
notice.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"notice_dict": {
|
||||
"代理风险预警通告之五": "\n## 代理风险预警通告之五\n\n鹰角小姐再次更新了她的用户协议,请您`手动确认新版用户协议`,否则MAA将无法正常执行账号登录。\n\n请注意:每个游戏账号均需`独立完成协议确认`且AUTO_MAA`无法代为操作此项流程`!\n",
|
||||
"主程序更新警示之三": "\n## 主程序更新警示之三\n\n- 由于开发者犯蠢,`v4.4.1-beta.1` 版本出现大量莫名其妙的崩溃弹窗,应用内更新也无法进行,相关问题已在 `v4.4.1-beta.3` 版本中修复,但您需要手动下载 `v4.4.1-beta.3` 版本进行覆盖安装。\n\n- 若您无法直接访问Github,请使用[此临时链接](http://221.236.27.82:10197/d/AUTO_MAA/AUTO_MAA_v4.4.1-beta.3.zip)进行下载。\n\n- 此次异常仅影响公测版用户,稳定版用户无需理会。\n",
|
||||
"主程序更新警示之二": "\n## 主程序更新警示之二\n\n- Mirror酱由于平台策略更新,相关更新服务暂不可用,请暂时删除cdk,使用一般更新渠道进行更新,预期将在 `v4.4.0-beta.2` 版本完成修复。\n\n- `AUTO_MAA_v4.3` 向 `AUTO_MAA_v4.4` 版本更新时,提示权限不足属正常现象,直接关闭该窗口,手动打开 `AUTO_MAA` 即可。\n",
|
||||
"MuMu 模拟器更新预警": "\n## MuMu 模拟器更新预警\n\n近期 **MuMu 模拟器 5.0** 正在进行内测,并预计将于 6 月 20 日起陆续开放下载。此次 MuMu 新版本修改了 `adb路径`、`模拟器程序名` 及 `安装路径`。\n\n在更新了 `MuMu 5.0` 后:\n\n若使用 MuMu 的默认 adb,须勾选 MAA 中的 「设置 - 连接设置 - 自动检测连接」 重新检测或手动修改 「设置 - 连接设置 - ADB 路径」。\n\n- 原路径:{安装目录}\\shell\\adb.exe\n\n- 新路径:{安装目录}\\nx_main\\adb.exe\n\n若开启自动启动模拟器,须重新设置 「设置 - 启动设置 - 模拟器路径」。\n\n- 原路径:{安装目录}\\shell\\MuMuPlayer.exe\n\n- 新路径:{安装目录}\\nx_device\\12.0\\shell\\MuMuNxDevice.exe\n\n另:若无必要,项目组不建议用户升级到该版本,而是在新版本基本稳定后再进行升级。\n",
|
||||
"版本更新方法升级!": "\n## 版本更新方法升级!\n\n为改善更新体验,从v4.3.0版本开始,AUTO_MAA正式接入`Mirror酱`更新服务!\n\n`Mirror酱`是一个第三方应用分发平台,为开源应用提供更新辅助服务。\n\n在v4.3.0版本后,`Mirror酱`将为AUTO_MAA用户提供免费的更新检查服务以及付费的文件下载服务。\n\n若您未填写`Mirror酱 CDK`,AUTO_MAA将在获取到来自`Mirror酱`的版本更新信息后,从原有的镜像站或加速站获取更新文件,下载过程可能不稳定。\n\n若您填写`Mirror酱 CDK`,AUTO_MAA将在获取到来自`Mirror酱`的版本更新信息后,从`Mirror酱`下载站获取更新文件,下载速度更稳定更快。\n\n- **为什么要接入第三方应用分发平台?**因为旧有的更新逻辑存在较大缺陷,由于版本更新信息与软件源代码必须同时发布,而软件源代码大约需要 1.5 小时才能生成可以直接使用的软件包。这导致每次版本更新后 1.5 小时内,用户可以看到更新的通知却无法下载更新文件。使用第三方应用分发服务可以规避这一窘境,平台会在收到软件包时才公示版本更新信息。\n\n- **为什么选择 Mirror 酱?** 因为`Mirror酱`可以免费接入,且`Mirror酱 CDK`是通用的,获取之后可以凭此更新包括 MAA、March7thAssistant 在内的多款开源软件,对于用户来说性价比较高。此外,`Mirror酱`的收益除了用于维护服务器与给开发者提供分成外,还会不时拿出一部分回馈明日方舟周边社区,为许多存在赤字的项目提供资金赞助。\n\n- **用户有啥需要注意的地方吗?**如果您已经拥有了`Mirror酱 CDK`,请速速填上。若还没有,可以视自己的软件更新情况选择是否获取。项目组不会因为接入`Mirror酱`而停止对原更新渠道的维护。\n\n若您有相关需求,请前往 [Mirror 酱官网](https://Mirrorchyan.com) 获取 `Mirror酱 CDK`。\n",
|
||||
"AUTO_MAA私域邮箱": "\n## AUTO_MAA私域邮箱已上线!\n\n- **AUTO_MAA私域邮箱是什么?**AUTO_MAA私域邮箱是基于阿里云企业邮箱的`automaa.xyz`域名邮箱。\n\n- **AUTO_MAA私域邮箱有啥优点?**嗯,域名比较特别,看起来专业点?\n\n- **AUTO_MAA私域邮 箱怎么用于通知服务?**AUTO_MAA私域邮箱的登录页为[阿里邮箱企业版](https://qiye.aliyun.com),SMTP 服务器地址为`smtp.qiye.aliyun.com`,授权码为`登录密码`,其他使用方法与普通邮箱一致。\n\n- **怎么申请AUTO_MAA私域邮箱?**发送申请邮件到`DLmaster_361@automaa.xyz`,要求邮件中包含:`申请邮箱的类别(用户/项目组)`、`邮箱名(纯英文)`、`安全手机号`、`申请原因`。 邮箱创建成功后,将会返回一封包含`初始密码`的回执邮件。\n",
|
||||
"开发者须知": "\n## AUTO_MAA开发者须知\n\n本项目开发者紧缺,欢迎任何有兴趣的开发者参与项目开发。参与项目前,请阅读以下两个文档,你需要的信息都在里面了:\n\n- [AUTO_MAA开发文档](https://github.com/DLmaster361/AUTO_MAA/wiki/%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3)\n\n- [AUTO_MAA开发者协作文档](https://docs.qq.com/aio/DQ3Z5eHNxdmxFQmZX)\n",
|
||||
"长期公告": "\n## 长期公告\n\n项目组**不希望**发现任何人在**明日方舟官方媒体(包括官方媒体账号与森空岛社区等)**或**明日方舟游戏相关内容(包括同好群、线下活动与游戏内容讨论等)**下提及`AUTO_MAA`或`MAA`。\n\n但也请注意,`AUTO_MAA`与`MAA`做出来就是要给大家用的,自然需要进行宣传。在正常的宣传内容底下上纲上线大可不必。\n\n若您在任何地方发现有人传播`AUTO_MAA`软件本体或衍生软件,却没有提供**源代码与本软件项目地址**的,请立即向项目组反馈,谢谢。\n"
|
||||
},
|
||||
"time": "2025-07-25 20:00"
|
||||
}
|
||||
13
notice_formatting.py
Normal file
13
notice_formatting.py
Normal file
@@ -0,0 +1,13 @@
|
||||
title = "主程序更新警示之三"
|
||||
markdown = """
|
||||
## 主程序更新警示之三
|
||||
|
||||
- 由于开发者犯蠢,`v4.4.1-beta.1` 版本出现大量莫名其妙的崩溃弹窗,应用内更新也无法进行,相关问题已在 `v4.4.1-beta.3` 版本中修复,但您需要手动下载 `v4.4.1-beta.3` 版本进行覆盖安装。
|
||||
|
||||
- 若您无法直接访问Github,请使用[此临时链接](http://221.236.27.82:10197/d/AUTO_MAA/AUTO_MAA_v4.4.1-beta.3.zip)进行下载。
|
||||
|
||||
- 此次异常仅影响公测版用户,稳定版用户无需理会。
|
||||
"""
|
||||
with open("notice.txt", "w", encoding="utf-8") as f:
|
||||
f.write(f'"{title}": "{markdown.replace("\n",r"\n")}"')
|
||||
print(f'"{title}": "{markdown.replace("\n",r"\n")}"')
|
||||
@@ -1,9 +0,0 @@
|
||||
plyer
|
||||
PySide6
|
||||
PySide6-Fluent-Widgets[full]
|
||||
psutil
|
||||
pywin32
|
||||
pyautogui
|
||||
pycryptodome
|
||||
requests
|
||||
nuitka
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"main_version": "4.2.0.0",
|
||||
"updater_version": "1.1.0.0",
|
||||
"announcement": "\n# 这是一个中转版本,此版本后更换程序架构方式。\n# 由于更新方法无法通用,您需要在完成本次更新后再次检查更新以获取最新版本。\n",
|
||||
"proxy_list":[
|
||||
"",
|
||||
"https://gitproxy.click/",
|
||||
"https://cdn.moran233.xyz/",
|
||||
"https://gh.llkk.cc/",
|
||||
"https://github.akams.cn/",
|
||||
"https://www.ghproxy.cn/",
|
||||
"https://ghp.ci/"
|
||||
]
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
#主界面
|
||||
"MainFunction.PostActions": "12" #完成后
|
||||
"TaskQueue.WakeUp.IsChecked": "True" #开始唤醒
|
||||
"TaskQueue.Recruiting.IsChecked": "True" #自动公招
|
||||
"TaskQueue.Base.IsChecked": "True" #基建换班
|
||||
"TaskQueue.Combat.IsChecked": "True" #刷理智
|
||||
"TaskQueue.Mission.IsChecked": "True" #领取奖励
|
||||
"TaskQueue.Mall.IsChecked": "True" #获取信用及购物
|
||||
"TaskQueue.AutoRoguelike.IsChecked": "False" #自动肉鸽
|
||||
"TaskQueue.Reclamation.IsChecked": "False" #生息演算
|
||||
"Start.RunDirectly": "True" #启动MAA后直接运行
|
||||
"Start.OpenEmulatorAfterLaunch": "True" #启动MAA后自动开启模拟器
|
||||
#刷理智
|
||||
"MainFunction.Stage1": "" #主关卡
|
||||
"MainFunction.Stage2": "" #备选关卡1
|
||||
"MainFunction.Stage3": "" #备选关卡2
|
||||
"Fight.RemainingSanityStage": "Annihilation" #剩余理智关卡
|
||||
"MainFunction.Series.Quantity": "1" #连战次数
|
||||
"Penguin.IsDrGrandet": "True" #博朗台模式
|
||||
"GUI.CustomStageCode": "False" #手动输入关卡名
|
||||
"GUI.UseAlternateStage": "False" #使用备选关卡
|
||||
"Fight.UseRemainingSanityStage": "True" #使用剩余理智
|
||||
"GUI.AllowUseStoneSave": "False" #允许吃源石保持状态
|
||||
"Fight.UseExpiringMedicine": "False" #无限吃48小时内过期的理智药
|
||||
"GUI.HideUnavailableStage": "False" #隐藏当日不开放关卡
|
||||
"GUI.HideSeries": "False" #隐藏连战次数
|
||||
"Infrast.CustomInfrastPlanShowInFightSettings": "False" #显示基建计划
|
||||
"Penguin.EnablePenguin": "True" #上报企鹅物流
|
||||
"Yituliu.EnableYituliu": "True" #上报一图流
|
||||
#基建换班
|
||||
"Infrast.CustomInfrastEnabled": "True" #启用自定义基建配置
|
||||
"Infrast.CustomInfrastPlanIndex": "1" #自定义基建配置索引
|
||||
"Infrast.DefaultInfrast": "user_defined" #内置配置
|
||||
"Infrast.IsCustomInfrastFileReadOnly": "False" #自定义基建配置文件只读
|
||||
"Infrast.CustomInfrastFile": "" #自定义基建配置文件地址
|
||||
#设置
|
||||
"Start.ClientType": "Bilibili"、 "Official" #服务器
|
||||
G"Timer.Timer1": "False" #时间设置1
|
||||
G"VersionUpdate.ScheduledUpdateCheck": "True" #定时检查更新
|
||||
G"VersionUpdate.AutoDownloadUpdatePackage": "True" #自动下载更新包
|
||||
G"VersionUpdate.AutoInstallUpdatePackage": "True" #自动安装更新包
|
||||
G"Start.MinimizeDirectly": "True" #启动MAA后直接最小化
|
||||
G"GUI.UseTray": "True" #显示托盘图标
|
||||
G"GUI.MinimizeToTray": "False" #最小化时隐藏至托盘
|
||||
"Start.EmulatorPath" #模拟器路径
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 51 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 38 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 26 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 61 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 309 KiB |
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"main_version": "4.2.1.0",
|
||||
"updater_version": "1.1.0.0",
|
||||
"announcement": "\n## 新增功能\n- 无\n## 修复BUG\n- 同步MAA`v5.11.1-beta.1`的字段修改\n## 程序优化\n- 无",
|
||||
"proxy_list":[
|
||||
"",
|
||||
"https://gitproxy.click/",
|
||||
"https://cdn.moran233.xyz/",
|
||||
"https://gh.llkk.cc/",
|
||||
"https://github.akams.cn/",
|
||||
"https://www.ghproxy.cn/",
|
||||
"https://ghp.ci/"
|
||||
]
|
||||
}
|
||||
6
theme_image.json
Normal file
6
theme_image.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user