Skip to content

Commit

Permalink
Fix url scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhduytran0 committed Feb 21, 2024
1 parent 9883351 commit df808e8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion LCRootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,14 @@ - (void)launchButtonTapped {
return;
}

NSURL *sidejitURL = [NSURL URLWithString:[NSString stringWithFormat:@"apple-magnifier://enable-jit?bundle-id=%@", NSBundle.mainBundle.bundleIdentifier]];
NSString *urlScheme;
NSString *tsPath = [NSString stringWithFormat:@"%@/../_TrollStore", NSBundle.mainBundle.bundlePath];
if (!access(tsPath.UTF8String, F_OK)) {
urlScheme = @"apple-magnifier://enable-jit?bundle-id=%@";
} else {
urlScheme = @"sidestore://sidejit-enable?bid=%@";
}
NSURL *sidejitURL = [NSURL URLWithString:[NSString stringWithFormat:urlScheme, NSBundle.mainBundle.bundleIdentifier]];
if ([UIApplication.sharedApplication canOpenURL:sidejitURL]) {
[UIApplication.sharedApplication openURL:sidejitURL options:@{} completionHandler:^(BOOL b){
exit(0);
Expand Down

0 comments on commit df808e8

Please sign in to comment.