From 49beef71dfe80529b15c453eb3b0d09d4287f80d Mon Sep 17 00:00:00 2001 From: Dusk Date: Mon, 31 Mar 2025 11:14:22 +0800 Subject: [PATCH] added LC setting --- StikJIT/Views/HomeView.swift | 6 +++++- StikJIT/Views/SettingsView.swift | 2 +- StikJIT/idevice/JITEnableContext.h | 2 +- StikJIT/idevice/JITEnableContext.m | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/StikJIT/Views/HomeView.swift b/StikJIT/Views/HomeView.swift index 2c89125..f01dd00 100644 --- a/StikJIT/Views/HomeView.swift +++ b/StikJIT/Views/HomeView.swift @@ -32,6 +32,10 @@ struct HomeView: View { @State private var viewDidAppeared = false @State private var pendingBundleIdToEnableJIT : String? = nil + + init(is_lc: Binding? = nil) { + self._is_lc = is_lc ?? .constant(false) + } var body: some View { ZStack { @@ -265,7 +269,7 @@ struct HomeView: View { LogManager.shared.addInfoLog("Starting JIT for \(bundleID)") DispatchQueue.global(qos: .background).async { - JITEnableContext.shared().debugApp(withBundleID: bundleID, logger: { message in + JITEnableContext.shared().debugApp(withBundleID: bundleID,isLC: is_lc, logger: { message in if let message = message { // Log messages from the JIT process LogManager.shared.addInfoLog(message) diff --git a/StikJIT/Views/SettingsView.swift b/StikJIT/Views/SettingsView.swift index 035a2ea..0c75058 100644 --- a/StikJIT/Views/SettingsView.swift +++ b/StikJIT/Views/SettingsView.swift @@ -251,7 +251,7 @@ struct SettingsView: View { .foregroundColor(.primary) .padding(.bottom, 4) - Toggle("Enable in-LiveContainer JIT", isOn: $is_lc) + Toggle("Enable In-LiveContainer JIT", isOn: $is_lc) .padding() HomeView(is_lc: $is_lc) diff --git a/StikJIT/idevice/JITEnableContext.h b/StikJIT/idevice/JITEnableContext.h index 85df85a..4e0fd3a 100644 --- a/StikJIT/idevice/JITEnableContext.h +++ b/StikJIT/idevice/JITEnableContext.h @@ -15,6 +15,6 @@ typedef void (^LogFunc)(NSString *message); + (instancetype)shared; - (IdevicePairingFile*)getPairingFileWithError:(NSError**)error; - (void)startHeartbeatWithCompletionHandler:(HeartbeatCompletionHandler)completionHandler logger:(LogFunc)logger; -- (void)debugAppWithBundleID:(NSString*)bundleID logger:(LogFunc)logger; +- (void)debugAppWithBundleID:(NSString*)bundleID isLC:(BOOL)isLC logger:(LogFunc)logger; - (NSDictionary*)getAppListWithError:(NSError**)error; @end diff --git a/StikJIT/idevice/JITEnableContext.m b/StikJIT/idevice/JITEnableContext.m index 580b2ce..4777402 100644 --- a/StikJIT/idevice/JITEnableContext.m +++ b/StikJIT/idevice/JITEnableContext.m @@ -96,7 +96,7 @@ JITEnableContext* sharedJITContext = nil; completionHandler(result,[NSString stringWithCString:message encoding:NSASCIIStringEncoding]); }, [self createCLogger:logger]); } -- (void)debugAppWithBundleID:(NSString*)bundleID logger:(LogFunc)logger isLC:(BOOL)isLC { +- (void)debugAppWithBundleID:(NSString*)bundleID isLC:(BOOL)isLC logger:(LogFunc)logger { if(!provider) { if(logger) { logger(@"Provider not initialized!");