mirror of
https://github.com/xweiba/location-spoofer.git
synced 2026-09-21 22:30:46 +08:00
- iOS 虚拟定位工具,基于本地 HTTP 代理 MITM 方案 - MapKit 原生地图体验,支持搜索、收藏、实时定位 - 完整的设置引导流程(证书安装、WiFi 代理配置、环境验证) - 支持 iOS 15+,SwiftUI 构建
42 lines
868 B
Swift
42 lines
868 B
Swift
import Foundation
|
|
|
|
enum CertificateTrustState: Equatable {
|
|
case checking
|
|
case trusted
|
|
case unavailable
|
|
|
|
var canModify: Bool { self == .trusted }
|
|
|
|
var message: String {
|
|
switch self {
|
|
case .checking: return "checking..."
|
|
case .trusted: return "trusted"
|
|
case .unavailable: return "not configured"
|
|
}
|
|
}
|
|
}
|
|
|
|
enum LocationActionState: Equatable {
|
|
case idle
|
|
case applyingLocation
|
|
case failed(String)
|
|
|
|
var isBusy: Bool {
|
|
if case .applyingLocation = self { return true }
|
|
return false
|
|
}
|
|
|
|
var isFailure: Bool {
|
|
if case .failed = self { return true }
|
|
return false
|
|
}
|
|
|
|
var statusTitle: String {
|
|
switch self {
|
|
case .idle: return ""
|
|
case .applyingLocation: return "applying..."
|
|
case .failed: return "failed"
|
|
}
|
|
}
|
|
}
|