From 4ff643805bedcff46b6c9a233434b7a9c9124964 Mon Sep 17 00:00:00 2001 From: Stossy11 <69031796+stossy11@users.noreply.github.com> Date: Thu, 24 Apr 2025 15:48:29 +1000 Subject: [PATCH] Feat: Add Pairing File Export URL callback and replace Wireguard with StosVPN (#962) * Add Pairing File Export URL callback and replace Wireguard with StosVPN * Fix Data() * Add Switching Tab * Fix Pairing Callback Template and fix spelling mistake * Add Observer for openExportPairingFileConfirm * Add Logging and fix certificate callback * add func to Scene Delegate * Fix ToastView and Logging * Remove ? * Fix Logging * Call AppDelegate instead of SceneDelegate * Fix Scene Delegate * Set back SceneDelegate * Add Logging * Fix error * Fix Case Sensitive * Remove openExportPairingFileConfirm and fix AppDelegate.exportPairingFileNotification * Remove Alert * Remove Unnecessary code * rename export() to exportPairingFile() --- AltStore/AppDelegate.swift | 12 ++++- .../Authentication/Authentication.storyboard | 44 +++++++++--------- .../Operations/Errors/OperationError.swift | 4 +- AltStore/SceneDelegate.swift | 45 +++++++++++++++++++ AltStore/TabBarController.swift | 4 +- 5 files changed, 82 insertions(+), 27 deletions(-) diff --git a/AltStore/AppDelegate.swift b/AltStore/AppDelegate.swift index 4ed8642b..497bd9e8 100644 --- a/AltStore/AppDelegate.swift +++ b/AltStore/AppDelegate.swift @@ -291,10 +291,20 @@ private extension AppDelegate } return true + + case "pairing": + let queryItems = components.queryItems?.reduce(into: [String: String]()) { $0[$1.name.lowercased()] = $1.value } ?? [:] + guard let callbackTemplate = queryItems["urlName"]?.removingPercentEncoding else { return false } + + DispatchQueue.main.async { + exportPairingFile(callbackTemplate) + } + + return true case "certificate": let queryItems = components.queryItems?.reduce(into: [String: String]()) { $0[$1.name.lowercased()] = $1.value } ?? [:] - guard let callbackTemplate = queryItems["callback"]?.removingPercentEncoding else { return false } + guard let callbackTemplate = queryItems["callback_template"]?.removingPercentEncoding else { return false } DispatchQueue.main.async { NotificationCenter.default.post(name: AppDelegate.exportCertificateNotification, object: nil, userInfo: [AppDelegate.exportCertificateCallbackTemplateKey: callbackTemplate]) diff --git a/AltStore/Authentication/Authentication.storyboard b/AltStore/Authentication/Authentication.storyboard index b2f0647a..feaf7987 100644 --- a/AltStore/Authentication/Authentication.storyboard +++ b/AltStore/Authentication/Authentication.storyboard @@ -1,9 +1,9 @@ - + - + @@ -14,7 +14,7 @@ - + @@ -42,13 +42,13 @@ - + @@ -57,13 +57,13 @@ -