Merge branch 'dev'
This commit is contained in:
8
.github/workflows/build-app.yml
vendored
8
.github/workflows/build-app.yml
vendored
@@ -136,11 +136,3 @@ jobs:
|
||||
gh workflow run --repo $GITHUB_REPOSITORY mirrorchyan_release_note
|
||||
env:
|
||||
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/
|
||||
|
||||
@@ -532,7 +532,12 @@ class MaaUserConfig(QConfig):
|
||||
self.Info_MedicineNumb = ConfigItem(
|
||||
"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_1 = ConfigItem("Info", "GameId_1", "-")
|
||||
self.Info_GameId_2 = ConfigItem("Info", "GameId_2", "-")
|
||||
@@ -617,7 +622,7 @@ class MaaUserConfig(QConfig):
|
||||
|
||||
class AppConfig(GlobalConfig):
|
||||
|
||||
VERSION = "4.3.6.5"
|
||||
VERSION = "4.3.6.0"
|
||||
|
||||
gameid_refreshed = Signal()
|
||||
PASSWORD_refreshed = Signal()
|
||||
|
||||
@@ -1278,9 +1278,9 @@ class MaaManager(QObject):
|
||||
) # 剩余理智关卡
|
||||
data["Configurations"]["Default"][
|
||||
"MainFunction.Series.Quantity"
|
||||
] = str(
|
||||
user_data["Info"]["SeriesNumb"]
|
||||
) # 连战次数
|
||||
] = user_data["Info"][
|
||||
"SeriesNumb"
|
||||
] # 连战次数
|
||||
data["Configurations"]["Default"][
|
||||
"Penguin.IsDrGrandet"
|
||||
] = "False" # 博朗台模式
|
||||
@@ -1382,9 +1382,9 @@ class MaaManager(QObject):
|
||||
) # 剩余理智关卡
|
||||
data["Configurations"]["Default"][
|
||||
"MainFunction.Series.Quantity"
|
||||
] = str(
|
||||
user_data["Info"]["SeriesNumb"]
|
||||
) # 连战次数
|
||||
] = user_data["Info"][
|
||||
"SeriesNumb"
|
||||
] # 连战次数
|
||||
data["Configurations"]["Default"][
|
||||
"GUI.UseAlternateStage"
|
||||
] = "True" # 备选关卡
|
||||
|
||||
@@ -315,45 +315,63 @@ class MemberManager(QWidget):
|
||||
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(
|
||||
self.window(),
|
||||
"选择一个脚本类型以下载相应脚本",
|
||||
["选择脚本类型"],
|
||||
[["MAA"]],
|
||||
[["MAA", "StarRailAssistant"]],
|
||||
)
|
||||
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(
|
||||
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("选择MAA下载目录时未选择文件夹")
|
||||
logger.warning(f"选择{app_name}下载目录时未选择文件夹")
|
||||
MainInfoBar.push_info_bar(
|
||||
"warning", "警告", "未选择MAA下载目录", 5000
|
||||
"warning", "警告", f"未选择{app_name}下载目录", 5000
|
||||
)
|
||||
return None
|
||||
|
||||
if app_name in ["MAA"]:
|
||||
|
||||
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"
|
||||
|
||||
elif app_name in ["StarRailAssistant"]:
|
||||
|
||||
url = f"https://mirrorchyan.com/api/resources/{app_name}/latest?user_agent=AutoMaaGui&cdk={Crypto.win_decryptor(Config.get(Config.update_MirrorChyanCDK))}&channel=stable"
|
||||
|
||||
# 从mirrorc服务器获取最新版本信息
|
||||
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.set_info(mode="get", url=url)
|
||||
Network.start()
|
||||
Network.loop.exec()
|
||||
if Network.stutus_code == 200:
|
||||
maa_info = Network.response_json
|
||||
app_info = Network.response_json
|
||||
else:
|
||||
|
||||
if Network.response_json:
|
||||
|
||||
maa_info = Network.response_json
|
||||
app_info = Network.response_json
|
||||
|
||||
if maa_info["code"] != 0:
|
||||
if app_info["code"] != 0:
|
||||
|
||||
logger.error(f"获取版本信息时出错:{maa_info["msg"]}")
|
||||
logger.error(f"获取版本信息时出错:{app_info["msg"]}")
|
||||
|
||||
error_remark_dict = {
|
||||
1001: "获取版本信息的URL参数不正确",
|
||||
@@ -366,14 +384,14 @@ class MemberManager(QWidget):
|
||||
8002: "错误的系统参数",
|
||||
8003: "错误的架构参数",
|
||||
8004: "错误的更新通道参数",
|
||||
1: maa_info["msg"],
|
||||
1: app_info["msg"],
|
||||
}
|
||||
|
||||
if maa_info["code"] in error_remark_dict:
|
||||
if app_info["code"] in error_remark_dict:
|
||||
MainInfoBar.push_info_bar(
|
||||
"error",
|
||||
"获取版本信息时出错",
|
||||
error_remark_dict[maa_info["code"]],
|
||||
error_remark_dict[app_info["code"]],
|
||||
-1,
|
||||
)
|
||||
else:
|
||||
@@ -395,36 +413,19 @@ class MemberManager(QWidget):
|
||||
)
|
||||
return None
|
||||
|
||||
maa_version = list(
|
||||
map(
|
||||
int,
|
||||
maa_info["data"]["version_name"][1:]
|
||||
.replace("-beta", "")
|
||||
.split("."),
|
||||
)
|
||||
)
|
||||
while len(maa_version) < 4:
|
||||
maa_version.append(0)
|
||||
|
||||
self.downloader = DownloadManager(
|
||||
Path(folder),
|
||||
"MAA",
|
||||
maa_version,
|
||||
(
|
||||
app_name,
|
||||
None,
|
||||
{
|
||||
"mode": "MirrorChyan",
|
||||
"thread_numb": 1,
|
||||
"url": maa_info["data"]["url"],
|
||||
}
|
||||
if "url" in maa_info["data"]
|
||||
else {
|
||||
"mode": "Proxy",
|
||||
"thread_numb": Config.get(Config.update_ThreadNumb),
|
||||
}
|
||||
),
|
||||
"url": app_info["data"]["url"],
|
||||
},
|
||||
)
|
||||
self.downloader.setWindowTitle("AUTO_MAA下载器 - Mirror酱渠道")
|
||||
self.downloader.setWindowIcon(
|
||||
QIcon(str(Config.app_path / "resources/icons/AUTO_MAA_Updater.ico"))
|
||||
QIcon(str(Config.app_path / "resources/icons/MirrorChyan.ico"))
|
||||
)
|
||||
self.downloader.show()
|
||||
self.downloader.run()
|
||||
@@ -1421,15 +1422,16 @@ class MemberManager(QWidget):
|
||||
configItem=self.config.Info_MedicineNumb,
|
||||
parent=self,
|
||||
)
|
||||
self.card_SeriesNumb = SpinBoxSettingCard(
|
||||
self.card_SeriesNumb = ComboBoxSettingCard(
|
||||
icon=FluentIcon.GAME,
|
||||
title="连战次数",
|
||||
content="连战次数较大时建议搭配剩余理智关卡使用",
|
||||
range=(1, 6),
|
||||
texts=["AUTO", "6", "5", "4", "3", "2", "1", "不选择"],
|
||||
qconfig=self.config,
|
||||
configItem=self.config.Info_SeriesNumb,
|
||||
parent=self,
|
||||
)
|
||||
self.card_SeriesNumb.comboBox.setMinimumWidth(150)
|
||||
self.card_GameId = EditableComboBoxSettingCard(
|
||||
icon=FluentIcon.GAME,
|
||||
title="关卡选择",
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
AppId={{D116A92A-E174-4699-B777-61C5FD837B19}
|
||||
AppName={#MyAppName}
|
||||
AppVersion={#MyAppVersion}
|
||||
AppVerName={#MyAppName} {#MyAppVersion}
|
||||
AppVerName={#MyAppName}
|
||||
AppPublisher={#MyAppPublisher}
|
||||
AppPublisherURL={#MyAppURL}
|
||||
AppSupportURL={#MyAppURL}
|
||||
@@ -71,7 +71,7 @@ var
|
||||
|
||||
function InitializeUninstall: Boolean;
|
||||
begin
|
||||
DeleteDataQuestion := MsgBox('您是否要移除所有用户数据文件与子组件?', mbConfirmation, MB_YESNO) = IDYES;
|
||||
DeleteDataQuestion := MsgBox('您确认要完全移除 AUTO_MAA 的所有用户数据文件与子组件吗?', mbConfirmation, MB_YESNO) = IDYES;
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
@@ -79,15 +79,11 @@ procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
|
||||
begin
|
||||
if CurUninstallStep = usPostUninstall then
|
||||
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}\resources'), True, True, True);
|
||||
if DeleteDataQuestion then
|
||||
begin
|
||||
DelTree(ExpandConstant('{app}'), True, True, True);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -266,14 +266,14 @@ class DownloadManager(QDialog):
|
||||
|
||||
def run(self) -> None:
|
||||
|
||||
if self.name == "MAA":
|
||||
self.download_task1()
|
||||
elif self.name == "AUTO_MAA":
|
||||
if self.name == "AUTO_MAA":
|
||||
if self.config["mode"] == "Proxy":
|
||||
self.test_speed_task1()
|
||||
self.speed_test_accomplish.connect(self.download_task1)
|
||||
elif self.config["mode"] == "MirrorChyan":
|
||||
self.download_task1()
|
||||
elif self.config["mode"] == "MirrorChyan":
|
||||
self.download_task1()
|
||||
|
||||
def get_download_url(self, mode: str) -> Union[str, Dict[str, str]]:
|
||||
"""获取下载链接"""
|
||||
@@ -300,23 +300,6 @@ class DownloadManager(QDialog):
|
||||
|
||||
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.config["mode"] == "Proxy":
|
||||
@@ -349,6 +332,14 @@ class DownloadManager(QDialog):
|
||||
if response.status_code == 200:
|
||||
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:
|
||||
|
||||
if self.isInterruptionRequested:
|
||||
|
||||
BIN
resources/icons/MirrorChyan.ico
Normal file
BIN
resources/icons/MirrorChyan.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -1,8 +1,13 @@
|
||||
{
|
||||
"main_version": "4.3.6.5",
|
||||
"main_version": "4.3.6.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- 公告样式优化",
|
||||
"version_info": {
|
||||
"4.3.6.0": {
|
||||
"新增功能": [
|
||||
"适配MAA连战次数`AUTO`模式"
|
||||
]
|
||||
},
|
||||
"4.3.6.5": {
|
||||
"新增功能": [
|
||||
"release中添加安装程序"
|
||||
@@ -15,7 +20,7 @@
|
||||
},
|
||||
"4.3.6.3": {
|
||||
"新增功能": [
|
||||
"下载器支持调用Mirror酱"
|
||||
"下载器仅支持调用Mirror酱"
|
||||
],
|
||||
"修复BUG": [
|
||||
"修复Mirror酱更新检查报错不显示详细信息的问题"
|
||||
|
||||
Reference in New Issue
Block a user