using System.Reflection; using System.Text.Json; using CommunityToolkit.Mvvm.Input; using XFEEDToolBox.Controls; using XFEEDToolBox.Core.Data; using XFEEDToolBox.Views; namespace XFEEDToolBox; public partial class App { private static async Task RunRelogProbeAsync(string path) { var directory = Path.GetDirectoryName(Path.GetFullPath(path))!; Directory.CreateDirectory(directory); string? failure = null; object? result = null; static void Require(bool value, string message) { if (!value) throw new InvalidOperationException(message); } try { Require(ViewModel.OfflinePreview && Runtime.FlightDriver is null && Runtime.Journal.Sequence == 0, "The relog fixture requires an isolated offline runtime without a game connection."); MainWindow.AppWindow.Move(new(-30000, -30000)); MainWindow.AppWindow.Resize(new(1680, 1080)); MainWindow.AppWindow.Show(false); var projector = (PlayerProjector)typeof(JournalMonitor).GetField("projector", BindingFlags.Instance | BindingFlags.NonPublic)!.GetValue(Runtime.Journal)!; using var load = JsonDocument.Parse("""{"timestamp":"2026-10-23T00:00:00Z","event":"LoadGame","FID":"OFFLINE-RELOG","Commander":"离线按钮验证","GameMode":"Solo","Ship":"sidewinder"}"""); projector.Apply(load.RootElement); ViewModel.DemoMode = false; await ViewModel.RefreshCommand.ExecuteAsync(null); AppShellPage.Current!.Navigate(typeof(MainPage)); await Task.Delay(350); var page = (MainPage)AppShellPage.Current.CurrentPage!; var button = Descendants(page).OfType