diff --git a/AltStore/SceneDelegate.swift b/AltStore/SceneDelegate.swift index c195f3ea..6106339a 100644 --- a/AltStore/SceneDelegate.swift +++ b/AltStore/SceneDelegate.swift @@ -9,6 +9,8 @@ import UIKit import AltStoreCore import EmotionalDamage +import minimuxer + @available(iOS 13, *) final class SceneDelegate: UIResponder, UIWindowSceneDelegate @@ -139,6 +141,45 @@ private extension SceneDelegate DispatchQueue.main.async { NotificationCenter.default.post(name: AppDelegate.addSourceDeepLinkNotification, object: nil, userInfo: [AppDelegate.addSourceDeepLinkURLKey: sourceURL]) } + + case "sidejit-enable": + let queryItems = components.queryItems?.reduce(into: [String: String]()) { $0[$1.name.lowercased()] = $1.value } ?? [:] + if let jitdebugURLString = queryItems["bid"] { + DispatchQueue.main.async { + let v = minimuxer_to_operation(code: 1) + + do { + var x = try debug_app(app_id: jitdebugURLString) + switch x { + case .Good: print(jitdebugURLString) + case .Bad(let code): minimuxer_to_operation(code: code) + } + } catch Uhoh.Bad(let code) { + minimuxer_to_operation(code: code) + } catch { + print(OperationError.unknown) + } + } } + + else if let jitdebugURLString = queryItems["pid"] { + DispatchQueue.main.async { + let v = minimuxer_to_operation(code: 1) + + do { + var x = try debug_app(app_id: jitdebugURLString) + switch x { + case .Good: print(jitdebugURLString) + case .Bad(let code): minimuxer_to_operation(code: code) + } + } catch Uhoh.Bad(let code) { + minimuxer_to_operation(code: code) + } catch { + print(OperationError.unknown) + } + } } + + else { return } + default: break }