Files
whitelist-bypass/ios-proxy-app/whitelist-bypass-proxy/AppDefaults.swift
T
kulikov0 1b2d6bc5d3 v0.2.1 (#53)
* ios proxy app, tune vp8 tunnel

* refactor go modules, move headless joiner android to a go captcha

* restore emojis in vk bot keyboard

* headless support in vk bot

* remove telemost dc hooks, update cretor-app ui and bot

* remove telemost support from go code, add fallback to video if mode == dc in joiners

* fix headless creators in windows

* update vk call creation autoclick

* force desktop useragent for creator app

* kick disconnected user in headless vk creator immediately when connection is lost

* update README.md

* update SETUP.md

* update release version

* add fallback for link creation in vk bot
2026-04-19 17:47:36 +02:00

57 lines
2.0 KiB
Swift

import Foundation
enum DefaultsKeys {
static let lastUrl = "lastUrl"
static let socksPort = "socksPort"
static let tunnelMode = "tunnelMode"
static let displayName = "displayName"
static let showLogs = "showLogs"
static let socksAuthMode = "socksAuthMode"
static let socksUser = "socksUser"
static let socksPass = "socksPass"
}
struct AppDefaults {
private static let defaults = UserDefaults.standard
static var lastUrl: String {
get { defaults.string(forKey: DefaultsKeys.lastUrl) ?? "" }
set { defaults.set(newValue, forKey: DefaultsKeys.lastUrl) }
}
static var socksPort: Int {
get { defaults.object(forKey: DefaultsKeys.socksPort) as? Int ?? 1080 }
set { defaults.set(newValue, forKey: DefaultsKeys.socksPort) }
}
static var tunnelMode: TunnelMode {
get { TunnelMode(rawValue: defaults.string(forKey: DefaultsKeys.tunnelMode) ?? "") ?? .video }
set { defaults.set(newValue.rawValue, forKey: DefaultsKeys.tunnelMode) }
}
static var displayName: String {
get { defaults.string(forKey: DefaultsKeys.displayName) ?? "Hello" }
set { defaults.set(newValue, forKey: DefaultsKeys.displayName) }
}
static var showLogs: Bool {
get { defaults.object(forKey: DefaultsKeys.showLogs) as? Bool ?? true }
set { defaults.set(newValue, forKey: DefaultsKeys.showLogs) }
}
static var socksAuthMode: SocksAuthMode {
get { SocksAuthMode(rawValue: defaults.string(forKey: DefaultsKeys.socksAuthMode) ?? "") ?? .auto }
set { defaults.set(newValue.rawValue, forKey: DefaultsKeys.socksAuthMode) }
}
static var socksUser: String {
get { defaults.string(forKey: DefaultsKeys.socksUser) ?? "" }
set { defaults.set(newValue, forKey: DefaultsKeys.socksUser) }
}
static var socksPass: String {
get { defaults.string(forKey: DefaultsKeys.socksPass) ?? "" }
set { defaults.set(newValue, forKey: DefaultsKeys.socksPass) }
}
}