mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-10-01 12:30:00 +02:00
Initial Setup: Reload keys before verifying firmware (#1955)
* Initial Setup: Reload keys before verifying firmware Also, display the NoKeys dialog if keyset is empty when verifying firmware. * LoadApplications: Remove the lone debug log and print the error directly
This commit is contained in:
parent
9551bfdeeb
commit
d1e24ba5c2
3 changed files with 15 additions and 2 deletions
|
@ -653,6 +653,15 @@ namespace Ryujinx.HLE.FileSystem.Content
|
||||||
|
|
||||||
public SystemVersion VerifyFirmwarePackage(string firmwarePackage)
|
public SystemVersion VerifyFirmwarePackage(string firmwarePackage)
|
||||||
{
|
{
|
||||||
|
_virtualFileSystem.Reload();
|
||||||
|
|
||||||
|
// LibHac.NcaHeader's DecryptHeader doesn't check if HeaderKey is empty and throws InvalidDataException instead
|
||||||
|
// So, we check it early for a better user experience.
|
||||||
|
if (_virtualFileSystem.KeySet.HeaderKey.IsEmpty())
|
||||||
|
{
|
||||||
|
throw new MissingKeyException("HeaderKey is empty. Cannot decrypt NCA headers.");
|
||||||
|
}
|
||||||
|
|
||||||
Dictionary<ulong, List<(NcaContentType type, string path)>> updateNcas = new Dictionary<ulong, List<(NcaContentType, string)>>();
|
Dictionary<ulong, List<(NcaContentType type, string path)>> updateNcas = new Dictionary<ulong, List<(NcaContentType, string)>>();
|
||||||
|
|
||||||
if (Directory.Exists(firmwarePackage))
|
if (Directory.Exists(firmwarePackage))
|
||||||
|
|
|
@ -298,8 +298,7 @@ namespace Ryujinx.Ui.App
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
Logger.Warning?.Print(LogClass.Application, $"The file encountered was not of a valid type. Errored File: {applicationPath}");
|
Logger.Warning?.Print(LogClass.Application, $"The file encountered was not of a valid type. File: '{applicationPath}' Error: {exception}");
|
||||||
Logger.Debug?.Print(LogClass.Application, exception.ToString());
|
|
||||||
|
|
||||||
numApplicationsFound--;
|
numApplicationsFound--;
|
||||||
_loadingError = true;
|
_loadingError = true;
|
||||||
|
|
|
@ -1035,6 +1035,11 @@ namespace Ryujinx.Ui
|
||||||
thread.Start();
|
thread.Start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (LibHac.MissingKeyException ex)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Application, ex.ToString());
|
||||||
|
UserErrorDialog.CreateUserErrorDialog(UserError.NoKeys);
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
GtkDialog.CreateErrorDialog(ex.Message);
|
GtkDialog.CreateErrorDialog(ex.Message);
|
||||||
|
|
Loading…
Reference in a new issue