Compare commits

...

6 Commits

Author SHA1 Message Date
DLmaster
a3fe641f6b 添加启动AUTO_MAA后直接代理功能 2024-11-07 17:25:58 +08:00
DLmaster
f4f99c25db 适配“启动MAA后自动开启模拟器”字段更改 2024-11-06 21:51:56 +08:00
DLmaster
640d80e334 当前为最新版本通知修复,报错格式化 2024-11-03 01:23:32 +08:00
DLmaster
4f196b516f 部分功能恢复 2024-11-03 00:55:18 +08:00
DLmaster
87f07bf95c 调整参数适配主分支 2024-11-02 23:57:23 +08:00
DLmaster
1bfd7891b5 Merge branch 'Updater' 2024-11-02 23:30:16 +08:00
14 changed files with 614 additions and 95 deletions

View File

@@ -41,6 +41,7 @@ jobs:
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."
@@ -69,21 +70,33 @@ jobs:
# 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: |
pyinstaller -F --version-file res/info.txt -w --icon=res/AUTO_MAA.ico AUTO_MAA.py --hidden-import plyer.platforms.win.notification
python package.py
- name: Read version
id: read_version
run: |
$VERSION=(Get-Content -Path "更新说明.txt" -TotalCount 1).Trim()
"version=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
$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: |
Compress-Archive -Path gui,res,AUTO_MAA.py,dist/AUTO_MAA.exe,requirements.txt,README.md,LICENSE,更新说明.txt -DestinationPath AUTO_MAA_${{ env.version }}.zip
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
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.version }}
path: AUTO_MAA_${{ env.version }}.zip
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
@@ -97,10 +110,15 @@ jobs:
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 $(head -n 1 更新说明.txt) --json id --jq .id || true)
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
@@ -114,22 +132,23 @@ jobs:
run: |
set -xe
shopt -s nullglob
NAME="$(head -n 1 更新说明.txt)"
TAGNAME="$(head -n 1 更新说明.txt)"
NOTES_MAIN="$(tail -n +2 更新说明.txt)"
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="$(head -n 1 更新说明.txt)"
TAGNAME="$(head -n 1 更新说明.txt)"
NOTES_MAIN="$(tail -n +2 更新说明.txt)"
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

View File

@@ -18,6 +18,13 @@
# DLmaster_361@163.com
"""
AUTO_MAA
AUTO_MAA主程序
v4.1
作者DLmaster_361
"""
from PySide6.QtWidgets import (
QWidget,
QApplication,
@@ -54,11 +61,14 @@ import time
import random
import secrets
import winreg
import requests
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
from Crypto.Util.Padding import pad, unpad
import Updater
uiLoader = QUiLoader()
@@ -575,9 +585,13 @@ class MaaRunner(QtCore.QThread):
] = "True" # 启动MAA后直接最小化
# 启动MAA后自动开启模拟器
if "启动模拟器" in mode:
data["Configurations"]["Default"]["Start.StartEmulator"] = "True"
data["Configurations"]["Default"][
"Start.OpenEmulatorAfterLaunch"
] = "True"
elif "仅切换账号" in mode:
data["Configurations"]["Default"]["Start.StartEmulator"] = "False"
data["Configurations"]["Default"][
"Start.OpenEmulatorAfterLaunch"
] = "False"
data["Configurations"]["Default"][
"Start.MinimizingStartup"
] = "False" # 最小化启动模拟器
@@ -641,7 +655,7 @@ class MaaRunner(QtCore.QThread):
"Start.RunDirectly"
] = "False" # 启动MAA后直接运行
data["Configurations"]["Default"][
"Start.StartEmulator"
"Start.OpenEmulatorAfterLaunch"
] = "False" # 启动MAA后自动开启模拟器
if "全局" in mode:
data["Global"][
@@ -689,7 +703,7 @@ class MaaRunner(QtCore.QThread):
"Start.RunDirectly"
] = "True" # 启动MAA后直接运行
data["Configurations"]["Default"][
"Start.StartEmulator"
"Start.OpenEmulatorAfterLaunch"
] = "True" # 启动MAA后自动开启模拟器
if self.data[index][15] == "simple":
data["Global"][
@@ -781,7 +795,7 @@ class MaaRunner(QtCore.QThread):
"Start.RunDirectly"
] = "True" # 启动MAA后直接运行
data["Configurations"]["Default"][
"Start.StartEmulator"
"Start.OpenEmulatorAfterLaunch"
] = "True" # 启动MAA后自动开启模拟器
if self.data[index][15] == "simple":
data["Global"][
@@ -1005,6 +1019,7 @@ class Main(QWidget):
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 + "/res/version.json"
self.PASSWORD = PASSWARD
self.if_user_list_editable = True
self.if_update_database = True
@@ -1069,7 +1084,6 @@ class Main(QWidget):
]
self.ui = uiLoader.load(self.app_path + "/gui/ui/main.ui")
self.ui.setWindowTitle("AUTO_MAA")
self.ui.setWindowIcon(QIcon(self.app_path + "/res/AUTO_MAA.ico"))
# 检查文件完整性
self.initialize()
@@ -1147,6 +1161,14 @@ class Main(QWidget):
self.if_sleep = self.ui.findChild(QCheckBox, "checkBox_ifsleep")
self.if_sleep.stateChanged.connect(self.change_config)
self.if_proxy_directly = self.ui.findChild(
QCheckBox, "checkBox_ifproxydirectly"
)
self.if_proxy_directly.stateChanged.connect(self.change_config)
self.check_update = self.ui.findChild(QPushButton, "pushButton_check_update")
self.check_update.clicked.connect(self.check_version)
self.run_text = self.ui.findChild(QTextBrowser, "textBrowser_run")
self.wait_text = self.ui.findChild(QTextBrowser, "textBrowser_wait")
self.over_text = self.ui.findChild(QTextBrowser, "textBrowser_over")
@@ -1204,6 +1226,9 @@ class Main(QWidget):
self.update_config()
self.change_userlist_method()
if self.config["Default"]["SelfSet.IfProxyDirectly"] == "True":
self.routine_starter()
def initialize(self):
"""初始化程序的配置文件"""
# 检查目录
@@ -1212,10 +1237,18 @@ class Main(QWidget):
os.makedirs(self.app_path + "/data/MAAconfig/simple", exist_ok=True)
os.makedirs(self.app_path + "/data/MAAconfig/beta", exist_ok=True)
os.makedirs(self.app_path + "/data/MAAconfig/Default", exist_ok=True)
# 生成版本信息文件
if not os.path.exists(self.version_path):
version = {
"main_version": "0.0.0.0",
"updater_version": "0.0.0.0",
}
with open(self.version_path, "w", encoding="utf-8") as f:
json.dump(version, f, indent=4)
# 生成配置文件
if not os.path.exists(self.config_path):
config = {"Default": {}}
with open(self.config_path, "w") as f:
with open(self.config_path, "w", encoding="utf-8") as f:
json.dump(config, f, indent=4)
# 生成预设gameid替换方案文件
if not os.path.exists(self.gameid_path):
@@ -1273,9 +1306,10 @@ class Main(QWidget):
["TimesLimit.run", 3],
["SelfSet.IfSelfStart", "False"],
["SelfSet.IfSleep", "False"],
["SelfSet.IfProxyDirectly", "False"],
]
# 导入配置文件
with open(self.config_path, "r") as f:
with open(self.config_path, "r", encoding="utf-8") as f:
config = json.load(f)
# 检查并补充缺失的字段
for i in range(len(config_list)):
@@ -1283,7 +1317,7 @@ class Main(QWidget):
config["Default"][config_list[i][0]] = config_list[i][1]
self.config = config
# 导出配置文件
with open(self.config_path, "w") as f:
with open(self.config_path, "w", encoding="utf-8") as f:
json.dump(config, f, indent=4)
def check_database(self):
@@ -1684,6 +1718,10 @@ class Main(QWidget):
bool(self.config["Default"]["SelfSet.IfSleep"] == "True")
)
self.if_proxy_directly.setChecked(
bool(self.config["Default"]["SelfSet.IfProxyDirectly"] == "True")
)
for i in range(10):
self.start_time[i][0].setChecked(
bool(self.config["Default"]["TimeSet.set" + str(i + 1)] == "True")
@@ -2067,16 +2105,18 @@ class Main(QWidget):
"""将GUI中发生修改的程序配置同步至self.config变量"""
if not self.if_update_config:
return None
self.config["Default"]["MaaSet.path"] = self.maa_path.text().replace("\\", "/")
if not self.check_maa_path():
self.config["Default"]["MaaSet.path"] = ""
with open(self.config_path, "w") as f:
with open(self.config_path, "w", encoding="utf-8") as f:
json.dump(self.config, f, indent=4)
self.update_config()
QMessageBox.critical(
self.ui, "错误", "未找到MAA.exe或MAA配置文件请重新设置MAA路径"
)
return None
self.config["Default"]["TimeLimit.routine"] = self.routine.value()
self.config["Default"]["TimeLimit.annihilation"] = self.annihilation.value()
self.config["Default"]["TimesLimit.run"] = self.num.value()
@@ -2091,6 +2131,11 @@ class Main(QWidget):
else:
self.config["Default"]["SelfSet.IfSelfStart"] = "False"
if self.if_proxy_directly.isChecked():
self.config["Default"]["SelfSet.IfProxyDirectly"] = "True"
else:
self.config["Default"]["SelfSet.IfProxyDirectly"] = "False"
for i in range(10):
if self.start_time[i][0].isChecked():
self.config["Default"]["TimeSet.set" + str(i + 1)] = "True"
@@ -2098,8 +2143,10 @@ class Main(QWidget):
self.config["Default"]["TimeSet.set" + str(i + 1)] = "False"
time = self.start_time[i][1].time().toString("HH:mm")
self.config["Default"]["TimeSet.run" + str(i + 1)] = time
with open(self.config_path, "w") as f:
with open(self.config_path, "w", encoding="utf-8") as f:
json.dump(self.config, f, indent=4)
self.update_config()
def change_userlist_method(self):
@@ -2309,6 +2356,78 @@ class Main(QWidget):
self.run_now.setText("立即执行")
self.run_now.clicked.connect(self.routine_starter)
def check_version(self):
"""检查版本更新,调起文件下载进程"""
# 从本地版本信息文件获取当前版本信息
with open(self.version_path, "r", encoding="utf-8") as f:
version_current = json.load(f)
main_version_current = list(
map(int, version_current["main_version"].split("."))
)
updater_version_current = list(
map(int, version_current["updater_version"].split("."))
)
if not os.path.exists(self.app_path + "/Updater.exe"):
updater_version_current = [0, 0, 0, 0]
# 从远程服务器获取最新版本信息
try:
response = requests.get(
"https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/blob/main/res/version.json"
)
except Exception as e:
QMessageBox.critical(
self.ui,
"错误",
f"获取版本信息时出错:\n{e}",
)
return None
version_remote = response.json()
main_version_remote = list(map(int, version_remote["main_version"].split(".")))
updater_version_remote = list(
map(int, version_remote["updater_version"].split("."))
)
if (main_version_remote > main_version_current) or (
updater_version_remote > updater_version_current
):
choice = QMessageBox.question(
self.ui,
"版本更新",
f"发现新版本:\n 主程序:{self.version_text(main_version_current)} --> {self.version_text(main_version_remote)}\n 更新器:{self.version_text(updater_version_current)} --> {self.version_text(updater_version_remote)}\n 更新说明:\n{version_remote['announcement'].replace("\n","\n ")}\n\n是否开始更新?\n\n 注意主程序更新时AUTO_MAA将自动关闭",
)
if choice == QMessageBox.No:
return None
if updater_version_remote > updater_version_current:
self.updater = Updater.Updater(
self.app_path,
"AUTO_MAA更新器",
version_remote["updater_download_url"],
)
if main_version_remote > main_version_current:
self.updater.update_process.accomplish.connect(self.update_main)
self.updater.ui.show()
elif main_version_remote > main_version_current:
self.update_main()
else:
self.push_notification("已是最新版本~", " ", " ", 10)
def update_main(self):
subprocess.Popen(
self.app_path + "/Updater.exe",
shell=True,
creationflags=subprocess.CREATE_NO_WINDOW,
)
sys.exit()
def version_text(self, version_numb):
"""将版本号列表转为可读的文本信息"""
if version_numb[3] == 0:
version = f"v{'.'.join(str(_) for _ in version_numb[0:3])}"
elif version_numb[3] == 1:
version = f"v{'.'.join(str(_) for _ in version_numb[0:3])}_beta"
return version
def push_notification(self, title, message, ticker, t):
"""推送系统通知"""
notification.notify(

View File

@@ -113,6 +113,7 @@ MAA多账号管理与自动化软件
- `运行失败重试次数上限`:对于每一用户,若超过该次数限制仍未完成代理,视为代理失败。
- `开机自动启动AUTO_MAA`实现AUTO_MAA的自启动。
- `AUTO_MAA启动时禁止电脑休眠`:仅阻止电脑自动休眠,不会影响屏幕是否熄灭。
- `检查版本更新`从GitHub上获取版本更新要求网络能够访问GitHub。获取版本信息时若遇网络不稳定主程序有概率未响应稍等片刻后恢复。
- `修改管理密钥`:修改管理密钥,当用户列表中无用户时,将跳过验证旧管理密钥。
#### 设置用户配置
@@ -182,6 +183,7 @@ MAA多账号管理与自动化软件
- [x] 支持B服
- [x] 支持完全自定义MAA配置
- [x] 支持程序版本更新
- [ ] 支持对MAA运行状况的进一步识别
- [ ] 支持宽幅ADB连接适配
- [ ] 添加更多通知手段

162
Updater.py Normal file
View File

@@ -0,0 +1,162 @@
# <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):
super(UpdateProcess, self).__init__()
self.app_path = app_path
self.name = name
self.download_url = download_url
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}")
self.accomplish.emit()
class Updater(QObject):
def __init__(self, app_path, name, download_url):
super().__init__()
self.ui = uiLoader.load(app_path + "/gui/ui/updater.ui")
self.ui.setWindowTitle("AUTO_MAA更新器")
self.ui.setWindowIcon(QIcon(app_path + "/res/AUTO_MAA.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)
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):
super().__init__()
self.main = Updater(app_path, name, download_url)
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"]
)
sys.exit(app.exec())

View File

@@ -6,12 +6,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>1280</width>
<height>697</height>
<width>1218</width>
<height>718</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
<string>AUTO_MAA</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_13">
<item>
@@ -105,8 +105,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1218</width>
<height>525</height>
<width>1156</width>
<height>546</height>
</rect>
</property>
<attribute name="label">
@@ -189,7 +189,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>98</width>
<width>88</width>
<height>74</height>
</rect>
</property>
@@ -1037,8 +1037,8 @@
<property name="title">
<string>AUTO_MAA设置</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_20">
<item>
<layout class="QGridLayout" name="gridLayout_4" rowstretch="1,1" columnstretch="1,1,1,1">
<item row="0" column="0">
<widget class="QFrame" name="frame_routine_3">
<property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum>
@@ -1054,10 +1054,23 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<item row="0" column="1">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
@@ -1070,7 +1083,7 @@
</property>
</spacer>
</item>
<item>
<item row="0" column="2">
<widget class="QFrame" name="frame_routine_2">
<property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum>
@@ -1086,10 +1099,23 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<item row="0" column="3">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
@@ -1102,6 +1128,109 @@
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame_routine_4">
<property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_20">
<item>
<widget class="QCheckBox" name="checkBox_ifproxydirectly">
<property name="text">
<string>启动AUTO_MAA后直接代理</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_15">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="1">
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>231</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<widget class="QFrame" name="frame_check_update">
<property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_21">
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_check_update">
<property name="text">
<string> 检查版本更新 </string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="3">
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>311</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
@@ -1139,21 +1268,19 @@ li.checked::marker { content: &quot;\2612&quot;; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;致用户:&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 这是AUTO_MAA_v4.0_beta,服务器切换与用户高级配置功能上线。&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 使用本程序前请先仔细阅读README.md。&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 在用户高级配置列表中选中需要配置的用户的“日常”或“剿灭”项单击“修改配置”即可呼出MAA进行配置的自定义。关闭MAA窗口后将自动保存您的修改。为保证程序正常运行我们仍会接管部分MAA的设置项您无须担心。&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 如果是B服用户由于我们无权替您同意用户协议若出现用户协议弹窗您需要自行完成确认否则可能造成MAA卡死代理任务失败。&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 对于B服用户由于我们无权替您同意用户协议若出现用户协议弹窗您需要自行完成确认否则可能造成MAA卡死代理任务失败。&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 老用户请务必备份原有数据,此次更新的代码改动较大,可能有数据遗失的风险。&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 我们去除了命令行窗口但这不意味着BUG不会出现。由于用户与项目贡献者的稀缺,我们无法确保正式版足够完善,还望谅解。&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 由于用户与项目贡献者的稀缺,我们无法确保正式版足够完善,还望谅解。&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 当遇到严重漏洞,请前往官网检查是否有新的版本或包发布。如有,请更新到最新版本后再次尝试。&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 当遇到严重漏洞,请先确保当前为最新版本。&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 您还可以通过官方仓库 &lt;a href=&quot;https://github.com/DLmaster361/AUTO_MAA/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#007ad6;&quot;&gt;DLmaster361/AUTO_MAA&lt;/span&gt;&lt;/a&gt; 发布Issues求助。&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 官方QQ群957750551&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 官方QQ交流957750551&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p align=&quot;right&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;DLmaster&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>

35
gui/ui/updater.ui Normal file
View 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>

50
package.py Normal file
View File

@@ -0,0 +1,50 @@
# <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
os.system(
"pyinstaller -F --version-file res/AUTO_MAA_info.txt -w --icon=res/AUTO_MAA.ico AUTO_MAA.py --hidden-import plyer.platforms.win.notification"
)
os.system(
"pyinstaller -F --version-file res/Updater_info.txt -w --icon=res/AUTO_MAA.ico Updater.py"
)
with open("res/version.json", "r", encoding="utf-8") as f:
version = json.load(f)
main_version = list(map(int, version["main_version"].split(".")))
updater_version = list(map(int, version["updater_version"].split(".")))
if main_version[3] == 0:
main_version = f"v{'.'.join(str(_) for _ in main_version[0:3])}"
elif main_version[3] == 1:
main_version = f"v{'.'.join(str(_) for _ in main_version[0:3])}_beta"
if updater_version[3] == 0:
updater_version = f"v{'.'.join(str(_) for _ in updater_version[0:3])}"
elif updater_version[3] == 1:
updater_version = f"v{'.'.join(str(_) for _ in updater_version[0:3])}_beta"
with open("update_info.txt", "w", encoding="utf-8") as f:
print(f"{main_version}\n{updater_version}\n{version["announcement"]}", file=f)

View File

@@ -1,4 +1,5 @@
plyer
PySide6
pycryptodome
pyinstaller
pyinstaller
requests

View File

@@ -4,7 +4,7 @@ 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=(4, 0, 0, 1),
filevers=(4, 1, 1, 1),
prodvers=(0, 0, 0, 0),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f,
@@ -31,13 +31,13 @@ VSVersionInfo(
[StringStruct('Comments', 'https://github.com/DLmaster361/AUTO_MAA/'),
StringStruct('CompanyName', 'AUTO_MAA Team'),
StringStruct('FileDescription', 'AUTO_MAA Component'),
StringStruct('FileVersion', '4.0.0.1'),
StringStruct('FileVersion', '4.1.1.1'),
StringStruct('InternalName', 'AUTO_MAA'),
StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),
StringStruct('OriginalFilename', 'AUTO_MAA.py'),
StringStruct('ProductName', 'AUTO_MAA'),
StringStruct('ProductVersion', 'v4.0.0.1'),
StringStruct('Assembly Version', 'v4.0.0.1')])
StringStruct('ProductVersion', 'v4.1.1.1'),
StringStruct('Assembly Version', 'v4.1.1.1')])
])
]
)

43
res/Updater_info.txt Normal file
View File

@@ -0,0 +1,43 @@
# 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=(1, 0, 0, 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', '1.0.0.0'),
StringStruct('InternalName', 'AUTO_MAA_Updater'),
StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),
StringStruct('OriginalFilename', 'Updater.py'),
StringStruct('ProductName', 'AUTO_MAA_Updater'),
StringStruct('ProductVersion', 'v1.0.0.0'),
StringStruct('Assembly Version', 'v1.0.0.0')])
])
]
)

View File

@@ -1,6 +1,5 @@
#主界面
"MainFunction.ActionAfterCompleted": "ExitEmulatorAndSelf" #完成后(旧)
"MainFunction.PostActions": "12" #完成后(新)
"MainFunction.PostActions": "12" #完成后
"TaskQueue.WakeUp.IsChecked": "True" #开始唤醒
"TaskQueue.Recruiting.IsChecked": "True" #自动公招
"TaskQueue.Base.IsChecked": "True" #基建换班
@@ -37,5 +36,5 @@
"VersionUpdate.AutoInstallUpdatePackage": "True" #自动安装更新包
"Start.RunDirectly": "True" #启动MAA后直接运行
"Start.MinimizeDirectly": "True" #启动MAA后直接最小化
"Start.StartEmulator": "True" #启动MAA后自动开启模拟器
"Start.OpenEmulatorAfterLaunch": "True" #启动MAA后自动开启模拟器
"Start.MinimizingStartup": "True" #最小化启动模拟器

7
res/version.json Normal file
View File

@@ -0,0 +1,7 @@
{
"main_version": "4.1.1.1",
"main_download_url": "https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/releases/download/v4.1.1_beta/AUTO_MAA_v4.1.1_beta.zip",
"updater_version": "1.0.0.0",
"updater_download_url": "https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/releases/download/v4.1.1_beta/Updater_v1.0.0.zip",
"announcement": "\n# 开发中的版本!非开发者勿直接更新!!否则后果自负!!!\n## 新增功能\n- 添加`启动AUTO_MAA后直接代理`功能"
}

View File

@@ -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 -w --icon=res/AUTO_MAA.ico AUTO_MAA.py --hidden-import plyer.platforms.win.notification"
)

View File

@@ -1,20 +0,0 @@
v4.0_beta
## 新增功能
- 服务器切换功能上线支持B服 #7
- 用户高级配置功能上线支持用户修改几乎所有MAA配置
## 修复BUG
- 修复无用户进行代理时的逻辑错误
## 程序优化
- 进一步优化MAA配置流程
- 优化自定义基建配置方法 #7
- 无命令行窗口中止MAA进程
- `gameid.txt`改由主程序进行初始化
- log获取部分集成为1个函数
- 消除部分if嵌套
## 更新说明
- 项目初始阶段,不会提供专门的版本更新程序,您需要手动更新程序。
- v2.1.5及以前的用户,由于新版本采用全新的架构,您需要手动输入之前的信息。
- v3.0_Beta版用户,直接用`AUTO_MAA.exe`替代`gui.exe`后,将原文件夹下的`gui文件夹`用新版本对应文件替换,重新设置每个用户的`自定义基建`选项(输入`-`以关闭该功能,输入自定义基建配置文件地址以开启该功能)。
- v3.1~v3.1.3_beta版用户,直接用新版本文件替换旧版本即可。
- 老用户请务必备份原有数据在更新前确保所填MAA路径有效且已存在MAA配置文件此次更新的代码改动较大可能有数据遗失的风险。
- 新用户请忽略本说明。