0
0
Fork 0
mirror of https://github.com/GreemDev/Ryujinx.git synced 2024-12-22 19:15:47 +00:00

chore: small cleanups

This commit is contained in:
Evan Husted 2024-12-21 16:59:13 -06:00
parent a460eda195
commit 5b36a9cf9f
6 changed files with 8 additions and 8 deletions

View file

@ -333,7 +333,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
return Path.Combine(AppDataManager.KeysDirPath, "key_retail.bin"); return Path.Combine(AppDataManager.KeysDirPath, "key_retail.bin");
} }
public static bool HasKeyRetailBinPath => File.Exists(GetKeyRetailBinPath()); public static bool HasAmiiboKeyFile => File.Exists(GetKeyRetailBinPath());
public static DateTime DateTimeFromTag(ushort value) public static DateTime DateTimeFromTag(ushort value)

View file

@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
private byte[] DeriveKey(AmiiboMasterKey key, bool deriveAes, out byte[] derivedAesKey, out byte[] derivedAesIv) private byte[] DeriveKey(AmiiboMasterKey key, bool deriveAes, out byte[] derivedAesKey, out byte[] derivedAesIv)
{ {
List<byte> seed = new List<byte>(); List<byte> seed = [];
// Start with the type string (14 bytes) // Start with the type string (14 bytes)
seed.AddRange(key.TypeString); seed.AddRange(key.TypeString);

View file

@ -33,10 +33,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
byte[] dataBin = combinedBin.Take(80).ToArray(); byte[] dataBin = combinedBin.Take(80).ToArray();
byte[] tagBin = combinedBin.Skip(80).Take(80).ToArray(); byte[] tagBin = combinedBin.Skip(80).Take(80).ToArray();
AmiiboMasterKey dataKey = new AmiiboMasterKey(dataBin); return (new AmiiboMasterKey(dataBin), new AmiiboMasterKey(tagBin));
AmiiboMasterKey tagKey = new AmiiboMasterKey(tagBin);
return (dataKey, tagKey);
} }
} }
} }

View file

@ -1,3 +1,4 @@
using Gommon;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using System; using System;
using System.Diagnostics; using System.Diagnostics;
@ -34,6 +35,8 @@ namespace Ryujinx.UI.Common.Helper
} }
} }
public static void OpenFolder(FilePath path) => OpenFolder(path.Path);
public static void LocateFile(string path) public static void LocateFile(string path)
{ {
if (File.Exists(path)) if (File.Exists(path))

View file

@ -334,7 +334,7 @@ namespace Ryujinx.Ava.UI.ViewModels
} }
} }
public bool CanScanAmiiboBinaries => AmiiboBinReader.HasKeyRetailBinPath; public bool CanScanAmiiboBinaries => AmiiboBinReader.HasAmiiboKeyFile;
public bool ShowLoadProgress public bool ShowLoadProgress
{ {

View file

@ -178,7 +178,7 @@ namespace Ryujinx.Ava.UI.Views.Main
private void ScanBinAmiiboMenuItem_AttachedToVisualTree(object sender, VisualTreeAttachmentEventArgs e) private void ScanBinAmiiboMenuItem_AttachedToVisualTree(object sender, VisualTreeAttachmentEventArgs e)
{ {
if (sender is MenuItem) if (sender is MenuItem)
ViewModel.IsAmiiboBinRequested = ViewModel.IsAmiiboRequested && AmiiboBinReader.HasKeyRetailBinPath; ViewModel.IsAmiiboBinRequested = ViewModel.IsAmiiboRequested && AmiiboBinReader.HasAmiiboKeyFile;
} }
private async void InstallFileTypes_Click(object sender, RoutedEventArgs e) private async void InstallFileTypes_Click(object sender, RoutedEventArgs e)