Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion StikJIT/JSSupport/attachDetach.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function attach() {
log("Welcome to use StikDebug's srcipting feature! Here you can use JavaScript to customize your debug experience!")
log("Welcome to use StikDebug's scripting feature! Here you can use JavaScript to customize your debug experience!")
log("This script is a demo script that attaches to the connected app and detaches from it.")

// get pid of the connected app
Expand Down
1 change: 1 addition & 0 deletions StikJIT/StikJITApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ private func registerAdvancedOptionsDefault() {
// Enable advanced options by default on iOS 19/26 and above
let enabled = os.majorVersion >= 19
UserDefaults.standard.register(defaults: ["enableAdvancedOptions": enabled])
UserDefaults.standard.register(defaults: ["enablePiP": enabled])
}

// MARK: - Welcome Sheet
Expand Down
2 changes: 1 addition & 1 deletion StikJIT/Views/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ struct HomeView: View {
}
}
.pipify(isPresented: Binding(
get: { enablePiP && isProcessing },
get: { useDefaultScript && enablePiP && isProcessing },
set: { newValue in isProcessing = newValue }
)) {
RunJSViewPiP(model: $jsModel)
Expand Down
2 changes: 1 addition & 1 deletion StikJIT/Views/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct SettingsView: View {
@AppStorage("selectedAppIcon") private var selectedAppIcon: String = "AppIcon"
@AppStorage("useDefaultScript") private var useDefaultScript = false
@AppStorage("enableAdvancedOptions") private var enableAdvancedOptions = false
@AppStorage("enablePiP") private var enablePiP = true
@AppStorage("enablePiP") private var enablePiP = false

@State private var isShowingPairingFilePicker = false
@Environment(\.colorScheme) private var colorScheme
Expand Down
15 changes: 11 additions & 4 deletions StikJIT/idevice/heartbeat.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

void startHeartbeat(IdevicePairingFile* pairing_file, IdeviceProviderHandle** provider, bool* isHeartbeat, HeartbeatCompletionHandlerC completion, LogFuncC logger) {

*isHeartbeat = true;
// Initialize logger
idevice_init_logger(Debug, Disabled, NULL);

Expand All @@ -28,8 +27,9 @@ void startHeartbeat(IdevicePairingFile* pairing_file, IdeviceProviderHandle** pr
addr.sin_port = htons(LOCKDOWN_PORT);
inet_pton(AF_INET, "10.7.0.2", &addr.sin_addr);

IdeviceProviderHandle* newProvider = 0;
IdeviceFfiError* err = idevice_tcp_provider_new((struct sockaddr *)&addr, pairing_file,
"ExampleProvider", provider);
"ExampleProvider", &newProvider);
if (err != NULL) {
fprintf(stderr, "Failed to create TCP provider: [%d] %s", err->code,
err->message);
Expand All @@ -41,16 +41,23 @@ void startHeartbeat(IdevicePairingFile* pairing_file, IdeviceProviderHandle** pr

// Connect to installation proxy
HeartbeatClientHandle *client = NULL;
err = heartbeat_connect(*provider, &client);
err = heartbeat_connect(newProvider, &client);
if (err != NULL) {
fprintf(stderr, "Failed to connect to installation proxy: [%d] %s",
err->code, err->message);
idevice_provider_free(*provider);
idevice_provider_free(newProvider);
idevice_error_free(err);
*isHeartbeat = false;
return;
}
if(*isHeartbeat) {
idevice_provider_free(newProvider);
return;
}

// we mark heartbeat as success and set the default provider
*isHeartbeat = true;
*provider = newProvider;

completion(0, "Heartbeat Completed");

Expand Down
5 changes: 0 additions & 5 deletions StikJIT/idevice/jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,6 @@ int debug_app(IdeviceProviderHandle* tcp_provider, const char *bundle_id, LogFun
return 1;
}
printf("Successfully launched app with PID: %llu\n", pid);

char* path = malloc(2048);
snprintf(path, 2048, "%s/Documents/debugProxy.pcap", getenv("HOME"));
adapter_pcap(adapter, path);
free(path);

printf("\n=== Setting up Debug Proxy ===\n");

Expand Down