Merge branch 'dev'

This commit is contained in:
DLmaster361
2025-05-06 17:42:42 +08:00
8 changed files with 133 additions and 142 deletions

View File

@@ -136,11 +136,3 @@ jobs:
gh workflow run --repo $GITHUB_REPOSITORY mirrorchyan_release_note gh workflow run --repo $GITHUB_REPOSITORY mirrorchyan_release_note
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup SSH Key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -p ${{ secrets.SSH_PORT }} -H ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts
- name: Upload Release to Server
run: scp -P ${{ secrets.SSH_PORT }} -r artifacts/* ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }}:/mnt/data/AUTO_MAA/

View File

@@ -532,7 +532,12 @@ class MaaUserConfig(QConfig):
self.Info_MedicineNumb = ConfigItem( self.Info_MedicineNumb = ConfigItem(
"Info", "MedicineNumb", 0, RangeValidator(0, 1024) "Info", "MedicineNumb", 0, RangeValidator(0, 1024)
) )
self.Info_SeriesNumb = ConfigItem("Info", "SeriesNumb", 1, RangeValidator(1, 6)) self.Info_SeriesNumb = OptionsConfigItem(
"Info",
"SeriesNumb",
"1",
OptionsValidator(["1000", "6", "5", "4", "3", "2", "1", "-1"]),
)
self.Info_GameId = ConfigItem("Info", "GameId", "-") self.Info_GameId = ConfigItem("Info", "GameId", "-")
self.Info_GameId_1 = ConfigItem("Info", "GameId_1", "-") self.Info_GameId_1 = ConfigItem("Info", "GameId_1", "-")
self.Info_GameId_2 = ConfigItem("Info", "GameId_2", "-") self.Info_GameId_2 = ConfigItem("Info", "GameId_2", "-")
@@ -617,7 +622,7 @@ class MaaUserConfig(QConfig):
class AppConfig(GlobalConfig): class AppConfig(GlobalConfig):
VERSION = "4.3.6.5" VERSION = "4.3.6.0"
gameid_refreshed = Signal() gameid_refreshed = Signal()
PASSWORD_refreshed = Signal() PASSWORD_refreshed = Signal()

View File

@@ -1278,9 +1278,9 @@ class MaaManager(QObject):
) # 剩余理智关卡 ) # 剩余理智关卡
data["Configurations"]["Default"][ data["Configurations"]["Default"][
"MainFunction.Series.Quantity" "MainFunction.Series.Quantity"
] = str( ] = user_data["Info"][
user_data["Info"]["SeriesNumb"] "SeriesNumb"
) # 连战次数 ] # 连战次数
data["Configurations"]["Default"][ data["Configurations"]["Default"][
"Penguin.IsDrGrandet" "Penguin.IsDrGrandet"
] = "False" # 博朗台模式 ] = "False" # 博朗台模式
@@ -1382,9 +1382,9 @@ class MaaManager(QObject):
) # 剩余理智关卡 ) # 剩余理智关卡
data["Configurations"]["Default"][ data["Configurations"]["Default"][
"MainFunction.Series.Quantity" "MainFunction.Series.Quantity"
] = str( ] = user_data["Info"][
user_data["Info"]["SeriesNumb"] "SeriesNumb"
) # 连战次数 ] # 连战次数
data["Configurations"]["Default"][ data["Configurations"]["Default"][
"GUI.UseAlternateStage" "GUI.UseAlternateStage"
] = "True" # 备选关卡 ] = "True" # 备选关卡

View File

@@ -315,119 +315,120 @@ class MemberManager(QWidget):
def member_downloader(self): def member_downloader(self):
"""脚本下载器""" """脚本下载器"""
if not Config.get(Config.update_MirrorChyanCDK):
logger.warning("脚本下载器未设置CDK")
MainInfoBar.push_info_bar(
"warning",
"未设置Mirror酱CDK",
"下载器依赖于Mirror酱未设置CDK时无法使用",
5000,
)
return None
choice = ComboBoxMessageBox( choice = ComboBoxMessageBox(
self.window(), self.window(),
"选择一个脚本类型以下载相应脚本", "选择一个脚本类型以下载相应脚本",
["选择脚本类型"], ["选择脚本类型"],
[["MAA"]], [["MAA", "StarRailAssistant"]],
) )
if choice.exec() and choice.input[0].currentIndex() != -1: if choice.exec() and choice.input[0].currentIndex() != -1:
if choice.input[0].currentText() == "MAA": app_name = choice.input[0].currentText()
(Config.app_path / "script/MAA").mkdir(parents=True, exist_ok=True) (Config.app_path / f"script/{app_name}").mkdir(parents=True, exist_ok=True)
folder = QFileDialog.getExistingDirectory( folder = QFileDialog.getExistingDirectory(
self, "选择MAA下载目录", str(Config.app_path / "script/MAA") self,
f"选择{app_name}下载目录",
str(Config.app_path / f"script/{app_name}"),
)
if not folder:
logger.warning(f"选择{app_name}下载目录时未选择文件夹")
MainInfoBar.push_info_bar(
"warning", "警告", f"未选择{app_name}下载目录", 5000
) )
if not folder: return None
logger.warning("选择MAA下载目录时未选择文件夹")
MainInfoBar.push_info_bar(
"warning", "警告", "未选择MAA下载目录", 5000
)
return None
# 从mirrorc服务器获取最新版本信息 if app_name in ["MAA"]:
Network.set_info(
mode="get",
url=f"https://mirrorchyan.com/api/resources/MAA/latest?user_agent=AutoMaaGui&cdk={Crypto.win_decryptor(Config.get(Config.update_MirrorChyanCDK))}&os=win&arch=x64&channel=stable",
)
Network.start()
Network.loop.exec()
if Network.stutus_code == 200:
maa_info = Network.response_json
else:
if Network.response_json: url = f"https://mirrorchyan.com/api/resources/{app_name}/latest?user_agent=AutoMaaGui&cdk={Crypto.win_decryptor(Config.get(Config.update_MirrorChyanCDK))}&os=win&arch=x64&channel=stable"
maa_info = Network.response_json elif app_name in ["StarRailAssistant"]:
if maa_info["code"] != 0: url = f"https://mirrorchyan.com/api/resources/{app_name}/latest?user_agent=AutoMaaGui&cdk={Crypto.win_decryptor(Config.get(Config.update_MirrorChyanCDK))}&channel=stable"
logger.error(f"获取版本信息时出错:{maa_info["msg"]}") # 从mirrorc服务器获取最新版本信息
Network.set_info(mode="get", url=url)
Network.start()
Network.loop.exec()
if Network.stutus_code == 200:
app_info = Network.response_json
else:
error_remark_dict = { if Network.response_json:
1001: "获取版本信息的URL参数不正确",
7001: "填入的 CDK 已过期",
7002: "填入的 CDK 错误",
7003: "填入的 CDK 今日下载次数已达上限",
7004: "填入的 CDK 类型和待下载的资源不匹配",
7005: "填入的 CDK 已被封禁",
8001: "对应架构和系统下的资源不存在",
8002: "错误的系统参数",
8003: "错误的架构参数",
8004: "错误的更新通道参数",
1: maa_info["msg"],
}
if maa_info["code"] in error_remark_dict: app_info = Network.response_json
MainInfoBar.push_info_bar(
"error",
"获取版本信息时出错",
error_remark_dict[maa_info["code"]],
-1,
)
else:
MainInfoBar.push_info_bar(
"error",
"获取版本信息时出错",
"意料之外的错误,请及时联系项目组以获取来自 Mirror 酱的技术支持",
-1,
)
return None if app_info["code"] != 0:
logger.warning(f"获取版本信息时出错:{Network.error_message}") logger.error(f"获取版本信息时出错:{app_info["msg"]}")
MainInfoBar.push_info_bar(
"warning",
"获取版本信息时出错",
f"网络错误:{Network.stutus_code}",
5000,
)
return None
maa_version = list( error_remark_dict = {
map( 1001: "获取版本信息的URL参数不正确",
int, 7001: "填入的 CDK 已过期",
maa_info["data"]["version_name"][1:] 7002: "填入的 CDK 错误",
.replace("-beta", "") 7003: "填入的 CDK 今日下载次数已达上限",
.split("."), 7004: "填入的 CDK 类型和待下载的资源不匹配",
) 7005: "填入的 CDK 已被封禁",
) 8001: "对应架构和系统下的资源不存在",
while len(maa_version) < 4: 8002: "错误的系统参数",
maa_version.append(0) 8003: "错误的架构参数",
8004: "错误的更新通道参数",
self.downloader = DownloadManager( 1: app_info["msg"],
Path(folder),
"MAA",
maa_version,
(
{
"mode": "MirrorChyan",
"thread_numb": 1,
"url": maa_info["data"]["url"],
} }
if "url" in maa_info["data"]
else { if app_info["code"] in error_remark_dict:
"mode": "Proxy", MainInfoBar.push_info_bar(
"thread_numb": Config.get(Config.update_ThreadNumb), "error",
} "获取版本信息时出错",
), error_remark_dict[app_info["code"]],
-1,
)
else:
MainInfoBar.push_info_bar(
"error",
"获取版本信息时出错",
"意料之外的错误,请及时联系项目组以获取来自 Mirror 酱的技术支持",
-1,
)
return None
logger.warning(f"获取版本信息时出错:{Network.error_message}")
MainInfoBar.push_info_bar(
"warning",
"获取版本信息时出错",
f"网络错误:{Network.stutus_code}",
5000,
) )
self.downloader.setWindowIcon( return None
QIcon(str(Config.app_path / "resources/icons/AUTO_MAA_Updater.ico"))
) self.downloader = DownloadManager(
self.downloader.show() Path(folder),
self.downloader.run() app_name,
None,
{
"mode": "MirrorChyan",
"thread_numb": 1,
"url": app_info["data"]["url"],
},
)
self.downloader.setWindowTitle("AUTO_MAA下载器 - Mirror酱渠道")
self.downloader.setWindowIcon(
QIcon(str(Config.app_path / "resources/icons/MirrorChyan.ico"))
)
self.downloader.show()
self.downloader.run()
def show_password(self): def show_password(self):
@@ -1421,15 +1422,16 @@ class MemberManager(QWidget):
configItem=self.config.Info_MedicineNumb, configItem=self.config.Info_MedicineNumb,
parent=self, parent=self,
) )
self.card_SeriesNumb = SpinBoxSettingCard( self.card_SeriesNumb = ComboBoxSettingCard(
icon=FluentIcon.GAME, icon=FluentIcon.GAME,
title="连战次数", title="连战次数",
content="连战次数较大时建议搭配剩余理智关卡使用", content="连战次数较大时建议搭配剩余理智关卡使用",
range=(1, 6), texts=["AUTO", "6", "5", "4", "3", "2", "1", "不选择"],
qconfig=self.config, qconfig=self.config,
configItem=self.config.Info_SeriesNumb, configItem=self.config.Info_SeriesNumb,
parent=self, parent=self,
) )
self.card_SeriesNumb.comboBox.setMinimumWidth(150)
self.card_GameId = EditableComboBoxSettingCard( self.card_GameId = EditableComboBoxSettingCard(
icon=FluentIcon.GAME, icon=FluentIcon.GAME,
title="关卡选择", title="关卡选择",

View File

@@ -15,7 +15,7 @@
AppId={{D116A92A-E174-4699-B777-61C5FD837B19} AppId={{D116A92A-E174-4699-B777-61C5FD837B19}
AppName={#MyAppName} AppName={#MyAppName}
AppVersion={#MyAppVersion} AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion} AppVerName={#MyAppName}
AppPublisher={#MyAppPublisher} AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL} AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL} AppSupportURL={#MyAppURL}
@@ -71,7 +71,7 @@ var
function InitializeUninstall: Boolean; function InitializeUninstall: Boolean;
begin begin
DeleteDataQuestion := MsgBox('您是否要移除所有用户数据文件与子组件?', mbConfirmation, MB_YESNO) = IDYES; DeleteDataQuestion := MsgBox('您确认要完全移除 AUTO_MAA 的所有用户数据文件与子组件', mbConfirmation, MB_YESNO) = IDYES;
Result := True; Result := True;
end; end;
@@ -79,15 +79,11 @@ procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin begin
if CurUninstallStep = usPostUninstall then if CurUninstallStep = usPostUninstall then
begin begin
if DeleteDataQuestion then
begin
DelTree(ExpandConstant('{app}\config'), True, True, True);
DelTree(ExpandConstant('{app}\data'), True, True, True);
DelTree(ExpandConstant('{app}\debug'), True, True, True);
DelTree(ExpandConstant('{app}\history'), True, True, True);
DelTree(ExpandConstant('{app}\script'), True, True, True);
end;
DelTree(ExpandConstant('{app}\app'), True, True, True); DelTree(ExpandConstant('{app}\app'), True, True, True);
DelTree(ExpandConstant('{app}\resources'), True, True, True); DelTree(ExpandConstant('{app}\resources'), True, True, True);
if DeleteDataQuestion then
begin
DelTree(ExpandConstant('{app}'), True, True, True);
end;
end; end;
end; end;

View File

@@ -266,14 +266,14 @@ class DownloadManager(QDialog):
def run(self) -> None: def run(self) -> None:
if self.name == "MAA": if self.name == "AUTO_MAA":
self.download_task1()
elif self.name == "AUTO_MAA":
if self.config["mode"] == "Proxy": if self.config["mode"] == "Proxy":
self.test_speed_task1() self.test_speed_task1()
self.speed_test_accomplish.connect(self.download_task1) self.speed_test_accomplish.connect(self.download_task1)
elif self.config["mode"] == "MirrorChyan": elif self.config["mode"] == "MirrorChyan":
self.download_task1() self.download_task1()
elif self.config["mode"] == "MirrorChyan":
self.download_task1()
def get_download_url(self, mode: str) -> Union[str, Dict[str, str]]: def get_download_url(self, mode: str) -> Union[str, Dict[str, str]]:
"""获取下载链接""" """获取下载链接"""
@@ -300,23 +300,6 @@ class DownloadManager(QDialog):
elif mode == "下载": elif mode == "下载":
if self.name == "MAA":
if self.config["mode"] == "Proxy":
return f"https://jp-download.fearr.xyz/MAA/MAA-{version_text(self.version)}-win-x64.zip"
elif self.config["mode"] == "MirrorChyan":
with requests.get(
self.config["url"],
allow_redirects=True,
timeout=10,
stream=True,
) as response:
if response.status_code == 200:
return response.url
if self.name == "AUTO_MAA": if self.name == "AUTO_MAA":
if self.config["mode"] == "Proxy": if self.config["mode"] == "Proxy":
@@ -349,6 +332,14 @@ class DownloadManager(QDialog):
if response.status_code == 200: if response.status_code == 200:
return response.url return response.url
elif self.config["mode"] == "MirrorChyan":
with requests.get(
self.config["url"], allow_redirects=True, timeout=10, stream=True
) as response:
if response.status_code == 200:
return response.url
def test_speed_task1(self) -> None: def test_speed_task1(self) -> None:
if self.isInterruptionRequested: if self.isInterruptionRequested:

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -1,8 +1,13 @@
{ {
"main_version": "4.3.6.5", "main_version": "4.3.6.0",
"updater_version": "1.0.0.0", "updater_version": "1.0.0.0",
"announcement": "\n## 新增功能\n- 屏蔽MuMu模拟器开屏广告功能上线\n- 更新器支持多线程下载\n- 添加强制关闭ADB与模拟器等增强任务项\n## 修复BUG\n- 修复统计信息HTML模板公招匹配错误\n- 修复密码显示按钮动画异常\n- 修复`检测到MAA未能实际执行任务`报错被异常屏蔽\n- 修复MAA超时判定异常失效\n## 程序优化\n- 关机等电源操作添加100s倒计时\n- 人工排查弹窗方法优化\n- 人工排查时自动屏蔽静默操作\n- 公告样式优化", "announcement": "\n## 新增功能\n- 屏蔽MuMu模拟器开屏广告功能上线\n- 更新器支持多线程下载\n- 添加强制关闭ADB与模拟器等增强任务项\n## 修复BUG\n- 修复统计信息HTML模板公招匹配错误\n- 修复密码显示按钮动画异常\n- 修复`检测到MAA未能实际执行任务`报错被异常屏蔽\n- 修复MAA超时判定异常失效\n## 程序优化\n- 关机等电源操作添加100s倒计时\n- 人工排查弹窗方法优化\n- 人工排查时自动屏蔽静默操作\n- 公告样式优化",
"version_info": { "version_info": {
"4.3.6.0": {
"新增功能": [
"适配MAA连战次数`AUTO`模式"
]
},
"4.3.6.5": { "4.3.6.5": {
"新增功能": [ "新增功能": [
"release中添加安装程序" "release中添加安装程序"
@@ -15,7 +20,7 @@
}, },
"4.3.6.3": { "4.3.6.3": {
"新增功能": [ "新增功能": [
"下载器支持调用Mirror酱" "下载器支持调用Mirror酱"
], ],
"修复BUG": [ "修复BUG": [
"修复Mirror酱更新检查报错不显示详细信息的问题" "修复Mirror酱更新检查报错不显示详细信息的问题"