mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-03-13 01:51:09 +00:00
Linux: Fix file picker not launching from disabling core dumps
Core dumps are disabled by default on Linux, but this prevents access to the file picker due to security hardening. To work around this, core dumps are selectively enabled and disabled around the file picker tasks.
This commit is contained in:
@@ -1266,6 +1266,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
private async Task LoadContentFromFolder(LocaleKeys localeMessageAddedKey, LocaleKeys localeMessageRemovedKey,
|
||||
LoadContentFromFolderDelegate onDirsSelected, LocaleKeys dirSelectDialogTitle)
|
||||
{
|
||||
OsUtils.SetCoreDumpable(true);
|
||||
|
||||
Optional<IReadOnlyList<IStorageFolder>> result =
|
||||
await StorageProvider.OpenMultiFolderPickerAsync(
|
||||
new FolderPickerOpenOptions { Title = LocaleManager.Instance[dirSelectDialogTitle] });
|
||||
@@ -1293,6 +1295,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
(int)Symbol.Checkmark);
|
||||
});
|
||||
}
|
||||
|
||||
if (!Program.CoreDumpArg)
|
||||
{
|
||||
OsUtils.SetCoreDumpable(false);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1355,6 +1362,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
public async Task InstallFirmwareFromFile()
|
||||
{
|
||||
OsUtils.SetCoreDumpable(true);
|
||||
|
||||
Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions
|
||||
{
|
||||
FileTypeFilter = new List<FilePickerFileType>
|
||||
@@ -1384,20 +1393,34 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
await HandleFirmwareInstallation(result.Value.Path.LocalPath);
|
||||
}
|
||||
|
||||
if (!Program.CoreDumpArg)
|
||||
{
|
||||
OsUtils.SetCoreDumpable(false);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task InstallFirmwareFromFolder()
|
||||
{
|
||||
OsUtils.SetCoreDumpable(true);
|
||||
|
||||
Optional<IStorageFolder> result = await StorageProvider.OpenSingleFolderPickerAsync();
|
||||
|
||||
if (result.HasValue)
|
||||
{
|
||||
await HandleFirmwareInstallation(result.Value.Path.LocalPath);
|
||||
}
|
||||
|
||||
if (!Program.CoreDumpArg)
|
||||
{
|
||||
OsUtils.SetCoreDumpable(false);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task InstallKeysFromFile()
|
||||
{
|
||||
OsUtils.SetCoreDumpable(true);
|
||||
|
||||
Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions
|
||||
{
|
||||
FileTypeFilter = new List<FilePickerFileType>
|
||||
@@ -1415,16 +1438,28 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
await HandleKeysInstallation(result.Value.Path.LocalPath);
|
||||
}
|
||||
|
||||
if (!Program.CoreDumpArg)
|
||||
{
|
||||
OsUtils.SetCoreDumpable(false);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task InstallKeysFromFolder()
|
||||
{
|
||||
OsUtils.SetCoreDumpable(true);
|
||||
|
||||
Optional<IStorageFolder> result = await StorageProvider.OpenSingleFolderPickerAsync();
|
||||
|
||||
if (result.HasValue)
|
||||
{
|
||||
await HandleKeysInstallation(result.Value.Path.LocalPath);
|
||||
}
|
||||
|
||||
if (!Program.CoreDumpArg)
|
||||
{
|
||||
OsUtils.SetCoreDumpable(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenRyujinxFolder()
|
||||
@@ -1528,6 +1563,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
public async Task OpenFile()
|
||||
{
|
||||
OsUtils.SetCoreDumpable(true);
|
||||
|
||||
Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions
|
||||
{
|
||||
Title = LocaleManager.Instance[LocaleKeys.LoadApplicationFromFileDialogTitle],
|
||||
@@ -1599,6 +1636,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
LocaleManager.Instance[LocaleKeys.MenuBarFileOpenFromFileError]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!Program.CoreDumpArg)
|
||||
{
|
||||
OsUtils.SetCoreDumpable(false);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task LoadDlcFromFolder()
|
||||
@@ -1621,6 +1663,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
public async Task OpenFolder()
|
||||
{
|
||||
OsUtils.SetCoreDumpable(true);
|
||||
|
||||
Optional<IStorageFolder> result = await StorageProvider.OpenSingleFolderPickerAsync(
|
||||
new FolderPickerOpenOptions
|
||||
{
|
||||
@@ -1636,6 +1680,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
await LoadApplication(applicationData);
|
||||
}
|
||||
|
||||
if (!Program.CoreDumpArg)
|
||||
{
|
||||
OsUtils.SetCoreDumpable(false);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool InitializeUserConfig(ApplicationData application)
|
||||
@@ -1843,6 +1892,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
public async Task OpenBinFile()
|
||||
{
|
||||
OsUtils.SetCoreDumpable(true);
|
||||
|
||||
if (AppHost.Device.System.SearchingForAmiibo(out _) && IsGameRunning)
|
||||
{
|
||||
Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(
|
||||
@@ -1862,6 +1913,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
AppHost.Device.System.ScanAmiiboFromBin(result.Value.Path.LocalPath);
|
||||
}
|
||||
|
||||
if (!Program.CoreDumpArg)
|
||||
{
|
||||
OsUtils.SetCoreDumpable(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user