diff options
| author | Joakim Hulthe <joakim.hulthe@mullvad.net> | 2024-09-23 10:06:12 +0200 |
|---|---|---|
| committer | Joakim Hulthe <joakim.hulthe@mullvad.net> | 2024-09-25 11:44:14 +0200 |
| commit | d0b2b24a97e55239ee73e0dc96754bda55f88e63 (patch) | |
| tree | 1558405f31ea02445c2565b12fb1728c537b5c2b /gui/src/main | |
| parent | 78c7edb64a94dadff4782e57380ec4a69c7c7e34 (diff) | |
| download | mullvadvpn-d0b2b24a97e55239ee73e0dc96754bda55f88e63.tar.xz mullvadvpn-d0b2b24a97e55239ee73e0dc96754bda55f88e63.zip | |
Add setting to leak traffic to apple networks
Co-authored-by: David Lönnhager <david.l@mullvad.net>
Diffstat (limited to 'gui/src/main')
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 4 | ||||
| -rw-r--r-- | gui/src/main/default-settings.ts | 1 | ||||
| -rw-r--r-- | gui/src/main/index.ts | 3 | ||||
| -rw-r--r-- | gui/src/main/platform-version.ts | 15 | ||||
| -rw-r--r-- | gui/src/main/settings.ts | 6 |
5 files changed, 24 insertions, 5 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index 1c96be12bb..c09ee1b40a 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -546,6 +546,10 @@ export class DaemonRpc { await this.call<grpcTypes.DnsOptions, Empty>(this.client.setDnsOptions, dnsOptions); } + public async setAppleServicesBypass(enabled: boolean): Promise<void> { + await this.callBool<Empty>(this.client.setAppleServicesBypass, enabled); + } + public async getVersionInfo(): Promise<IAppVersionInfo> { const response = await this.callEmpty<grpcTypes.AppVersionInfo>(this.client.getVersionInfo); return response.toObject(); diff --git a/gui/src/main/default-settings.ts b/gui/src/main/default-settings.ts index e11a7434e1..62f60cf65b 100644 --- a/gui/src/main/default-settings.ts +++ b/gui/src/main/default-settings.ts @@ -81,6 +81,7 @@ export function getDefaultSettings(): ISettings { customLists: [], apiAccessMethods: getDefaultApiAccessMethods(), relayOverrides: [], + appleServicesBypass: false, }; } diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index be6c6609a0..2401e70b69 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -55,7 +55,7 @@ import NotificationController, { NotificationControllerDelegate, NotificationSender, } from './notification-controller'; -import { isMacOs13OrNewer } from './platform-version'; +import { isMacOs13OrNewer, isMacOs14p6OrNewer } from './platform-version'; import * as problemReport from './problem-report'; import { resolveBin } from './proc'; import ReconnectionBackoff from './reconnection-backoff'; @@ -774,6 +774,7 @@ class ApplicationMain navigationHistory: this.navigationHistory, currentApiAccessMethod: this.currentApiAccessMethod, isMacOs13OrNewer: isMacOs13OrNewer(), + isMacOs14p6OrNewer: isMacOs14p6OrNewer(), })); IpcMainEventChannel.map.handleGetData(async () => ({ diff --git a/gui/src/main/platform-version.ts b/gui/src/main/platform-version.ts index 027434d8d9..9b483fed65 100644 --- a/gui/src/main/platform-version.ts +++ b/gui/src/main/platform-version.ts @@ -1,24 +1,31 @@ import os from 'os'; -export function isMacOs11OrNewer() { +export function isMacOs11OrNewer(): boolean { const [major] = parseVersion(); return process.platform === 'darwin' && major >= 20; } -export function isMacOs13OrNewer() { +export function isMacOs13OrNewer(): boolean { const [major] = parseVersion(); return process.platform === 'darwin' && major >= 22; } +export function isMacOs14p6OrNewer(): boolean { + const [major, minor] = parseVersion(); + const darwin24 = major >= 24; + const darwin236 = major == 23 && minor >= 6; // 23.6 is used by macOS 14.6 + return process.platform === 'darwin' && (darwin236 || darwin24); +} + // Windows 11 has the internal version 10.0.22000+. -export function isWindows11OrNewer() { +export function isWindows11OrNewer(): boolean { const [major, minor, patch] = parseVersion(); return ( process.platform === 'win32' && (major > 10 || (major === 10 && (minor > 0 || patch >= 22000))) ); } -function parseVersion() { +function parseVersion(): number[] { return os .release() .split('.') diff --git a/gui/src/main/settings.ts b/gui/src/main/settings.ts index 03537ba581..d53219ec6d 100644 --- a/gui/src/main/settings.ts +++ b/gui/src/main/settings.ts @@ -72,6 +72,9 @@ export default class Settings implements Readonly<ISettings> { IpcMainEventChannel.settings.handleSetDnsOptions((dns) => { return this.daemonRpc.setDnsOptions(dns); }); + IpcMainEventChannel.settings.handleSetAppleServicesBypass((enabled) => { + return this.daemonRpc.setAppleServicesBypass(enabled); + }); IpcMainEventChannel.autoStart.handleSet((autoStart: boolean) => { return this.setAutoStart(autoStart); }); @@ -187,6 +190,9 @@ export default class Settings implements Readonly<ISettings> { public get relayOverrides() { return this.settingsValue.relayOverrides; } + public get appleServicesBypass() { + return this.settingsValue.appleServicesBypass; + } public get gui() { return this.guiSettings; |
