public async Task Inject(Jector jector) { var inputPath = GetPath("Provide path to file to be written into:", true); var dataPath = GetPath("Provide a path to the file to be hidden:", true); var outputPath = GetPath("Provide a path where the file copy with hidden data will be saved:", false); if (inputPath == outputPath) { Speak("The input file cannot be the same as the save file!"); await Inject(jector); return; } else if (inputPath == dataPath) { Speak("The input file cannot be the same as the data file. What will be the point?"); await Inject(jector); return; } else if (dataPath == outputPath) { Speak("The data file cannot be the same as the save file"); await Inject(jector); } Speak("Executing Command. Please Wait"); try { using var source = File.OpenRead(inputPath); using var destination = File.OpenWrite(outputPath); using var data = File.OpenRead(dataPath); await jector.InjectAsync(source, destination, data, Aretha.WriteProgress()); Speak($"Command Executed Successfully!"); } catch (Exception ex) { Aretha.SoulFailed(Soul.Anubis, ex); } }
public async Task Eject(Jector jector) { var inputPath = GetPath("Provide a path to file containing hidden data:", true); if (inputPath == null) { return; } var outputPath = GetPath("Provide a path where the hidden file will be saved: ", false); if (outputPath == null) { return; } if (inputPath == outputPath) { Speak("The input file cannot be the same as the save file!"); await Inject(jector); return; } Speak("Executing Command. Please Wait"); try { using var source = File.OpenRead(inputPath); using var destination = File.OpenWrite(outputPath); await jector.EjectAsync(source, destination, Aretha.WriteProgress()); Speak($"Command Executed Successfully!"); } catch (Exception ex) { Aretha.SoulFailed(Soul.Anubis, ex); } }