From d3229575a9b6077be63a2a47c4b0169bbac45ca4 Mon Sep 17 00:00:00 2001 From: Duy Tran Khanh <40482367+khanhduytran0@users.noreply.github.com> Date: Mon, 10 Oct 2022 10:25:10 +0700 Subject: [PATCH] Skip ptrace if already being debugged (#395) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems like Jitterbug launches app with parent pid ≠ 0, which prevented app from reaching UIApplicationMain. --- Natives/main.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Natives/main.m b/Natives/main.m index c29ffa9e..7657e8ed 100644 --- a/Natives/main.m +++ b/Natives/main.m @@ -272,7 +272,7 @@ void init_setupResolvConf() { } int main(int argc, char * argv[]) { - if (getppid() != 1) { + if (!isJITEnabled() && getppid() != 1) { NSLog(@"parent pid is not launchd, calling ptrace(PT_TRACE_ME)"); // Child process can call to PT_TRACE_ME // then both parent and child processes get CS_DEBUGGED