Compare commits

..

19 Commits

Author SHA1 Message Date
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
DLmaster
472eb0ee52 修正部分措辞 2024-10-31 20:12:30 +08:00
DLmaster
7638c67da6 更详细的使用说明书 2024-10-31 20:04:17 +08:00
DLmaster
7a0c143b5b 适配MAA的adb连接文案修改 2024-10-29 08:55:01 +08:00
DLmaster
fff8e11524 恢复代理时的自动更新 2024-10-29 08:11:06 +08:00
DLmaster
af24208cf3 无命令行中止MAA进程 2024-10-26 15:31:49 +08:00
DLmaster
85bccea2dd 删除冗余代码 2024-10-26 11:20:12 +08:00
DLmaster
f7c8cac6ec 人工排查接管更多MAA启动设置 2024-10-26 10:41:02 +08:00
DLmaster
97a5ac5bb0 修复MAA切换配置选项 2024-10-25 18:50:34 +08:00
DLmaster
1d57076010 修复自定义基建默认配置 2024-10-25 18:30:15 +08:00
DLmaster
d298ac872c 优化自定义基建配置方法 2024-10-25 15:04:05 +08:00
DLmaster
c0581e781c 工作流适配新目录结构 2024-10-24 20:08:22 +08:00
DLmaster
6befd6341a gameid.txt改由主程序进行初始化 2024-10-24 20:03:23 +08:00
DLmaster
504ef8dd68 修改部分格式 2024-10-23 21:56:41 +08:00
DLmaster
127500d890 禁用MAA路径直接编辑;更新README至最新版 2024-10-23 21:41:35 +08:00
20 changed files with 970 additions and 369 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 data,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()
@@ -220,7 +230,12 @@ class MaaRunner(QtCore.QThread):
"\n".join([self.data[_][0] for _ in error_index]),
result,
)
os.system("taskkill /F /T /PID " + str(maa.pid))
killprocess = subprocess.Popen(
"taskkill /F /T /PID " + str(maa.pid),
shell=True,
creationflags=subprocess.CREATE_NO_WINDOW,
)
killprocess.wait()
self.push_notification.emit(
"用户日常代理出现异常!",
"用户 "
@@ -322,7 +337,12 @@ class MaaRunner(QtCore.QThread):
"\n".join([self.data[_][0] for _ in error_index]),
result,
)
os.system("taskkill /F /T /PID " + str(maa.pid))
killprocess = subprocess.Popen(
"taskkill /F /T /PID " + str(maa.pid),
shell=True,
creationflags=subprocess.CREATE_NO_WINDOW,
)
killprocess.wait()
if_strat_app = True
if self.if_run:
time.sleep(10)
@@ -387,7 +407,12 @@ class MaaRunner(QtCore.QThread):
if self.mode in ["日常代理", "人工排查"]:
# 关闭可能未正常退出的MAA进程
if not self.if_run:
os.system("taskkill /F /T /PID " + str(maa.pid))
killprocess = subprocess.Popen(
"taskkill /F /T /PID " + str(maa.pid),
shell=True,
creationflags=subprocess.CREATE_NO_WINDOW,
)
killprocess.wait()
# 更新用户数据
modes = [self.data[_][15] for _ in all_index]
uids = [self.data[_][16] for _ in all_index]
@@ -467,7 +492,7 @@ class MaaRunner(QtCore.QThread):
elif "任务已全部完成!" in log:
return "Success!"
elif (
("请检查连接设置尝试重启模拟器与 ADB重启电脑" in log)
("检查连接设置」或「尝试重启模拟器与 ADB」或「重启电脑" in log)
or ("已停止" in log)
or ("MaaAssistantArknights GUI exited" in log)
):
@@ -482,7 +507,7 @@ class MaaRunner(QtCore.QThread):
if "完成任务: StartUp" in log:
return "Success!"
elif (
("请检查连接设置尝试重启模拟器与 ADB重启电脑" in log)
("检查连接设置」或「尝试重启模拟器与 ADB」或「重启电脑" in log)
or ("已停止" in log)
or ("MaaAssistantArknights GUI exited" in log)
):
@@ -555,11 +580,21 @@ class MaaRunner(QtCore.QThread):
data["Configurations"]["Default"][
"Start.RunDirectly"
] = "True" # 启动MAA后直接运行
data["Configurations"]["Default"][
"Start.MinimizeDirectly"
] = "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" # 最小化启动模拟器
if self.data[index][15] == "simple":
data["Global"][
"VersionUpdate.ScheduledUpdateCheck"
@@ -620,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"][
@@ -658,6 +693,9 @@ class MaaRunner(QtCore.QThread):
] = "False" # 生息演算
# 剿灭代理配置
elif mode == "日常代理_剿灭":
data["Current"] = "Default" # 切换配置
for i in range(1, 9):
data["Global"]["Timer.Timer" + str(i)] = "False" # 时间设置
data["Configurations"]["Default"][
"MainFunction.PostActions"
] = "12" # 完成后退出MAA和模拟器
@@ -665,9 +703,18 @@ 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"][
"VersionUpdate.ScheduledUpdateCheck"
] = "True" # 定时检查更新
data["Global"][
"VersionUpdate.AutoDownloadUpdatePackage"
] = "True" # 自动下载更新包
data["Global"][
"VersionUpdate.AutoInstallUpdatePackage"
] = "True" # 自动安装更新包
data["Configurations"]["Default"]["Start.ClientType"] = self.data[
index
][
@@ -738,6 +785,9 @@ class MaaRunner(QtCore.QThread):
] = "True" # 无限吃48小时内过期的理智药
# 日常代理配置
elif mode == "日常代理_日常":
data["Current"] = "Default" # 切换配置
for i in range(1, 9):
data["Global"]["Timer.Timer" + str(i)] = "False" # 时间设置
data["Configurations"]["Default"][
"MainFunction.PostActions"
] = "12" # 完成后退出MAA和模拟器
@@ -745,9 +795,18 @@ 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"][
"VersionUpdate.ScheduledUpdateCheck"
] = "True" # 定时检查更新
data["Global"][
"VersionUpdate.AutoDownloadUpdatePackage"
] = "True" # 自动下载更新包
data["Global"][
"VersionUpdate.AutoInstallUpdatePackage"
] = "True" # 自动安装更新包
data["Configurations"]["Default"]["Start.ClientType"] = self.data[
index
][
@@ -837,7 +896,7 @@ class MaaRunner(QtCore.QThread):
"Fight.UseExpiringMedicine"
] = "True" # 无限吃48小时内过期的理智药
# 自定义基建配置
if self.data[index][11] == "-":
if self.data[index][11] == "n":
data["Configurations"]["Default"][
"Infrast.CustomInfrastEnabled"
] = "False" # 禁用自定义基建配置
@@ -851,11 +910,12 @@ class MaaRunner(QtCore.QThread):
data["Configurations"]["Default"][
"Infrast.IsCustomInfrastFileReadOnly"
] = "False" # 自定义基建配置文件只读
data["Configurations"]["Default"][
"Infrast.CustomInfrastFile"
] = self.data[index][
11
] # 自定义基建配置文件地址
data["Configurations"]["Default"]["Infrast.CustomInfrastFile"] = (
self.json_path
+ "/simple/"
+ str(self.data[index][16])
+ "/infrastructure/infrastructure.json"
) # 自定义基建配置文件地址
# 覆写配置文件
with open(self.set_path, "w", encoding="utf-8") as f:
json.dump(data, f, indent=4)
@@ -959,7 +1019,9 @@ 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
self.if_update_config = True
self.user_mode_list = ["simple", "beta"]
@@ -1077,9 +1139,10 @@ class Main(QWidget):
self.maa_path = self.ui.findChild(QLineEdit, "lineEdit_MAApath")
self.maa_path.textChanged.connect(self.change_config)
self.maa_path.setReadOnly(True)
self.get_maa_path = self.ui.findChild(QPushButton, "pushButton_getMAApath")
self.get_maa_path.clicked.connect(lambda: self.read("file_path"))
self.get_maa_path.clicked.connect(lambda: self.read("file_path_maa"))
self.set_maa = self.ui.findChild(QPushButton, "pushButton_setMAA")
self.set_maa.clicked.connect(lambda: self.maa_set_starter("设置MAA_全局"))
@@ -1099,6 +1162,9 @@ class Main(QWidget):
self.if_sleep = self.ui.findChild(QCheckBox, "checkBox_ifsleep")
self.if_sleep.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")
@@ -1143,7 +1209,7 @@ class Main(QWidget):
self.MaaRunner.update_gui.connect(self.update_board)
self.MaaRunner.update_user_info.connect(self.change_user_info)
self.MaaRunner.push_notification.connect(self.push_notification)
self.MaaRunner.accomplish.connect(self.routine_ender)
self.MaaRunner.accomplish.connect(lambda: self.maa_ender("日常代理_结束"))
self.MaaRunner.get_json.connect(self.get_maa_config)
self.MainTimer = MainTimer(self.config)
@@ -1164,11 +1230,26 @@ 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):
with open(self.gameid_path, "w", encoding="utf-8") as f:
print(
"龙门币CE-6\n技能CA-5\n红票AP-5\n经验LS-6\n剿灭模式Annihilation",
file=f,
)
# 生成管理密钥
if not os.path.exists(self.key_path):
while True:
@@ -1220,7 +1301,7 @@ class Main(QWidget):
["SelfSet.IfSleep", "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)):
@@ -1228,7 +1309,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):
@@ -1241,7 +1322,7 @@ class Main(QWidget):
"CREATE TABLE adminx(admin text,id text,server text,day int,status text,last date,game text,game_1 text,game_2 text,routines text,annihilation text,infrastructure text,password byte,notes text,numb int,mode text,uid int)"
)
cur.execute("CREATE TABLE version(v text)")
cur.execute("INSERT INTO version VALUES(?)", ("v1.1",))
cur.execute("INSERT INTO version VALUES(?)", ("v1.2",))
db.commit()
cur.close()
db.close()
@@ -1286,6 +1367,21 @@ class Main(QWidget):
cur.execute("DELETE FROM version WHERE v = ?", ("v1.0",))
cur.execute("INSERT INTO version VALUES(?)", ("v1.1",))
db.commit()
# v1.1-->v1.2
if version[0][0] == "v1.1":
cur.execute("SELECT * FROM adminx WHERE True")
data = cur.fetchall()
for i in range(len(data)):
cur.execute(
"UPDATE adminx SET infrastructure = 'n' WHERE mode = ? AND uid = ?",
(
data[i][15],
data[i][16],
),
)
cur.execute("DELETE FROM version WHERE v = ?", ("v1.1",))
cur.execute("INSERT INTO version VALUES(?)", ("v1.2",))
db.commit()
cur.close()
db.close()
@@ -1454,134 +1550,143 @@ class Main(QWidget):
if operation == "clear":
self.PASSWORD = ""
elif operation == "read_only":
self.if_user_list_editable = False
elif operation == "editable":
self.if_user_list_editable = True
self.if_update_database = False
if self.user_set.currentIndex() == 0:
data = [_ for _ in data if _[15] == "simple"]
self.user_list_simple.setRowCount(len(data))
for i, row in enumerate(data):
for j, value in enumerate(row):
if self.userlist_simple_index[j] == "-":
continue
if j == 2:
item = QComboBox()
item.addItems(["官服", "B服"])
if value == "Official":
item.setCurrentIndex(0)
elif value == "Bilibili":
item.setCurrentIndex(1)
item.currentIndexChanged.connect(
partial(
self.change_user_CellWidget,
data[i][16],
self.user_column[j],
)
data_simple = [_ for _ in data if _[15] == "simple"]
self.user_list_simple.setRowCount(len(data_simple))
for i, row in enumerate(data_simple):
for j, value in enumerate(row):
if self.userlist_simple_index[j] == "-":
continue
if j == 2:
item = QComboBox()
item.addItems(["官服", "B服"])
if value == "Official":
item.setCurrentIndex(0)
elif value == "Bilibili":
item.setCurrentIndex(1)
item.currentIndexChanged.connect(
partial(
self.change_user_CellWidget,
data_simple[i][16],
self.user_column[j],
)
elif j in [4, 10]:
item = QComboBox()
item.addItems(["启用", "禁用"])
if value == "y":
item.setCurrentIndex(0)
elif value == "n":
item.setCurrentIndex(1)
item.currentIndexChanged.connect(
partial(
self.change_user_CellWidget,
data[i][16],
self.user_column[j],
)
)
elif j in [4, 10, 11]:
item = QComboBox()
item.addItems(["启用", "禁用"])
if value == "y":
item.setCurrentIndex(0)
elif value == "n":
item.setCurrentIndex(1)
item.currentIndexChanged.connect(
partial(
self.change_user_CellWidget,
data_simple[i][16],
self.user_column[j],
)
elif j == 5:
curdate = server_date()
if curdate != value:
item = QTableWidgetItem("今日未代理")
else:
item = QTableWidgetItem(
"今日已代理" + str(data[i][14]) + ""
)
)
elif j == 5:
curdate = server_date()
if curdate != value:
item = QTableWidgetItem("今日未代理")
else:
item = QTableWidgetItem(
"今日已代理" + str(data_simple[i][14]) + ""
)
item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
elif j == 12:
if self.PASSWORD == "":
item = QTableWidgetItem("******")
item.setFlags(
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled
)
elif j == 11:
item = QTableWidgetItem(str(value).replace("\\", "/"))
elif j == 12:
if self.PASSWORD == "":
item = QTableWidgetItem("******")
else:
result = self.decryptx(value)
item = QTableWidgetItem(result)
if result == "管理密钥错误":
item.setFlags(
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled
)
else:
result = self.decryptx(value)
item = QTableWidgetItem(result)
if result == "管理密钥错误":
item.setFlags(
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled
)
else:
item = QTableWidgetItem(str(value))
if j in [2, 4, 10, 11]:
if not self.if_user_list_editable:
item.setEnabled(False)
self.user_list_simple.setCellWidget(
data_simple[i][16], self.userlist_simple_index[j], item
)
else:
self.user_list_simple.setItem(
data_simple[i][16], self.userlist_simple_index[j], item
)
data_beta = [_ for _ in data if _[15] == "beta"]
self.user_list_beta.setRowCount(len(data_beta))
for i, row in enumerate(data_beta):
for j, value in enumerate(row):
if self.userlist_beta_index[j] == "-":
continue
if j in [4, 9, 10]:
item = QComboBox()
item.addItems(["启用", "禁用"])
if value == "y":
item.setCurrentIndex(0)
elif value == "n":
item.setCurrentIndex(1)
item.currentIndexChanged.connect(
partial(
self.change_user_CellWidget,
data_beta[i][16],
self.user_column[j],
)
)
elif j == 5:
curdate = server_date()
if curdate != value:
item = QTableWidgetItem("今日未代理")
else:
item = QTableWidgetItem(str(value))
if j in [2, 4, 10]:
self.user_list_simple.setCellWidget(
data[i][16], self.userlist_simple_index[j], item
item = QTableWidgetItem(
"今日已代理" + str(data_beta[i][14]) + ""
)
else:
self.user_list_simple.setItem(
data[i][16], self.userlist_simple_index[j], item
)
elif self.user_set.currentIndex() == 1:
data = [_ for _ in data if _[15] == "beta"]
self.user_list_beta.setRowCount(len(data))
for i, row in enumerate(data):
for j, value in enumerate(row):
if self.userlist_beta_index[j] == "-":
continue
if j in [4, 9, 10]:
item = QComboBox()
item.addItems(["启用", "禁用"])
if value == "y":
item.setCurrentIndex(0)
elif value == "n":
item.setCurrentIndex(1)
item.currentIndexChanged.connect(
partial(
self.change_user_CellWidget,
data[i][16],
self.user_column[j],
)
)
elif j == 5:
curdate = server_date()
if curdate != value:
item = QTableWidgetItem("今日未代理")
else:
item = QTableWidgetItem(
"今日已代理" + str(data[i][14]) + ""
)
item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
elif j == 12:
if self.PASSWORD == "":
item = QTableWidgetItem("******")
item.setFlags(
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled
)
elif j == 12:
if self.PASSWORD == "":
item = QTableWidgetItem("******")
else:
result = self.decryptx(value)
item = QTableWidgetItem(result)
if result == "管理密钥错误":
item.setFlags(
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled
)
else:
result = self.decryptx(value)
item = QTableWidgetItem(result)
if result == "管理密钥错误":
item.setFlags(
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled
)
else:
item = QTableWidgetItem(str(value))
if j in [4, 9, 10]:
self.user_list_beta.setCellWidget(
data[i][16], self.userlist_beta_index[j], item
)
else:
self.user_list_beta.setItem(
data[i][16], self.userlist_beta_index[j], item
)
else:
item = QTableWidgetItem(str(value))
if j in [4, 9, 10]:
if not self.if_user_list_editable:
item.setEnabled(False)
self.user_list_beta.setCellWidget(
data_beta[i][16], self.userlist_beta_index[j], item
)
else:
self.user_list_beta.setItem(
data_beta[i][16], self.userlist_beta_index[j], item
)
if self.if_user_list_editable:
self.user_list_simple.setEditTriggers(QTableWidget.AllEditTriggers)
self.user_list_beta.setEditTriggers(QTableWidget.AllEditTriggers)
else:
self.user_list_simple.setEditTriggers(QTableWidget.NoEditTriggers)
self.user_list_beta.setEditTriggers(QTableWidget.NoEditTriggers)
# 设置QComboBox为可编辑
self.if_update_database = True
self.user_list_simple.horizontalHeader().setSectionResizeMode(
QHeaderView.Stretch
@@ -1639,7 +1744,7 @@ class Main(QWidget):
return None
if self.user_set.currentIndex() == 0:
self.cur.execute(
"INSERT INTO adminx VALUES('新用户','手机号码(官服)/B站IDB服','Official',0,'y','2000-01-01','1-7','-','-','y','y','-',?,'',0,'simple',?)",
"INSERT INTO adminx VALUES('新用户','手机号码(官服)/B站IDB服','Official',0,'y','2000-01-01','1-7','-','-','y','y','n',?,'',0,'simple',?)",
(
self.encryptx("未设置"),
self.user_list_simple.rowCount(),
@@ -1784,16 +1889,6 @@ class Main(QWidget):
self.app_path
+ "/data/MAAconfig/"
+ self.user_mode_list[1 - self.user_set.currentIndex()]
+ "/-1",
)
os.rename(
self.app_path
+ "/data/MAAconfig/"
+ self.user_mode_list[1 - self.user_set.currentIndex()]
+ "/-1",
self.app_path
+ "/data/MAAconfig/"
+ self.user_mode_list[1 - self.user_set.currentIndex()]
+ "/"
+ str(other_numb),
)
@@ -1818,9 +1913,12 @@ class Main(QWidget):
self.update_user_info("normal")
def change_user_set(self):
"""修改用户配置的详细文件"""
"""执行用户配置列表的进一步配置"""
if self.user_set.currentIndex() == 0:
QMessageBox.critical(self.ui, "错误", "该项目无法进一步配置")
if self.user_list_simple.currentColumn() in [10]:
self.get_maa_config([0, self.user_list_simple.currentRow(), 2])
else:
QMessageBox.critical(self.ui, "错误", "该项目无法进一步配置")
elif self.user_set.currentIndex() == 1:
if self.user_list_beta.currentColumn() in [4, 5]:
self.MaaRunner.get_json_path = [
@@ -1847,6 +1945,33 @@ class Main(QWidget):
self.config["Default"]["MaaSet.path"] + "/config/gui.json",
self.app_path + "/data/MAAconfig/Default",
)
elif info[2] == 2:
infrastructure_path = self.read("file_path_infrastructure")
if infrastructure_path:
os.makedirs(
self.app_path
+ "/data/MAAconfig/"
+ set_book1[info[0]]
+ str(info[1])
+ "/infrastructure",
exist_ok=True,
)
shutil.copy(
infrastructure_path,
self.app_path
+ "/data/MAAconfig/"
+ set_book1[info[0]]
+ str(info[1])
+ "/infrastructure/infrastructure.json",
)
return True
else:
QMessageBox.critical(
self.ui,
"错误",
"未选择自定义基建文件",
)
return False
else:
os.makedirs(
self.app_path
@@ -1876,16 +2001,13 @@ class Main(QWidget):
if item.column() in [6, 7, 8]:
# 导入与应用特殊关卡规则
games = {}
if os.path.exists(self.gameid_path):
with open(self.gameid_path, encoding="utf-8") as f:
gameids = f.readlines()
for line in gameids:
if "" in line:
game_in, game_out = line.split("", 1)
games[game_in.strip()] = game_out.strip()
with open(self.gameid_path, encoding="utf-8") as f:
gameids = f.readlines()
for line in gameids:
if "" in line:
game_in, game_out = line.split("", 1)
games[game_in.strip()] = game_out.strip()
text = games.get(text, text)
if item.column() == 10:
text = text.replace("\\", "/")
if item.column() == 11:
text = self.encryptx(text)
if text != "":
@@ -1910,6 +2032,22 @@ class Main(QWidget):
"""将GUI中发生修改的用户配置表中的CellWidget类信息同步至本地数据库"""
if not self.if_update_database:
return None
if (
self.user_set.currentIndex() == 0
and column == "infrastructure"
and index == 0
):
if not os.path.exists(
self.app_path
+ "/data/MAAconfig/"
+ self.user_mode_list[self.user_set.currentIndex()]
+ "/"
+ str(row)
+ "/infrastructure/infrastructure.json",
):
result = self.get_maa_config([0, row, 2])
if not result:
index = 1
if self.user_set.currentIndex() == 0 and column == "server":
server_list = ["Official", "Bilibili"]
self.cur.execute(
@@ -1958,7 +2096,7 @@ class Main(QWidget):
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(
@@ -1986,7 +2124,7 @@ 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()
@@ -2032,11 +2170,17 @@ class Main(QWidget):
self.MaaRunner.question_choice = "Yes"
elif choice == QMessageBox.No:
self.MaaRunner.question_choice = "No"
# 读入文件目录
elif operation == "file_path":
# 读入MAA文件目录
elif operation == "file_path_maa":
file_path = QFileDialog.getExistingDirectory(self.ui, "选择MAA文件夹")
if file_path != "":
if file_path:
self.maa_path.setText(file_path)
# 读入自定义基建文件目录
elif operation == "file_path_infrastructure":
file_path, _ = QFileDialog.getOpenFileName(
self.ui, "选择自定义基建文件", "", "JSON 文件 (*.json)"
)
return file_path
def check_maa_path(self):
if os.path.exists(
@@ -2049,36 +2193,12 @@ class Main(QWidget):
else:
return False
def routine_ender(self):
"""中止日常代理进程"""
self.MaaRunner.if_run = False
self.MaaRunner.wait()
self.MainTimer.is_maa_run = False
shutil.copy(
self.app_path + "/data/MAAconfig/Default/gui.json",
self.config["Default"]["MaaSet.path"] + "/config",
)
self.check_start.setEnabled(True)
self.set_maa.setEnabled(True)
self.user_changeset.setEnabled(True)
self.run_now.clicked.disconnect()
self.run_now.setText("立即执行")
self.run_now.clicked.connect(self.routine_starter)
def routine_starter(self):
"""启动MaaRunner线程运行日常代理任务"""
if not self.check_maa_path():
QMessageBox.critical(self.ui, "错误", "您还未正确配置MAA路径")
return None
# 运行过程中修改部分组件
self.MaaRunner.accomplish.disconnect()
self.MaaRunner.accomplish.connect(self.routine_ender)
self.check_start.setEnabled(False)
self.set_maa.setEnabled(False)
self.user_changeset.setEnabled(False)
self.run_now.clicked.disconnect()
self.run_now.setText("结束运行")
self.run_now.clicked.connect(self.routine_ender)
self.maa_running_set("日常代理_开始")
# 配置参数
self.MaaRunner.set_path = (
self.config["Default"]["MaaSet.path"] + "/config/gui.json"
@@ -2098,36 +2218,12 @@ class Main(QWidget):
self.MainTimer.is_maa_run = True
self.MaaRunner.start()
def check_ender(self):
"""中止人工排查进程"""
self.MaaRunner.if_run = False
self.MaaRunner.wait()
self.MainTimer.is_maa_run = False
shutil.copy(
self.app_path + "/data/MAAconfig/Default/gui.json",
self.config["Default"]["MaaSet.path"] + "/config",
)
self.run_now.setEnabled(True)
self.set_maa.setEnabled(True)
self.user_changeset.setEnabled(True)
self.check_start.clicked.disconnect()
self.check_start.setText("开始排查")
self.check_start.clicked.connect(self.check_starter)
def check_starter(self):
"""启动MaaRunner线程运行人工排查任务"""
if not self.check_maa_path():
QMessageBox.critical(self.ui, "错误", "您还未正确配置MAA路径")
return None
# 运行过程中修改部分组件
self.MaaRunner.accomplish.disconnect()
self.MaaRunner.accomplish.connect(self.check_ender)
self.run_now.setEnabled(False)
self.set_maa.setEnabled(False)
self.user_changeset.setEnabled(False)
self.check_start.clicked.disconnect()
self.check_start.setText("中止排查")
self.check_start.clicked.connect(self.check_ender)
self.maa_running_set("人工排查_开始")
# 配置参数
self.MaaRunner.set_path = (
self.config["Default"]["MaaSet.path"] + "/config/gui.json"
@@ -2144,33 +2240,12 @@ class Main(QWidget):
self.MainTimer.is_maa_run = True
self.MaaRunner.start()
def maa_set_ender(self):
"""中止MAA设置进程"""
self.MaaRunner.if_run = False
self.MaaRunner.wait()
self.MainTimer.is_maa_run = False
if self.MaaRunner.mode == "设置MAA_用户":
shutil.copy(
self.app_path + "/data/MAAconfig/Default/gui.json",
self.config["Default"]["MaaSet.path"] + "/config",
)
self.set_maa.setEnabled(True)
self.user_changeset.setEnabled(True)
self.run_now.setEnabled(True)
self.check_start.setEnabled(True)
def maa_set_starter(self, mode):
"""启动MaaRunner线程进行MAA设置"""
if not self.check_maa_path():
QMessageBox.critical(self.ui, "错误", "您还未正确配置MAA路径")
return None
# 运行过程中修改部分组件
self.MaaRunner.accomplish.disconnect()
self.MaaRunner.accomplish.connect(self.maa_set_ender)
self.set_maa.setEnabled(False)
self.user_changeset.setEnabled(False)
self.run_now.setEnabled(False)
self.check_start.setEnabled(False)
self.maa_running_set("设置MAA_开始")
# 配置参数
self.MaaRunner.set_path = (
self.config["Default"]["MaaSet.path"] + "/config/gui.json"
@@ -2184,6 +2259,154 @@ class Main(QWidget):
self.MainTimer.is_maa_run = True
self.MaaRunner.start()
def maa_ender(self, mode):
"""中止MAA线程"""
self.MaaRunner.if_run = False
self.MaaRunner.wait()
self.MainTimer.is_maa_run = False
self.maa_running_set(mode)
def maa_running_set(self, mode):
"""处理MAA运行过程中的GUI组件变化"""
if "开始" in mode:
self.MaaRunner.accomplish.disconnect()
self.user_add.setEnabled(False)
self.user_del.setEnabled(False)
self.user_switch.setEnabled(False)
self.user_changeset.setEnabled(False)
self.set_maa.setEnabled(False)
# self.update_user_info("read_only")
if mode == "日常代理_开始":
self.MaaRunner.accomplish.connect(
lambda: self.maa_ender("日常代理_结束")
)
self.check_start.setEnabled(False)
self.run_now.clicked.disconnect()
self.run_now.setText("结束运行")
self.run_now.clicked.connect(lambda: self.maa_ender("日常代理_结束"))
elif mode == "人工排查_开始":
self.MaaRunner.accomplish.connect(
lambda: self.maa_ender("人工排查_结束")
)
self.run_now.setEnabled(False)
self.check_start.clicked.disconnect()
self.check_start.setText("中止排查")
self.check_start.clicked.connect(
lambda: self.maa_ender("人工排查_结束")
)
elif mode == "设置MAA_开始":
self.MaaRunner.accomplish.connect(
lambda: self.maa_ender("设置MAA_结束")
)
self.run_now.setEnabled(False)
self.check_start.setEnabled(False)
elif "结束" in mode:
shutil.copy(
self.app_path + "/data/MAAconfig/Default/gui.json",
self.config["Default"]["MaaSet.path"] + "/config",
)
self.user_add.setEnabled(True)
self.user_del.setEnabled(True)
self.user_switch.setEnabled(True)
self.user_changeset.setEnabled(True)
self.set_maa.setEnabled(True)
# self.update_user_info("editable")
if mode == "设置MAA_结束":
self.run_now.setEnabled(True)
self.check_start.setEnabled(True)
elif mode == "人工排查_结束":
self.run_now.setEnabled(True)
self.check_start.clicked.disconnect()
self.check_start.setText("开始排查")
self.check_start.clicked.connect(self.check_starter)
elif mode == "日常代理_结束":
self.check_start.setEnabled(True)
self.run_now.clicked.disconnect()
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(

177
README.md
View File

@@ -1,9 +1,10 @@
# AUTO_MAA
MAA多账号管理与自动化软件
!["软件图标"](https://github.com/DLmaster361/AUTO_MAA/blob/main/res/AUTO_MAA.png "软件图标")
----------------------------------------------------------------------------------------------
---
</h1>
@@ -15,88 +16,136 @@ MAA多账号管理与自动化软件
</div>
## 重要声明
本软件是一个外部工具旨在优化MAA多账号功能体验并通过一些方法解决MAA项目未能解决的部分问题改善代理的稳定性。该软件包可以存储明日方舟多账号数据并通过修改MAA配置文件、读取MAA日志等行为自动完成多账号代理。本开发团队承诺不会修改明日方舟游戏本体与相关配置文件。
本项目使用GPL开源相关细则如下
- **作者:** AUTO_MAA软件作者为DLmaster、DLmaster361或DLmaster_361以上均指代同一人。
- **使用:** AUTO_MAA使用者可以按自己的意愿自由使用本软件。依据GPL对于由此可能产生的损失AUTO_MAA项目组不负任何责任
- **分发:** AUTO_MAA允许任何人自由分发本软件包括进行商业活动牟利。但所有分发者必须遵循GPL向接收者提供本软件项目地址、完整的软件源码与GPL协议原文违反者可能会被追究法律责任
- **传播:** AUTO_MAA原则上允许传播者自由传播本软件。但由于软件性质项目组不希望发现任何人在明日方舟官方媒体包括官方媒体账号与森空岛社区等或明日方舟游戏相关内容包括同好群、线下活动与游戏内容讨论等下提及AUTO_MAA或MAA希望各位理解
- **衍生:** AUTO_MAA允许任何人对软件本体或软件部分代码进行二次开发或利用。但依据GPL相关成果也必须使用GPL开源
- **授权:** 如果希望在使用AUTO_MAA的相关成果后仍保持自己的项目闭源请在Issues中说明来意。得到项目组认可后我们可以提供另一份使用不同协议的代码此协议主要内容如下被授权者可以自由使用该代码并维持闭源被授权者必须定期为AUTO_MAA作出贡献
- **贡献:** 不论是直接参与软件的维护编写或是撰写文档、测试、反馈BUG、给出建议、参与讨论都为AUTO_MAA项目的发展完善做出了不可忽视的贡献。项目组提倡各位贡献者遵照GitHub开源社区惯例发布Issues参与项目。避免私信或私发邮件安全性漏洞或敏感问题除外以帮助更多用户
- **使用:** AUTO_MAA使用者可以按自己的意愿自由使用本软件。依据GPL对于由此可能产生的损失AUTO_MAA项目组不负任何责任
- **分发:** AUTO_MAA允许任何人自由分发本软件包括进行商业活动牟利。但所有分发者必须遵循GPL向接收者提供本软件项目地址、完整的软件源码与GPL协议原文违反者可能会被追究法律责任
- **传播:** AUTO_MAA原则上允许传播者自由传播本软件。但由于软件性质项目组不希望发现任何人在明日方舟官方媒体包括官方媒体账号与森空岛社区等或明日方舟游戏相关内容包括同好群、线下活动与游戏内容讨论等下提及AUTO_MAA或MAA希望各位理解
- **衍生:** AUTO_MAA允许任何人对软件本体或软件部分代码进行二次开发或利用。但依据GPL相关成果也必须使用GPL开源
- **授权:** 如果希望在使用AUTO_MAA的相关成果后仍保持自己的项目闭源请在Issues中说明来意。得到项目组认可后我们可以提供另一份使用不同协议的代码此协议主要内容如下被授权者可以自由使用该代码并维持闭源被授权者必须定期为AUTO_MAA作出贡献
- **贡献:** 不论是直接参与软件的维护编写或是撰写文档、测试、反馈BUG、给出建议、参与讨论都为AUTO_MAA项目的发展完善做出了不可忽视的贡献。项目组提倡各位贡献者遵照GitHub开源社区惯例发布Issues参与项目。避免私信或私发邮件安全性漏洞或敏感问题除外以帮助更多用户
以上细则是本项目对GPL的相关补充与强调。未提及的以GPL为准发生冲突的以本细则为准。如有不清楚的部分请发Issues询问。若发生纠纷相关内容也没有在Issues上提及的项目组拥有最终解释权
以上细则是本项目对GPL的相关补充与强调。未提及的以GPL为准发生冲突的以本细则为准。如有不清楚的部分请发Issues询问。若发生纠纷相关内容也没有在Issues上提及的项目组拥有最终解释权
**注意**
- 由于本软件有修改其它目录JSON文件等行为使用前请将AUTO_MAA添加入Windows Defender信任区以及防病毒软件的信任区或开发者目录避免被误杀
- 由于本软件有修改其它目录JSON文件等行为使用前请将AUTO_MAA添加入Windows Defender信任区以及防病毒软件的信任区或开发者目录避免被误杀。
---
# 使用方法
## 安装与配置MAA
## 安装软件
```
本软件是MAA的外部工具需要安装配置MAA后才能使用。
本软件是MAA的外部工具需要安装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配置
### 安装MAA
1. 完成MAA的adb配置等基本配置
- 将MAA压缩包解压至任意普通文件夹即可。
2. 确保当前配置名为“Default”取消所有“定时执行”
- 若为首次安装MAA请双击`MAA.exe`启动MAA程序以生成MAA配置文件。
![MAA配置1](https://github.com/DLmaster361/AUTO_MAA/blob/main/res/README/MAA配置1.png "MAA配置1")
3. 取消勾选“开机自启动MAA”勾选“启动MAA后直接运行”和“启动MAA后自动开启模拟器”。配置自己模拟器所在的位置并根据实际情况填写“等待模拟器启动时间”建议预留10s以防意外。如果是多开用户需要填写“附加命令”具体填写值参见多开模拟器对应快捷方式路径如“-v 1”
![MAA配置2](https://github.com/DLmaster361/AUTO_MAA/blob/main/res/README/MAA配置2.png "MAA配置2")
4. 勾选“定时检查更新”、“自动下载更新包”和“自动安装更新包”
![MAA配置3](https://github.com/DLmaster361/AUTO_MAA/blob/main/res/README/MAA配置3.png "MAA配置3")
## 下载AUTO_MAA [![](https://img.shields.io/github/downloads/DLmaster361/AUTO_MAA/total?color=66ccff)](https://github.com/DLmaster361/AUTO_MAA/releases)
### 下载AUTO_MAA [![](https://img.shields.io/github/downloads/DLmaster361/AUTO_MAA/total?color=66ccff)](https://github.com/DLmaster361/AUTO_MAA/releases)
- GitHub下载地址 [GitHub下载](https://github.com/DLmaster361/AUTO_MAA/releases)
## 配置AUTO_MAA
### 安装AUTO_MAA
- 将AUTO_MAA压缩包解压至任意普通文件夹即可。
## 配置AUTO_MAA
### 启动AUTO_MAA
- 双击`AUTO_MAA.exe`以启动软件
- 双击`AUTO_MAA.exe`以启动软件
```
注意:
首次启动时会要求设置管理密钥。
首次启动时会要求设置管理密钥。
管理密钥是解密用户密码的唯一凭证,与数据库绑定。
密钥丢失或data/key/目录下任一文件损坏都将导致解密无法正常进行。
管理密钥是解密用户密码的唯一凭证,与数据库绑定。
密钥丢失或data/key/目录下任一文件损坏都将导致解密无法正常进行。
本项目采用自主开发的混合加密模式项目组也无法找回您的管理密钥或修复data/key/目录下的文件。
如果不幸的事发生建议您删除data/key/目录与data/data.db文件后重新录入信息。
本项目采用自主开发的混合加密模式项目组也无法找回您的管理密钥或修复data/key/目录下的文件。
如果不幸的事发生建议您删除data/key/目录与data/data.db文件后重新录入信息。
```
### 配置信息
- 本项目已初步完成GUI开发您可以在用户管理页与设置页配置信息。
#### 设置MAA
```
特别的:
1. 通过`浏览`绑定MAA后单击`设置MAA`进行MAA全局设置。
你可以自定义关卡号替换方案
程序会读取data/gameid.txt中的数据依据此进行关卡号的替换便于常用关卡的使用。
gameid.txt在初始已经存储了一些常用资源本的替代方案
```
2. 在打开的MAA界面完成`性能设置``游戏设置``连接设置``启动设置``界面设置``软件更新`等基本配置以及代理任务的详细配置
3. 完成基本配置后关闭MAA页面AUTO_MAA会自动保存您的配置
- 注意在MAA的设置过程中若MAA要求`立刻重启应用更改`,请选择`稍后`。否则MAA重启后的一切更改都不会被程序记录。
- 特别的,您需要确保自己:
- 取消勾选`开机自启动MAA`
- 配置自己模拟器所在的位置并根据实际情况填写`等待模拟器启动时间`建议预留10s以防意外
- 如果是模拟器多开用户,还需要填写`附加命令`,具体填写值参见多开模拟器对应快捷方式路径(如`-v 1`)。
![MAA配置](https://github.com/DLmaster361/AUTO_MAA/blob/main/res/README/MAA配置.png "MAA配置")
#### 设置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栏目`您可以自定义关卡号替换方案。
- 程序会读取`data/gameid.txt`中的数据,依据此进行关卡号的替换,便于常用关卡的使用。
- `gameid.txt`会在程序首次运行时生成,其中将预置一些常用资源本的替换方案。
![gameid](https://github.com/DLmaster361/AUTO_MAA/blob/main/res/README/gameid.png "gameid")
@@ -104,42 +153,42 @@ gameid.txt在初始已经存储了一些常用资源本的替代方案。
### 直接运行
- 在执行页单击`立即执行`直接运行
- 在执行页单击`立即执行`直接运行
### 定时运行
- 在执行页的`定时执行`栏设置时间
- 在执行页的`定时执行`栏设置时间
- 保持软件打开,软件会在设定的时间自动运行
- 保持软件打开,软件会在设定的时间自动运行
## 人工排查代理结果
### 直接开始人工排查
- 在执行页单击`开始排查`启动排查进程
- 在执行页单击`开始排查`启动排查进程
- 软件将调起MAA依次登录各用户的账号
- 软件将调起MAA依次登录各用户的账号
- 检查代理情况,可以手动完成未代理的任务
- 完成PRTS登录后请人工检查代理情况,可以手动完成未代理的任务
- 在对话框中单击对应账号的代理情况
- 在对话框中单击对应账号的代理情况
- 结束人工排查后,相排查情况将被写入用户管理页的`备注`
- 结束人工排查后,相排查情况将被写入用户管理页的`备注栏目`
---
# 关于
欢迎加入AUTO_MAA项目组欢迎反馈bug
## 未来开发方向
QQ群957750551
- [x] 支持B服
- [x] 支持完全自定义MAA配置
- [x] 支持程序版本更新
- [ ] 支持对MAA运行状况的进一步识别
- [ ] 支持宽幅ADB连接适配
- [ ] 添加更多通知手段
- [ ] GUI界面美化
----------------------------------------------------------------------------------------------
如果喜欢这个项目,可以打赏作者一杯咖啡吗?
![payid](https://github.com/DLmaster361/AUTO_MAA/blob/main/res/README/payid.png "payid")
----------------------------------------------------------------------------------------------
## 贡献者
感谢以下贡献者对本项目做出的贡献
@@ -154,4 +203,16 @@ QQ群957750551
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=DLmaster361/AUTO_MAA&type=Date)](https://star-history.com/#DLmaster361/AUTO_MAA&Date)
[![Star History Chart](https://api.star-history.com/svg?repos=DLmaster361/AUTO_MAA&type=Date)](https://star-history.com/#DLmaster361/AUTO_MAA&Date)
## 交流与赞助
欢迎加入AUTO_MAA项目组欢迎反馈bug
- QQ群957750551
---
如果喜欢这个项目的话,给作者来杯咖啡吧!
![payid](https://github.com/DLmaster361/AUTO_MAA/blob/main/res/README/payid.png "payid")

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

@@ -1,5 +0,0 @@
龙门币CE-6
技能CA-5
红票AP-5
经验LS-6
剿灭模式Annihilation

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,8 +189,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>98</width>
<height>74</height>
<width>1156</width>
<height>546</height>
</rect>
</property>
<attribute name="label">
@@ -1102,6 +1102,51 @@
</property>
</spacer>
</item>
<item>
<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>
</layout>
</widget>
</item>
@@ -1139,21 +1184,21 @@ 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; 这是AUTO_MAA_v4.1.0,版本更新程序上线。&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; 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; 如果是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, 0),
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.0'),
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.0'),
StringStruct('Assembly Version', 'v4.1.1.0')])
])
]
)

BIN
res/README/MAA配置.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 21 KiB

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" #基建换班
@@ -36,4 +35,6 @@
"VersionUpdate.AutoDownloadUpdatePackage": "True" #自动下载更新包
"VersionUpdate.AutoInstallUpdatePackage": "True" #自动安装更新包
"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
View File

@@ -0,0 +1,7 @@
{
"main_version": "4.1.1.0",
"main_download_url": "https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/releases/download/v4.1.1/AUTO_MAA_v4.1.1.zip",
"updater_version": "1.0.0.0",
"updater_download_url": "https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/releases/download/v4.1.1/Updater_v1.0.0.zip",
"announcement": "\n## 修复BUG\n- 适配MAA的`启动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,16 +0,0 @@
v4.0_beta
## 新增功能
- 服务器切换功能上线支持B服 #7
- 用户高级配置功能上线支持用户修改几乎所有MAA配置
## 修复BUG
- 修复无用户进行代理时的逻辑错误
## 程序优化
- log获取部分集成为1个函数
- 消除部分if嵌套
## 更新说明
- 项目初始阶段,不会提供专门的版本更新程序,您需要手动更新程序。
- v2.1.5及以前的用户,由于新版本采用全新的架构,您需要手动输入之前的信息。
- v3.0_Beta版用户,直接用`AUTO_MAA.exe`替代`gui.exe`后,将原文件夹下的`gui文件夹`用新版本对应文件替换,重新设置每个用户的`自定义基建`选项(输入`-`以关闭该功能,输入自定义基建配置文件地址以开启该功能)。
- v3.1~v3.1.3_beta版用户,将原文件夹下除`data文件夹`和`config文件夹`外的内容用新版本对应文件替换即可。
- 老用户请务必备份原有数据在更新前确保所填MAA路径有效且已存在MAA配置文件此次更新的代码改动较大可能有数据遗失的风险。
- 新用户请忽略本说明。