diff options
| author | 2023-09-26 14:07:12 -0400 | |
|---|---|---|
| committer | 2023-09-26 14:07:12 -0400 | |
| commit | 75180bdc9d32bcff42e67ed73c40a0dc507e9aff (patch) | |
| tree | 68368be236a5d5086b6cdde5a03b524c2c5aca50 | |
| parent | Merge pull request #11599 from lat9nq/aud-bknd-fix (diff) | |
| parent | android: Use a different string for the content install dialog (diff) | |
| download | yuzu-75180bdc9d32bcff42e67ed73c40a0dc507e9aff.tar.gz yuzu-75180bdc9d32bcff42e67ed73c40a0dc507e9aff.tar.xz yuzu-75180bdc9d32bcff42e67ed73c40a0dc507e9aff.zip | |
Merge pull request #11602 from t895/case-fix
android: Content install lowercase fix
Diffstat (limited to '')
4 files changed, 21 insertions, 8 deletions
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 21f67f32a..7745c9fc7 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 | |||
| @@ -247,7 +247,12 @@ object NativeLibrary { | |||
| 247 | 247 | ||
| 248 | external fun setAppDirectory(directory: String) | 248 | external fun setAppDirectory(directory: String) |
| 249 | 249 | ||
| 250 | external fun installFileToNand(filename: String): Int | 250 | /** |
| 251 | * Installs a nsp or xci file to nand | ||
| 252 | * @param filename String representation of file uri | ||
| 253 | * @param extension Lowercase string representation of file extension without "." | ||
| 254 | */ | ||
| 255 | external fun installFileToNand(filename: String, extension: String): Int | ||
| 251 | 256 | ||
| 252 | external fun initializeGpuDriver( | 257 | external fun initializeGpuDriver( |
| 253 | hookLibDir: String?, | 258 | hookLibDir: String?, |
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 6fa847631..ee490abc0 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 | |||
| @@ -515,7 +515,7 @@ class MainActivity : AppCompatActivity(), ThemeProvider { | |||
| 515 | if (documents.isNotEmpty()) { | 515 | if (documents.isNotEmpty()) { |
| 516 | IndeterminateProgressDialogFragment.newInstance( | 516 | IndeterminateProgressDialogFragment.newInstance( |
| 517 | this@MainActivity, | 517 | this@MainActivity, |
| 518 | R.string.install_game_content | 518 | R.string.installing_game_content |
| 519 | ) { | 519 | ) { |
| 520 | var installSuccess = 0 | 520 | var installSuccess = 0 |
| 521 | var installOverwrite = 0 | 521 | var installOverwrite = 0 |
| @@ -523,7 +523,12 @@ class MainActivity : AppCompatActivity(), ThemeProvider { | |||
| 523 | var errorExtension = 0 | 523 | var errorExtension = 0 |
| 524 | var errorOther = 0 | 524 | var errorOther = 0 |
| 525 | documents.forEach { | 525 | documents.forEach { |
| 526 | when (NativeLibrary.installFileToNand(it.toString())) { | 526 | when ( |
| 527 | NativeLibrary.installFileToNand( | ||
| 528 | it.toString(), | ||
| 529 | FileUtil.getExtension(it) | ||
| 530 | ) | ||
| 531 | ) { | ||
| 527 | NativeLibrary.InstallFileToNandResult.Success -> { | 532 | NativeLibrary.InstallFileToNandResult.Success -> { |
| 528 | installSuccess += 1 | 533 | installSuccess += 1 |
| 529 | } | 534 | } |
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index f31fe054b..71ef2833d 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp | |||
| @@ -102,7 +102,7 @@ public: | |||
| 102 | m_native_window = native_window; | 102 | m_native_window = native_window; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | int InstallFileToNand(std::string filename) { | 105 | int InstallFileToNand(std::string filename, std::string file_extension) { |
| 106 | jconst copy_func = [](const FileSys::VirtualFile& src, const FileSys::VirtualFile& dest, | 106 | jconst copy_func = [](const FileSys::VirtualFile& src, const FileSys::VirtualFile& dest, |
| 107 | std::size_t block_size) { | 107 | std::size_t block_size) { |
| 108 | if (src == nullptr || dest == nullptr) { | 108 | if (src == nullptr || dest == nullptr) { |
| @@ -134,12 +134,12 @@ public: | |||
| 134 | m_system.GetFileSystemController().CreateFactories(*m_vfs); | 134 | m_system.GetFileSystemController().CreateFactories(*m_vfs); |
| 135 | 135 | ||
| 136 | [[maybe_unused]] std::shared_ptr<FileSys::NSP> nsp; | 136 | [[maybe_unused]] std::shared_ptr<FileSys::NSP> nsp; |
| 137 | if (filename.ends_with("nsp")) { | 137 | if (file_extension == "nsp") { |
| 138 | nsp = std::make_shared<FileSys::NSP>(m_vfs->OpenFile(filename, FileSys::Mode::Read)); | 138 | nsp = std::make_shared<FileSys::NSP>(m_vfs->OpenFile(filename, FileSys::Mode::Read)); |
| 139 | if (nsp->IsExtractedType()) { | 139 | if (nsp->IsExtractedType()) { |
| 140 | return InstallError; | 140 | return InstallError; |
| 141 | } | 141 | } |
| 142 | } else if (filename.ends_with("xci")) { | 142 | } else if (file_extension == "xci") { |
| 143 | jconst xci = | 143 | jconst xci = |
| 144 | std::make_shared<FileSys::XCI>(m_vfs->OpenFile(filename, FileSys::Mode::Read)); | 144 | std::make_shared<FileSys::XCI>(m_vfs->OpenFile(filename, FileSys::Mode::Read)); |
| 145 | nsp = xci->GetSecurePartitionNSP(); | 145 | nsp = xci->GetSecurePartitionNSP(); |
| @@ -607,8 +607,10 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_setAppDirectory(JNIEnv* env, jobject | |||
| 607 | } | 607 | } |
| 608 | 608 | ||
| 609 | int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env, jobject instance, | 609 | int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env, jobject instance, |
| 610 | [[maybe_unused]] jstring j_file) { | 610 | jstring j_file, |
| 611 | return EmulationSession::GetInstance().InstallFileToNand(GetJString(env, j_file)); | 611 | jstring j_file_extension) { |
| 612 | return EmulationSession::GetInstance().InstallFileToNand(GetJString(env, j_file), | ||
| 613 | GetJString(env, j_file_extension)); | ||
| 612 | } | 614 | } |
| 613 | 615 | ||
| 614 | void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver(JNIEnv* env, jclass clazz, | 616 | void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver(JNIEnv* env, jclass clazz, |
diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 0730143bd..574290479 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml | |||
| @@ -107,6 +107,7 @@ | |||
| 107 | <string name="share_log_missing">No log file found</string> | 107 | <string name="share_log_missing">No log file found</string> |
| 108 | <string name="install_game_content">Install game content</string> | 108 | <string name="install_game_content">Install game content</string> |
| 109 | <string name="install_game_content_description">Install game updates or DLC</string> | 109 | <string name="install_game_content_description">Install game updates or DLC</string> |
| 110 | <string name="installing_game_content">Installing content…</string> | ||
| 110 | <string name="install_game_content_failure">Error installing file(s) to NAND</string> | 111 | <string name="install_game_content_failure">Error installing file(s) to NAND</string> |
| 111 | <string name="install_game_content_failure_description">Please ensure content(s) are valid and that the prod.keys file is installed.</string> | 112 | <string name="install_game_content_failure_description">Please ensure content(s) are valid and that the prod.keys file is installed.</string> |
| 112 | <string name="install_game_content_failure_base">Installation of base games isn\'t permitted in order to avoid possible conflicts.</string> | 113 | <string name="install_game_content_failure_base">Installation of base games isn\'t permitted in order to avoid possible conflicts.</string> |