VERY experimental Nintendo Switch 2 emulator
C++
[gradle] fix warnings & update deps (#189)
crueteraf923c92eb08
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.ktsindex de5d891f01..c99e62d4b8 100644--- a/src/android/app/build.gradle.kts+++ b/src/android/app/build.gradle.kts@@ -1,9 +1,9 @@-// SPDX-FileCopyrightText: Copyright yuzu/Citra 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+// SPDX-FileCopyrightText: Copyright yuzu/Citra Emulator Project+// SPDX-License-Identifier: GPL-2.0-or-later+import android.annotation.SuppressLintimport kotlin.collections.setOfimport org.jlleitschuh.gradle.ktlint.reporter.ReporterType@@ -13,7 +13,7 @@ plugins {id("com.android.application")id("org.jetbrains.kotlin.android")id("kotlin-parcelize")- kotlin("plugin.serialization") version "1.9.20"+ kotlin("plugin.serialization") version "2.0.0-RC1"id("androidx.navigation.safeargs.kotlin")id("org.jlleitschuh.gradle.ktlint") version "11.4.0"id("com.github.triplet.play") version "3.8.6"@@ -35,6 +35,7 @@ android {buildFeatures {viewBinding = true+ buildConfig = true}compileOptions {@@ -62,11 +63,7 @@ android {targetSdk = 35versionName = getGitVersion()- versionCode = if (System.getenv("AUTO_VERSIONED") == "true") {- autoVersion- } else {- 1- }+ versionCode = autoVersionndk {@SuppressLint("ChromeOsAbiSupport")@@ -121,7 +118,6 @@ android {isDefault = trueresValue("string", "app_name_suffixed", "eden Debug Release")signingConfig = signingConfigs.getByName("default")- isMinifyEnabled = trueisDebuggable = trueproguardFiles(getDefaultProguardFile("proguard-android.txt"),@@ -197,13 +193,6 @@ ktlint {version.set("0.47.1")android.set(true)ignoreFailures.set(false)- disabledRules.set(- setOf(- "no-wildcard-imports",- "package-name",- "import-ordering"- )- )reporters {reporter(ReporterType.CHECKSTYLE)}@@ -219,29 +208,29 @@ play {}dependencies {- implementation("androidx.core:core-ktx:1.15.0")- implementation("androidx.appcompat:appcompat:1.7.0")+ implementation("androidx.core:core-ktx:1.16.0")+ implementation("androidx.appcompat:appcompat:1.7.1")implementation("androidx.recyclerview:recyclerview:1.4.0")implementation("androidx.constraintlayout:constraintlayout:2.2.1")- implementation("androidx.fragment:fragment-ktx:1.8.6")- implementation("androidx.documentfile:documentfile:1.0.1")+ implementation("androidx.fragment:fragment-ktx:1.8.8")+ implementation("androidx.documentfile:documentfile:1.1.0")implementation("com.google.android.material:material:1.12.0")implementation("androidx.preference:preference-ktx:1.2.1")- implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7")+ implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.1")implementation("com.squareup.okhttp3:okhttp:4.12.0")- implementation("io.coil-kt:coil:2.2.2")+ implementation("io.coil-kt:coil:2.7.0")implementation("androidx.core:core-splashscreen:1.0.1")implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.17.2")- implementation("androidx.window:window:1.3.0")+ implementation("androidx.window:window:1.4.0")implementation("androidx.constraintlayout:constraintlayout:2.2.1")implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")implementation("org.commonmark:commonmark:0.22.0")- implementation("androidx.navigation:navigation-fragment-ktx:2.8.9")- implementation("androidx.navigation:navigation-ui-ktx:2.8.9")+ implementation("androidx.navigation:navigation-fragment-ktx:2.9.0")+ implementation("androidx.navigation:navigation-ui-ktx:2.9.0")implementation("info.debatty:java-string-similarity:2.0.0")- implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")- implementation("androidx.compose.ui:ui-graphics-android:1.7.8")- implementation("androidx.compose.ui:ui-text-android:1.7.8")+ implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")+ implementation("androidx.compose.ui:ui-graphics-android:1.8.2")+ implementation("androidx.compose.ui:ui-text-android:1.8.2")}fun runGitCommand(command: List<String>): String {diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.ktindex e058067c97..ce4a83bcac 100644--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.kt+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/applets/keyboard/SoftwareKeyboard.kt@@ -1,3 +1,6 @@+// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project+// SPDX-License-Identifier: GPL-3.0-or-later+// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project// SPDX-License-Identifier: GPL-2.0-or-later@@ -35,7 +38,7 @@ object SoftwareKeyboard {val overlayView = emulationActivity!!.findViewById<View>(R.id.surface_input_overlay)val im =overlayView.context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager- im.showSoftInput(overlayView, InputMethodManager.SHOW_FORCED)+ im.showSoftInput(overlayView, InputMethodManager.SHOW_IMPLICIT)// There isn't a good way to know that the IMM is dismissed, so poll every 500ms to submit inline keyboard result.val handler = Handler(Looper.myLooper()!!)diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.ktindex 4b7da6ef23..9e6e175395 100644--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt@@ -1,9 +1,8 @@-// SPDX-FileCopyrightText: 2023 yuzu Emulator Project-// SPDX-License-Identifier: GPL-2.0-or-later--// SPDX-FileCopyrightText: 2025 Eden Emulator Project+// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project// SPDX-License-Identifier: GPL-3.0-or-later+// SPDX-FileCopyrightText: 2023 yuzu Emulator Project+// SPDX-License-Identifier: GPL-2.0-or-laterpackage org.yuzu.yuzu_emu.fragments@@ -1113,7 +1112,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {val cutInsets: Insets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())var left = 0var right = 0- if (ViewCompat.getLayoutDirection(v) == ViewCompat.LAYOUT_DIRECTION_LTR) {+ if (v.layoutDirection == View.LAYOUT_DIRECTION_LTR) {left = cutInsets.left} else {right = cutInsets.rightdiff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/GamePropertiesFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/GamePropertiesFragment.ktindex f55edb418e..a1242d547a 100644--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/GamePropertiesFragment.kt+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/GamePropertiesFragment.kt@@ -1,4 +1,4 @@-// SPDX-FileCopyrightText: 2025 Eden Emulator Project+// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project// SPDX-License-Identifier: GPL-3.0-or-laterpackage org.yuzu.yuzu_emu.fragments@@ -300,8 +300,8 @@ class GamePropertiesFragment : Fragment() {if (smallLayout) {binding.listAll.updateMargins(left = leftInsets, right = rightInsets)} else {- if (ViewCompat.getLayoutDirection(binding.root) ==- ViewCompat.LAYOUT_DIRECTION_LTR+ if (binding.root.layoutDirection ==+ View.LAYOUT_DIRECTION_LTR) {binding.listAll.updateMargins(right = rightInsets)binding.iconLayout!!.updateMargins(top = barInsets.top, left = leftInsets)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.ktindex 3e3759d7eb..e089784927 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@@ -1,4 +1,4 @@-// SPDX-FileCopyrightText: 2025 Eden Emulator Project+// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project// SPDX-License-Identifier: GPL-3.0-or-laterpackage org.yuzu.yuzu_emu.ui.main@@ -90,6 +90,7 @@ class MainActivity : AppCompatActivity(), ThemeProvider {WindowCompat.setDecorFitsSystemWindows(window, false)window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING)+ // TODO(crueter): Remove thiswindow.statusBarColor =ContextCompat.getColor(applicationContext, android.R.color.transparent)window.navigationBarColor =diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NfcReader.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NfcReader.ktindex 331b7ddca7..bdc573405f 100644--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NfcReader.kt+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/NfcReader.kt@@ -1,3 +1,6 @@+// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project+// SPDX-License-Identifier: GPL-3.0-or-later+// SPDX-FileCopyrightText: 2023 yuzu Emulator Project// SPDX-License-Identifier: GPL-3.0-or-later@@ -104,7 +107,9 @@ class NfcReader(private val activity: Activity) {try {val data = ntag215FastRead(amiibo, dataStart, dataEnd - 1)- System.arraycopy(data, 0, tagData, i, (dataEnd - dataStart) * pageSize)+ if (data != null) {+ System.arraycopy(data, 0, tagData, i, (dataEnd - dataStart) * pageSize)+ }} catch (e: IOException) {return null}diff --git a/src/android/build.gradle.kts b/src/android/build.gradle.ktsindex 051695d2d1..c91585627b 100644--- a/src/android/build.gradle.kts+++ b/src/android/build.gradle.kts@@ -1,19 +1,21 @@+// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project+// SPDX-License-Identifier: GPL-3.0-or-later+// SPDX-FileCopyrightText: 2023 yuzu Emulator Project// SPDX-License-Identifier: GPL-3.0-or-later// Top-level build file where you can add configuration options common to all sub-projects/modules.plugins {- id("com.android.application") version "8.9.1" apply false+ id("com.android.application") version "8.10.1" apply falseid("com.android.library") version "8.1.4" apply false- id("org.jetbrains.kotlin.android") version "1.9.20" apply false+ id("org.jetbrains.kotlin.android") version "2.0.0-RC1" apply false}tasks.register("clean").configure {- delete(rootProject.buildDir)+ delete(rootProject.layout.buildDirectory)}buildscript {- val agp_version by extra("8.9.1")repositories {google()}diff --git a/src/android/gradle.properties b/src/android/gradle.propertiesindex 4fca1b5769..e0574816d7 100644--- a/src/android/gradle.properties+++ b/src/android/gradle.properties@@ -1,3 +1,6 @@+# SPDX-FileCopyrightText: 2025 Eden Emulator Project+# SPDX-License-Identifier: GPL-3.0-or-later+# SPDX-FileCopyrightText: 2023 yuzu Emulator Project# SPDX-License-Identifier: GPL-3.0-or-later@@ -14,7 +17,5 @@ android.useAndroidX=true# Kotlin code style for this project: "official" or "obsolete":kotlin.code.style=officialkotlin.parallel.tasks.in.project=true-android.defaults.buildfeatures.buildconfig=true-# Android Gradle plugin 8.0.2android.suppressUnsupportedCompileSdk=34