Skip to content

Commit df808e8

Browse files
committed
Fix url scheme
1 parent 9883351 commit df808e8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

LCRootViewController.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,14 @@ - (void)launchButtonTapped {
201201
return;
202202
}
203203

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

0 commit comments

Comments
 (0)