mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-06-27 14:16:04 +02:00
[core/am] ban y2k domain to make Civ7 boot web-appletless (#3868)
Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3868 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
b4b41ee62c
commit
81c6e56713
2 changed files with 16 additions and 14 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "applet_web_browser_types.h"
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "common/fs/file.h"
|
#include "common/fs/file.h"
|
||||||
#include "common/fs/fs.h"
|
#include "common/fs/fs.h"
|
||||||
|
|
@ -370,16 +371,13 @@ void WebBrowser::ExtractOfflineRomFS() {
|
||||||
|
|
||||||
void WebBrowser::WebBrowserExit(WebExitReason exit_reason, std::string last_url) {
|
void WebBrowser::WebBrowserExit(WebExitReason exit_reason, std::string last_url) {
|
||||||
const bool use_tlv_output =
|
const bool use_tlv_output =
|
||||||
(web_arg_header.shim_kind == ShimKind::Share &&
|
(web_arg_header.shim_kind == ShimKind::Share && web_applet_version >= WebAppletVersion::Version196608)
|
||||||
web_applet_version >= WebAppletVersion::Version196608) ||
|
|| (web_arg_header.shim_kind == ShimKind::Web && web_applet_version >= WebAppletVersion::Version524288)
|
||||||
(web_arg_header.shim_kind == ShimKind::Web &&
|
|| (web_arg_header.shim_kind == ShimKind::Lhub);
|
||||||
web_applet_version >= WebAppletVersion::Version524288) ||
|
|
||||||
(web_arg_header.shim_kind == ShimKind::Lhub);
|
|
||||||
|
|
||||||
// https://switchbrew.org/wiki/Internet_Browser#TLVs
|
// https://switchbrew.org/wiki/Internet_Browser#TLVs
|
||||||
if (use_tlv_output) {
|
if (use_tlv_output) {
|
||||||
LOG_DEBUG(Service_AM, "Using TLV output: exit_reason={}, last_url={}, last_url_size={}",
|
LOG_DEBUG(Service_AM, "Using TLV output: exit_reason={}, last_url={}, last_url_size={}", exit_reason, last_url, last_url.size());
|
||||||
exit_reason, last_url, last_url.size());
|
|
||||||
|
|
||||||
// storage size for TLVs is 0x2000 bytes (as per switchbrew documentation)
|
// storage size for TLVs is 0x2000 bytes (as per switchbrew documentation)
|
||||||
constexpr size_t TLV_STORAGE_SIZE = 0x2000;
|
constexpr size_t TLV_STORAGE_SIZE = 0x2000;
|
||||||
|
|
@ -600,11 +598,14 @@ void WebBrowser::ExecuteShare() {
|
||||||
|
|
||||||
void WebBrowser::ExecuteWeb() {
|
void WebBrowser::ExecuteWeb() {
|
||||||
LOG_INFO(Service_AM, "Opening external URL at {}", external_url);
|
LOG_INFO(Service_AM, "Opening external URL at {}", external_url);
|
||||||
|
frontend.OpenExternalWebPage(external_url, [this](WebExitReason exit_reason, std::string last_url) {
|
||||||
frontend.OpenExternalWebPage(external_url,
|
// Offline and web applets must be explicitly exited from because they respect exit state
|
||||||
[this](WebExitReason exit_reason, std::string last_url) {
|
// Unlike the other web stuffs
|
||||||
WebBrowserExit(exit_reason, last_url);
|
if (exit_reason == WebExitReason::ExitRequested || exit_reason == WebExitReason::EndButtonPressed)
|
||||||
});
|
exit_reason = (web_arg_header.shim_kind == ShimKind::Web || web_arg_header.shim_kind == ShimKind::Offline)
|
||||||
|
? WebExitReason::ExitRequested : WebExitReason::EndButtonPressed;
|
||||||
|
WebBrowserExit(exit_reason, last_url);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebBrowser::ExecuteWifi() {
|
void WebBrowser::ExecuteWifi() {
|
||||||
|
|
|
||||||
|
|
@ -88,11 +88,12 @@ static const constexpr std::array blockedDomains = {
|
||||||
"sun.hac.lp1.d4c.nintendo.net",
|
"sun.hac.lp1.d4c.nintendo.net",
|
||||||
"phoenix-api.wbagora.com", //hogwarts legacy
|
"phoenix-api.wbagora.com", //hogwarts legacy
|
||||||
"battle.net",
|
"battle.net",
|
||||||
"microsoft.com", //minecraft dungeons + other games
|
"microsoft.com", // Minecraft dungeons + other games
|
||||||
"mojang.com",
|
"mojang.com",
|
||||||
"xboxlive.com",
|
"xboxlive.com",
|
||||||
"api.epicgames.dev", // marvel cosmic invasion +?
|
"api.epicgames.dev", // marvel cosmic invasion +?
|
||||||
"minecraftservices.com"
|
"minecraftservices.com",
|
||||||
|
"508223012e5a5ff19f30a391b2bdadc0.my.2k.com", // Civilization 5
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool IsBlockedHost(const std::string& host) {
|
static bool IsBlockedHost(const std::string& host) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue