Compare commits
99 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c4e5eb5cc | ||
|
|
cd42f45a1f | ||
|
|
ec38895765 | ||
|
|
fc30579bbc | ||
|
|
3e6223e4e5 | ||
|
|
27c71124ff | ||
|
|
3a8a8a36f5 | ||
|
|
ed6de5e806 | ||
|
|
bf8a5befa3 | ||
|
|
a3fe641f6b | ||
|
|
f4f99c25db | ||
|
|
640d80e334 | ||
|
|
4f196b516f | ||
|
|
87f07bf95c | ||
|
|
1bfd7891b5 | ||
|
|
472eb0ee52 | ||
|
|
7638c67da6 | ||
|
|
7a0c143b5b | ||
|
|
fff8e11524 | ||
|
|
af24208cf3 | ||
|
|
85bccea2dd | ||
|
|
f7c8cac6ec | ||
|
|
97a5ac5bb0 | ||
|
|
1d57076010 | ||
|
|
d298ac872c | ||
|
|
c0581e781c | ||
|
|
6befd6341a | ||
|
|
504ef8dd68 | ||
|
|
127500d890 | ||
|
|
ab94173df7 | ||
|
|
e50697aae1 | ||
|
|
c71389fc0b | ||
|
|
732129ba34 | ||
|
|
77dfc895ed | ||
|
|
0c6f3123f8 | ||
|
|
e872d30b3a | ||
|
|
48fa4413c8 | ||
|
|
94e693db77 | ||
|
|
025d328d79 | ||
|
|
d086a5a152 | ||
|
|
5f2337d949 | ||
|
|
5e163181a8 | ||
|
|
0913cbb813 | ||
|
|
6aed64ce4e | ||
|
|
3c95e58fb2 | ||
|
|
64d0d4ed41 | ||
|
|
7fb659c511 | ||
|
|
d4ec91940f | ||
|
|
77f63ebb44 | ||
|
|
051b062e29 | ||
|
|
ec9083b556 | ||
|
|
156080a3b7 | ||
|
|
5b6effd43e | ||
|
|
97e8d41c39 | ||
|
|
d64ef447d2 | ||
|
|
461b2a62b0 | ||
|
|
f8988651b5 | ||
|
|
ffe865e29e | ||
|
|
cd5250c09f | ||
|
|
8f01bf6027 | ||
|
|
81eb11f5c5 | ||
|
|
80cadfa52c | ||
|
|
9974d70d99 | ||
|
|
6e3e4662f4 | ||
|
|
e2fb2e5565 | ||
|
|
6f8be226b0 | ||
|
|
2606f1e587 | ||
|
|
4d1fd7ea76 | ||
|
|
e61fbe6c69 | ||
|
|
0c287577ca | ||
|
|
a4aa562db9 | ||
|
|
33c5ff3a52 | ||
|
|
7c8e43bd35 | ||
|
|
bc0014dbe6 | ||
|
|
e41eca33bc | ||
|
|
e39b965459 | ||
|
|
f2aa3d7347 | ||
|
|
76c126284f | ||
|
|
44ee917d88 | ||
|
|
669019c051 | ||
|
|
4685c12570 | ||
|
|
d815529510 | ||
|
|
1da3620feb | ||
|
|
44d529c60f | ||
|
|
cdbcebd945 | ||
|
|
5bc2bf9397 | ||
|
|
d41419a579 | ||
|
|
a7e15e509e | ||
|
|
6518a378ac | ||
|
|
ebb73182f7 | ||
|
|
8fcc69165f | ||
|
|
5b98c58926 | ||
|
|
ce1534657b | ||
|
|
e2f02ea616 | ||
|
|
76134c2e2b | ||
|
|
2010855139 | ||
|
|
e550b9a155 | ||
|
|
53049d4acd | ||
|
|
bb4b45bc36 |
163
.github/workflows/python-app.yml
vendored
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
# <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: Built with pyinstaller
|
||||||
|
id: built_with_pyinstaller
|
||||||
|
run: |
|
||||||
|
python package.py
|
||||||
|
- name: Read version
|
||||||
|
id: read_version
|
||||||
|
run: |
|
||||||
|
$MAIN_VERSION=(Get-Content -Path "update_info.txt" -TotalCount 1).Trim()
|
||||||
|
"AUTO_MAA_version=$MAIN_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||||
|
$UPDATER_VERSION=(Get-Content -Path "update_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: |
|
||||||
|
move gui\ui\updater.ui .\
|
||||||
|
move gui\ico\AUTO_MAA_Updater.ico .\
|
||||||
|
Compress-Archive -Path gui,res,AUTO_MAA.py,Updater.py,package.py,dist/AUTO_MAA.exe,requirements.txt,README.md,LICENSE -DestinationPath AUTO_MAA_${{ env.AUTO_MAA_version }}.zip
|
||||||
|
del gui\ui\main.ui
|
||||||
|
del gui\ico\AUTO_MAA.ico
|
||||||
|
move updater.ui gui\ui
|
||||||
|
move AUTO_MAA_Updater.ico gui\ico
|
||||||
|
Compress-Archive -Path gui,dist/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 Update_Info Artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: update_info
|
||||||
|
path: update_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 Update_Info
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: update_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 update_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 update_info.txt))"
|
||||||
|
TAGNAME="$(sed 's/\r$//g' <(head -n 1 update_info.txt))"
|
||||||
|
NOTES_MAIN="$(sed 's/\r$//g' <(tail -n +3 update_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 update_info.txt))"
|
||||||
|
TAGNAME="$(sed 's/\r$//g' <(head -n 1 update_info.txt))"
|
||||||
|
NOTES_MAIN="$(sed 's/\r$//g' <(tail -n +3 update_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 }}
|
||||||
BIN
AUTO_MAA.exe
2509
AUTO_MAA.py
342
README.md
@@ -1,258 +1,194 @@
|
|||||||
# AUTO_MAA
|
# AUTO_MAA
|
||||||
|
|
||||||
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多账号功能体验。该软件包可以存储明日方舟多账号数据,并通过修改MAA配置文件、读取MAA日志等行为自动完成多账号代理。本开发团队承诺,不会修改明日方舟游戏本体与相关配置文件。
|
|
||||||
|
本软件是一个外部工具,旨在优化MAA多账号功能体验,并通过一些方法解决MAA项目未能解决的部分问题,改善代理的稳定性。该软件包可以存储明日方舟多账号数据,并通过修改MAA配置文件、读取MAA日志等行为自动完成多账号代理。本开发团队承诺,不会修改明日方舟游戏本体与相关配置文件。
|
||||||
|
|
||||||
本项目使用GPL开源,相关细则如下:
|
本项目使用GPL开源,相关细则如下:
|
||||||
|
|
||||||
- **作者:** AUTO_MAA软件作者为DLmaster、DLmaster361或DLmaster_361,以上均指代同一人。
|
- **作者:** AUTO_MAA软件作者为DLmaster、DLmaster361或DLmaster_361,以上均指代同一人。
|
||||||
- **使用:** AUTO_MAA使用者可以按自己的意愿自由使用本软件。依据GPL,对于由此可能产生的损失,AUTO_MAA项目组不负任何责任
|
- **使用:** AUTO_MAA使用者可以按自己的意愿自由使用本软件。依据GPL,对于由此可能产生的损失,AUTO_MAA项目组不负任何责任。
|
||||||
- **分发:** AUTO_MAA允许任何人自由分发本软件,包括进行商业活动牟利。但所有分发者必须遵循GPL向接收者提供本软件项目地址、完整的软件源码与GPL协议原文(件),违反者可能会被追究法律责任
|
- **分发:** AUTO_MAA允许任何人自由分发本软件,包括进行商业活动牟利。但所有分发者必须遵循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作出贡献
|
- **授权:** 如果希望在使用AUTO_MAA的相关成果后仍保持自己的项目闭源,请在Issues中说明来意。得到项目组认可后,我们可以提供另一份使用不同协议的代码,此协议主要内容如下:被授权者可以自由使用该代码并维持闭源;被授权者必须定期为AUTO_MAA作出贡献。
|
||||||
- **贡献:** 不论是直接参与软件的维护编写,或是撰写文档、测试、反馈BUG、给出建议、参与讨论,都为AUTO_MAA项目的发展完善做出了不可忽视的贡献。项目组提倡各位贡献者遵照GitHub开源社区惯例,发布Issues参与项目。避免私信或私发邮件(安全性漏洞或敏感问题除外),以帮助更多用户
|
- **贡献:** 不论是直接参与软件的维护编写,或是撰写文档、测试、反馈BUG、给出建议、参与讨论,都为AUTO_MAA项目的发展完善做出了不可忽视的贡献。项目组提倡各位贡献者遵照GitHub开源社区惯例,发布Issues参与项目。避免私信或私发邮件(安全性漏洞或敏感问题除外),以帮助更多用户。
|
||||||
|
|
||||||
以上细则是本项目对GPL的相关补充与强调。未提及的以GPL为准,发生冲突的以GPL为准。如有不清楚的部分,请发Issues询问。若发生纠纷,相关内容也没有在Issues上提及的,项目组拥有最终解释权
|
以上细则是本项目对GPL的相关补充与强调。未提及的以GPL为准,发生冲突的以本细则为准。如有不清楚的部分,请发Issues询问。若发生纠纷,相关内容也没有在Issues上提及的,项目组拥有最终解释权。
|
||||||
|
|
||||||
**注意**
|
**注意**
|
||||||
- 由于本软件有修改其它目录JSON文件等行为,使用前请将AUTO_MAA添加入Windows Defender信任区以及防病毒软件的信任区或开发者目录,避免被误杀
|
|
||||||
- 如程序无法正常启动,请删除`state`目录下所有文件后重试
|
|
||||||
|
|
||||||
## 安装与配置MAA
|
- 由于本软件有修改其它目录JSON文件等行为,使用前请将AUTO_MAA添加入Windows Defender信任区以及防病毒软件的信任区或开发者目录,避免被误杀。
|
||||||
|
|
||||||
本软件是MAA的外部工具,需要安装配置MAA后才能使用。
|
---
|
||||||
|
|
||||||
### MAA安装
|
# 使用方法
|
||||||
|
|
||||||
什么是MAA? [官网](https://maa.plus/)/[GitHub](https://github.com/CHNZYX/Auto_Simulated_Universe/archive/refs/heads/main.zip)
|
## 安装软件
|
||||||
|
|
||||||
MAA下载地址 [GitHub下载](https://github.com/MaaAssistantArknights/MaaAssistantArknights/releases)
|
|
||||||
|
|
||||||
### MAA配置
|
|
||||||
|
|
||||||
1. 完成MAA的adb配置等基本配置
|
|
||||||
|
|
||||||
2. 确保当前配置名为“Default”,取消所有“定时执行”
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
3. 取消勾选“开机自启动MAA”,勾选“启动MAA后直接运行”和“启动MAA后自动开启模拟器”。配置自己模拟器所在的位置并根据实际情况填写“等待模拟器启动时间”(建议预留10s以防意外)。如果是多开用户,需要填写“附加命令”,具体填写值参见多开模拟器对应快捷方式路径(如“-v 1”)。
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
4. 勾选“定时检查更新”、“自动下载更新包”和“自动安装更新包”
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## 下载AUTO_MAA软件包 [](https://github.com/DLmaster361/AUTO_MAA/releases)
|
|
||||||
|
|
||||||
GitHub下载地址 [GitHub下载](https://github.com/DLmaster361/AUTO_MAA/releases)
|
|
||||||
|
|
||||||
## 配置用户信息与相关参数
|
|
||||||
|
|
||||||
**注意:** 当前所有的密码输入部分都存在一点“小问题”,请在输入密码时避免输入Delete、F12、Tab等功能键。
|
|
||||||
|
|
||||||
-------------------------------------------------
|
|
||||||
|
|
||||||
### 第一次启动
|
|
||||||
|
|
||||||
双击启动`manage.exe`,输入MAA所在文件夹路径并回车(注意使用斜杠的种类,不要使用反斜杠),然后设置管理密钥(密钥可以包含字母大小写与特殊字符)。
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
管理密钥是解密用户密码的唯一凭证,与数据库绑定。密钥丢失或`data/key/`目录下任一文件损坏都将导致解密无法正常进行。
|
|
||||||
|
|
||||||
本项目采用自主开发的混合加密模式,项目组也无法找回您的管理密钥或修复`data/key/`目录下的文件。如果不幸的事发生,建议您删除`data/data.db`重新录入信息。
|
|
||||||
|
|
||||||
### 添加用户
|
|
||||||
|
|
||||||
输入“+”以开始添加用户。依次输入:
|
|
||||||
|
|
||||||
**用户名:** 管理用户的惟一凭证
|
|
||||||
|
|
||||||
**手机号码:** 允许隐去中间四位以“****”代替
|
|
||||||
|
|
||||||
**代理天数:** 这个还要我解释吗?
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 删除用户
|
|
||||||
|
|
||||||
输入用户名+“-”以删除用户。格式:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
用户名 -
|
本软件是MAA的外部工具,需要安装MAA后才能使用。
|
||||||
```
|
```
|
||||||
|
|
||||||

|
### 下载MAA
|
||||||
|
|
||||||
### 配置用户状态
|
- 什么是MAA? [官网](https://maa.plus/)/[GitHub](https://github.com/CHNZYX/Auto_Simulated_Universe/archive/refs/heads/main.zip)
|
||||||
|
|
||||||
**启用代理:** 输入用户名+“y”以启用该用户的代理。格式:
|
- 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`以启动软件。
|
||||||
|
|
||||||
```
|
```
|
||||||
用户名 y
|
注意:
|
||||||
|
|
||||||
|
首次启动时会要求设置管理密钥。
|
||||||
|
|
||||||
|
管理密钥是解密用户密码的唯一凭证,与数据库绑定。
|
||||||
|
密钥丢失或data/key/目录下任一文件损坏都将导致解密无法正常进行。
|
||||||
|
|
||||||
|
本项目采用自主开发的混合加密模式,项目组也无法找回您的管理密钥或修复data/key/目录下的文件。
|
||||||
|
如果不幸的事发生,建议您删除data/key/目录与data/data.db文件后重新录入信息。
|
||||||
```
|
```
|
||||||
|
|
||||||

|
### 配置信息
|
||||||
|
|
||||||
**禁用代理:** 输入用户名+“n”以禁用该用户的代理。格式:
|
#### 设置MAA
|
||||||
|
|
||||||
```
|
1. 通过`浏览`绑定MAA后,单击`设置MAA`进行MAA全局设置。
|
||||||
用户名 n
|
|
||||||
```
|
|
||||||
|
|
||||||

|
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启动时禁止电脑休眠`:仅阻止电脑自动休眠,不会影响屏幕是否熄灭。
|
||||||
|
- `检查版本更新`:从GitHub上获取版本更新,要求网络能够访问GitHub。获取版本信息时若遇网络不稳定,主程序有概率未响应,稍等片刻后恢复。
|
||||||
|
- `修改管理密钥`:修改管理密钥,当用户列表中无用户时,将跳过验证旧管理密钥。
|
||||||
|
|
||||||
```
|
#### 设置用户配置
|
||||||
用户名 关卡号 ~
|
|
||||||
```
|
|
||||||
|
|
||||||

|
本项目已基本完成GUI开发,您可以直接在用户管理页配置用户相关信息,页面简介如下:
|
||||||
|
- `新建`、`删除`:新建一个用户到当前用户配置列表、删除当前所选第一行所对应的用户。
|
||||||
|
- `转为高级/简洁`:将当前所选第一行所对应的用户转为高级/简洁配置模式。
|
||||||
|
- `修改配置`:修改更深层的用户配置信息,当前支持该项的有`简洁用户配置列表的自定义基建栏目`、`高级用户配置列表的日常、剿灭栏目`,详解如下:
|
||||||
|
- `简洁用户配置列表的自定义基建栏目`:获取自定义基建的JSON文件。
|
||||||
|
- `高级用户配置列表的日常、剿灭栏目`:打开MAA进行具体的任务配置,配置方法参见上文。注意,此时你还需要确保所要执行的任务被勾选。
|
||||||
|
- `显示密码`:输入管理密钥以显示用户密码,仅当管理密钥正确时能够修改`密码栏目`。
|
||||||
|
- `刷新`:清除临时保存的管理密钥。
|
||||||
|
- `简洁用户配置列表`:仅支持核心代理选项的设置,其它设置选项沿用MAA的全局设置,部分代理核心功能选项由程序托管。
|
||||||
|
- `高级用户配置列表`:支持几乎所有代理选项的设置,通过`修改配置`进行MAA自定义,仅部分代理核心功能选项由程序托管。
|
||||||
|
- `用户配置列表栏目`:详解如下:
|
||||||
|
- `用户名`:展示在执行界面的用户名,用于区分不同用户。
|
||||||
|
- `账号ID`:MAA进行账号切换所需的凭据,官服用户请输入手机号码、B服请输入B站ID。
|
||||||
|
- `服务器`:当前支持官服、B服。
|
||||||
|
- `代理天数`:剩余需要进行代理的天数,输入`任意负数`可设置为无限代理天数,当剩余天数为0时不再代理或排查。
|
||||||
|
- `状态`:用户的状态,禁用时将不再对其进行代理或排查。
|
||||||
|
- `执行情况`:当日执行情况,不可编辑。
|
||||||
|
- `关卡`、`备选关卡-1`、`备选关卡-2`:关卡号。
|
||||||
|
- `日常`:单独设定是否进行日常代理的日常部分,可进一步配置MAA的具体代理任务,该配置与全局MAA配置相互独立。
|
||||||
|
- `剿灭`:单独设定是否进行日常代理的剿灭部分,高级配置模式下可进一步配置MAA的具体代理任务,该配置与全局MAA配置相互独立。
|
||||||
|
- `自定义基建`:是否启用自定义基建功能,可进一步配置自定义基建文件,该配置与其他用户相互独立。
|
||||||
|
- `密码`:仅用于登记用户的密码,可留空。
|
||||||
|
- `备注`:用于备注用户信息。
|
||||||
|
|
||||||
**特别的:**
|
- 特别的:
|
||||||
|
- 对于`简洁用户配置列表的关卡、备选关卡-1、备选关卡-2栏目`您可以自定义关卡号替换方案。
|
||||||
你可以自定义关卡号替换方案。程序会读取`gameid.txt`中的数据,依据此进行关卡号的替换,便于常用关卡的使用。`gameid.txt`在初始已经存储了一些常用资源本的替代方案。
|
- 程序会读取`data/gameid.txt`中的数据,依据此进行关卡号的替换,便于常用关卡的使用。
|
||||||
|
- `gameid.txt`会在程序首次运行时生成,其中将预置一些常用资源本的替换方案。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 设置MAA路径
|
## 运行代理任务
|
||||||
|
|
||||||
输入“/”+新的MAA文件夹路径以修改MAA安装位置的配置。格式:
|
|
||||||
|
|
||||||
```
|
|
||||||
/新的MAA文件夹路径
|
|
||||||
```
|
|
||||||
|
|
||||||
**注意:** ‘/’与路径间没有空格,路径同样不能使用反斜杠
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 设置启动时间
|
|
||||||
|
|
||||||
**添加启动时间:** 输入“:+”+时间以添加定时启动时间。格式:
|
|
||||||
|
|
||||||
```
|
|
||||||
:+小时:分钟
|
|
||||||
```
|
|
||||||
|
|
||||||
**注意:** 所有输入间没有空格
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
**删除启动时间:** 输入“:-”+时间以删除定时启动时间。格式:
|
|
||||||
|
|
||||||
```
|
|
||||||
:-小时:分钟
|
|
||||||
```
|
|
||||||
|
|
||||||
**注意:** 所有输入间没有空格
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 检索信息
|
|
||||||
|
|
||||||
**检索所有信息:** `manage.exe`打开时会打印所有用户与配置信息。除此之外,你可以通过输入“all ?”以打印所有信息,如下:
|
|
||||||
|
|
||||||
```
|
|
||||||
all ?
|
|
||||||
```
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
**检索MAA路径:** 输入“maa ?”以检索MAA安装路径,如下:
|
|
||||||
|
|
||||||
```
|
|
||||||
maa ?
|
|
||||||
```
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
**检索启动时间:** 输入“time ?”以检索定时启动的时间,如下:
|
|
||||||
|
|
||||||
```
|
|
||||||
time ?
|
|
||||||
```
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
**检索指定用户:** 输入用户名+“?”以检索指定用户信息,如下:
|
|
||||||
|
|
||||||
```
|
|
||||||
用户名 ?
|
|
||||||
```
|
|
||||||
|
|
||||||
**注意:** 由于需要检索用户密码,每一次`manage.exe`启动后的首次查询需要验证管理密钥。为了方便操作,之后的查询不会再要求重复验证。因此,完成密码查询后,请及时关闭`manage.exe`。
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 修改管理密钥
|
|
||||||
|
|
||||||
输入“*”以开始修改管理密钥。依次输入:
|
|
||||||
|
|
||||||
**旧管理密钥:** 当数据库中没有存储用户信息时,允许跳过验证直接配置新管理密钥
|
|
||||||
|
|
||||||
**新管理密钥:** 请妥善保管,丢失无法找回。
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### 退出
|
|
||||||
|
|
||||||
输入“-”以退出`manage.exe`,如下:
|
|
||||||
|
|
||||||
```
|
|
||||||
-
|
|
||||||
```
|
|
||||||
|
|
||||||
## 运行代理
|
|
||||||
|
|
||||||
### 直接运行
|
### 直接运行
|
||||||
|
|
||||||
双击`run.exe`直接运行
|
- 在执行页单击`立即执行`直接运行。
|
||||||
|
|
||||||
### 定时运行
|
### 定时运行
|
||||||
|
|
||||||
双击`AUTO_MAA.exe`打开,不要关闭。它会读取设定时间,在该时刻自动运行
|
- 在执行页的`定时执行`栏设置时间。
|
||||||
|
|
||||||
**注意:** 将优先进行剿灭代理
|
- 保持软件打开,软件会在设定的时间自动运行。
|
||||||
|
|
||||||
## 关于
|
## 人工排查代理结果
|
||||||
|
|
||||||
项目图标由文心一格AI生成
|
### 直接开始人工排查
|
||||||
|
|
||||||
----------------------------------------------------------------------------------------------
|
- 在执行页单击`开始排查`启动排查进程。
|
||||||
|
|
||||||
欢迎加入AUTO_MAA项目组,欢迎反馈bug
|
- 软件将调起MAA,依次登录各用户的账号。
|
||||||
|
|
||||||
QQ群:暂时没有
|
- 完成PRTS登录后,请人工检查代理情况,可以手动完成未代理的任务。
|
||||||
|
|
||||||
----------------------------------------------------------------------------------------------
|
- 在对话框中单击对应账号的代理情况。
|
||||||
|
|
||||||
如果喜欢本项目,可以打赏送作者一杯咖啡喵!
|
- 结束人工排查后,相应排查情况将被写入用户管理页的`备注栏目`。
|
||||||
|
|
||||||

|
---
|
||||||
|
|
||||||
|
# 关于
|
||||||
|
|
||||||
|
## 未来开发方向
|
||||||
|
|
||||||
|
- [x] 支持B服
|
||||||
|
- [x] 支持完全自定义MAA配置
|
||||||
|
- [x] 支持程序版本更新
|
||||||
|
- [ ] 支持对MAA运行状况的进一步识别
|
||||||
|
- [ ] 支持宽幅ADB连接适配
|
||||||
|
- [ ] 添加更多通知手段
|
||||||
|
- [ ] GUI界面美化
|
||||||
|
|
||||||
----------------------------------------------------------------------------------------------
|
|
||||||
## 贡献者
|
## 贡献者
|
||||||
|
|
||||||
感谢以下贡献者对本项目做出的贡献
|
感谢以下贡献者对本项目做出的贡献
|
||||||
@@ -267,4 +203,16 @@ QQ群:暂时没有
|
|||||||
|
|
||||||
## Star History
|
## Star History
|
||||||
|
|
||||||
[](https://star-history.com/#DLmaster361/AUTO_MAA&Date)
|
[](https://star-history.com/#DLmaster361/AUTO_MAA&Date)
|
||||||
|
|
||||||
|
## 交流与赞助
|
||||||
|
|
||||||
|
欢迎加入AUTO_MAA项目组,欢迎反馈bug
|
||||||
|
|
||||||
|
- QQ群:957750551
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
如果喜欢这个项目的话,给作者来杯咖啡吧!
|
||||||
|
|
||||||
|

|
||||||
176
Updater.py
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
# <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.0
|
||||||
|
作者:DLmaster_361
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import json
|
||||||
|
import zipfile
|
||||||
|
import requests
|
||||||
|
|
||||||
|
from PySide6.QtWidgets import (
|
||||||
|
QApplication,
|
||||||
|
QLabel,
|
||||||
|
QProgressBar,
|
||||||
|
)
|
||||||
|
from PySide6.QtGui import QIcon
|
||||||
|
from PySide6.QtCore import QObject, QThread, Signal
|
||||||
|
from PySide6.QtUiTools import QUiLoader
|
||||||
|
|
||||||
|
uiLoader = QUiLoader()
|
||||||
|
|
||||||
|
|
||||||
|
class UpdateProcess(QThread):
|
||||||
|
|
||||||
|
info = Signal(str)
|
||||||
|
progress = Signal(int, int, int)
|
||||||
|
accomplish = Signal()
|
||||||
|
|
||||||
|
def __init__(self, app_path, name, download_url, version):
|
||||||
|
super(UpdateProcess, self).__init__()
|
||||||
|
|
||||||
|
self.app_path = app_path
|
||||||
|
self.name = name
|
||||||
|
self.download_url = download_url
|
||||||
|
self.version = version
|
||||||
|
self.download_path = app_path + "/AUTO_MAA_Update.zip" # 临时下载文件的路径
|
||||||
|
self.version_path = app_path + "/res/version.json"
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
|
||||||
|
# 下载
|
||||||
|
try:
|
||||||
|
response = requests.get(self.download_url, stream=True)
|
||||||
|
file_size = response.headers.get("Content-Length")
|
||||||
|
if file_size is None:
|
||||||
|
file_size = 1
|
||||||
|
else:
|
||||||
|
file_size = int(file_size)
|
||||||
|
with open(self.download_path, "wb") as f:
|
||||||
|
downloaded_size = 0
|
||||||
|
for chunk in response.iter_content(chunk_size=8192):
|
||||||
|
f.write(chunk)
|
||||||
|
downloaded_size += len(chunk)
|
||||||
|
self.info.emit(
|
||||||
|
f"正在下载:{self.name} 已下载: {downloaded_size / 1048576:.2f}/{file_size / 1048576:.2f} MB ({downloaded_size / file_size * 100:.2f}%)"
|
||||||
|
)
|
||||||
|
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:
|
||||||
|
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)
|
||||||
|
|
||||||
|
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}")
|
||||||
|
|
||||||
|
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"] = self.version
|
||||||
|
elif self.name == "AUTO_MAA主程序":
|
||||||
|
version_info["main_version"] = self.version
|
||||||
|
with open(self.version_path, "w", encoding="utf-8") as f:
|
||||||
|
json.dump(version_info, f, indent=4)
|
||||||
|
|
||||||
|
self.accomplish.emit()
|
||||||
|
|
||||||
|
|
||||||
|
class Updater(QObject):
|
||||||
|
|
||||||
|
def __init__(self, app_path, name, download_url, version):
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
self.ui = uiLoader.load(app_path + "/gui/ui/updater.ui")
|
||||||
|
self.ui.setWindowTitle("AUTO_MAA更新器")
|
||||||
|
self.ui.setWindowIcon(QIcon(app_path + "/gui/ico/AUTO_MAA_Updater.ico"))
|
||||||
|
|
||||||
|
self.info = self.ui.findChild(QLabel, "label")
|
||||||
|
self.info.setText("正在初始化")
|
||||||
|
|
||||||
|
self.progress = self.ui.findChild(QProgressBar, "progressBar")
|
||||||
|
self.progress.setRange(0, 0)
|
||||||
|
|
||||||
|
self.update_process = UpdateProcess(app_path, name, download_url, 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):
|
||||||
|
self.info.setText(text)
|
||||||
|
|
||||||
|
def update_progress(self, begin, end, current):
|
||||||
|
self.progress.setRange(begin, end)
|
||||||
|
self.progress.setValue(current)
|
||||||
|
|
||||||
|
|
||||||
|
class AUTO_MAA_Updater(QApplication):
|
||||||
|
def __init__(self, app_path, name, download_url, version):
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
self.main = Updater(app_path, name, download_url, version)
|
||||||
|
self.main.ui.show()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
# 获取软件自身的路径
|
||||||
|
app_path = os.path.dirname(os.path.realpath(sys.argv[0])).replace("\\", "/")
|
||||||
|
# 从本地版本信息文件获取当前版本信息
|
||||||
|
with open(app_path + "/res/version.json", "r", encoding="utf-8") as f:
|
||||||
|
version_current = json.load(f)
|
||||||
|
main_version_current = list(map(int, version_current["main_version"].split(".")))
|
||||||
|
# 从远程服务器获取最新版本信息
|
||||||
|
response = requests.get(
|
||||||
|
"https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/blob/main/res/version.json"
|
||||||
|
)
|
||||||
|
version_remote = response.json()
|
||||||
|
main_version_remote = list(map(int, version_remote["main_version"].split(".")))
|
||||||
|
|
||||||
|
if main_version_remote > main_version_current:
|
||||||
|
app = AUTO_MAA_Updater(
|
||||||
|
app_path,
|
||||||
|
"AUTO_MAA主程序",
|
||||||
|
version_remote["main_download_url"],
|
||||||
|
version_remote["main_version"],
|
||||||
|
)
|
||||||
|
sys.exit(app.exec())
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
龙门币:CE-6
|
|
||||||
技能:CA-5
|
|
||||||
红票:AP-5
|
|
||||||
经验:LS-6
|
|
||||||
剿灭模式:Annihilation
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
管理密钥是解密用户密码的唯一凭证,与数据库绑定。密钥丢失或data/key/目录下任一文件损坏都将导致解密无法正常进行。
|
|
||||||
|
|
||||||
本项目采用自主开发的混合加密模式,项目组也无法找回您的管理密钥或修复data/key/目录下的文件。如果不幸的事发生,建议您删除data/data.db重新录入信息。
|
|
||||||
BIN
gui/ico/AUTO_MAA.ico
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
gui/ico/AUTO_MAA_Updater.ico
Normal file
|
After Width: | Height: | Size: 21 KiB |
1320
gui/ui/main.ui
Normal file
35
gui/ui/updater.ui
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>Dialog</class>
|
||||||
|
<widget class="QDialog" name="Dialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>500</width>
|
||||||
|
<height>61</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>AUTO_MAA更新器</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QProgressBar" name="progressBar">
|
||||||
|
<property name="value">
|
||||||
|
<number>24</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
BIN
manage.exe
470
manage.py
@@ -1,470 +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
|
|
||||||
|
|
||||||
import sqlite3
|
|
||||||
import datetime
|
|
||||||
import msvcrt
|
|
||||||
import sys
|
|
||||||
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
|
|
||||||
|
|
||||||
#读入密码
|
|
||||||
def readpass(text):
|
|
||||||
sys.stdout=sys.__stdout__
|
|
||||||
sys.stdout.write(text)
|
|
||||||
sys.stdout.flush()
|
|
||||||
p=''
|
|
||||||
while True:
|
|
||||||
typed=msvcrt.getch()
|
|
||||||
if len(p)!=0:
|
|
||||||
if typed==b'\r':
|
|
||||||
sys.stdout.write('\b*')
|
|
||||||
sys.stdout.flush()
|
|
||||||
break
|
|
||||||
elif typed==b'\b':
|
|
||||||
p=p[:-1]
|
|
||||||
sys.stdout.write('\b \b')
|
|
||||||
sys.stdout.flush()
|
|
||||||
else:
|
|
||||||
p+=typed.decode("utf-8")
|
|
||||||
sys.stdout.write('\b*'+typed.decode("utf-8"))
|
|
||||||
sys.stdout.flush()
|
|
||||||
elif typed!=b'\r' and typed!=b'\b':
|
|
||||||
p+=typed.decode("utf-8")
|
|
||||||
sys.stdout.write(typed.decode("utf-8"))
|
|
||||||
sys.stdout.flush()
|
|
||||||
print('')
|
|
||||||
return p
|
|
||||||
|
|
||||||
#配置密钥
|
|
||||||
def getPASSWORD(PASSWORD):
|
|
||||||
#生成RSA密钥对
|
|
||||||
key=RSA.generate(2048)
|
|
||||||
public_key_local=key.publickey()
|
|
||||||
private_key=key
|
|
||||||
#保存RSA公钥
|
|
||||||
with open('data/key/public_key.pem','wb') as f:
|
|
||||||
f.write(public_key_local.exportKey())
|
|
||||||
#生成密钥转换与校验随机盐
|
|
||||||
PASSWORDsalt=secrets.token_hex(random.randint(32,1024))
|
|
||||||
with open("data/key/PASSWORDsalt.txt","w",encoding="utf-8") as f:
|
|
||||||
print(PASSWORDsalt,file=f)
|
|
||||||
verifysalt=secrets.token_hex(random.randint(32,1024))
|
|
||||||
with open("data/key/verifysalt.txt","w",encoding="utf-8") as f:
|
|
||||||
print(verifysalt,file=f)
|
|
||||||
#将管理密钥转化为AES-256密钥
|
|
||||||
AES_password=hashlib.sha256((PASSWORD+PASSWORDsalt).encode("utf-8")).digest()
|
|
||||||
#生成AES-256密钥校验哈希值并保存
|
|
||||||
AES_password_verify=hashlib.sha256(AES_password+verifysalt.encode("utf-8")).digest()
|
|
||||||
with open("data/key/AES_password_verify.bin","wb") as f:
|
|
||||||
f.write(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))
|
|
||||||
with open("data/key/private_key.bin","wb") as f:
|
|
||||||
f.write(private_key_local)
|
|
||||||
|
|
||||||
#加密
|
|
||||||
def encryptx(note):
|
|
||||||
#读取RSA公钥
|
|
||||||
with open('data/key/public_key.pem','rb') as f:
|
|
||||||
public_key_local=RSA.import_key(f.read())
|
|
||||||
#使用RSA公钥对数据进行加密
|
|
||||||
cipher=PKCS1_OAEP.new(public_key_local)
|
|
||||||
encrypted=cipher.encrypt(note.encode("utf-8"))
|
|
||||||
return encrypted
|
|
||||||
|
|
||||||
#解密
|
|
||||||
def decryptx(note,PASSWORD):
|
|
||||||
#读入RSA私钥密文、盐与校验哈希值
|
|
||||||
with open("data/key/private_key.bin","rb") as f:
|
|
||||||
private_key_local=f.read().strip()
|
|
||||||
with open("data/key/PASSWORDsalt.txt","r",encoding="utf-8") as f:
|
|
||||||
PASSWORDsalt=f.read().strip()
|
|
||||||
with open("data/key/verifysalt.txt","r",encoding="utf-8") as f:
|
|
||||||
verifysalt=f.read().strip()
|
|
||||||
with open("data/key/AES_password_verify.bin","rb") as f:
|
|
||||||
AES_password_verify=f.read().strip()
|
|
||||||
#将管理密钥转化为AES-256密钥并验证
|
|
||||||
AES_password=hashlib.sha256((PASSWORD+PASSWORDsalt).encode("utf-8")).digest()
|
|
||||||
AES_password_SHA=hashlib.sha256(AES_password+verifysalt.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 changePASSWORD():
|
|
||||||
#获取用户信息
|
|
||||||
db=sqlite3.connect(DATABASE)
|
|
||||||
cur=db.cursor()
|
|
||||||
cur.execute("SELECT * FROM adminx WHERE True")
|
|
||||||
data=cur.fetchall()
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
data=[list(row) for row in data]
|
|
||||||
global PASSWORD
|
|
||||||
#验证管理密钥
|
|
||||||
PASSWORDold=readpass("请输入旧管理密钥:")
|
|
||||||
if len(data)==0:
|
|
||||||
print("当前无用户,验证自动通过")
|
|
||||||
PASSWORDnew=readpass("请输入新管理密钥:")
|
|
||||||
getPASSWORD(PASSWORDnew)
|
|
||||||
PASSWORD=PASSWORDnew
|
|
||||||
return "管理密钥修改成功"
|
|
||||||
while decryptx(data[0][6],PASSWORDold)=="管理密钥错误":
|
|
||||||
print("管理密钥错误")
|
|
||||||
PASSWORDold=readpass("请输入旧管理密钥:")
|
|
||||||
print("验证通过")
|
|
||||||
#修改管理密钥
|
|
||||||
PASSWORDnew=readpass("请输入新管理密钥:")
|
|
||||||
#使用旧管理密钥解密
|
|
||||||
for i in range(len(data)):
|
|
||||||
data[i][6]=decryptx(data[i][6],PASSWORDold)
|
|
||||||
#使用新管理密钥重新加密
|
|
||||||
getPASSWORD(PASSWORDnew)
|
|
||||||
db=sqlite3.connect(DATABASE)
|
|
||||||
cur=db.cursor()
|
|
||||||
for i in range(len(data)):
|
|
||||||
cur.execute("UPDATE adminx SET password=? WHERE admin=?",(encryptx(data[i][6]),data[i][0]))
|
|
||||||
db.commit()
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
PASSWORD=PASSWORDnew
|
|
||||||
return "管理密钥修改成功"
|
|
||||||
|
|
||||||
#添加用户
|
|
||||||
def add():
|
|
||||||
adminx=input("用户名:")
|
|
||||||
#用户名重复验证
|
|
||||||
while search(adminx,0)=="":
|
|
||||||
print("该用户已存在,请重新输入")
|
|
||||||
adminx=input("用户名:")
|
|
||||||
numberx=input("手机号码:")
|
|
||||||
dayx=int(input("代理天数:"))
|
|
||||||
gamex=input("关卡号:")
|
|
||||||
passwordx=readpass("密码:")
|
|
||||||
passwordx=encryptx(passwordx)
|
|
||||||
#应用更新
|
|
||||||
db=sqlite3.connect(DATABASE)
|
|
||||||
cur=db.cursor()
|
|
||||||
cur.execute("INSERT INTO adminx VALUES(?,?,?,'y','2000-01-01',?,?)",(adminx,numberx,dayx,gamex,passwordx))
|
|
||||||
db.commit()
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
return "操作成功"
|
|
||||||
|
|
||||||
#删除用户信息
|
|
||||||
def delete(id):
|
|
||||||
#检查用户是否存在
|
|
||||||
if search(id,0)!="":
|
|
||||||
return "未找到"+id
|
|
||||||
#应用更新
|
|
||||||
db=sqlite3.connect(DATABASE)
|
|
||||||
cur=db.cursor()
|
|
||||||
cur.execute("DELETE FROM adminx WHERE admin=?",(id,))
|
|
||||||
db.commit()
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
return "成功删除"+id
|
|
||||||
|
|
||||||
#检索用户信息与配置
|
|
||||||
def search(id,book):
|
|
||||||
db=sqlite3.connect(DATABASE)
|
|
||||||
cur=db.cursor()
|
|
||||||
#处理启动时间查询
|
|
||||||
if id=="time":
|
|
||||||
cur.execute("SELECT * FROM timeset WHERE True")
|
|
||||||
timex=cur.fetchall()
|
|
||||||
timex=[list(row) for row in timex]
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
if len(timex)==0:
|
|
||||||
return "启动时间未设置"
|
|
||||||
else:
|
|
||||||
for i in range(len(timex)):
|
|
||||||
print(timex[i][0])
|
|
||||||
return ""
|
|
||||||
#处理MAA路径查询
|
|
||||||
if id=="maa":
|
|
||||||
cur.execute("SELECT * FROM pathset WHERE True")
|
|
||||||
pathx=cur.fetchall()
|
|
||||||
if len(pathx)>0:
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
return pathx[0][0]
|
|
||||||
else:
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
return "MAA路径未设置"
|
|
||||||
#处理用户查询与全部信息查询
|
|
||||||
if id=="all":
|
|
||||||
cur.execute("SELECT * FROM adminx WHERE True")
|
|
||||||
else:
|
|
||||||
cur.execute("SELECT * FROM adminx WHERE admin=?",(id,))
|
|
||||||
data=cur.fetchall()
|
|
||||||
#处理全部信息查询时的MAA路径与启动时间查询
|
|
||||||
if id=="all":
|
|
||||||
cur.execute("SELECT * FROM pathset WHERE True")
|
|
||||||
pathx=cur.fetchall()
|
|
||||||
if len(pathx)>0:
|
|
||||||
print("\nMAA路径:"+pathx[0][0])
|
|
||||||
else:
|
|
||||||
print("\nMAA路径未设置")
|
|
||||||
cur.execute("SELECT * FROM timeset WHERE True")
|
|
||||||
timex=cur.fetchall()
|
|
||||||
timex=[list(row) for row in timex]
|
|
||||||
if len(timex)==0:
|
|
||||||
print("\n启动时间未设置")
|
|
||||||
else:
|
|
||||||
print("启动时间:",end='')
|
|
||||||
for i in range(len(timex)):
|
|
||||||
print(timex[i][0],end=' ')
|
|
||||||
print('')
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
data=[list(row) for row in data]
|
|
||||||
if len(data)>0:
|
|
||||||
#转译执行情况、用户状态,对全部信息查询与无输出查询隐去密码
|
|
||||||
curdate=datetime.date.today()
|
|
||||||
curdate=curdate.strftime('%Y-%m-%d')
|
|
||||||
for i in range(len(data)):
|
|
||||||
if data[i][4]==curdate:
|
|
||||||
data[i][4]="今日已执行"
|
|
||||||
else:
|
|
||||||
data[i][4]="今日未执行"
|
|
||||||
if data[i][3]=='y':
|
|
||||||
data[i][3]="启用"
|
|
||||||
else:
|
|
||||||
data[i][3]="禁用"
|
|
||||||
if id=="all" or book==0:
|
|
||||||
data[i][6]="******"
|
|
||||||
else:
|
|
||||||
#解密
|
|
||||||
global PASSWORD
|
|
||||||
if PASSWORD==0 or decryptx(data[i][6],PASSWORD)=="管理密钥错误":
|
|
||||||
PASSWORD=readpass("请输入管理密钥:")
|
|
||||||
data[i][6]=decryptx(data[i][6],PASSWORD)
|
|
||||||
#制表输出
|
|
||||||
if book==1:
|
|
||||||
print('')
|
|
||||||
print(unit("用户名",15),unit("手机号码",12),unit("代理天数",8),unit("状态",4),unit("执行情况",10),unit("关卡",10),unit("密码",25))
|
|
||||||
for i in range(len(data)):
|
|
||||||
print(unit(data[i][0],15),unit(data[i][1],12),unit(data[i][2],8),unit(data[i][3],4),unit(data[i][4],10),unit(data[i][5],10),unit(data[i][6],25))
|
|
||||||
return ""
|
|
||||||
elif id=="all":
|
|
||||||
return "\n当前没有用户记录"
|
|
||||||
else:
|
|
||||||
return "未找到"+id
|
|
||||||
|
|
||||||
#续期
|
|
||||||
def renewal(readxx):
|
|
||||||
#提取用户名与续期时间
|
|
||||||
for i in range(len(readxx)):
|
|
||||||
if readxx[i]==' ':
|
|
||||||
id=readxx[:i]
|
|
||||||
dayp=int(readxx[i+1:])
|
|
||||||
break
|
|
||||||
#检查用户是否存在
|
|
||||||
if search(id,0)!="":
|
|
||||||
return "未找到"+id
|
|
||||||
#应用更新
|
|
||||||
db=sqlite3.connect(DATABASE)
|
|
||||||
cur=db.cursor()
|
|
||||||
cur.execute("SELECT * FROM adminx WHERE admin=?",(id,))
|
|
||||||
data=cur.fetchall()
|
|
||||||
cur.execute("UPDATE adminx SET day=? WHERE admin=?",(data[0][2]+dayp,id))
|
|
||||||
db.commit()
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
return '成功更新'+id+'的代理天数至'+str(data[0][2]+dayp)+'天'
|
|
||||||
|
|
||||||
#用户状态配置
|
|
||||||
def turn(id,t):
|
|
||||||
#检查用户是否存在
|
|
||||||
if search(id,0)!="":
|
|
||||||
return "未找到"+id
|
|
||||||
#应用更新
|
|
||||||
db=sqlite3.connect(DATABASE)
|
|
||||||
cur=db.cursor()
|
|
||||||
cur.execute("UPDATE adminx SET status=? WHERE admin=?",(t,id))
|
|
||||||
db.commit()
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
if t=='y':
|
|
||||||
return '已启用'+id
|
|
||||||
else:
|
|
||||||
return '已禁用'+id
|
|
||||||
|
|
||||||
#修改刷取关卡
|
|
||||||
def gameid(readxx):
|
|
||||||
#提取用户名与修改值
|
|
||||||
for i in range(len(readxx)):
|
|
||||||
if readxx[i]==' ':
|
|
||||||
id=readxx[:i]
|
|
||||||
gamep=readxx[i+1:]
|
|
||||||
break
|
|
||||||
#检查用户是否存在
|
|
||||||
if search(id,0)!="":
|
|
||||||
return "未找到"+id
|
|
||||||
#导入与应用特殊关卡规则
|
|
||||||
games={}
|
|
||||||
with open('data/gameid.txt',encoding='utf-8') as f:
|
|
||||||
gameids=f.readlines()
|
|
||||||
for i in range(len(gameids)):
|
|
||||||
for j in range(len(gameids[i])):
|
|
||||||
if gameids[i][j]==':':
|
|
||||||
gamein=gameids[i][:j]
|
|
||||||
gameout=gameids[i][j+1:]
|
|
||||||
break
|
|
||||||
games[gamein]=gameout.strip()
|
|
||||||
if gamep in games:
|
|
||||||
gamep=games[gamep]
|
|
||||||
#应用更新
|
|
||||||
db=sqlite3.connect(DATABASE)
|
|
||||||
cur=db.cursor()
|
|
||||||
cur.execute("UPDATE adminx SET game=? WHERE admin=?",(gamep,id))
|
|
||||||
db.commit()
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
return '成功更新'+id+'的关卡为'+gamep
|
|
||||||
|
|
||||||
#设置MAA路径
|
|
||||||
def setpath(pathx):
|
|
||||||
db=sqlite3.connect(DATABASE)
|
|
||||||
cur=db.cursor()
|
|
||||||
cur.execute("SELECT * FROM pathset WHERE True")
|
|
||||||
pathold=cur.fetchall()
|
|
||||||
if len(pathold)>0:
|
|
||||||
cur.execute("UPDATE pathset SET path=? WHERE True",(pathx,))
|
|
||||||
else:
|
|
||||||
cur.execute("INSERT INTO pathset VALUES(?)",(pathx,))
|
|
||||||
db.commit()
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
return "MAA路径已设置为"+pathx
|
|
||||||
|
|
||||||
#设置启动时间
|
|
||||||
def settime(book,timex):
|
|
||||||
db=sqlite3.connect(DATABASE)
|
|
||||||
cur=db.cursor()
|
|
||||||
#检查待操作对象存在情况
|
|
||||||
cur.execute("SELECT * FROM timeset WHERE True")
|
|
||||||
timeold=cur.fetchall()
|
|
||||||
timeold=[list(row) for row in timeold]
|
|
||||||
timenew=[]
|
|
||||||
timenew.append(timex)
|
|
||||||
#添加时间设置
|
|
||||||
if book=='+':
|
|
||||||
if timenew in timeold:
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
return "已存在"+timex
|
|
||||||
else:
|
|
||||||
cur.execute("INSERT INTO timeset VALUES(?)",(timex,))
|
|
||||||
db.commit()
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
return "已添加"+timex
|
|
||||||
#删除时间设置
|
|
||||||
elif book=='-':
|
|
||||||
if timenew in timeold:
|
|
||||||
cur.execute("DELETE FROM timeset WHERE time=?",(timex,))
|
|
||||||
db.commit()
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
return "已删除"+timex
|
|
||||||
else:
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
return "未找到"+timex
|
|
||||||
|
|
||||||
#统一制表单元
|
|
||||||
def unit(x,m):
|
|
||||||
#字母与连接符占1位,中文占2位
|
|
||||||
x=str(x)
|
|
||||||
n=0
|
|
||||||
for i in x:
|
|
||||||
if 'a'<=i<='z' or 'A'<=i<='Z' or '0'<=i<='9' or i=='_' or i=='-':
|
|
||||||
n+=1
|
|
||||||
return ' '+x+' '*(m-2*len(x)+n)
|
|
||||||
|
|
||||||
#初期检查
|
|
||||||
DATABASE="data/data.db"
|
|
||||||
PASSWORD=0
|
|
||||||
if not os.path.exists(DATABASE):
|
|
||||||
db=sqlite3.connect(DATABASE)
|
|
||||||
cur=db.cursor()
|
|
||||||
db.execute("CREATE TABLE adminx(admin text,number text,day int,status text,last date,game text,password byte)")
|
|
||||||
db.execute("CREATE TABLE pathset(path text)")
|
|
||||||
db.execute("CREATE TABLE timeset(time text)")
|
|
||||||
readx=input("首次启动,请设置MAA路径:")
|
|
||||||
cur.execute("INSERT INTO pathset VALUES(?)",(readx,))
|
|
||||||
db.commit()
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
PASSWORD=readpass("请设置管理密钥(密钥与数据库绑定):")
|
|
||||||
getPASSWORD(PASSWORD)
|
|
||||||
|
|
||||||
#初始界面
|
|
||||||
print("Good evening!")
|
|
||||||
print(search("all",1))
|
|
||||||
|
|
||||||
#主程序
|
|
||||||
while True:
|
|
||||||
read=input()
|
|
||||||
if len(read)==0:
|
|
||||||
print("无法识别的输入")
|
|
||||||
elif read[0]=='+' and len(read)==1:
|
|
||||||
print(add())
|
|
||||||
elif read[0]=='-' and len(read)==1:
|
|
||||||
os._exit(0)
|
|
||||||
elif read[0]=='/':
|
|
||||||
print(setpath(read[1:]))
|
|
||||||
elif read[0]=='*' and len(read)==1:
|
|
||||||
print(changePASSWORD())
|
|
||||||
elif read[0]==':' and (read[1]=='+' or read[1]=='-'):
|
|
||||||
print(settime(read[1],read[2:]))
|
|
||||||
else:
|
|
||||||
if read[-1]=='?' and read[-2]==' ':
|
|
||||||
print(search(read[:-2],1))
|
|
||||||
elif read[-1]=='+' and read[-2]==' ':
|
|
||||||
print(renewal(read[:-2]))
|
|
||||||
elif read[-1]=='-' and read[-2]==' ':
|
|
||||||
print(delete(read[:-2]))
|
|
||||||
elif read[-1]=='~' and read[-2]==' ':
|
|
||||||
print(gameid(read[:-2]))
|
|
||||||
elif (read[-1]=='y' or read[-1]=='n') and read[-2]==' ':
|
|
||||||
print(turn(read[:-2],read[-1]))
|
|
||||||
else:
|
|
||||||
print("无法识别的输入")
|
|
||||||
66
package.py
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
# <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.1
|
||||||
|
作者:DLmaster_361
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
def version_text(version_numb):
|
||||||
|
"""将版本号列表转为可读的文本信息"""
|
||||||
|
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"
|
||||||
|
return version
|
||||||
|
|
||||||
|
|
||||||
|
with open("res/version.json", "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(".")))
|
||||||
|
|
||||||
|
main_info = f"# UTF-8\n#\nVSVersionInfo(\n ffi=FixedFileInfo(\n # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)\n # Set not needed items to zero 0.\n filevers=({', '.join(str(_) for _ in main_version_numb)}),\n prodvers=(0, 0, 0, 0),\n # Contains a bitmask that specifies the valid bits 'flags'r\n mask=0x3f,\n # Contains a bitmask that specifies the Boolean attributes of the file.\n flags=0x0,\n # The operating system for which this file was designed.\n # 0x4 - NT and there is no need to change it.\n OS=0x4,\n # The general type of file.\n # 0x1 - the file is an application.\n fileType=0x1,\n # The function of the file.\n # 0x0 - the function is not defined for this fileType\n subtype=0x0,\n # Creation date and time stamp.\n date=(0, 0)\n ),\n kids=[\n VarFileInfo([VarStruct('Translation', [0, 1200])]), \n StringFileInfo(\n [\n StringTable(\n '000004b0',\n [StringStruct('Comments', 'https://github.com/DLmaster361/AUTO_MAA/'),\n StringStruct('CompanyName', 'AUTO_MAA Team'),\n StringStruct('FileDescription', 'AUTO_MAA Component'),\n StringStruct('FileVersion', '{version["main_version"]}'),\n StringStruct('InternalName', 'AUTO_MAA'),\n StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),\n StringStruct('OriginalFilename', 'AUTO_MAA.py'),\n StringStruct('ProductName', 'AUTO_MAA'),\n StringStruct('ProductVersion', 'v{version["main_version"]}'),\n StringStruct('Assembly Version', 'v{version["main_version"]}')])\n ])\n ]\n)"
|
||||||
|
updater_info = f"# UTF-8\n#\nVSVersionInfo(\n ffi=FixedFileInfo(\n # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)\n # Set not needed items to zero 0.\n filevers=({', '.join(str(_) for _ in updater_version_numb)}),\n prodvers=(0, 0, 0, 0),\n # Contains a bitmask that specifies the valid bits 'flags'r\n mask=0x3f,\n # Contains a bitmask that specifies the Boolean attributes of the file.\n flags=0x0,\n # The operating system for which this file was designed.\n # 0x4 - NT and there is no need to change it.\n OS=0x4,\n # The general type of file.\n # 0x1 - the file is an application.\n fileType=0x1,\n # The function of the file.\n # 0x0 - the function is not defined for this fileType\n subtype=0x0,\n # Creation date and time stamp.\n date=(0, 0)\n ),\n kids=[\n VarFileInfo([VarStruct('Translation', [0, 1200])]), \n StringFileInfo(\n [\n StringTable(\n '000004b0',\n [StringStruct('Comments', 'https://github.com/DLmaster361/AUTO_MAA/'),\n StringStruct('CompanyName', 'AUTO_MAA Team'),\n StringStruct('FileDescription', 'AUTO_MAA Component'),\n StringStruct('FileVersion', '{version["updater_version"]}'),\n StringStruct('InternalName', 'AUTO_MAA_Updater'),\n StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),\n StringStruct('OriginalFilename', 'Updater.py'),\n StringStruct('ProductName', 'AUTO_MAA_Updater'),\n StringStruct('ProductVersion', 'v{version["updater_version"]}'),\n StringStruct('Assembly Version', 'v{version["updater_version"]}')])\n ])\n ]\n)"
|
||||||
|
|
||||||
|
with open("AUTO_MAA_info.txt", "w", encoding="utf-8") as f:
|
||||||
|
print(main_info, end="", file=f)
|
||||||
|
with open("Updater_info.txt", "w", encoding="utf-8") as f:
|
||||||
|
print(updater_info, end="", file=f)
|
||||||
|
|
||||||
|
os.system(
|
||||||
|
"pyinstaller -F --version-file AUTO_MAA_info.txt -w --icon=gui/ico/AUTO_MAA.ico AUTO_MAA.py --hidden-import plyer.platforms.win.notification"
|
||||||
|
)
|
||||||
|
os.system(
|
||||||
|
"pyinstaller -F --version-file Updater_info.txt -w --icon=gui/ico/AUTO_MAA_Updater.ico Updater.py"
|
||||||
|
)
|
||||||
|
|
||||||
|
with open("update_info.txt", "w", encoding="utf-8") as f:
|
||||||
|
print(
|
||||||
|
f"{version_text(main_version_numb)}\n{version_text(updater_version_numb)}{version["announcement"]}",
|
||||||
|
file=f,
|
||||||
|
)
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
termcolor
|
plyer
|
||||||
|
PySide6
|
||||||
pycryptodome
|
pycryptodome
|
||||||
pyinstaller
|
pyinstaller
|
||||||
|
requests
|
||||||
BIN
res/AUTO_MAA.ico
|
Before Width: | Height: | Size: 1.0 MiB |
BIN
res/AUTO_MAA.png
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 1.6 MiB |
BIN
res/README/MAA配置.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 746 KiB After Width: | Height: | Size: 309 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 92 KiB |
43
res/info.txt
@@ -1,43 +0,0 @@
|
|||||||
# UTF-8
|
|
||||||
#
|
|
||||||
VSVersionInfo(
|
|
||||||
ffi=FixedFileInfo(
|
|
||||||
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
|
||||||
# Set not needed items to zero 0.
|
|
||||||
filevers=(2, 1, 4, 0),
|
|
||||||
prodvers=(0, 0, 0, 0),
|
|
||||||
# Contains a bitmask that specifies the valid bits 'flags'r
|
|
||||||
mask=0x3f,
|
|
||||||
# Contains a bitmask that specifies the Boolean attributes of the file.
|
|
||||||
flags=0x0,
|
|
||||||
# The operating system for which this file was designed.
|
|
||||||
# 0x4 - NT and there is no need to change it.
|
|
||||||
OS=0x4,
|
|
||||||
# The general type of file.
|
|
||||||
# 0x1 - the file is an application.
|
|
||||||
fileType=0x1,
|
|
||||||
# The function of the file.
|
|
||||||
# 0x0 - the function is not defined for this fileType
|
|
||||||
subtype=0x0,
|
|
||||||
# Creation date and time stamp.
|
|
||||||
date=(0, 0)
|
|
||||||
),
|
|
||||||
kids=[
|
|
||||||
VarFileInfo([VarStruct('Translation', [0, 1200])]),
|
|
||||||
StringFileInfo(
|
|
||||||
[
|
|
||||||
StringTable(
|
|
||||||
'000004b0',
|
|
||||||
[StringStruct('Comments', 'https://github.com/DLmaster361/AUTO_MAA/'),
|
|
||||||
StringStruct('CompanyName', 'AUTO_MAA Team'),
|
|
||||||
StringStruct('FileDescription', 'AUTO_MAA Component'),
|
|
||||||
StringStruct('FileVersion', '2.1.4'),
|
|
||||||
StringStruct('InternalName', 'AUTO_MAA'),
|
|
||||||
StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),
|
|
||||||
StringStruct('OriginalFilename', 'AUTO_MAA'),
|
|
||||||
StringStruct('ProductName', 'AUTO_MAA'),
|
|
||||||
StringStruct('ProductVersion', 'v2.1.4'),
|
|
||||||
StringStruct('Assembly Version', '2.1.4.0')])
|
|
||||||
])
|
|
||||||
]
|
|
||||||
)
|
|
||||||
19
res/set.txt
@@ -1,16 +1,19 @@
|
|||||||
#主界面
|
#主界面
|
||||||
"MainFunction.ActionAfterCompleted": "ExitEmulatorAndSelf" #完成后
|
"MainFunction.PostActions": "12" #完成后
|
||||||
"TaskQueue.WakeUp.IsChecked": "True" #开始唤醒
|
"TaskQueue.WakeUp.IsChecked": "True" #开始唤醒
|
||||||
"TaskQueue.Recruiting.IsChecked": "True" #自动公招
|
"TaskQueue.Recruiting.IsChecked": "True" #自动公招
|
||||||
"TaskQueue.Base.IsChecked": "True" #基建换班
|
"TaskQueue.Base.IsChecked": "True" #基建换班
|
||||||
"TaskQueue.Combat.IsChecked": "True" #刷理智
|
"TaskQueue.Combat.IsChecked": "True" #刷理智
|
||||||
"TaskQueue.Mission.IsChecked": "True" #领取奖励
|
"TaskQueue.Mission.IsChecked": "True" #领取奖励
|
||||||
"TaskQueue.Mall.IsChecked": "True" #获取信用及购物
|
"TaskQueue.Mall.IsChecked": "True" #获取信用及购物
|
||||||
|
"TaskQueue.AutoRoguelike.IsChecked": "False" #自动肉鸽
|
||||||
|
"TaskQueue.Reclamation.IsChecked": "False" #生息演算
|
||||||
#刷理智
|
#刷理智
|
||||||
"MainFunction.Stage1": "" #主关卡
|
"MainFunction.Stage1": "" #主关卡
|
||||||
"MainFunction.Stage2": "" #备选关卡1
|
"MainFunction.Stage2": "" #备选关卡1
|
||||||
"MainFunction.Stage3": "" #备选关卡2
|
"MainFunction.Stage3": "" #备选关卡2
|
||||||
"Fight.RemainingSanityStage": "Annihilation" #剩余理智关卡
|
"Fight.RemainingSanityStage": "Annihilation" #剩余理智关卡
|
||||||
|
"MainFunction.Series.Quantity": "1" #连战次数
|
||||||
"Penguin.IsDrGrandet": "True" #博朗台模式
|
"Penguin.IsDrGrandet": "True" #博朗台模式
|
||||||
"GUI.CustomStageCode": "False" #手动输入关卡名
|
"GUI.CustomStageCode": "False" #手动输入关卡名
|
||||||
"GUI.UseAlternateStage": "False" #使用备选关卡
|
"GUI.UseAlternateStage": "False" #使用备选关卡
|
||||||
@@ -20,6 +23,18 @@
|
|||||||
"Infrast.CustomInfrastPlanShowInFightSettings": "False" #显示基建计划
|
"Infrast.CustomInfrastPlanShowInFightSettings": "False" #显示基建计划
|
||||||
"Penguin.EnablePenguin": "True" #上报企鹅物流
|
"Penguin.EnablePenguin": "True" #上报企鹅物流
|
||||||
"Yituliu.EnableYituliu": "True" #上报一图流
|
"Yituliu.EnableYituliu": "True" #上报一图流
|
||||||
|
#基建换班
|
||||||
|
"Infrast.CustomInfrastEnabled": "True" #启用自定义基建配置
|
||||||
|
"Infrast.DefaultInfrast": "user_defined" #内置配置
|
||||||
|
"Infrast.IsCustomInfrastFileReadOnly": "False" #自定义基建配置文件只读
|
||||||
|
"Infrast.CustomInfrastFile": "" #自定义基建配置文件地址
|
||||||
#设置
|
#设置
|
||||||
|
"Start.ClientType": "Bilibili"、 "Official" #服务器
|
||||||
|
"Timer.Timer1": "False" #时间设置1
|
||||||
|
"VersionUpdate.ScheduledUpdateCheck": "True" #定时检查更新
|
||||||
|
"VersionUpdate.AutoDownloadUpdatePackage": "True" #自动下载更新包
|
||||||
|
"VersionUpdate.AutoInstallUpdatePackage": "True" #自动安装更新包
|
||||||
"Start.RunDirectly": "True" #启动MAA后直接运行
|
"Start.RunDirectly": "True" #启动MAA后直接运行
|
||||||
"Start.StartEmulator": "True" #启动MAA后自动开启模拟器
|
"Start.MinimizeDirectly": "True" #启动MAA后直接最小化
|
||||||
|
"Start.OpenEmulatorAfterLaunch": "True" #启动MAA后自动开启模拟器
|
||||||
|
"Start.MinimizingStartup": "True" #最小化启动模拟器
|
||||||
7
res/version.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"main_version": "4.1.2.0",
|
||||||
|
"main_download_url": "https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/releases/download/v4.1.1_beta/AUTO_MAA_v4.1.2.zip",
|
||||||
|
"updater_version": "1.0.2.0",
|
||||||
|
"updater_download_url": "https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/releases/download/v4.1.1_beta/Updater_v1.0.2.zip",
|
||||||
|
"announcement": "\n# 公测版,若出现问题请及时反馈给项目组!\n## 新增功能\n- 添加`启动AUTO_MAA后直接代理`功能\n- 添加无限代理天数模式\n## 修复BUG\n- 尝试解决卡日志情况\n## 程序优化\n- Updater.exe图标更换\n- 更新逻辑优化"
|
||||||
|
}
|
||||||
241
run.py
@@ -1,241 +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
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import subprocess
|
|
||||||
import atexit
|
|
||||||
import sqlite3
|
|
||||||
import datetime
|
|
||||||
import time
|
|
||||||
import json
|
|
||||||
from termcolor import colored
|
|
||||||
|
|
||||||
#配置MAA运行参数
|
|
||||||
def setmaa(s,tel,game):
|
|
||||||
with open(setpath,"r",encoding="utf-8") as f:
|
|
||||||
data=json.load(f)
|
|
||||||
if s==0:
|
|
||||||
data["Configurations"]["Default"]["MainFunction.ActionAfterCompleted"]="ExitEmulatorAndSelf" #完成后退出MAA和模拟器
|
|
||||||
data["Configurations"]["Default"]["Start.RunDirectly"]="True" #启动MAA后直接运行
|
|
||||||
data["Configurations"]["Default"]["Start.StartEmulator"]="True" #启动MAA后自动开启模拟器
|
|
||||||
elif s==1:
|
|
||||||
data["Configurations"]["Default"]["Start.AccountName"]=tel[:3]+"****"+tel[7:] #账号切换
|
|
||||||
data["Configurations"]["Default"]["TaskQueue.WakeUp.IsChecked"]="True" #开始唤醒
|
|
||||||
data["Configurations"]["Default"]["TaskQueue.Recruiting.IsChecked"]="False" #自动公招
|
|
||||||
data["Configurations"]["Default"]["TaskQueue.Base.IsChecked"]="False" #基建换班
|
|
||||||
data["Configurations"]["Default"]["TaskQueue.Combat.IsChecked"]="True" #刷理智
|
|
||||||
data["Configurations"]["Default"]["TaskQueue.Mission.IsChecked"]="False" #领取奖励
|
|
||||||
data["Configurations"]["Default"]["TaskQueue.Mall.IsChecked"]="False" #获取信用及购物
|
|
||||||
data["Configurations"]["Default"]["MainFunction.Stage1"]="Annihilation" #主关卡
|
|
||||||
data["Configurations"]["Default"]["MainFunction.Stage2"]="" #备选关卡1
|
|
||||||
data["Configurations"]["Default"]["MainFunction.Stage3"]="" #备选关卡2
|
|
||||||
data["Configurations"]["Default"]["Fight.RemainingSanityStage"]="" #剩余理智关卡
|
|
||||||
data["Configurations"]["Default"]["Penguin.IsDrGrandet"]="False" #博朗台模式
|
|
||||||
data["Configurations"]["Default"]["GUI.CustomStageCode"]="True" #手动输入关卡名
|
|
||||||
data["Configurations"]["Default"]["GUI.UseAlternateStage"]="False" #使用备选关卡
|
|
||||||
data["Configurations"]["Default"]["Fight.UseRemainingSanityStage"]="False" #使用剩余理智
|
|
||||||
data["Configurations"]["Default"]["Fight.UseExpiringMedicine"]="True" #无限吃48小时内过期的理智药
|
|
||||||
elif s==2:
|
|
||||||
data["Configurations"]["Default"]["Start.AccountName"]=tel[:3]+"****"+tel[7:] #账号切换
|
|
||||||
data["Configurations"]["Default"]["TaskQueue.WakeUp.IsChecked"]="True" #开始唤醒
|
|
||||||
data["Configurations"]["Default"]["TaskQueue.Recruiting.IsChecked"]="True" #自动公招
|
|
||||||
data["Configurations"]["Default"]["TaskQueue.Base.IsChecked"]="True" #基建换班
|
|
||||||
data["Configurations"]["Default"]["TaskQueue.Combat.IsChecked"]="True" #刷理智
|
|
||||||
data["Configurations"]["Default"]["TaskQueue.Mission.IsChecked"]="True" #领取奖励
|
|
||||||
data["Configurations"]["Default"]["TaskQueue.Mall.IsChecked"]="True" #获取信用及购物
|
|
||||||
data["Configurations"]["Default"]["MainFunction.Stage1"]=game #主关卡
|
|
||||||
data["Configurations"]["Default"]["MainFunction.Stage2"]="" #备选关卡1
|
|
||||||
data["Configurations"]["Default"]["MainFunction.Stage3"]="" #备选关卡2
|
|
||||||
data["Configurations"]["Default"]["Fight.RemainingSanityStage"]="" #剩余理智关卡
|
|
||||||
data["Configurations"]["Default"]["Penguin.IsDrGrandet"]="False" #博朗台模式
|
|
||||||
data["Configurations"]["Default"]["GUI.CustomStageCode"]="True" #手动输入关卡名
|
|
||||||
data["Configurations"]["Default"]["GUI.UseAlternateStage"]="False" #使用备选关卡
|
|
||||||
data["Configurations"]["Default"]["Fight.UseRemainingSanityStage"]="False" #使用剩余理智
|
|
||||||
data["Configurations"]["Default"]["Fight.UseExpiringMedicine"]="True" #无限吃48小时内过期的理智药
|
|
||||||
with open(setpath,"w",encoding="utf-8") as f:
|
|
||||||
json.dump(data,f)
|
|
||||||
return True
|
|
||||||
|
|
||||||
#执行MAA任务
|
|
||||||
def runmaa(id,tel,game,num=3):
|
|
||||||
#开始运行
|
|
||||||
for i in range(num):
|
|
||||||
global idnew,idold,idfail,idall,logx,logi
|
|
||||||
runbook=[False for i in range(2)]
|
|
||||||
for j in range(2):
|
|
||||||
#配置MAA
|
|
||||||
setmaa(j+1,tel,game)
|
|
||||||
#创建MAA任务
|
|
||||||
print(colored("等待中~",'yellow'))
|
|
||||||
time.sleep(10)
|
|
||||||
maa=subprocess.Popen([maapath])
|
|
||||||
maapid=maa.pid
|
|
||||||
#等待MAA启动
|
|
||||||
idsuccess=idnew+idold
|
|
||||||
idwait=[idx for idx in idall if not idx in idsuccess+idfail+[id]]
|
|
||||||
os.system('cls')
|
|
||||||
if i==0:
|
|
||||||
if j==0:
|
|
||||||
print(colored("正在代理:",'white')+colored(id+"-剿灭",'blue'))
|
|
||||||
elif j==1:
|
|
||||||
print(colored("正在代理:",'white')+colored(id+"-日常",'blue'))
|
|
||||||
else:
|
|
||||||
if j==0:
|
|
||||||
print(colored("正在代理:",'white')+colored(id+"-剿灭",'light_blue'))
|
|
||||||
elif j==1:
|
|
||||||
print(colored("正在代理:",'white')+colored(id+"-日常",'light_blue'))
|
|
||||||
print(colored("等待代理:",'white')+colored(','.join(idwait),'yellow'))
|
|
||||||
print(colored("代理成功:",'white')+colored(','.join(idsuccess),'green'))
|
|
||||||
print(colored("代理失败:",'white')+colored(','.join(idfail),'red'))
|
|
||||||
print(colored("运行日志:",'white')+colored("等待MAA初始化",'light_green'))
|
|
||||||
time.sleep(60)
|
|
||||||
#监测MAA运行状态
|
|
||||||
while True:
|
|
||||||
#打印基本信息
|
|
||||||
os.system('cls')
|
|
||||||
if i==0:
|
|
||||||
if j==0:
|
|
||||||
print(colored("正在代理:",'white')+colored(id+"-剿灭",'blue'))
|
|
||||||
elif j==1:
|
|
||||||
print(colored("正在代理:",'white')+colored(id+"-日常",'blue'))
|
|
||||||
else:
|
|
||||||
if j==0:
|
|
||||||
print(colored("正在代理:",'white')+colored(id+"-剿灭",'light_blue'))
|
|
||||||
elif j==1:
|
|
||||||
print(colored("正在代理:",'white')+colored(id+"-日常",'light_blue'))
|
|
||||||
print(colored("等待代理:",'white')+colored(','.join(idwait),'yellow'))
|
|
||||||
print(colored("代理成功:",'white')+colored(','.join(idsuccess),'green'))
|
|
||||||
print(colored("代理失败:",'white')+colored(','.join(idfail),'red'))
|
|
||||||
print(colored("运行日志:",'white'))
|
|
||||||
#读取并保存MAA日志
|
|
||||||
with open(logpath,'r',encoding='utf-8') as f:
|
|
||||||
logs=f.readlines()[-1:-11:-1]
|
|
||||||
print(colored(''.join(logs[::-1]),'light_green'),end='')
|
|
||||||
log=''.join(logs)
|
|
||||||
logx[logi]=log
|
|
||||||
logi=(logi+1) % len(logx)
|
|
||||||
#判断MAA程序运行状态
|
|
||||||
if ("任务已全部完成!" in log):
|
|
||||||
runbook[j]=True
|
|
||||||
break
|
|
||||||
elif ("请检查连接设置或尝试重启模拟器与 ADB 或重启电脑" in log) or ("已停止" in log) or ("MaaAssistantArknights GUI exited" in log) or timeout():
|
|
||||||
os.system('taskkill /F /T /PID '+str(maapid))
|
|
||||||
break
|
|
||||||
if j==0:
|
|
||||||
time.sleep(40)
|
|
||||||
elif j==1:
|
|
||||||
time.sleep(10)
|
|
||||||
if runbook[0] and runbook[1]:
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
#检查是否超时
|
|
||||||
def timeout():
|
|
||||||
global logx
|
|
||||||
log0=logx[0]
|
|
||||||
for i in range(len(logx)):
|
|
||||||
if logx[i]!=log0:
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
#更新已完成用户的数据
|
|
||||||
def updata(id):
|
|
||||||
db=sqlite3.connect(DATABASE)
|
|
||||||
cur=db.cursor()
|
|
||||||
cur.execute("SELECT * FROM adminx WHERE admin=?",(id,))
|
|
||||||
info=cur.fetchall()
|
|
||||||
cur.execute("UPDATE adminx SET day=? WHERE admin=?",(info[0][2]-1,id))
|
|
||||||
db.commit()
|
|
||||||
cur.execute("UPDATE adminx SET last=? WHERE admin=?",(curdate,id))
|
|
||||||
db.commit()
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
return 0
|
|
||||||
|
|
||||||
#资源回收
|
|
||||||
def cleanup():
|
|
||||||
if os.path.exists("state/RUNNING"):
|
|
||||||
os.remove("state/RUNNING")
|
|
||||||
|
|
||||||
#读取运行情况
|
|
||||||
if os.path.exists("state/RUNNING"):
|
|
||||||
os._exit(1)
|
|
||||||
#标记当前正在运行
|
|
||||||
with open("state/RUNNING","w",encoding="utf-8") as f:
|
|
||||||
print("RUNNING",file=f)
|
|
||||||
#设置回调函数
|
|
||||||
atexit.register(cleanup)
|
|
||||||
#获取PATH与用户数据
|
|
||||||
DATABASE="data/data.db"
|
|
||||||
db=sqlite3.connect(DATABASE)
|
|
||||||
cur=db.cursor()
|
|
||||||
cur.execute("SELECT * FROM pathset WHERE True")
|
|
||||||
path=cur.fetchall()
|
|
||||||
path=str(path[0][0])
|
|
||||||
setpath=path+"/config/gui.json"
|
|
||||||
logpath=path+"/debug/gui.log"
|
|
||||||
maapath=path+"/MAA.exe"
|
|
||||||
cur.execute("SELECT * FROM adminx WHERE True")
|
|
||||||
data=cur.fetchall()
|
|
||||||
data=[list(row) for row in data]
|
|
||||||
cur.close()
|
|
||||||
db.close()
|
|
||||||
#开始执行
|
|
||||||
curdate=datetime.date.today().strftime('%Y-%m-%d')
|
|
||||||
begintime=datetime.datetime.now().strftime("%H:%M")
|
|
||||||
idnew=[]
|
|
||||||
idold=[]
|
|
||||||
idfail=[]
|
|
||||||
idall=[data[i][0] for i in range(len(data))]
|
|
||||||
LOGXLEN=60
|
|
||||||
logx=['' for i in range(LOGXLEN)]
|
|
||||||
logi=0
|
|
||||||
#MAA预配置
|
|
||||||
setmaa(0,0,0)
|
|
||||||
#优先代理今日未完成的用户
|
|
||||||
for i in range(len(data)):
|
|
||||||
if data[i][3]=='y' and data[i][4]!=curdate and data[i][2]>0:
|
|
||||||
book=runmaa(data[i][0],data[i][1],data[i][5])
|
|
||||||
if book:
|
|
||||||
updata(data[i][0])
|
|
||||||
idnew.append(data[i][0])
|
|
||||||
else:
|
|
||||||
idfail.append(data[i][0])
|
|
||||||
#次优先重复代理
|
|
||||||
for i in range(len(data)):
|
|
||||||
if data[i][3]=='y' and data[i][4]==curdate and data[i][2]>0:
|
|
||||||
book=runmaa(data[i][0],data[i][1],data[i][5])
|
|
||||||
if book:
|
|
||||||
idold.append(data[i][0])
|
|
||||||
else:
|
|
||||||
idall.remove(data[i][0])
|
|
||||||
endtime=datetime.datetime.now().strftime("%H:%M")
|
|
||||||
with open("log.txt","w",encoding="utf-8") as f:
|
|
||||||
print("任务开始时间:"+begintime+",结束时间:"+endtime,file=f)
|
|
||||||
print("已完成数:"+str(len(idnew))+",未完成数:"+str(len(idfail))+",重复执行数:"+str(len(idold)),file=f)
|
|
||||||
if len(idfail)!=0:
|
|
||||||
print("代理未完成的用户:",file=f)
|
|
||||||
for i in range(len(idfail)):
|
|
||||||
print(idfail[i],file=f)
|
|
||||||
if os.path.exists("state/BEGIN"):
|
|
||||||
with open("state/END","w",encoding="utf-8") as f:
|
|
||||||
print("END",file=f)
|
|
||||||
sys.exit(0)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
此文件夹内文件用于AUTO_MAA组件间的信息传递,如果遇到run.exe闪退或AUTO_MAA.exe一直显示“正在运行代理”,请尝试删除本文件夹下的所有文件。
|
|
||||||
25
toexe.py
@@ -1,25 +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
|
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
os.system("pyinstaller -F --version-file res/info.txt -i res/AUTO_MAA.ico manage.py")
|
|
||||||
os.system("pyinstaller -F --version-file res/info.txt -i res/AUTO_MAA.ico run.py")
|
|
||||||
os.system("pyinstaller -F --version-file res/info.txt -i res/AUTO_MAA.ico AUTO_MAA.py")
|
|
||||||