From 3abf9d5b193087ca3b3c2458cf763ca7229bb728 Mon Sep 17 00:00:00 2001 From: CelloSerenity <195480169+CelloSerenity@users.noreply.github.com> Date: Wed, 23 Sep 2026 17:09:48 -0600 Subject: [PATCH] feat: warn before manually enabling LiveContainer JIT --- StikDebug/Views/HomeView.swift | 42 +++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/StikDebug/Views/HomeView.swift b/StikDebug/Views/HomeView.swift index 363ba80..ab605c3 100644 --- a/StikDebug/Views/HomeView.swift +++ b/StikDebug/Views/HomeView.swift @@ -19,6 +19,7 @@ struct HomeView: View { @State private var isShowingPairingFilePicker = false @State private var debugFeedback: DebugFeedback? @State private var pendingExternalURLAction: HomeExternalAction? + @State private var pendingLiveContainerApp: LiveContainerApp? @State private var scriptRunModel: RunJSViewModel? private let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect() @@ -30,11 +31,18 @@ struct HomeView: View { let isWorking: Bool } + private struct LiveContainerApp { + let bundleID: String + let name: String + } + var body: some View { InstalledAppsListView(onSelectApp: { selectedBundle, selectedName in - bundleID = selectedBundle - Haptics.medium() - startJITInBackground(bundleID: selectedBundle, displayName: selectedName) + if selectedName.localizedCaseInsensitiveContains("LiveContainer") { + pendingLiveContainerApp = LiveContainerApp(bundleID: selectedBundle, name: selectedName) + } else { + enableJITForSelectedApp(bundleID: selectedBundle, name: selectedName) + } }, showDoneButton: false, onImportPairingFile: { isShowingPairingFilePicker = true }) .overlay(alignment: .bottom) { if let debugFeedback { @@ -74,6 +82,28 @@ struct HomeView: View { } message: { action in Text(action.message) } + .alert( + "Enable JIT for LiveContainer?", + isPresented: Binding( + get: { pendingLiveContainerApp != nil }, + set: { isPresented in + if !isPresented { + pendingLiveContainerApp = nil + } + } + ), + presenting: pendingLiveContainerApp + ) { app in + Button("Cancel", role: .cancel) { + pendingLiveContainerApp = nil + } + Button("Proceed") { + pendingLiveContainerApp = nil + enableJITForSelectedApp(bundleID: app.bundleID, name: app.name) + } + } message: { _ in + Text("StikDebug isn't meant to enable JIT for LiveContainer manually. Select StikDebug in LiveContainer settings, enable \"Run with JIT\" for your app, then open your app normally. It will automatically jump back here.") + } .fileImporter( isPresented: $isShowingPairingFilePicker, allowedContentTypes: PairingFileStore.supportedContentTypes, @@ -92,6 +122,12 @@ struct HomeView: View { } } + private func enableJITForSelectedApp(bundleID selectedBundle: String, name: String) { + bundleID = selectedBundle + Haptics.medium() + startJITInBackground(bundleID: selectedBundle, displayName: name) + } + private func handleAppear() { startTunnelInBackground() MountingProgress.shared.checkforMounted()