From 0aacb0d2258642d0695ed9fff264f04a893afbb0 Mon Sep 17 00:00:00 2001 From: Huge_Black Date: Wed, 6 Nov 2024 12:40:58 +0800 Subject: [PATCH] may fix [BUG] LiveContainer broken on iOS 18.2 beta 1 #195 --- LCSharedUtils.m | 2 +- README.md | 2 +- TweakLoader/UIKit+GuestHooks.m | 2 +- control | 2 +- main.m | 5 ++++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/LCSharedUtils.m b/LCSharedUtils.m index f670d0f..c098976 100644 --- a/LCSharedUtils.m +++ b/LCSharedUtils.m @@ -39,7 +39,7 @@ + (BOOL)launchToGuestApp { if (!access(tsPath.UTF8String, F_OK)) { urlScheme = @"apple-magnifier://enable-jit?bundle-id=%@"; } else if (self.certificatePassword) { - tries = 8; + tries = 2; urlScheme = [NSString stringWithFormat:@"%@://livecontainer-relaunch", lcAppUrlScheme]; } else { urlScheme = @"sidestore://sidejit-enable?bid=%@"; diff --git a/README.md b/README.md index 010cea5..40796e2 100644 --- a/README.md +++ b/README.md @@ -106,4 +106,4 @@ To install tweaks, you can use the built-in tweak manager in LiveContainer, whic - @hugeBlack for SwiftUI contribution - @Staubgeborener for automatic AltStore/SideStore source updater - @fkunn1326 for improved app hiding -- @slds1 for dynamic color frature +- @slds1 for dynamic color feature diff --git a/TweakLoader/UIKit+GuestHooks.m b/TweakLoader/UIKit+GuestHooks.m index e0d8be5..48259fc 100644 --- a/TweakLoader/UIKit+GuestHooks.m +++ b/TweakLoader/UIKit+GuestHooks.m @@ -85,7 +85,7 @@ void LCOpenWebPage(NSString* webPageUrlString, NSString* originalUrl) { NSString *message = @"lc.guestTweak.openWebPageTip".loc; UIWindow *window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"LiveContainer" message:message preferredStyle:UIAlertControllerStyleAlert]; - UIAlertAction* okAction = [UIAlertAction actionWithTitle:@"lc.common.ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { + UIAlertAction* okAction = [UIAlertAction actionWithTitle:@"lc.common.ok".loc style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [NSClassFromString(@"LCSharedUtils") setWebPageUrlForNextLaunch:webPageUrlString]; [NSClassFromString(@"LCSharedUtils") launchToGuestApp]; }]; diff --git a/control b/control index 1ce766b..846835f 100644 --- a/control +++ b/control @@ -1,6 +1,6 @@ Package: com.kdt.livecontainer Name: livecontainer -Version: 2.1.2 +Version: 3.0.0 Architecture: iphoneos-arm Description: Run iOS app without actually installing it! Maintainer: khanhduytran0 diff --git a/main.m b/main.m index 3256c4f..30743ec 100644 --- a/main.m +++ b/main.m @@ -157,7 +157,10 @@ static void overwriteExecPath(NSString *bundlePath) { char currPath[PATH_MAX]; uint32_t len = PATH_MAX; _NSGetExecutablePath(currPath, &len); - if (strncmp(currPath, newPath, newLen)) { + // trying to overrite config.process.mainExecutablePath will result in app crash and confuse dylb in 18.2+, so we skip it for now + if(@available(iOS 18.2, *)) { + + } else if (strncmp(currPath, newPath, newLen)) { struct sigaction sa, saOld; sa.sa_sigaction = overwriteExecPath_handler; sa.sa_flags = SA_SIGINFO;