diff --git a/.ci/linux/build.sh b/.ci/linux/build.sh index 41e0ca308b..72eb4d5b9b 100755 --- a/.ci/linux/build.sh +++ b/.ci/linux/build.sh @@ -67,10 +67,6 @@ else export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DYUZU_USE_PRECOMPILED_HEADERS=OFF) fi -if [ "$DEVEL" != "true" ]; then - export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DENABLE_QT_UPDATE_CHECKER=ON) -fi - if [ "$USE_WEBENGINE" = "true" ]; then WEBENGINE=ON else diff --git a/.ci/windows/build.sh b/.ci/windows/build.sh index d554e00e1b..d735563a0d 100644 --- a/.ci/windows/build.sh +++ b/.ci/windows/build.sh @@ -37,7 +37,6 @@ cmake .. -G Ninja \ -DDYNARMIC_ENABLE_LTO=ON \ -DYUZU_USE_BUNDLED_QT=${BUNDLE_QT:-false} \ -DUSE_CCACHE=${CCACHE:-false} \ - -DENABLE_QT_UPDATE_CHECKER=${DEVEL:-true} \ "${EXTRA_CMAKE_FLAGS[@]}" \ "$@" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac67f73d00..df79c1ff9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -135,7 +135,7 @@ jobs: echo $GIT_TAG_NAME - name: Build - run: ANDROID_HOME=/home/runner/sdk ./.ci/android/build.sh + run: DEVEL=true ANDROID_HOME=/home/runner/sdk ./.ci/android/build.sh env: ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }} ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml index 645b21e25a..325e0a02b4 100644 --- a/.github/workflows/trigger_release.yml +++ b/.github/workflows/trigger_release.yml @@ -96,7 +96,7 @@ jobs: fetch-tags: true - name: Build - run: TARGET=appimage RELEASE=1 ./.ci/linux/build.sh v3 8 + run: TARGET=appimage RELEASE=1 DEVEL=false ./.ci/linux/build.sh v3 8 - name: Package AppImage run: ./.ci/linux/package.sh v3 &> /dev/null @@ -133,7 +133,7 @@ jobs: echo $GIT_TAG_NAME - name: Build - run: ANDROID_HOME=/home/runner/sdk ./.ci/android/build.sh + run: DEVEL=false ANDROID_HOME=/home/runner/sdk ./.ci/android/build.sh env: ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }} ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f192887f7..8ad2a16380 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,7 +160,7 @@ endif() # qt stuff option(ENABLE_QT "Enable the Qt frontend" ON) option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF) -option(ENABLE_QT_UPDATE_CHECKER "Enable update checker for the Qt frontend" OFF) +option(ENABLE_UPDATE_CHECKER "Enable update checker (for Qt and Android)" OFF) cmake_dependent_option(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF) option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF) option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF) @@ -563,10 +563,20 @@ if (ENABLE_WEB_SERVICE) find_package(httplib) endif() -if (ENABLE_WEB_SERVICE OR ENABLE_QT_UPDATE_CHECKER) +if (ENABLE_WEB_SERVICE OR ENABLE_UPDATE_CHECKER) find_package(cpp-jwt) endif() +if (DEFINED ENV{DEVEL}) + if ("$ENV{DEVEL}" STREQUAL "false") + message(STATUS "DEVEL=false: Enabling update checker for release builds") + set(ENABLE_UPDATE_CHECKER ON) + else() + message(STATUS "DEVEL=$ENV{DEVEL}: Disabling updates checker for development builds") + set(ENABLE_UPDATE_CHECKER OFF) + endif() +endif() + if (ARCHITECTURE_arm64 OR DYNARMIC_TESTS) find_package(oaknut) endif() diff --git a/docs/Deps.md b/docs/Deps.md index b8a1be66d2..9a6b9b99d2 100644 --- a/docs/Deps.md +++ b/docs/Deps.md @@ -62,7 +62,7 @@ Certain other dependencies will be fetched by CPM regardless. System packages *c * [libusb](https://github.com/libusb/libusb) * [VulkanMemoryAllocator](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator) * [sirit](https://github.com/eden-emulator/sirit) -* [httplib](https://github.com/yhirose/cpp-httplib) - if `ENABLE_QT_UPDATE_CHECKER` or `ENABLE_WEB_SERVICE` are on +* [httplib](https://github.com/yhirose/cpp-httplib) - if `ENABLE_UPDATE_CHECKER` or `ENABLE_WEB_SERVICE` are on - This package is known to be broken on the AUR. * [cpp-jwt](https://github.com/arun11299/cpp-jwt) 1.4+ - if `ENABLE_WEB_SERVICE` is on * [unordered-dense](https://github.com/martinus/unordered_dense) diff --git a/docs/Options.md b/docs/Options.md index 3dd84ea645..708da51837 100644 --- a/docs/Options.md +++ b/docs/Options.md @@ -38,6 +38,7 @@ Notes: - `YUZU_USE_BUNDLED_OPENSSL` (ON for MSVC) Download bundled OpenSSL build * Always on for Android * Unavailable on OpenBSD +- `ENABLE_UPDATE_CHECKER` (OFF) Enable update checker for the Qt an Android frontends The following options are desktop only: - `ENABLE_SDL2` (ON) Enable the SDL2 desktop, audio, and input frontend (HIGHLY RECOMMENDED!) @@ -51,7 +52,6 @@ The following options are desktop only: * Unavailable on Windows/ARM64 and Android - `ENABLE_QT` (ON) Enable the Qt frontend (recommended) - `ENABLE_QT_TRANSLATION` (OFF) Enable translations for the Qt frontend -- `ENABLE_QT_UPDATE_CHECKER` (OFF) Enable update checker for the Qt frontend - `YUZU_USE_BUNDLED_QT` (ON for MSVC) Download bundled Qt binaries * Note that using **system Qt** requires you to include the Qt CMake directory in `CMAKE_PREFIX_PATH`, e.g: * `-DCMAKE_PREFIX_PATH=C:/Qt/6.9.0/msvc2022_64/lib/cmake/Qt6` diff --git a/docs/scripts/Linux.md b/docs/scripts/Linux.md index 8b18e41ced..93e76c222e 100644 --- a/docs/scripts/Linux.md +++ b/docs/scripts/Linux.md @@ -27,5 +27,5 @@ Boolean flags (set `true` to enable, `false` to disable): * AppImage packaging script: `.ci/linux/package.sh` * Accepts same arch targets as build script - * Use `DEVEL=true` to rename app to `Eden Nightly` + * Use `DEVEL=true` to rename app to `Eden Nightly` and disable the update checker * This should generally not be used unless in a tailor-made packaging environment (e.g. Actions/CI) \ No newline at end of file diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 434e6fb100..8138cb26d4 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -207,7 +207,7 @@ if (VulkanMemoryAllocator_ADDED) endif() # httplib -if (ENABLE_WEB_SERVICE OR ENABLE_QT_UPDATE_CHECKER) +if (ENABLE_WEB_SERVICE OR ENABLE_UPDATE_CHECKER) AddJsonPackage(httplib) endif() diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt index ba50bcad34..5cb8c5458a 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt @@ -200,6 +200,26 @@ object NativeLibrary { external fun logSettings() + /** + * Sets the path to CA certificates for SSL/TLS verification. + */ + external fun setCACertificatePath(path: String) + + /** + * Checks for available updates. + */ + external fun checkForUpdate(): String? + + /** + * Return the URL to the release page + */ + external fun getUpdateUrl(version: String): String + + /** + * Returns whether the update checker is enabled through CMAKE options. + */ + external fun isUpdateCheckerEnabled(): Boolean + enum class CoreError { ErrorSystemFiles, ErrorSavestate, diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/YuzuApplication.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/YuzuApplication.kt index e9a0d5a75c..c4089a65d1 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/YuzuApplication.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/YuzuApplication.kt @@ -12,6 +12,10 @@ import android.app.NotificationManager import android.content.Context import org.yuzu.yuzu_emu.features.input.NativeInput import java.io.File +import java.io.FileOutputStream +import java.security.KeyStore +import javax.net.ssl.TrustManagerFactory +import javax.net.ssl.X509TrustManager import org.yuzu.yuzu_emu.utils.DirectoryInitialization import org.yuzu.yuzu_emu.utils.DocumentsTree import org.yuzu.yuzu_emu.utils.GpuDriverHelper @@ -59,9 +63,55 @@ class YuzuApplication : Application() { PowerStateUpdater.start() Log.logDeviceInfo() + // Initialize CA certificates for HTTPS + if (NativeLibrary.isUpdateCheckerEnabled()) { + initializeCACertificates() + } + createNotificationChannels() } + // required for httplib and update checker + private fun initializeCACertificates() { + try { + val trustManagerFactory = TrustManagerFactory.getInstance( + TrustManagerFactory.getDefaultAlgorithm() + ) + trustManagerFactory.init(null as KeyStore?) + + val trustManagers = trustManagerFactory.trustManagers + if (trustManagers.isEmpty()) { + Log.error("[SSL] No trust managers found") + return + } + val x509TrustManager = trustManagers[0] as X509TrustManager + val acceptedIssuers = x509TrustManager.acceptedIssuers + + if (acceptedIssuers.isEmpty()) { + Log.error("[SSL] No CA certificates found") + return + } + + val certFile = File(filesDir, "cacert.pem") + FileOutputStream(certFile).use { outputStream -> + for (cert in acceptedIssuers) { + outputStream.write("-----BEGIN CERTIFICATE-----\n".toByteArray()) + val encoded = android.util.Base64.encodeToString( + cert.encoded, + android.util.Base64.DEFAULT + ) + outputStream.write(encoded.toByteArray()) + outputStream.write("-----END CERTIFICATE-----\n".toByteArray()) + } + } + + NativeLibrary.setCACertificatePath(certFile.absolutePath) + Log.info("[SSL] Initialized ${acceptedIssuers.size} CA certificates at: ${certFile.absolutePath}") + } catch (e: Exception) { + Log.error("[SSL] Failed to initialize CA certificates: ${e.message}") + } + } + companion object { var documentsTree: DocumentsTree? = null lateinit var application: YuzuApplication diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt index 956d93a4eb..0e5ebaf844 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt @@ -23,6 +23,7 @@ import androidx.navigation.NavController import androidx.navigation.fragment.NavHostFragment import androidx.preference.PreferenceManager import com.google.android.material.color.MaterialColors +import com.google.android.material.dialog.MaterialAlertDialogBuilder import java.io.File import java.io.FilenameFilter import org.yuzu.yuzu_emu.NativeLibrary @@ -50,6 +51,7 @@ import java.util.zip.ZipInputStream import androidx.core.content.edit import org.yuzu.yuzu_emu.activities.EmulationActivity import kotlin.text.compareTo +import androidx.core.net.toUri class MainActivity : AppCompatActivity(), ThemeProvider { private lateinit var binding: ActivityMainBinding @@ -192,9 +194,39 @@ class MainActivity : AppCompatActivity(), ThemeProvider { // Dismiss previous notifications (should not happen unless a crash occurred) EmulationActivity.stopForegroundService(this) + val firstTimeSetup = PreferenceManager.getDefaultSharedPreferences(applicationContext) + .getBoolean(Settings.PREF_FIRST_APP_LAUNCH, true) + + if (!firstTimeSetup && NativeLibrary.isUpdateCheckerEnabled()) { + checkForUpdates() + } setInsets() } + private fun checkForUpdates() { + Thread { + val latestVersion = NativeLibrary.checkForUpdate() + if (latestVersion != null) { + runOnUiThread { + showUpdateDialog(latestVersion) + } + } + }.start() + } + + private fun showUpdateDialog(version: String) { + MaterialAlertDialogBuilder(this) + .setTitle(R.string.update_available) + .setMessage(getString(R.string.update_available_description, version)) + .setPositiveButton(android.R.string.ok) { _, _ -> + val url = NativeLibrary.getUpdateUrl(version) + val intent = Intent(Intent.ACTION_VIEW, url.toUri()) + startActivity(intent) + } + .setNegativeButton(android.R.string.cancel, null) + .show() + } + fun showPreAlphaWarningDialog() { val shouldDisplayAlphaWarning = PreferenceManager.getDefaultSharedPreferences(applicationContext) diff --git a/src/android/app/src/main/jni/CMakeLists.txt b/src/android/app/src/main/jni/CMakeLists.txt index 0557236394..cb17de46da 100644 --- a/src/android/app/src/main/jni/CMakeLists.txt +++ b/src/android/app/src/main/jni/CMakeLists.txt @@ -30,4 +30,8 @@ if (ENABLE_OPENSSL OR ENABLE_WEB_SERVICE) target_link_libraries(yuzu-android PRIVATE OpenSSL::SSL cpp-jwt::cpp-jwt) endif() +if (ENABLE_UPDATE_CHECKER) + target_compile_definitions(yuzu-android PUBLIC ENABLE_UPDATE_CHECKER) +endif() + set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} yuzu-android) diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 306b7e2a4c..2c0a15250a 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp @@ -60,6 +60,9 @@ #include "core/loader/loader.h" #include "frontend_common/config.h" #include "frontend_common/firmware_manager.h" +#ifdef ENABLE_UPDATE_CHECKER +#include "frontend_common/update_checker.h" +#endif #include "hid_core/frontend/emulated_controller.h" #include "hid_core/hid_core.h" #include "hid_core/hid_types.h" @@ -85,6 +88,9 @@ std::atomic g_battery_percentage = {100}; std::atomic g_is_charging = {false}; std::atomic g_has_battery = {true}; +// SSL Certificate path for HTTPS requests +std::string g_ca_cert_path; + EmulationSession::EmulationSession() { m_vfs = std::make_shared(); } @@ -1057,4 +1063,56 @@ JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_updatePowerState( g_is_charging.store(isCharging, std::memory_order_relaxed); g_has_battery.store(hasBattery, std::memory_order_relaxed); } + +// return #ifdef ENABLE_UPDATE_CHECKER +JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_isUpdateCheckerEnabled( + JNIEnv* env, + jobject obj) { +#ifdef ENABLE_UPDATE_CHECKER + return JNI_TRUE; +#else + return JNI_FALSE; +#endif + } + +#ifdef ENABLE_UPDATE_CHECKER +JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_setCACertificatePath( + JNIEnv* env, + jobject obj, + jstring path) { + const char* path_str = env->GetStringUTFChars(path, nullptr); + g_ca_cert_path = std::string(path_str); + env->ReleaseStringUTFChars(path, path_str); +} + +JNIEXPORT jstring JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_checkForUpdate( + JNIEnv* env, + jobject obj) { + const bool is_prerelease = ((strstr(Common::g_build_version, "pre-alpha") != nullptr) || + (strstr(Common::g_build_version, "alpha") != nullptr) || + (strstr(Common::g_build_version, "beta") != nullptr) || + (strstr(Common::g_build_version, "rc") != nullptr)); + const std::optional latest_release_tag = + UpdateChecker::GetLatestRelease(is_prerelease); + + if (latest_release_tag && latest_release_tag.value() != Common::g_build_version) { + return env->NewStringUTF(latest_release_tag.value().c_str()); + } + return nullptr; +} + +JNIEXPORT jstring JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_getUpdateUrl( + JNIEnv* env, + jobject obj, + jstring version) { + const char* version_str = env->GetStringUTFChars(version, nullptr); + const std::string url = fmt::format("{}/{}/releases/tag/{}", + std::string{Common::g_build_auto_update_website}, + std::string{Common::g_build_auto_update_repo}, + version_str); + env->ReleaseStringUTFChars(version, version_str); + return env->NewStringUTF(url.c_str()); +} +#endif + } // extern "C" diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 2a5cc48bb1..40efa6c4a6 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -297,6 +297,8 @@ WARNING: This software is in the pre-alpha stage and may have bugs and incomplete feature implementations. Don\'t Show Again PRE-ALPHA SOFTWARE + Update Available + A new version is available: %1$s\n\nWould you like to download it? New game directory added successfully Games Search diff --git a/src/frontend_common/CMakeLists.txt b/src/frontend_common/CMakeLists.txt index 70e142bb0c..800348f721 100644 --- a/src/frontend_common/CMakeLists.txt +++ b/src/frontend_common/CMakeLists.txt @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: 2023 yuzu Emulator Project -# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later add_library(frontend_common STATIC config.cpp @@ -9,5 +9,20 @@ add_library(frontend_common STATIC firmware_manager.cpp ) +if (ENABLE_UPDATE_CHECKER) + target_link_libraries(frontend_common PRIVATE httplib::httplib) + target_link_libraries(frontend_common PRIVATE nlohmann_json::nlohmann_json) + target_sources(frontend_common PRIVATE + update_checker.cpp + update_checker.h + ) + + if (ENABLE_OPENSSL) + target_compile_definitions(frontend_common PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT) + target_link_libraries(frontend_common PRIVATE OpenSSL::SSL) + endif() + +endif() + create_target_directory_groups(frontend_common) target_link_libraries(frontend_common PUBLIC core SimpleIni::SimpleIni PRIVATE common Boost::headers) diff --git a/src/yuzu/update_checker.cpp b/src/frontend_common/update_checker.cpp similarity index 84% rename from src/yuzu/update_checker.cpp rename to src/frontend_common/update_checker.cpp index e54eb8d7f8..134318966b 100644 --- a/src/yuzu/update_checker.cpp +++ b/src/frontend_common/update_checker.cpp @@ -5,9 +5,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -// SPDX-FileCopyrightText: eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later - #include "update_checker.h" #include "common/logging/log.h" #include @@ -17,11 +14,28 @@ #include #include "common/scm_rev.h" -std::optional UpdateChecker::GetResponse(std::string url, std::string path) -{ +#ifdef ANDROID +extern std::string g_ca_cert_path; +#endif + +namespace UpdateChecker { + +std::optional GetResponse(std::string url, std::string path) { constexpr std::size_t timeout_seconds = 15; std::unique_ptr client = std::make_unique(url); + +#ifdef ANDROID + // this is required in order for SSL to work on Android + if (!g_ca_cert_path.empty()) { + client->set_ca_cert_path(g_ca_cert_path.c_str()); + client->enable_server_certificate_verification(true); + LOG_INFO(Frontend, "Using Android system CA certificates for SSL verification"); + } else { + LOG_ERROR(Frontend, "No CA certificate path set for Android, skipping SSL verification"); + } +#endif + client->set_connection_timeout(timeout_seconds); client->set_read_timeout(timeout_seconds); client->set_write_timeout(timeout_seconds); @@ -56,8 +70,7 @@ std::optional UpdateChecker::GetResponse(std::string url, std::stri return response.body; } -std::optional UpdateChecker::GetLatestRelease(bool include_prereleases) -{ +std::optional GetLatestRelease(bool include_prereleases) { const auto update_check_url = std::string{Common::g_build_auto_update_api}; std::string update_check_path = fmt::format("/repos/{}", std::string{Common::g_build_auto_update_repo}); try { @@ -111,3 +124,5 @@ std::optional UpdateChecker::GetLatestRelease(bool include_prerelea return {}; } } + +} // namespace UpdateChecker diff --git a/src/yuzu/update_checker.h b/src/frontend_common/update_checker.h similarity index 64% rename from src/yuzu/update_checker.h rename to src/frontend_common/update_checker.h index cd2d15d834..957843bee0 100644 --- a/src/yuzu/update_checker.h +++ b/src/frontend_common/update_checker.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // Copyright Citra Emulator Project / Azahar Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. @@ -9,5 +12,5 @@ namespace UpdateChecker { std::optional GetResponse(std::string url, std::string path); -std::optional GetLatestRelease(bool); +std::optional GetLatestRelease(bool include_prereleases); } // namespace UpdateChecker diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index c03f7a3abf..cb76a0ece2 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -260,10 +260,8 @@ file(GLOB COMPAT_LIST file(GLOB_RECURSE ICONS ${PROJECT_SOURCE_DIR}/dist/icons/*) file(GLOB_RECURSE THEMES ${PROJECT_SOURCE_DIR}/dist/qt_themes/*) -if (ENABLE_QT_UPDATE_CHECKER) - target_link_libraries(yuzu PRIVATE httplib::httplib) - target_sources(yuzu PRIVATE update_checker.cpp) - target_compile_definitions(yuzu PUBLIC ENABLE_QT_UPDATE_CHECKER) +if (ENABLE_UPDATE_CHECKER) + target_compile_definitions(yuzu PUBLIC ENABLE_UPDATE_CHECKER) endif() if (ENABLE_QT_TRANSLATION) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 901a39cc9f..27dfa831a7 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -52,8 +52,8 @@ #include "yuzu/multiplayer/state.h" #include "yuzu/util/controller_navigation.h" -#ifdef ENABLE_QT_UPDATE_CHECKER -#include "yuzu/update_checker.h" +#ifdef ENABLE_UPDATE_CHECKER +#include "frontend_common/update_checker.h" #endif #ifdef YUZU_ROOM @@ -514,7 +514,7 @@ GMainWindow::GMainWindow(bool has_broken_vulkan) show(); -#ifdef ENABLE_QT_UPDATE_CHECKER +#ifdef ENABLE_UPDATE_CHECKER if (UISettings::values.check_for_updates) { update_future = QtConcurrent::run([]() -> QString { const bool is_prerelease = ((strstr(Common::g_build_version, "pre-alpha") != NULL) || @@ -4190,7 +4190,7 @@ void GMainWindow::MigrateConfigFiles() { } } -#ifdef ENABLE_QT_UPDATE_CHECKER +#ifdef ENABLE_UPDATE_CHECKER void GMainWindow::OnEmulatorUpdateAvailable() { QString version_string = update_future.result(); if (version_string.isEmpty()) diff --git a/src/yuzu/main.h b/src/yuzu/main.h index e3922759b0..71b4f9d382 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -32,7 +32,7 @@ #include #endif -#ifdef ENABLE_QT_UPDATE_CHECKER +#ifdef ENABLE_UPDATE_CHECKER #include #include #endif @@ -418,7 +418,7 @@ private slots: void OnEmulationStopped(); void OnEmulationStopTimeExpired(); -#ifdef ENABLE_QT_UPDATE_CHECKER +#ifdef ENABLE_UPDATE_CHECKER void OnEmulatorUpdateAvailable(); #endif @@ -474,7 +474,7 @@ private: std::unique_ptr play_time_manager; std::shared_ptr input_subsystem; -#ifdef ENABLE_QT_UPDATE_CHECKER +#ifdef ENABLE_UPDATE_CHECKER QFuture update_future; QFutureWatcher update_watcher; #endif