public UpdateCollectionItem(SwitchTitle title, bool isFavorite) : base(title, isFavorite) { if (Title is SwitchUpdate) { update = Title as SwitchUpdate; } }
public static async Task <bool> VerifyNCA(string ncaPath, SwitchTitle title) { string hactoolExe = (hactoolPath); string keysFile = (keysPath); string tkey = title.TitleKey; // NOTE: Using single quotes here instead of single quotes f***s up windows, it CANNOT handle single quotes // Anything surrounded in single quotes will throw an error because the file/folder isn't found // Must use escaped double quotes! string commandLine = $" -k \"{keysFile}\"" + $" --titlekey=\"{tkey}\"" + $" \"{ncaPath}\""; try { return(await Task.Run(delegate { ProcessStartInfo hactoolSI = new ProcessStartInfo() { FileName = hactoolExe, WorkingDirectory = System.IO.Directory.GetCurrentDirectory(), Arguments = commandLine, UseShellExecute = false, //RedirectStandardOutput = true, RedirectStandardError = true, CreateNoWindow = true, }; Process hactool = Process.Start(hactoolSI); string errors = hactool.StandardError.ReadToEnd(); hactool.WaitForExit(); if (errors.Contains("Error: section 0 is corrupted!") || errors.Contains("Error: section 1 is corrupted!")) { logger.Error("NCA title key verification failed"); return false; } logger.Info("NCA title key verification successful"); return true; })); } catch (Exception e) { throw new HactoolFailedException("Hactool decryption failed!", e); } }
public SwitchCollectionItem(SwitchTitle title, SwitchCollectionState state) : this(title, state, false) { }
public SwitchCollectionItem(SwitchTitle title, bool isFavorite) : this(title, SwitchCollectionState.NotOwned, isFavorite) { }
public SwitchCollectionItem(SwitchTitle title) : this(title, SwitchCollectionState.NotOwned, false) { }
public SwitchCollectionItem(SwitchTitle title, SwitchCollectionState state, bool isFavorite) { this.title = title; State = state; IsFavorite = isFavorite; }
public UpdateCollectionItem(SwitchTitle title, SwitchCollectionState state) : base(title, state) { }