diff --git a/.gitignore b/.gitignore index 9a43b93..d28f89b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ out/ .theos/ packages/ xcuserdata -.vscode \ No newline at end of file +.vscode +pwnify_compiled +Developer.ipa \ No newline at end of file diff --git a/Helper/main.m b/Helper/main.m index b81e367..76cafb5 100644 --- a/Helper/main.m +++ b/Helper/main.m @@ -13,6 +13,11 @@ #import #import +#ifdef INSTALLER_EMBEDDED +#define MAIN_NAME rootHelperMain +#else +#define MAIN_NAME main +#endif extern mach_msg_return_t SBReloadIconForIdentifier(mach_port_t machport, const char* identifier); @interface SBSHomeScreenService : NSObject @@ -1093,7 +1098,8 @@ void uninstallPersistenceHelper(void) } } -int main(int argc, char *argv[], char *envp[]) { +int MAIN_NAME(int argc, char *argv[], char *envp[]) +{ @autoreleasepool { if(argc <= 1) return -1; diff --git a/README.md b/README.md index 6285717..c23dff7 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,6 @@ It works because of a CoreTrust bug that affects iOS 14.0 - 15.4.1 (15.5b4). N/A means: NO DEVICE / VERSION COMBINATION EXISTS -None means: No way to install TrollStore currently - | Version / Device | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | | --- | --- | --- | --- | --- | --- | --- | --- | --- | | iOS 14.0 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | N/A | @@ -25,25 +23,23 @@ None means: No way to install TrollStore currently | iOS 14.4.2 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | N/A | | iOS 14.5 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | N/A | | iOS 14.5.1 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | N/A | -| iOS 14.6 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | None | N/A | -| iOS 14.7 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | None | N/A | -| iOS 14.7.1 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | None | N/A | -| iOS 14.8 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | None | N/A | -| iOS 14.8.1 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | None | None | None | N/A | +| iOS 14.6 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollInstaller2](./install_trollinstaller2) | N/A | +| iOS 14.7 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollInstaller2](./install_trollinstaller2) | N/A | +| iOS 14.7.1 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollInstaller2](./install_trollinstaller2) | N/A | +| iOS 14.8 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollInstaller2](./install_trollinstaller2) | N/A | +| iOS 14.8.1 | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollHelper](./install_trollhelper.md) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | N/A | | iOS 15.0 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | | iOS 15.0.1 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | | iOS 15.0.2 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | | iOS 15.1 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | | iOS 15.1.1 | N/A | N/A | N/A | N/A | N/A | N/A | [TrollInstaller](./install_trollinstaller.md) | [TrollInstaller](./install_trollinstaller.md) | -| iOS 15.2 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | None | None | None | None | -| iOS 15.2.1 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | None | None | None | None | -| iOS 15.3 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | None | None | None | None | -| iOS 15.3.1 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | None | None | None | None | -| iOS 15.4 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | None | None | None | None | -| iOS 15.4.1 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | None | None | None | None | -| iOS 15.5 Beta 1 - Beta 4 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | None | None | None | None | - -Full 14.0 - 15.5b4 installation support will come when the Fugu15 installation method is public. +| iOS 15.2 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | +| iOS 15.2.1 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | +| iOS 15.3 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | +| iOS 15.3.1 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | +| iOS 15.4 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | +| iOS 15.4.1 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | +| iOS 15.5 Beta 1 - Beta 4 | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [SSH Ramdisk](./install_with_sshrd.md) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | [TrollInstaller2](./install_trollinstaller2) | # Updating TrollStore diff --git a/Store/TSListControllerShared.h b/Store/TSListControllerShared.h index 59b65e3..1899fda 100644 --- a/Store/TSListControllerShared.h +++ b/Store/TSListControllerShared.h @@ -13,6 +13,7 @@ - (void)startActivity:(NSString*)activity; - (void)stopActivityWithCompletion:(void (^)(void))completion; +- (void)downloadTrollStoreAndDo:(void (^)(NSString* localTrollStoreTarPath))doHandler; - (void)installTrollStorePressed; - (void)updateTrollStorePressed; - (void)rebuildIconCachePressed; diff --git a/Store/TSListControllerShared.m b/Store/TSListControllerShared.m index 9bea3b0..8455cbf 100644 --- a/Store/TSListControllerShared.m +++ b/Store/TSListControllerShared.m @@ -53,20 +53,11 @@ }]; } -- (void)_updateOrInstallTrollStore:(BOOL)update +- (void)downloadTrollStoreAndDo:(void (^)(NSString* localTrollStoreTarPath))doHandler { NSURL* trollStoreURL = [NSURL URLWithString:@"https://github.com/opa334/TrollStore/releases/latest/download/TrollStore.tar"]; NSURLRequest* trollStoreRequest = [NSURLRequest requestWithURL:trollStoreURL]; - if(update) - { - [self startActivity:@"Updating TrollStore"]; - } - else - { - [self startActivity:@"Installing TrollStore"]; - } - NSURLSessionDownloadTask* downloadTask = [NSURLSession.sharedSession downloadTaskWithRequest:trollStoreRequest completionHandler:^(NSURL *location, NSURLResponse *response, NSError *error) { if(error) @@ -88,27 +79,36 @@ NSString* tarTmpPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"TrollStore.tar"]; [[NSFileManager defaultManager] copyItemAtPath:location.path toPath:tarTmpPath error:nil]; - int ret = spawnRoot(helperPath(), @[@"install-trollstore", tarTmpPath], nil, nil); - [[NSFileManager defaultManager] removeItemAtPath:tarTmpPath error:nil]; + doHandler(tarTmpPath); + } + }]; - if(ret == 0) + [downloadTask resume]; +} + +- (void)_updateOrInstallTrollStore:(BOOL)update +{ + if(update) + { + [self startActivity:@"Updating TrollStore"]; + } + else + { + [self startActivity:@"Installing TrollStore"]; + } + + [self downloadTrollStoreAndDo:^(NSString* tmpTarPath) + { + int ret = spawnRoot(helperPath(), @[@"install-trollstore", tmpTarPath], nil, nil); + [[NSFileManager defaultManager] removeItemAtPath:tmpTarPath error:nil]; + + if(ret == 0) + { + respring(); + + if([self isTrollStore]) { - respring(); - - if([self isTrollStore]) - { - exit(0); - } - else - { - dispatch_async(dispatch_get_main_queue(), ^ - { - [self stopActivityWithCompletion:^ - { - [self reloadSpecifiers]; - }]; - }); - } + exit(0); } else { @@ -116,17 +116,25 @@ { [self stopActivityWithCompletion:^ { - UIAlertController* errorAlert = [UIAlertController alertControllerWithTitle:@"Error" message:[NSString stringWithFormat:@"Error installing TrollStore: trollstorehelper returned %d", ret] preferredStyle:UIAlertControllerStyleAlert]; - UIAlertAction* closeAction = [UIAlertAction actionWithTitle:@"Close" style:UIAlertActionStyleDefault handler:nil]; - [errorAlert addAction:closeAction]; - [self presentViewController:errorAlert animated:YES completion:nil]; + [self reloadSpecifiers]; }]; }); } } + else + { + dispatch_async(dispatch_get_main_queue(), ^ + { + [self stopActivityWithCompletion:^ + { + UIAlertController* errorAlert = [UIAlertController alertControllerWithTitle:@"Error" message:[NSString stringWithFormat:@"Error installing TrollStore: trollstorehelper returned %d", ret] preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction* closeAction = [UIAlertAction actionWithTitle:@"Close" style:UIAlertActionStyleDefault handler:nil]; + [errorAlert addAction:closeAction]; + [self presentViewController:errorAlert animated:YES completion:nil]; + }]; + }); + } }]; - - [downloadTask resume]; } - (void)installTrollStorePressed diff --git a/TrollInstaller2/.gitignore b/TrollInstaller2/.gitignore new file mode 100644 index 0000000..faf8687 --- /dev/null +++ b/TrollInstaller2/.gitignore @@ -0,0 +1,3 @@ +.theos/ +packages/ +.DS_Store diff --git a/TrollInstaller2/Makefile b/TrollInstaller2/Makefile new file mode 100644 index 0000000..c6296d0 --- /dev/null +++ b/TrollInstaller2/Makefile @@ -0,0 +1,17 @@ +TARGET := iphone:clang:14.5:14.0 +INSTALL_TARGET_PROCESSES = TrollInstaller2 +ARCHS = arm64e + +include $(THEOS)/makefiles/common.mk + +APPLICATION_NAME = TrollInstaller2 + +TrollInstaller2_FILES = main.m $(wildcard *.m) $(wildcard ../Helper/*.m) ../Store/TSListControllerShared.m ../Store/TSUtil.m +TrollInstaller2_FRAMEWORKS = UIKit CoreGraphics +TrollInstaller2_PRIVATE_FRAMEWORKS = Preferences +TrollInstaller2_LIBRARIES = archive +TrollInstaller2_CFLAGS = -fobjc-arc -DINSTALLER_EMBEDDED=1 +TrollInstaller2_PRIVATE_FRAMEWORKS = SpringBoardServices BackBoardServices +TrollInstaller2_CODESIGN_FLAGS = -Sentitlements.plist + +include $(THEOS_MAKE_PATH)/application.mk diff --git a/TrollInstaller2/Resources/AppIcon29x29.png b/TrollInstaller2/Resources/AppIcon29x29.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon29x29@2x.png b/TrollInstaller2/Resources/AppIcon29x29@2x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon29x29@3x.png b/TrollInstaller2/Resources/AppIcon29x29@3x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon40x40.png b/TrollInstaller2/Resources/AppIcon40x40.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon40x40@2x.png b/TrollInstaller2/Resources/AppIcon40x40@2x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon40x40@3x.png b/TrollInstaller2/Resources/AppIcon40x40@3x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon50x50.png b/TrollInstaller2/Resources/AppIcon50x50.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon50x50@2x.png b/TrollInstaller2/Resources/AppIcon50x50@2x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon57x57.png b/TrollInstaller2/Resources/AppIcon57x57.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon57x57@2x.png b/TrollInstaller2/Resources/AppIcon57x57@2x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon57x57@3x.png b/TrollInstaller2/Resources/AppIcon57x57@3x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon60x60.png b/TrollInstaller2/Resources/AppIcon60x60.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon60x60@2x.png b/TrollInstaller2/Resources/AppIcon60x60@2x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon60x60@3x.png b/TrollInstaller2/Resources/AppIcon60x60@3x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon72x72.png b/TrollInstaller2/Resources/AppIcon72x72.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon72x72@2x.png b/TrollInstaller2/Resources/AppIcon72x72@2x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon76x76.png b/TrollInstaller2/Resources/AppIcon76x76.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/AppIcon76x76@2x.png b/TrollInstaller2/Resources/AppIcon76x76@2x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/Info.plist b/TrollInstaller2/Resources/Info.plist new file mode 100644 index 0000000..3e93310 --- /dev/null +++ b/TrollInstaller2/Resources/Info.plist @@ -0,0 +1,154 @@ + + + + + CFBundleExecutable + TrollInstaller2 + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcon29x29 + AppIcon40x40 + AppIcon57x57 + AppIcon60x60 + + UIPrerenderedIcon + + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcon29x29 + AppIcon40x40 + AppIcon57x57 + AppIcon60x60 + AppIcon50x50 + AppIcon72x72 + AppIcon76x76 + + UIPrerenderedIcon + + + + CFBundleIdentifier + com.opa334.trollinstaller2 + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + armv7 + + UILaunchImageFile + LaunchImage + UILaunchImages + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + LaunchImage + UILaunchImageOrientation + Portrait + UILaunchImageSize + {320, 480} + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + LaunchImage-700-568h + UILaunchImageOrientation + Portrait + UILaunchImageSize + {320, 568} + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + LaunchImage-Portrait + UILaunchImageOrientation + Portrait + UILaunchImageSize + {768, 1024} + + + UILaunchImageMinimumOSVersion + 7.0 + UILaunchImageName + LaunchImage-Landscape + UILaunchImageOrientation + Landscape + UILaunchImageSize + {768, 1024} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + LaunchImage-800-667h + UILaunchImageOrientation + Portrait + UILaunchImageSize + {375, 667} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + LaunchImage-800-Portrait-736h + UILaunchImageOrientation + Portrait + UILaunchImageSize + {414, 736} + + + UILaunchImageMinimumOSVersion + 8.0 + UILaunchImageName + LaunchImage-800-Landscape-736h + UILaunchImageOrientation + Landscape + UILaunchImageSize + {414, 736} + + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/TrollInstaller2/Resources/LaunchImage-700-568h@2x.png b/TrollInstaller2/Resources/LaunchImage-700-568h@2x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/LaunchImage-700-Landscape@2x~ipad.png b/TrollInstaller2/Resources/LaunchImage-700-Landscape@2x~ipad.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/LaunchImage-700-Landscape~ipad.png b/TrollInstaller2/Resources/LaunchImage-700-Landscape~ipad.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/LaunchImage-700-Portrait@2x~ipad.png b/TrollInstaller2/Resources/LaunchImage-700-Portrait@2x~ipad.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/LaunchImage-700-Portrait~ipad.png b/TrollInstaller2/Resources/LaunchImage-700-Portrait~ipad.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/LaunchImage-800-667h@2x.png b/TrollInstaller2/Resources/LaunchImage-800-667h@2x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/LaunchImage-800-Landscape-736h@3x.png b/TrollInstaller2/Resources/LaunchImage-800-Landscape-736h@3x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/LaunchImage-800-Portrait-736h@3x.png b/TrollInstaller2/Resources/LaunchImage-800-Portrait-736h@3x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/LaunchImage.png b/TrollInstaller2/Resources/LaunchImage.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/Resources/LaunchImage@2x.png b/TrollInstaller2/Resources/LaunchImage@2x.png new file mode 100644 index 0000000..e69de29 diff --git a/TrollInstaller2/TSI2AppDelegate.h b/TrollInstaller2/TSI2AppDelegate.h new file mode 100644 index 0000000..15625a6 --- /dev/null +++ b/TrollInstaller2/TSI2AppDelegate.h @@ -0,0 +1,6 @@ + +#import + +@interface TSI2AppDelegate : UIResponder + +@end \ No newline at end of file diff --git a/TrollInstaller2/TSI2AppDelegate.m b/TrollInstaller2/TSI2AppDelegate.m new file mode 100644 index 0000000..6da70a0 --- /dev/null +++ b/TrollInstaller2/TSI2AppDelegate.m @@ -0,0 +1,22 @@ +#import "TSI2AppDelegate.h" + +@implementation TSI2AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + return YES; +} + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + +@end \ No newline at end of file diff --git a/TrollInstaller2/TSI2RootViewController.h b/TrollInstaller2/TSI2RootViewController.h new file mode 100644 index 0000000..2370c78 --- /dev/null +++ b/TrollInstaller2/TSI2RootViewController.h @@ -0,0 +1,7 @@ +#import "../Store/TSListControllerShared.h" + +@interface TSI2RootViewController : TSListControllerShared +{ + NSString* _newerVersion; +} +@end diff --git a/TrollInstaller2/TSI2RootViewController.m b/TrollInstaller2/TSI2RootViewController.m new file mode 100644 index 0000000..1aa8cef --- /dev/null +++ b/TrollInstaller2/TSI2RootViewController.m @@ -0,0 +1,96 @@ +#import "TSI2RootViewController.h" +#import "../Helper/Shared.h" +#import "../Store/TSUtil.h" + +@implementation TSI2RootViewController + +- (NSMutableArray*)specifiers +{ + if(!_specifiers) + { + _specifiers = [NSMutableArray new]; + + BOOL isInstalled = trollStoreAppPath(); + + PSSpecifier* utilitiesGroupSpecifier = [PSSpecifier emptyGroupSpecifier]; + [_specifiers addObject:utilitiesGroupSpecifier]; + [utilitiesGroupSpecifier setProperty:@"Based on the Fugu15 install method\nMassive shoutouts to @LinusHenze\n\n© 2022 Lars Fröder (opa334)" forKey:@"footerText"]; + + if(isInstalled) + { + PSSpecifier* alreadyInstalledSpecifier = [PSSpecifier preferenceSpecifierNamed:@"TrollStore already installed" + target:self + set:nil + get:nil + detail:nil + cell:PSStaticTextCell + edit:nil]; + alreadyInstalledSpecifier.identifier = @"alreadyInstalled"; + [alreadyInstalledSpecifier setProperty:@YES forKey:@"enabled"]; + [_specifiers addObject:alreadyInstalledSpecifier]; + } + else + { + PSSpecifier* installTrollStoreSpecifier = [PSSpecifier preferenceSpecifierNamed:@"Install TrollStore" + target:self + set:nil + get:nil + detail:nil + cell:PSButtonCell + edit:nil]; + installTrollStoreSpecifier.identifier = @"installTrollStore"; + [installTrollStoreSpecifier setProperty:@YES forKey:@"enabled"]; + installTrollStoreSpecifier.buttonAction = @selector(installTrollStorePressed); + [_specifiers addObject:installTrollStoreSpecifier]; + } + } + + [(UINavigationItem *)self.navigationItem setTitle:@"TrollStore Installer 2"]; + return _specifiers; +} + +extern NSString* safe_getExecutablePath(); +- (void)installTrollStorePressed +{ + [self startActivity:@"Installing TrollStore"]; + + [self downloadTrollStoreAndDo:^(NSString* tmpTarPath) + { + int ret = spawnRoot(safe_getExecutablePath(), @[@"install-trollstore", tmpTarPath], nil, nil); + [[NSFileManager defaultManager] removeItemAtPath:tmpTarPath error:nil]; + if(ret == 0) + { + respring(); + + if([self isTrollStore]) + { + exit(0); + } + else + { + dispatch_async(dispatch_get_main_queue(), ^ + { + [self stopActivityWithCompletion:^ + { + [self reloadSpecifiers]; + }]; + }); + } + } + else + { + dispatch_async(dispatch_get_main_queue(), ^ + { + [self stopActivityWithCompletion:^ + { + UIAlertController* errorAlert = [UIAlertController alertControllerWithTitle:@"Error" message:[NSString stringWithFormat:@"Error installing TrollStore: trollstorehelper returned %d", ret] preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction* closeAction = [UIAlertAction actionWithTitle:@"Close" style:UIAlertActionStyleDefault handler:nil]; + [errorAlert addAction:closeAction]; + [self presentViewController:errorAlert animated:YES completion:nil]; + }]; + }); + } + }]; +} + +@end diff --git a/TrollInstaller2/TSI2SceneDelegate.h b/TrollInstaller2/TSI2SceneDelegate.h new file mode 100644 index 0000000..6e28497 --- /dev/null +++ b/TrollInstaller2/TSI2SceneDelegate.h @@ -0,0 +1,6 @@ +#import + +@interface TSI2SceneDelegate : UIResponder +@property (strong, nonatomic) UIWindow * window; +@property (nonatomic, strong) UINavigationController *rootViewController; +@end \ No newline at end of file diff --git a/TrollInstaller2/TSI2SceneDelegate.m b/TrollInstaller2/TSI2SceneDelegate.m new file mode 100644 index 0000000..541beb7 --- /dev/null +++ b/TrollInstaller2/TSI2SceneDelegate.m @@ -0,0 +1,55 @@ +#import "TSI2SceneDelegate.h" +#import "TSI2RootViewController.h" + +@implementation TSI2SceneDelegate + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + + NSLog(@"scene:%@ willConnectToSession:%@ options:%@", scene, session, connectionOptions); + UIWindowScene* windowScene = (UIWindowScene*)scene; + _window = [[UIWindow alloc] initWithWindowScene:windowScene]; + _rootViewController = [[UINavigationController alloc] initWithRootViewController:[[TSI2RootViewController alloc] init]]; + _window.rootViewController = _rootViewController; + [_window makeKeyAndVisible]; +} + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). +} + + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + +- (void)scene:(UIScene *)scene openURLContexts:(NSSet *)URLContexts +{ +} + +@end diff --git a/TrollInstaller2/control b/TrollInstaller2/control new file mode 100644 index 0000000..d9463c5 --- /dev/null +++ b/TrollInstaller2/control @@ -0,0 +1,8 @@ +Package: com.opa334.trollinstaller2 +Name: TrollInstaller2 +Version: 0.0.1 +Architecture: iphoneos-arm +Description: An awesome application! +Maintainer: opa334 +Author: opa334 +Section: Utilities diff --git a/TrollInstaller2/entitlements.plist b/TrollInstaller2/entitlements.plist new file mode 100644 index 0000000..68dc3fe --- /dev/null +++ b/TrollInstaller2/entitlements.plist @@ -0,0 +1,35 @@ + + + + platform-application + + com.apple.private.security.no-sandbox + + com.apple.private.persona-mgmt + + com.apple.security.exception.files.absolute-path.read-write + + / + + com.apple.private.security.container-manager + + com.apple.private.coreservices.canmaplsdatabase + + com.apple.lsapplicationworkspace.rebuildappdatabases + + com.apple.private.security.storage.AppBundles + + com.apple.private.MobileContainerManager.allowed + + com.apple.private.MobileInstallationHelperService.InstallDaemonOpsEnabled + + com.apple.private.MobileInstallationHelperService.allowed + + com.apple.private.uninstall.deletion + + com.apple.backboardd.launchapplications + + com.apple.multitasking.termination + + + diff --git a/TrollInstaller2/main.m b/TrollInstaller2/main.m new file mode 100644 index 0000000..5557169 --- /dev/null +++ b/TrollInstaller2/main.m @@ -0,0 +1,28 @@ +#import +#import "TSI2AppDelegate.h" +#import "TSI2SceneDelegate.h" +#import + +extern int rootHelperMain(int argc, char *argv[], char *envp[]); + +void classFixup(void) +{ + Class newClass = objc_allocateClassPair([TSI2SceneDelegate class], "WWDC.SceneDelegate", 0); + objc_registerClassPair(newClass); +} + +int main(int argc, char *argv[], char *envp[]) { + @autoreleasepool { + if(getuid() == 0) + { + // I got this idea while taking a shit + // Don't judge + return rootHelperMain(argc, argv, envp); + } + else + { + classFixup(); + return UIApplicationMain(argc, argv, nil, NSStringFromClass(TSI2AppDelegate.class)); + } + } +} diff --git a/_compile/build_full.sh b/_compile/build_full.sh index 5d3c66f..9025dad 100755 --- a/_compile/build_full.sh +++ b/_compile/build_full.sh @@ -50,7 +50,7 @@ rm -rf ./TrollStore.app cd - if [[ $1 == "installer" ]]; then - # Step five: compile installer + # Step five: compile TrollInstaller xcodebuild -project ../Installer/TrollInstaller/TrollInstaller.xcodeproj -scheme TrollInstaller -destination generic/platform=iOS -archivePath ./out/Installer.xcarchive archive if [[ -f "./out/Installer.xcarchive/Products/Applications/TrollInstaller.app/embedded.mobileprovision" ]]; then @@ -65,4 +65,7 @@ if [[ $1 == "installer" ]]; then cd - rm -rf ./out/Payload rm -rf ./out/Installer.xcarchive + + # Step six: compile TrollInstaller 2 + ./build_trollinstaller2.sh fi \ No newline at end of file diff --git a/_compile/build_trollinstaller2.sh b/_compile/build_trollinstaller2.sh new file mode 100755 index 0000000..197a3a5 --- /dev/null +++ b/_compile/build_trollinstaller2.sh @@ -0,0 +1,20 @@ +cd ../TrollInstaller2 +make clean +make package +cd - + +lipo -thin arm64e ../TrollInstaller2/.theos/obj/debug/TrollInstaller2.app/TrollInstaller2 -output ./out/pwn_arm64e +ldid -S -M -Kcert.p12 ./out/pwn_arm64e + +mkdir ./out/devpwn +unzip target/Developer.ipa -d ./out/devpwn + +./pwnify_compiled ./out/devpwn/Payload/Developer.app/Developer ./out/pwn_arm64e +rm ./out/pwn_arm64e + +cd ./out/devpwn +zip -mvr devpwn.ipa * +cd - + +cp ./out/devpwn/devpwn.ipa ./out/DeveloperInstaller.ipa +rm -rf ./out/devpwn \ No newline at end of file diff --git a/install_trollinstaller2.md b/install_trollinstaller2.md new file mode 100644 index 0000000..9986200 --- /dev/null +++ b/install_trollinstaller2.md @@ -0,0 +1,23 @@ +# Installation through TrollInstaller 2 + +**Supported devices:** A12-A15, 14.0 - 15.4.1 (15.5b4) + +## Compiling pwned IPA (currently requires a Mac) (Needs THEOS and 14.5 sdk installed) + +1. Get a stock "Apple Developer" IPA (this app: https://apps.apple.com/de/app/apple-developer/id640199958 (sorry german link but you get the idea)), you can do this using Apple Configurator (install it twice to your device and when it gives you the already exists error, copy the IPA from `~/Library/Group\ Containers/.group.com.apple.configurator/Library/Caches/Assets/TemporaryItems/MobileApps` to somewhere else and then cancel the installation). + +2. Put it into _compile/target/Developer.ipa + +3. Grab pwnify_compiled from Fugu14 repo (https://github.com/LinusHenze/Fugu14/blob/master/tools/pwnify_compiled), sign it using codesign (`codesign -s - `) and put it at _compile/pwnify_compiled + +4. Make sure you have Procursus ldid installed and added to your path! (https://github.com/ProcursusTeam/ldid) + +5. cd into _compile and run `./build_trollinstaller2.sh` (`chmod +x ./build_trollinstaller2.sh` if you get a permission error) + +6. Wait a bit, when done, there will be a `DeveloperInstaller.ipa` in _compile/out + +# Using compiled IPA (does not neccessarily require a Mac if you obtained the IPA from non orthodox ways) + +7. You can install that to a device using e.g. ideviceinstaller (other methods may also work, but make sure you don't use a signing cert, you can also use an enterprise plist or something to install it via Safari as shown in Fugu15 demo, something like iFunBox may also work) + +8. After installation, you can use the "Developer" app on your device to install TrollStore