Why does this code deadlock on ios 15 and up?


i have a jailbreak tweak that works well on ios 14 and lower. Essentially what it does is, it halts the main thread for a few seconds to get data from server then continues the main thread. This is due to the tweak requiring information before the application being injected to is actually fully loaded

This network request is pretty quick the longest it has taken id say would be 3-5 seconds maybe less.

I been trying to get this code to work on iOS 15 and up but for some reason i get a deadlock. And Apple WatchDog kills the app since it hangs for so long i dont understand why it does that.

Ive tried dispatch group as well and same issue.

%ctor {
manager = [[RMzManager alloc] init];
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
[RMzManager preSetup: ^(BOOL success) {
  DDSNDPBV();
  _dyld_register_func_for_add_image(&MOVSVWIIMTMX);
  dispatch_semaphore_signal(semaphore);
}];
});
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), NULL, &didFinishLaunching, (CFStringRef)UIApplicationDidFinishLaunchingNotification, NULL, CFNotificationSuspensionBehaviorDeliverImmediately); // DO NOT TOUCH
}

Thank you for the help

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img