Skip to content

Commit

Permalink
Fix [NSUserDefaults initialize] of some apps
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhduytran0 committed Apr 19, 2024
1 parent 2a3bcc7 commit 9abef4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static void overwriteExecPath(NSString *bundlePath) {
}

// Overwrite @executable_path
const char *appExecPath = appBundle.executablePath.UTF8String;
const char *appExecPath = appBundle.executablePath.UTF8String;
*path = appExecPath;
overwriteExecPath(appBundle.bundlePath);

Expand Down Expand Up @@ -250,6 +250,8 @@ static void overwriteExecPath(NSString *bundlePath) {
*path = oldPath;
return appError;
}
// Fix dynamic properties of some apps
[NSUserDefaults performSelector:@selector(initialize)];

if (![appBundle loadAndReturnError:&error]) {
appError = error.localizedDescription;
Expand Down

0 comments on commit 9abef4f

Please sign in to comment.