Skip ptrace if already being debugged (#395)

It seems like Jitterbug launches app with parent pid ≠ 0, which prevented app from reaching UIApplicationMain.
This commit is contained in:
Duy Tran Khanh authored and GitHub committed 2022-10-10 10:25:10 +07:00
1 parent 31fee44bf7
commit d3229575a9
1 file changed
+1 -1
+1 -1
View File
@@ -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