Writes both files; rolls back settings.json if pin-config write fails.
(string mode, bool cloudRedirectEnabled)
| 10 | { |
| 11 | // Writes both files; rolls back settings.json if pin-config write fails. |
| 12 | public static void PersistMode(string mode, bool cloudRedirectEnabled) |
| 13 | { |
| 14 | var settingsPath = GetSettingsPath(); |
| 15 | byte[]? settingsBackup = File.Exists(settingsPath) |
| 16 | ? TryReadAllBytes(settingsPath) |
| 17 | : null; |
| 18 | |
| 19 | SaveModeSetting(mode); |
| 20 | try |
| 21 | { |
| 22 | SetDllCloudRedirect(cloudRedirectEnabled); |
| 23 | } |
| 24 | catch |
| 25 | { |
| 26 | RestoreSettingsBackup(settingsPath, settingsBackup); |
| 27 | throw; |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | // One-time consent gate; not shown again on later mode switches. |
| 32 | public static bool HasAcceptedDisclaimer() |
no outgoing calls
no test coverage detected