diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/android/app/build.gradle.kts | 16 | ||||
| -rw-r--r-- | src/android/app/src/main/AndroidManifest.xml | 1 | ||||
| -rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/DriverManagerFragment.kt | 25 | ||||
| -rw-r--r-- | src/android/build.gradle.kts | 4 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 68 |
5 files changed, 61 insertions, 53 deletions
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index 84a3308b7..ac43d84b7 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts | |||
| @@ -27,7 +27,7 @@ android { | |||
| 27 | namespace = "org.yuzu.yuzu_emu" | 27 | namespace = "org.yuzu.yuzu_emu" |
| 28 | 28 | ||
| 29 | compileSdkVersion = "android-34" | 29 | compileSdkVersion = "android-34" |
| 30 | ndkVersion = "25.2.9519653" | 30 | ndkVersion = "26.1.10909125" |
| 31 | 31 | ||
| 32 | buildFeatures { | 32 | buildFeatures { |
| 33 | viewBinding = true | 33 | viewBinding = true |
| @@ -203,23 +203,23 @@ ktlint { | |||
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | dependencies { | 205 | dependencies { |
| 206 | implementation("androidx.core:core-ktx:1.10.1") | 206 | implementation("androidx.core:core-ktx:1.12.0") |
| 207 | implementation("androidx.appcompat:appcompat:1.6.1") | 207 | implementation("androidx.appcompat:appcompat:1.6.1") |
| 208 | implementation("androidx.recyclerview:recyclerview:1.3.0") | 208 | implementation("androidx.recyclerview:recyclerview:1.3.1") |
| 209 | implementation("androidx.constraintlayout:constraintlayout:2.1.4") | 209 | implementation("androidx.constraintlayout:constraintlayout:2.1.4") |
| 210 | implementation("androidx.fragment:fragment-ktx:1.6.0") | 210 | implementation("androidx.fragment:fragment-ktx:1.6.1") |
| 211 | implementation("androidx.documentfile:documentfile:1.0.1") | 211 | implementation("androidx.documentfile:documentfile:1.0.1") |
| 212 | implementation("com.google.android.material:material:1.9.0") | 212 | implementation("com.google.android.material:material:1.9.0") |
| 213 | implementation("androidx.preference:preference:1.2.0") | 213 | implementation("androidx.preference:preference-ktx:1.2.1") |
| 214 | implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1") | 214 | implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2") |
| 215 | implementation("io.coil-kt:coil:2.2.2") | 215 | implementation("io.coil-kt:coil:2.2.2") |
| 216 | implementation("androidx.core:core-splashscreen:1.0.1") | 216 | implementation("androidx.core:core-splashscreen:1.0.1") |
| 217 | implementation("androidx.window:window:1.2.0-beta03") | 217 | implementation("androidx.window:window:1.2.0-beta03") |
| 218 | implementation("org.ini4j:ini4j:0.5.4") | 218 | implementation("org.ini4j:ini4j:0.5.4") |
| 219 | implementation("androidx.constraintlayout:constraintlayout:2.1.4") | 219 | implementation("androidx.constraintlayout:constraintlayout:2.1.4") |
| 220 | implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") | 220 | implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") |
| 221 | implementation("androidx.navigation:navigation-fragment-ktx:2.6.0") | 221 | implementation("androidx.navigation:navigation-fragment-ktx:2.7.4") |
| 222 | implementation("androidx.navigation:navigation-ui-ktx:2.6.0") | 222 | implementation("androidx.navigation:navigation-ui-ktx:2.7.4") |
| 223 | implementation("info.debatty:java-string-similarity:2.0.0") | 223 | implementation("info.debatty:java-string-similarity:2.0.0") |
| 224 | implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0") | 224 | implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0") |
| 225 | } | 225 | } |
diff --git a/src/android/app/src/main/AndroidManifest.xml b/src/android/app/src/main/AndroidManifest.xml index 832c08e15..a67351727 100644 --- a/src/android/app/src/main/AndroidManifest.xml +++ b/src/android/app/src/main/AndroidManifest.xml | |||
| @@ -28,7 +28,6 @@ SPDX-License-Identifier: GPL-3.0-or-later | |||
| 28 | android:appCategory="game" | 28 | android:appCategory="game" |
| 29 | android:localeConfig="@xml/locales_config" | 29 | android:localeConfig="@xml/locales_config" |
| 30 | android:banner="@drawable/tv_banner" | 30 | android:banner="@drawable/tv_banner" |
| 31 | android:extractNativeLibs="true" | ||
| 32 | android:fullBackupContent="@xml/data_extraction_rules" | 31 | android:fullBackupContent="@xml/data_extraction_rules" |
| 33 | android:dataExtractionRules="@xml/data_extraction_rules_api_31" | 32 | android:dataExtractionRules="@xml/data_extraction_rules_api_31" |
| 34 | android:enableOnBackInvokedCallback="true"> | 33 | android:enableOnBackInvokedCallback="true"> |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/DriverManagerFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/DriverManagerFragment.kt index 10b1d3547..df21d74b2 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/DriverManagerFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/DriverManagerFragment.kt | |||
| @@ -26,6 +26,7 @@ import org.yuzu.yuzu_emu.model.DriverViewModel | |||
| 26 | import org.yuzu.yuzu_emu.model.HomeViewModel | 26 | import org.yuzu.yuzu_emu.model.HomeViewModel |
| 27 | import org.yuzu.yuzu_emu.utils.FileUtil | 27 | import org.yuzu.yuzu_emu.utils.FileUtil |
| 28 | import org.yuzu.yuzu_emu.utils.GpuDriverHelper | 28 | import org.yuzu.yuzu_emu.utils.GpuDriverHelper |
| 29 | import java.io.File | ||
| 29 | import java.io.IOException | 30 | import java.io.IOException |
| 30 | 31 | ||
| 31 | class DriverManagerFragment : Fragment() { | 32 | class DriverManagerFragment : Fragment() { |
| @@ -154,29 +155,29 @@ class DriverManagerFragment : Fragment() { | |||
| 154 | R.string.installing_driver, | 155 | R.string.installing_driver, |
| 155 | false | 156 | false |
| 156 | ) { | 157 | ) { |
| 158 | val driverPath = | ||
| 159 | "${GpuDriverHelper.driverStoragePath}/${FileUtil.getFilename(result)}" | ||
| 160 | val driverFile = File(driverPath) | ||
| 161 | |||
| 157 | // Ignore file exceptions when a user selects an invalid zip | 162 | // Ignore file exceptions when a user selects an invalid zip |
| 158 | try { | 163 | try { |
| 159 | GpuDriverHelper.copyDriverToInternalStorage(result) | 164 | if (!GpuDriverHelper.copyDriverToInternalStorage(result)) { |
| 165 | throw IOException("Driver failed validation!") | ||
| 166 | } | ||
| 160 | } catch (_: IOException) { | 167 | } catch (_: IOException) { |
| 168 | if (driverFile.exists()) { | ||
| 169 | driverFile.delete() | ||
| 170 | } | ||
| 161 | return@newInstance getString(R.string.select_gpu_driver_error) | 171 | return@newInstance getString(R.string.select_gpu_driver_error) |
| 162 | } | 172 | } |
| 163 | 173 | ||
| 164 | val driverData = GpuDriverHelper.customDriverData | 174 | val driverData = GpuDriverHelper.getMetadataFromZip(driverFile) |
| 165 | if (driverData.name == null) { | ||
| 166 | return@newInstance getString(R.string.select_gpu_driver_error) | ||
| 167 | } | ||
| 168 | |||
| 169 | val driverInList = | 175 | val driverInList = |
| 170 | driverViewModel.driverList.value.firstOrNull { it.second == driverData } | 176 | driverViewModel.driverList.value.firstOrNull { it.second == driverData } |
| 171 | if (driverInList != null) { | 177 | if (driverInList != null) { |
| 172 | return@newInstance getString(R.string.driver_already_installed) | 178 | return@newInstance getString(R.string.driver_already_installed) |
| 173 | } else { | 179 | } else { |
| 174 | driverViewModel.addDriver( | 180 | driverViewModel.addDriver(Pair(driverPath, driverData)) |
| 175 | Pair( | ||
| 176 | "${GpuDriverHelper.driverStoragePath}/${FileUtil.getFilename(result)}", | ||
| 177 | driverData | ||
| 178 | ) | ||
| 179 | ) | ||
| 180 | driverViewModel.setNewDriverInstalled(true) | 181 | driverViewModel.setNewDriverInstalled(true) |
| 181 | } | 182 | } |
| 182 | return@newInstance Any() | 183 | return@newInstance Any() |
diff --git a/src/android/build.gradle.kts b/src/android/build.gradle.kts index 80f370c16..51e559321 100644 --- a/src/android/build.gradle.kts +++ b/src/android/build.gradle.kts | |||
| @@ -3,8 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | // Top-level build file where you can add configuration options common to all sub-projects/modules. | 4 | // Top-level build file where you can add configuration options common to all sub-projects/modules. |
| 5 | plugins { | 5 | plugins { |
| 6 | id("com.android.application") version "8.0.2" apply false | 6 | id("com.android.application") version "8.1.2" apply false |
| 7 | id("com.android.library") version "8.0.2" apply false | 7 | id("com.android.library") version "8.1.2" apply false |
| 8 | id("org.jetbrains.kotlin.android") version "1.8.21" apply false | 8 | id("org.jetbrains.kotlin.android") version "1.8.21" apply false |
| 9 | } | 9 | } |
| 10 | 10 | ||
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 5427758c1..1a6b63856 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -67,6 +67,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual | |||
| 67 | #define QT_NO_OPENGL | 67 | #define QT_NO_OPENGL |
| 68 | #include <QClipboard> | 68 | #include <QClipboard> |
| 69 | #include <QDesktopServices> | 69 | #include <QDesktopServices> |
| 70 | #include <QDir> | ||
| 70 | #include <QFile> | 71 | #include <QFile> |
| 71 | #include <QFileDialog> | 72 | #include <QFileDialog> |
| 72 | #include <QInputDialog> | 73 | #include <QInputDialog> |
| @@ -76,6 +77,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual | |||
| 76 | #include <QPushButton> | 77 | #include <QPushButton> |
| 77 | #include <QScreen> | 78 | #include <QScreen> |
| 78 | #include <QShortcut> | 79 | #include <QShortcut> |
| 80 | #include <QStandardPaths> | ||
| 79 | #include <QStatusBar> | 81 | #include <QStatusBar> |
| 80 | #include <QString> | 82 | #include <QString> |
| 81 | #include <QSysInfo> | 83 | #include <QSysInfo> |
| @@ -2869,44 +2871,50 @@ void GMainWindow::OnGameListCreateShortcut(u64 program_id, const std::string& ga | |||
| 2869 | #endif // __linux__ | 2871 | #endif // __linux__ |
| 2870 | 2872 | ||
| 2871 | std::filesystem::path target_directory{}; | 2873 | std::filesystem::path target_directory{}; |
| 2872 | // Determine target directory for shortcut | ||
| 2873 | #if defined(WIN32) | ||
| 2874 | const char* home = std::getenv("USERPROFILE"); | ||
| 2875 | #else | ||
| 2876 | const char* home = std::getenv("HOME"); | ||
| 2877 | #endif | ||
| 2878 | const std::filesystem::path home_path = (home == nullptr ? "~" : home); | ||
| 2879 | const char* xdg_data_home = std::getenv("XDG_DATA_HOME"); | ||
| 2880 | 2874 | ||
| 2881 | if (target == GameListShortcutTarget::Desktop) { | 2875 | switch (target) { |
| 2882 | target_directory = home_path / "Desktop"; | 2876 | case GameListShortcutTarget::Desktop: { |
| 2883 | if (!Common::FS::IsDir(target_directory)) { | 2877 | const QString desktop_path = |
| 2884 | QMessageBox::critical( | 2878 | QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); |
| 2885 | this, tr("Create Shortcut"), | 2879 | target_directory = desktop_path.toUtf8().toStdString(); |
| 2886 | tr("Cannot create shortcut on desktop. Path \"%1\" does not exist.") | 2880 | break; |
| 2887 | .arg(QString::fromStdString(target_directory.generic_string())), | 2881 | } |
| 2888 | QMessageBox::StandardButton::Ok); | 2882 | case GameListShortcutTarget::Applications: { |
| 2889 | return; | 2883 | const QString applications_path = |
| 2890 | } | 2884 | QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation); |
| 2891 | } else if (target == GameListShortcutTarget::Applications) { | 2885 | if (applications_path.isEmpty()) { |
| 2892 | target_directory = (xdg_data_home == nullptr ? home_path / ".local/share" : xdg_data_home) / | 2886 | const char* home = std::getenv("HOME"); |
| 2893 | "applications"; | 2887 | if (home != nullptr) { |
| 2894 | if (!Common::FS::CreateDirs(target_directory)) { | 2888 | target_directory = std::filesystem::path(home) / ".local/share/applications"; |
| 2895 | QMessageBox::critical( | 2889 | } |
| 2896 | this, tr("Create Shortcut"), | 2890 | } else { |
| 2897 | tr("Cannot create shortcut in applications menu. Path \"%1\" " | 2891 | target_directory = applications_path.toUtf8().toStdString(); |
| 2898 | "does not exist and cannot be created.") | ||
| 2899 | .arg(QString::fromStdString(target_directory.generic_string())), | ||
| 2900 | QMessageBox::StandardButton::Ok); | ||
| 2901 | return; | ||
| 2902 | } | 2892 | } |
| 2893 | break; | ||
| 2894 | } | ||
| 2895 | default: | ||
| 2896 | return; | ||
| 2897 | } | ||
| 2898 | |||
| 2899 | const QDir dir(QString::fromStdString(target_directory.generic_string())); | ||
| 2900 | if (!dir.exists()) { | ||
| 2901 | QMessageBox::critical(this, tr("Create Shortcut"), | ||
| 2902 | tr("Cannot create shortcut. Path \"%1\" does not exist.") | ||
| 2903 | .arg(QString::fromStdString(target_directory.generic_string())), | ||
| 2904 | QMessageBox::StandardButton::Ok); | ||
| 2905 | return; | ||
| 2903 | } | 2906 | } |
| 2904 | 2907 | ||
| 2905 | const std::string game_file_name = std::filesystem::path(game_path).filename().string(); | 2908 | const std::string game_file_name = std::filesystem::path(game_path).filename().string(); |
| 2906 | // Determine full paths for icon and shortcut | 2909 | // Determine full paths for icon and shortcut |
| 2907 | #if defined(__linux__) || defined(__FreeBSD__) | 2910 | #if defined(__linux__) || defined(__FreeBSD__) |
| 2911 | const char* home = std::getenv("HOME"); | ||
| 2912 | const std::filesystem::path home_path = (home == nullptr ? "~" : home); | ||
| 2913 | const char* xdg_data_home = std::getenv("XDG_DATA_HOME"); | ||
| 2914 | |||
| 2908 | std::filesystem::path system_icons_path = | 2915 | std::filesystem::path system_icons_path = |
| 2909 | (xdg_data_home == nullptr ? home_path / ".local/share/" : xdg_data_home) / | 2916 | (xdg_data_home == nullptr ? home_path / ".local/share/" |
| 2917 | : std::filesystem::path(xdg_data_home)) / | ||
| 2910 | "icons/hicolor/256x256"; | 2918 | "icons/hicolor/256x256"; |
| 2911 | if (!Common::FS::CreateDirs(system_icons_path)) { | 2919 | if (!Common::FS::CreateDirs(system_icons_path)) { |
| 2912 | QMessageBox::critical( | 2920 | QMessageBox::critical( |