Compare commits
2 Commits
Canary-1.2
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
381921390a | ||
|
|
221524d879 |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 48 KiB |
@@ -33,9 +33,12 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||||||
const int pageSize = 4;
|
const int pageSize = 4;
|
||||||
const int totalBytes = totalPages * pageSize;
|
const int totalBytes = totalPages * pageSize;
|
||||||
|
|
||||||
if (fileBytes.Length < totalBytes)
|
if (fileBytes.Length == 532)
|
||||||
{
|
{
|
||||||
return new VirtualAmiiboFile();
|
// add 8 bytes to the end of the file
|
||||||
|
byte[] newFileBytes = new byte[totalBytes];
|
||||||
|
Array.Copy(fileBytes, newFileBytes, fileBytes.Length);
|
||||||
|
fileBytes = newFileBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
AmiiboDecrypter amiiboDecryptor = new AmiiboDecrypter(keyRetailBinPath);
|
AmiiboDecrypter amiiboDecryptor = new AmiiboDecrypter(keyRetailBinPath);
|
||||||
@@ -171,6 +174,14 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (readBytes.Length == 532)
|
||||||
|
{
|
||||||
|
// add 8 bytes to the end of the file
|
||||||
|
byte[] newFileBytes = new byte[540];
|
||||||
|
Array.Copy(readBytes, newFileBytes, readBytes.Length);
|
||||||
|
readBytes = newFileBytes;
|
||||||
|
}
|
||||||
|
|
||||||
AmiiboDecrypter amiiboDecryptor = new AmiiboDecrypter(keyRetailBinPath);
|
AmiiboDecrypter amiiboDecryptor = new AmiiboDecrypter(keyRetailBinPath);
|
||||||
AmiiboDump amiiboDump = amiiboDecryptor.DecryptAmiiboDump(readBytes);
|
AmiiboDump amiiboDump = amiiboDecryptor.DecryptAmiiboDump(readBytes);
|
||||||
|
|
||||||
@@ -231,6 +242,14 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (readBytes.Length == 532)
|
||||||
|
{
|
||||||
|
// add 8 bytes to the end of the file
|
||||||
|
byte[] newFileBytes = new byte[540];
|
||||||
|
Array.Copy(readBytes, newFileBytes, readBytes.Length);
|
||||||
|
readBytes = newFileBytes;
|
||||||
|
}
|
||||||
|
|
||||||
AmiiboDecrypter amiiboDecryptor = new AmiiboDecrypter(keyRetailBinPath);
|
AmiiboDecrypter amiiboDecryptor = new AmiiboDecrypter(keyRetailBinPath);
|
||||||
AmiiboDump amiiboDump = amiiboDecryptor.DecryptAmiiboDump(readBytes);
|
AmiiboDump amiiboDump = amiiboDecryptor.DecryptAmiiboDump(readBytes);
|
||||||
amiiboDump.AmiiboNickname = newNickName;
|
amiiboDump.AmiiboNickname = newNickName;
|
||||||
@@ -314,10 +333,9 @@ 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()
|
public static bool HasKeyRetailBinPath => File.Exists(GetKeyRetailBinPath());
|
||||||
{
|
|
||||||
return File.Exists(GetKeyRetailBinPath());
|
|
||||||
}
|
|
||||||
public static DateTime DateTimeFromTag(ushort value)
|
public static DateTime DateTimeFromTag(ushort value)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -127,6 +127,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
public IEnumerable<LdnGameData> LastLdnGameData;
|
public IEnumerable<LdnGameData> LastLdnGameData;
|
||||||
|
|
||||||
|
// The UI specifically uses a thicker bordered variant of the icon to avoid crunching out the border at lower resolutions.
|
||||||
|
// For an example of this, download canary 1.2.95, then open the settings menu, and look at the icon in the top-left.
|
||||||
|
// The border gets reduced to colored pixels in the 4 corners.
|
||||||
public static readonly Bitmap IconBitmap =
|
public static readonly Bitmap IconBitmap =
|
||||||
new(Assembly.GetAssembly(typeof(ConfigurationState))!.GetManifestResourceStream("Ryujinx.UI.Common.Resources.Logo_Thiccjinx.png")!);
|
new(Assembly.GetAssembly(typeof(ConfigurationState))!.GetManifestResourceStream("Ryujinx.UI.Common.Resources.Logo_Thiccjinx.png")!);
|
||||||
|
|
||||||
@@ -330,6 +333,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanScanAmiiboBinaries => AmiiboBinReader.HasKeyRetailBinPath;
|
||||||
|
|
||||||
public bool ShowLoadProgress
|
public bool ShowLoadProgress
|
||||||
{
|
{
|
||||||
get => _showLoadProgress;
|
get => _showLoadProgress;
|
||||||
|
|||||||
@@ -247,6 +247,7 @@
|
|||||||
Click="OpenBinFile"
|
Click="OpenBinFile"
|
||||||
Header="{ext:Locale MenuBarActionsScanAmiiboBin}"
|
Header="{ext:Locale MenuBarActionsScanAmiiboBin}"
|
||||||
Icon="{ext:Icon mdi-cube-scan}"
|
Icon="{ext:Icon mdi-cube-scan}"
|
||||||
|
IsVisible="{Binding CanScanAmiiboBinaries}"
|
||||||
IsEnabled="{Binding IsAmiiboBinRequested}" />
|
IsEnabled="{Binding IsAmiiboBinRequested}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Command="{Binding TakeScreenshot}"
|
Command="{Binding TakeScreenshot}"
|
||||||
|
|||||||
@@ -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.HasKeyRetailBinPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void InstallFileTypes_Click(object sender, RoutedEventArgs e)
|
private async void InstallFileTypes_Click(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user