From 73cdefe296adcacc5f9dab268228b5888731862d Mon Sep 17 00:00:00 2001 From: lincube Date: Sat, 21 Mar 2026 22:40:07 +0800 Subject: [PATCH] 0.7.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修东西 --- .../Services/PostHogUsageTelemetryService.cs | 8 ++++ .../Services/TelemetryIdentityService.cs | 19 ---------- .../PrivacySettingsPageViewModel.cs | 27 +------------- .../SettingsPages/AboutSettingsPage.axaml | 37 ++++++++++++++----- .../SettingsPages/PrivacySettingsPage.axaml | 9 +---- 5 files changed, 39 insertions(+), 61 deletions(-) diff --git a/LanMountainDesktop/Services/PostHogUsageTelemetryService.cs b/LanMountainDesktop/Services/PostHogUsageTelemetryService.cs index d24d70b..186e1c9 100644 --- a/LanMountainDesktop/Services/PostHogUsageTelemetryService.cs +++ b/LanMountainDesktop/Services/PostHogUsageTelemetryService.cs @@ -337,6 +337,14 @@ public sealed class PostHogUsageTelemetryService : IDisposable ["timestamp"] = timestamp.ToString("o"), ["properties"] = new Dictionary { + ["install_id"] = installId, + ["app_version"] = TelemetryEnvironmentInfo.GetAppVersion(), + ["os_name"] = TelemetryEnvironmentInfo.GetOsName(), + ["os_version"] = TelemetryEnvironmentInfo.GetOsVersion(), + ["device_model"] = TelemetryEnvironmentInfo.GetDeviceModel(), + ["device_arch"] = TelemetryEnvironmentInfo.GetDeviceArchitecture(), + ["runtime_version"] = TelemetryEnvironmentInfo.GetRuntimeVersion(), + ["language"] = TelemetryEnvironmentInfo.GetSystemLanguage(), ["launch_time_utc"] = timestamp.ToString("o") } }; diff --git a/LanMountainDesktop/Services/TelemetryIdentityService.cs b/LanMountainDesktop/Services/TelemetryIdentityService.cs index 0c4ec5f..0d19171 100644 --- a/LanMountainDesktop/Services/TelemetryIdentityService.cs +++ b/LanMountainDesktop/Services/TelemetryIdentityService.cs @@ -78,25 +78,6 @@ public sealed class TelemetryIdentityService } } - public string RefreshTelemetryId() - { - lock (_syncRoot) - { - EnsureInitialized(); - - var snapshot = _settingsFacade.Settings.LoadSnapshot(SettingsScope.App); - snapshot.TelemetryId = GenerateId(); - _settingsFacade.Settings.SaveSnapshot( - SettingsScope.App, - snapshot, - changedKeys: [nameof(AppSettingsSnapshot.TelemetryId)]); - - _telemetryId = snapshot.TelemetryId ?? GenerateId(); - AppLogger.Info("TelemetryIdentity", $"Telemetry id refreshed. TelemetryId={_telemetryId}"); - return _telemetryId; - } - } - public bool MarkBaselineReported() { lock (_syncRoot) diff --git a/LanMountainDesktop/ViewModels/PrivacySettingsPageViewModel.cs b/LanMountainDesktop/ViewModels/PrivacySettingsPageViewModel.cs index a22348b..f0ace0f 100644 --- a/LanMountainDesktop/ViewModels/PrivacySettingsPageViewModel.cs +++ b/LanMountainDesktop/ViewModels/PrivacySettingsPageViewModel.cs @@ -58,9 +58,6 @@ public sealed partial class PrivacySettingsPageViewModel : ViewModelBase [ObservableProperty] private string _telemetryIdDescription = string.Empty; - [ObservableProperty] - private string _refreshTelemetryIdText = string.Empty; - [ObservableProperty] private string _viewPrivacyPolicyText = string.Empty; @@ -75,27 +72,6 @@ public sealed partial class PrivacySettingsPageViewModel : ViewModelBase TelemetryId = TelemetryServices.Identity?.TelemetryId ?? string.Empty; } - [RelayCommand] - private void RefreshTelemetryId() - { - try - { - var identity = TelemetryServices.Identity; - if (identity is null) - { - AppLogger.Warn("PrivacySettings", "Telemetry identity service is unavailable."); - return; - } - - TelemetryId = identity.RefreshTelemetryId(); - AppLogger.Info("PrivacySettings", $"Telemetry ID refreshed: {TelemetryId}"); - } - catch (Exception ex) - { - AppLogger.Warn("PrivacySettings", "Failed to refresh telemetry ID.", ex); - } - } - partial void OnUploadAnonymousCrashDataChanged(bool value) { if (_isInitializing) @@ -137,8 +113,7 @@ public sealed partial class PrivacySettingsPageViewModel : ViewModelBase TelemetryIdHeader = L("settings.privacy.telemetry_id_title", "Telemetry ID"); TelemetryIdDescription = L( "settings.privacy.telemetry_id_description", - "A refreshable anonymous identifier used for detailed telemetry sessions."); - RefreshTelemetryIdText = L("settings.privacy.refresh_telemetry_id", "Refresh"); + "An anonymous identifier used for detailed telemetry sessions."); PrivacyPolicyHintPrefix = L("settings.privacy.policy_hint_prefix", "For more details, please "); ViewPrivacyPolicyText = L("settings.privacy.view_policy", "view our privacy policy"); } diff --git a/LanMountainDesktop/Views/SettingsPages/AboutSettingsPage.axaml b/LanMountainDesktop/Views/SettingsPages/AboutSettingsPage.axaml index 5ccc7c9..c56f94a 100644 --- a/LanMountainDesktop/Views/SettingsPages/AboutSettingsPage.axaml +++ b/LanMountainDesktop/Views/SettingsPages/AboutSettingsPage.axaml @@ -62,15 +62,34 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + Lincube + + + diff --git a/LanMountainDesktop/Views/SettingsPages/PrivacySettingsPage.axaml b/LanMountainDesktop/Views/SettingsPages/PrivacySettingsPage.axaml index 2b6218a..edf68a5 100644 --- a/LanMountainDesktop/Views/SettingsPages/PrivacySettingsPage.axaml +++ b/LanMountainDesktop/Views/SettingsPages/PrivacySettingsPage.axaml @@ -51,14 +51,9 @@ FontFamily="Consolas" FontSize="12" Focusable="False" - IsTabStop="False" /> + IsTabStop="False" + HorizontalAlignment="Stretch" /> -