Skip to content

Commit 30618f4

Browse files
committed
Feat: auto launch stikjit url scheme
1 parent a9586da commit 30618f4

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

Natives/LauncherMenuViewController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ - (void)viewDidLoad {
140140
if (isJITEnabled(false)) {
141141
[self displayProgress:localize(@"login.jit.enabled", nil)];
142142
[self displayProgress:nil];
143+
} else if (@available(iOS 17.0, *)) {
144+
// enabling JIT for 17.0+ is done when we actually launch the game
143145
} else {
144146
[self enableJITWithAltKit];
145147
}

Natives/LauncherNavigationController.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ - (void)receiveNotification:(NSNotification *)notification {
415415
- (void)invokeAfterJITEnabled:(void(^)(void))handler {
416416
localVersionList = remoteVersionList = nil;
417417
BOOL hasTrollStoreJIT = getEntitlementValue(@"jb.pmap_cs_custom_trust");
418+
BOOL isLiveContainer = getenv("LC_HOME_PATH") != NULL;
418419

419420
if (isJITEnabled(false)) {
420421
[ALTServerManager.sharedManager stopDiscovering];
@@ -428,6 +429,16 @@ - (void)invokeAfterJITEnabled:(void(^)(void))handler {
428429
NSLog(@"Debug option skipped waiting for JIT. Java might not work.");
429430
handler();
430431
return;
432+
} else if (@available(iOS 17.4, *)) {
433+
NSString *scriptDataString = @"";
434+
if(DeviceRequiresTXMWorkaround()) {
435+
NSData *scriptData = [NSData dataWithContentsOfFile:[NSBundle.mainBundle.bundlePath stringByAppendingPathComponent:@"UniversalJIT26.js"]];
436+
scriptDataString = [@"&script-data=" stringByAppendingString:[scriptData base64EncodedStringWithOptions:0]];
437+
}
438+
[UIApplication.sharedApplication openURL:[NSURL URLWithString:[NSString stringWithFormat:@"stikjit://enable-jit?bundle-id=%@&pid=%d%@", NSBundle.mainBundle.bundleIdentifier, getpid(), scriptDataString]] options:@{} completionHandler:nil];
439+
} else {
440+
// Assuming 16.7-17.3.1. SideStore still lacks this URL scheme at the time of writing, so it only jumps to SideStore.
441+
[UIApplication.sharedApplication openURL:[NSURL URLWithString:[NSString stringWithFormat:@"sidestore://sidejit-enable?pid=%d", getpid()]] options:@{} completionHandler:nil];
431442
}
432443

433444
self.progressText.text = localize(@"launcher.wait_jit.title", nil);

0 commit comments

Comments
 (0)