From e53e16fe3a496de019cbd0262dccc5ce3435de86 Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Thu, 15 Aug 2024 14:10:11 +0700 Subject: [PATCH] Fix some apps getting stuck on black screen Based on the backtrace of a hanging log, -[UIScreen mainScreen] would be called at some point in the constructor, causing a deadlock. This commit fixes it by pre-initializing UIScreen. Apollo and Provenance are now working again. Fixes #14 and #120 --- main.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.m b/main.m index 67dfd66..2a4a372 100644 --- a/main.m +++ b/main.m @@ -304,6 +304,9 @@ static void exceptionHandler(NSException *exception) { } int LiveContainerMain(int argc, char *argv[]) { + // This strangely fixes some apps getting stuck on black screen + NSLog(@"Ignore this: %@", UIScreen.mainScreen); + lcUserDefaults = NSUserDefaults.standardUserDefaults; NSString *selectedApp = [lcUserDefaults stringForKey:@"selected"]; if (selectedApp) {