feat(core): 屏蔽MuMu模拟器开屏广告功能上线
This commit is contained in:
@@ -780,6 +780,9 @@ class GlobalConfig(QConfig):
|
|||||||
function_IfAgreeBilibili = ConfigItem(
|
function_IfAgreeBilibili = ConfigItem(
|
||||||
"Function", "IfAgreeBilibili", False, BoolValidator()
|
"Function", "IfAgreeBilibili", False, BoolValidator()
|
||||||
)
|
)
|
||||||
|
function_IfSkipMumuSplashAds = ConfigItem(
|
||||||
|
"Function", "IfSkipMumuSplashAds", False, BoolValidator()
|
||||||
|
)
|
||||||
|
|
||||||
start_IfSelfStart = ConfigItem("Start", "IfSelfStart", False, BoolValidator())
|
start_IfSelfStart = ConfigItem("Start", "IfSelfStart", False, BoolValidator())
|
||||||
start_IfRunDirectly = ConfigItem("Start", "IfRunDirectly", False, BoolValidator())
|
start_IfRunDirectly = ConfigItem("Start", "IfRunDirectly", False, BoolValidator())
|
||||||
|
|||||||
@@ -44,11 +44,14 @@ from qfluentwidgets import (
|
|||||||
PushSettingCard,
|
PushSettingCard,
|
||||||
ComboBoxSettingCard,
|
ComboBoxSettingCard,
|
||||||
)
|
)
|
||||||
from datetime import datetime
|
import os
|
||||||
import json
|
import json
|
||||||
import subprocess
|
|
||||||
import time
|
import time
|
||||||
|
import shutil
|
||||||
import requests
|
import requests
|
||||||
|
import subprocess
|
||||||
|
from datetime import datetime
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from app.core import Config, MainInfoBar
|
from app.core import Config, MainInfoBar
|
||||||
from app.services import Crypto, System
|
from app.services import Crypto, System
|
||||||
@@ -75,6 +78,9 @@ class Setting(QWidget):
|
|||||||
|
|
||||||
self.function.card_IfAllowSleep.checkedChanged.connect(System.set_Sleep)
|
self.function.card_IfAllowSleep.checkedChanged.connect(System.set_Sleep)
|
||||||
self.function.card_IfAgreeBilibili.checkedChanged.connect(self.agree_bilibili)
|
self.function.card_IfAgreeBilibili.checkedChanged.connect(self.agree_bilibili)
|
||||||
|
self.function.card_IfSkipMumuSplashAds.checkedChanged.connect(
|
||||||
|
self.skip_MuMu_splash_ads
|
||||||
|
)
|
||||||
self.start.card_IfSelfStart.checkedChanged.connect(System.set_SelfStart)
|
self.start.card_IfSelfStart.checkedChanged.connect(System.set_SelfStart)
|
||||||
self.security.card_changePASSWORD.clicked.connect(self.change_PASSWORD)
|
self.security.card_changePASSWORD.clicked.connect(self.change_PASSWORD)
|
||||||
self.updater.card_CheckUpdate.clicked.connect(self.get_update)
|
self.updater.card_CheckUpdate.clicked.connect(self.get_update)
|
||||||
@@ -98,12 +104,7 @@ class Setting(QWidget):
|
|||||||
def agree_bilibili(self) -> None:
|
def agree_bilibili(self) -> None:
|
||||||
"""授权bilibili游戏隐私政策"""
|
"""授权bilibili游戏隐私政策"""
|
||||||
|
|
||||||
if not Config.global_config.get(Config.global_config.function_IfAgreeBilibili):
|
if Config.global_config.get(Config.global_config.function_IfAgreeBilibili):
|
||||||
logger.info("取消授权bilibili游戏隐私政策")
|
|
||||||
MainInfoBar.push_info_bar(
|
|
||||||
"info", "操作成功", "已取消授权bilibili游戏隐私政策", 3000
|
|
||||||
)
|
|
||||||
return None
|
|
||||||
|
|
||||||
choice = MessageBox(
|
choice = MessageBox(
|
||||||
"授权声明",
|
"授权声明",
|
||||||
@@ -119,6 +120,52 @@ class Setting(QWidget):
|
|||||||
Config.global_config.set(
|
Config.global_config.set(
|
||||||
Config.global_config.function_IfAgreeBilibili, False
|
Config.global_config.function_IfAgreeBilibili, False
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
|
||||||
|
logger.info("取消授权bilibili游戏隐私政策")
|
||||||
|
MainInfoBar.push_info_bar(
|
||||||
|
"info", "操作成功", "已取消授权bilibili游戏隐私政策", 3000
|
||||||
|
)
|
||||||
|
|
||||||
|
def skip_MuMu_splash_ads(self) -> None:
|
||||||
|
"""跳过MuMu启动广告"""
|
||||||
|
|
||||||
|
MuMu_splash_ads_path = (
|
||||||
|
Path(os.getenv("APPDATA")) / "Netease/MuMuPlayer-12.0/data/startupImage"
|
||||||
|
)
|
||||||
|
|
||||||
|
if Config.global_config.get(Config.global_config.function_IfSkipMumuSplashAds):
|
||||||
|
|
||||||
|
choice = MessageBox(
|
||||||
|
"风险声明",
|
||||||
|
"开启“跳过MuMu启动广告”功能,即代表您已安装MuMu模拟器-12且允许AUTO_MAA以其认定合适的方法屏蔽MuMu启动广告,并接受此操作带来的风险\n\n此功能即时生效,是否仍要开启此功能?",
|
||||||
|
self.window(),
|
||||||
|
)
|
||||||
|
if choice.exec():
|
||||||
|
|
||||||
|
if MuMu_splash_ads_path.exists() and MuMu_splash_ads_path.is_dir():
|
||||||
|
shutil.rmtree(MuMu_splash_ads_path)
|
||||||
|
|
||||||
|
MuMu_splash_ads_path.touch()
|
||||||
|
|
||||||
|
logger.success("开启跳过MuMu启动广告功能")
|
||||||
|
MainInfoBar.push_info_bar(
|
||||||
|
"success", "操作成功", "已开启跳过MuMu启动广告功能", 3000
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
Config.global_config.set(
|
||||||
|
Config.global_config.function_IfSkipMumuSplashAds, False
|
||||||
|
)
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
if MuMu_splash_ads_path.exists() and MuMu_splash_ads_path.is_file():
|
||||||
|
MuMu_splash_ads_path.unlink()
|
||||||
|
|
||||||
|
logger.info("关闭跳过MuMu启动广告功能")
|
||||||
|
MainInfoBar.push_info_bar(
|
||||||
|
"info", "操作成功", "已关闭跳过MuMu启动广告功能", 3000
|
||||||
|
)
|
||||||
|
|
||||||
def check_PASSWORD(self) -> None:
|
def check_PASSWORD(self) -> None:
|
||||||
"""检查并配置管理密钥"""
|
"""检查并配置管理密钥"""
|
||||||
@@ -436,6 +483,12 @@ class FunctionSettingCard(HeaderCardWidget):
|
|||||||
content="授权AUTO_MAA同意bilibili游戏隐私政策",
|
content="授权AUTO_MAA同意bilibili游戏隐私政策",
|
||||||
configItem=Config.global_config.function_IfAgreeBilibili,
|
configItem=Config.global_config.function_IfAgreeBilibili,
|
||||||
)
|
)
|
||||||
|
self.card_IfSkipMumuSplashAds = SwitchSettingCard(
|
||||||
|
icon=FluentIcon.PAGE_RIGHT,
|
||||||
|
title="跳过MuMu启动广告",
|
||||||
|
content="启动MuMu模拟器时屏蔽启动广告",
|
||||||
|
configItem=Config.global_config.function_IfSkipMumuSplashAds,
|
||||||
|
)
|
||||||
|
|
||||||
Layout = QVBoxLayout()
|
Layout = QVBoxLayout()
|
||||||
Layout.addWidget(self.card_HomeImageMode)
|
Layout.addWidget(self.card_HomeImageMode)
|
||||||
@@ -443,6 +496,7 @@ class FunctionSettingCard(HeaderCardWidget):
|
|||||||
Layout.addWidget(self.card_IfAllowSleep)
|
Layout.addWidget(self.card_IfAllowSleep)
|
||||||
Layout.addWidget(self.card_IfSilence)
|
Layout.addWidget(self.card_IfSilence)
|
||||||
Layout.addWidget(self.card_IfAgreeBilibili)
|
Layout.addWidget(self.card_IfAgreeBilibili)
|
||||||
|
Layout.addWidget(self.card_IfSkipMumuSplashAds)
|
||||||
self.viewLayout.addLayout(Layout)
|
self.viewLayout.addLayout(Layout)
|
||||||
|
|
||||||
class SilenceSettingCard(ExpandGroupSettingCard):
|
class SilenceSettingCard(ExpandGroupSettingCard):
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"main_version": "4.2.5.1",
|
"main_version": "4.2.5.2",
|
||||||
"updater_version": "1.1.2.1",
|
"updater_version": "1.1.2.1",
|
||||||
"announcement": "\n## 新增功能\n- 暂无\n## 修复BUG\n- 修复统计信息HTML模板公招匹配错误\n## 程序优化\n- 暂无",
|
"announcement": "\n## 新增功能\n- 屏蔽MuMu模拟器开屏广告功能上线\n## 修复BUG\n- 修复统计信息HTML模板公招匹配错误\n## 程序优化\n- 暂无",
|
||||||
"proxy_list": [
|
"proxy_list": [
|
||||||
"",
|
"",
|
||||||
"https://gitproxy.click/",
|
"https://gitproxy.click/",
|
||||||
|
|||||||
Reference in New Issue
Block a user