feat: remove wifi and external vpn requirements

This commit is contained in:
zy860 2026-08-18 14:50:24 +08:00
parent b86f6d9f24
commit aadf40aa30
11 changed files with 219 additions and 163 deletions

View file

@ -69,15 +69,15 @@ enum DeviceTransportError: LocalizedError, Equatable {
var errorDescription: String? {
switch self {
case .invalidIPAddress(let ip):
return "Invalid RPPairing IPv4 address: (ip)"
return "Invalid RPPairing IPv4 address: \(ip)"
case .pairingFileMissing(let path):
return "Pairing file not found at (path)"
return "Pairing file not found at \(path)"
case .pairingFileReadFailed(let message):
return "Failed to read the RPPairing file: (message)"
return "Failed to read the RPPairing file: \(message)"
case .vpnUnavailable(let message):
return "Embedded VPN unavailable: (message)"
return "Embedded VPN unavailable: \(message)"
case .ffiFailure(let message):
return "RPPairing tunnel creation failed: (message)"
return "RPPairing tunnel creation failed: \(message)"
case .incompleteTunnel:
return "RPPairing returned incomplete tunnel handles"
}

View file

@ -53,6 +53,9 @@ final class StikDebugVPNManager: ObservableObject {
lastEnsureError = ensureError
startingWaiter = nil
stateLock.unlock()
if ensureError != nil {
publish(.failed)
}
waiter.signal()
}

View file

@ -44,11 +44,11 @@ enum StikDebugVPNError: LocalizedError, Equatable {
var errorDescription: String? {
switch self {
case .profileLoadFailed(let message):
return "Unable to load the embedded VPN profile: (message)"
return "Unable to load the embedded VPN profile: \(message)"
case .profileSaveFailed(let message):
return "Unable to save the embedded VPN profile: (message)"
return "Unable to save the embedded VPN profile: \(message)"
case .permissionDenied(let message):
return "The embedded VPN permission was denied: (message)"
return "The embedded VPN permission was denied: \(message)"
case .competingVPN:
return "Another VPN is active. Stop it before starting the StikDebug local tunnel."
case .timeout: