├── .github └── workflows │ └── build.yml ├── .gitignore ├── Makefile ├── README.md ├── entitlements.plist ├── palera1nHelper ├── TrollStoreCock │ ├── CoreServices.h │ ├── TSUtil.h │ ├── TSUtil.m │ ├── uicache.h │ ├── uicache.m │ └── version.h ├── main.swift └── palera1nHelper-Bridging-Header.h ├── palera1nLoader.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── swiftpm │ │ │ └── Package.resolved │ └── xcuserdata │ │ ├── llsc12.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ ├── mineek.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── nebula.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── llsc12.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ └── xcschememanagement.plist │ ├── mineek.xcuserdatad │ └── xcschemes │ │ └── xcschememanagement.plist │ └── nebula.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist └── palera1nLoader ├── Assets.xcassets ├── AccentColor.colorset │ └── Contents.json ├── AppIcon.appiconset │ └── Contents.json ├── CellBackground.colorset │ └── Contents.json ├── Contents.json └── palera1n-white.imageset │ ├── Contents.json │ └── palera1n-white.png ├── BridgingHeader.h ├── CommandRunner.swift ├── ContentView.swift ├── Info.plist ├── SysInfo.swift ├── Utilities.swift ├── palera1nLoader.entitlements └── palera1nLoaderApp.swift /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Run Makefile 2 | 3 | on: 4 | push: 5 | 6 | pull_request: 7 | 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | runs-on: macos-latest 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v3 16 | 17 | - name: Install dependencies 18 | run: brew install ldid 19 | 20 | - name: Compile 21 | run: make 22 | 23 | - name: Upload artifact 24 | uses: actions/upload-artifact@v2 25 | with: 26 | name: bakera1n 27 | path: packages/bakera1n.ipa 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Payload 2 | .DS_Store 3 | packages 4 | palera1nLoader/Required/*.deb 5 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | TARGET_CODESIGN = $(shell command -v ldid) 2 | 3 | P1TMP = $(TMPDIR)/palera1nloader 4 | P1_REQUIRED = palera1nLoader/Required 5 | P1_STAGE_DIR = $(P1TMP)/stage 6 | P1_APP_DIR = $(P1TMP)/Build/Products/Release-iphoneos/palera1nLoader.app 7 | P1_HELPER_PATH = $(P1TMP)/Build/Products/Release-iphoneos/palera1nHelper 8 | 9 | .PHONY: package 10 | 11 | package: 12 | # Deps 13 | @rm -rf $(P1_REQUIRED)/*.deb 14 | 15 | curl -sL https://static.palera.in/libswift.deb -o $(P1_REQUIRED)/libswift.deb 16 | curl -sL https://static.palera.in/substitute.deb -o $(P1_REQUIRED)/substitute.deb 17 | curl -sL https://static.palera.in/safemode.deb -o $(P1_REQUIRED)/safemode.deb 18 | curl -sL https://static.palera.in/preferenceloader.deb -o $(P1_REQUIRED)/preferenceloader.deb 19 | curl -sL https://static.palera.in/sileo.deb -o $(P1_REQUIRED)/sileo.deb 20 | curl -sL https://apt.itsnebula.net/pool/palecursus_1.0_iphoneos-arm.deb -o $(P1_REQUIRED)/straprepo.deb 21 | 22 | # Build 23 | @set -o pipefail; \ 24 | xcodebuild -jobs $(shell sysctl -n hw.ncpu) -project 'palera1nLoader.xcodeproj' -scheme palera1nLoader -configuration Release -arch arm64 -sdk iphoneos -derivedDataPath $(P1TMP) \ 25 | CODE_SIGNING_ALLOWED=NO DSTROOT=$(P1TMP)/install ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO 26 | 27 | @set -o pipefail; \ 28 | xcodebuild -jobs $(shell sysctl -n hw.ncpu) -project 'palera1nLoader.xcodeproj' -scheme palera1nHelper -configuration Release -arch arm64 -sdk iphoneos -derivedDataPath $(P1TMP) \ 29 | CODE_SIGNING_ALLOWED=NO DSTROOT=$(P1TMP)/install ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO 30 | 31 | @rm -rf Payload 32 | @rm -rf $(P1_STAGE_DIR)/ 33 | @mkdir -p $(P1_STAGE_DIR)/Payload 34 | @mv $(P1_APP_DIR) $(P1_STAGE_DIR)/Payload/palera1nLoader.app 35 | 36 | # Package 37 | @echo $(P1TMP) 38 | @echo $(P1_STAGE_DIR) 39 | 40 | @mv $(P1_HELPER_PATH) $(P1_STAGE_DIR)/Payload/palera1nLoader.app/palera1nHelper 41 | @$(TARGET_CODESIGN) -Sentitlements.plist $(P1_STAGE_DIR)/Payload/palera1nLoader.app/ 42 | @$(TARGET_CODESIGN) -Sentitlements.plist $(P1_STAGE_DIR)/Payload/palera1nLoader.app/palera1nHelper 43 | 44 | @rm -rf $(P1_STAGE_DIR)/Payload/palera1nLoader.app/_CodeSignature 45 | 46 | @ln -sf $(P1_STAGE_DIR)/Payload Payload 47 | 48 | @rm -rf packages 49 | @mkdir -p packages 50 | 51 | @cp -r $(P1_REQUIRED)/* $(P1_STAGE_DIR)/Payload/palera1nLoader.app 52 | 53 | @zip -r9 packages/palera1n.ipa Payload 54 | @rm -rf Payload 55 | @mv packages/palera1n.ipa packages/bakera1n.ipa 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # bakera1n loader 2 | 3 | real 4 | -------------------------------------------------------------------------------- /entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.private.persona-mgmt 6 | 7 | platform-application 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | com.apple.private.security.system-application 14 | 15 | com.apple.private.skip-library-validation 16 | 17 | com.apple.security.iokit-user-client-class 18 | 19 | IOSurfaceRootUserClient 20 | AGXDeviceUserClient 21 | 22 | com.apple.security.exception.files.absolute-path.read-write 23 | 24 | / 25 | 26 | get-task-allow 27 | 28 | com.apple.AutoWake-write-access 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /palera1nHelper/TrollStoreCock/CoreServices.h: -------------------------------------------------------------------------------- 1 | extern NSString *LSInstallTypeKey; 2 | 3 | @interface LSBundleProxy 4 | @property (nonatomic,readonly) NSString * bundleIdentifier; 5 | @property (nonatomic) NSURL* dataContainerURL; 6 | @property (nonatomic,readonly) NSURL* bundleContainerURL; 7 | -(NSString*)localizedName; 8 | @end 9 | 10 | @interface LSApplicationProxy : LSBundleProxy 11 | + (instancetype)applicationProxyForIdentifier:(NSString*)identifier; 12 | + (instancetype)applicationProxyForBundleURL:(NSURL*)bundleURL; 13 | @property NSURL* bundleURL; 14 | @property NSString* bundleType; 15 | @property NSString* canonicalExecutablePath; 16 | @property (nonatomic,readonly) NSDictionary* groupContainerURLs; 17 | @property (nonatomic,readonly) NSArray* plugInKitPlugins; 18 | @property (getter=isInstalled,nonatomic,readonly) BOOL installed; 19 | @property (getter=isPlaceholder,nonatomic,readonly) BOOL placeholder; 20 | @property (getter=isRestricted,nonatomic,readonly) BOOL restricted; 21 | @property (nonatomic,readonly) NSSet* claimedURLSchemes; 22 | @property (nonatomic,readonly) NSString* applicationType; 23 | @end 24 | 25 | @interface LSApplicationWorkspace : NSObject 26 | + (instancetype)defaultWorkspace; 27 | - (BOOL)registerApplicationDictionary:(NSDictionary*)dict; 28 | - (BOOL)unregisterApplication:(id)arg1; 29 | - (BOOL)_LSPrivateRebuildApplicationDatabasesForSystemApps:(BOOL)arg1 internal:(BOOL)arg2 user:(BOOL)arg3; 30 | - (BOOL)openApplicationWithBundleID:(NSString *)arg1 ; 31 | - (void)enumerateApplicationsOfType:(NSUInteger)type block:(void (^)(LSApplicationProxy*))block; 32 | - (BOOL)installApplication:(NSURL*)appPackageURL withOptions:(NSDictionary*)options error:(NSError**)error; 33 | - (BOOL)uninstallApplication:(NSString*)appId withOptions:(NSDictionary*)options; 34 | - (void)addObserver:(id)arg1; 35 | - (void)removeObserver:(id)arg1; 36 | @end 37 | 38 | @protocol LSApplicationWorkspaceObserverProtocol 39 | @optional 40 | -(void)applicationsDidInstall:(id)arg1; 41 | -(void)applicationsDidUninstall:(id)arg1; 42 | @end 43 | 44 | @interface LSEnumerator : NSEnumerator 45 | @property (nonatomic,copy) NSPredicate * predicate; 46 | + (instancetype)enumeratorForApplicationProxiesWithOptions:(NSUInteger)options; 47 | @end 48 | 49 | @interface LSPlugInKitProxy : LSBundleProxy 50 | @property (nonatomic,readonly) NSString* pluginIdentifier; 51 | @property (nonatomic,readonly) NSDictionary * pluginKitDictionary; 52 | + (instancetype)pluginKitProxyForIdentifier:(NSString*)arg1; 53 | @end 54 | 55 | @interface MCMContainer : NSObject 56 | + (id)containerWithIdentifier:(id)arg1 createIfNecessary:(BOOL)arg2 existed:(BOOL*)arg3 error:(id*)arg4; 57 | @property (nonatomic,readonly) NSURL * url; 58 | @end 59 | 60 | @interface MCMDataContainer : MCMContainer 61 | 62 | @end 63 | 64 | @interface MCMAppDataContainer : MCMDataContainer 65 | 66 | @end 67 | 68 | @interface MCMAppContainer : MCMContainer 69 | @end 70 | 71 | @interface MCMPluginKitPluginDataContainer : MCMDataContainer 72 | @end -------------------------------------------------------------------------------- /palera1nHelper/TrollStoreCock/TSUtil.h: -------------------------------------------------------------------------------- 1 | @import Foundation; 2 | #import "CoreServices.h" 3 | 4 | #define TrollStoreErrorDomain @"TrollStoreErrorDomain" 5 | 6 | extern void chineseWifiFixup(void); 7 | extern void loadMCMFramework(void); 8 | extern NSString* safe_getExecutablePath(); 9 | extern NSString* rootHelperPath(void); 10 | extern NSString* getNSStringFromFile(int fd); 11 | extern void printMultilineNSString(NSString* stringToPrint); 12 | extern int spawnRoot(NSString* path, NSArray* args, NSString** stdOut, NSString** stdErr); 13 | extern void killall(NSString* processName, BOOL softly); 14 | extern void respring(void); 15 | extern void fetchLatestTrollStoreVersion(void (^completionHandler)(NSString* latestVersion)); 16 | 17 | extern NSArray* trollStoreInstalledAppBundlePaths(); 18 | extern NSArray* trollStoreInstalledAppContainerPaths(); 19 | extern NSString* trollStorePath(); 20 | extern NSString* trollStoreAppPath(); 21 | 22 | extern BOOL isRemovableSystemApp(NSString* appId); 23 | 24 | #import 25 | 26 | @interface UIAlertController (Private) 27 | @property (setter=_setAttributedTitle:,getter=_attributedTitle,nonatomic,copy) NSAttributedString* attributedTitle; 28 | @property (setter=_setAttributedMessage:,getter=_attributedMessage,nonatomic,copy) NSAttributedString* attributedMessage; 29 | @property (nonatomic,retain) UIImage* image; 30 | @end 31 | 32 | typedef enum 33 | { 34 | PERSISTENCE_HELPER_TYPE_USER = 1 << 0, 35 | PERSISTENCE_HELPER_TYPE_SYSTEM = 1 << 1, 36 | PERSISTENCE_HELPER_TYPE_ALL = PERSISTENCE_HELPER_TYPE_USER | PERSISTENCE_HELPER_TYPE_SYSTEM 37 | } PERSISTENCE_HELPER_TYPE; 38 | 39 | extern LSApplicationProxy* findPersistenceHelperApp(PERSISTENCE_HELPER_TYPE allowedTypes); 40 | 41 | typedef struct __SecCode const *SecStaticCodeRef; 42 | 43 | typedef CF_OPTIONS(uint32_t, SecCSFlags) { 44 | kSecCSDefaultFlags = 0 45 | }; 46 | #define kSecCSRequirementInformation 1 << 2 47 | #define kSecCSSigningInformation 1 << 1 48 | 49 | OSStatus SecStaticCodeCreateWithPathAndAttributes(CFURLRef path, SecCSFlags flags, CFDictionaryRef attributes, SecStaticCodeRef *staticCode); 50 | OSStatus SecCodeCopySigningInformation(SecStaticCodeRef code, SecCSFlags flags, CFDictionaryRef *information); 51 | CFDataRef SecCertificateCopyExtensionValue(SecCertificateRef certificate, CFTypeRef extensionOID, bool *isCritical); 52 | void SecPolicySetOptionsValue(SecPolicyRef policy, CFStringRef key, CFTypeRef value); 53 | 54 | extern CFStringRef kSecCodeInfoEntitlementsDict; 55 | extern CFStringRef kSecCodeInfoCertificates; 56 | extern CFStringRef kSecPolicyAppleiPhoneApplicationSigning; 57 | extern CFStringRef kSecPolicyAppleiPhoneProfileApplicationSigning; 58 | extern CFStringRef kSecPolicyLeafMarkerOid; 59 | 60 | extern SecStaticCodeRef getStaticCodeRef(NSString *binaryPath); 61 | extern NSDictionary* dumpEntitlements(SecStaticCodeRef codeRef); 62 | extern NSDictionary* dumpEntitlementsFromBinaryAtPath(NSString *binaryPath); 63 | extern NSDictionary* dumpEntitlementsFromBinaryData(NSData* binaryData); -------------------------------------------------------------------------------- /palera1nHelper/TrollStoreCock/TSUtil.m: -------------------------------------------------------------------------------- 1 | #import "TSUtil.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | @interface PSAppDataUsagePolicyCache : NSObject 8 | + (instancetype)sharedInstance; 9 | - (void)setUsagePoliciesForBundle:(NSString*)bundleId cellular:(BOOL)cellular wifi:(BOOL)wifi; 10 | @end 11 | 12 | #define POSIX_SPAWN_PERSONA_FLAGS_OVERRIDE 1 13 | extern int posix_spawnattr_set_persona_np(const posix_spawnattr_t* __restrict, uid_t, uint32_t); 14 | extern int posix_spawnattr_set_persona_uid_np(const posix_spawnattr_t* __restrict, uid_t); 15 | extern int posix_spawnattr_set_persona_gid_np(const posix_spawnattr_t* __restrict, uid_t); 16 | 17 | void chineseWifiFixup(void) 18 | { 19 | NSBundle *bundle = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/SettingsCellular.framework"]; 20 | [bundle load]; 21 | 22 | PSAppDataUsagePolicyCache* policyCache = [NSClassFromString(@"PSAppDataUsagePolicyCache") sharedInstance]; 23 | if([policyCache respondsToSelector:@selector(setUsagePoliciesForBundle:cellular:wifi:)]) 24 | { 25 | [policyCache setUsagePoliciesForBundle:NSBundle.mainBundle.bundleIdentifier cellular:true wifi:true]; 26 | } 27 | } 28 | 29 | void loadMCMFramework(void) 30 | { 31 | static dispatch_once_t onceToken; 32 | dispatch_once (&onceToken, ^{ 33 | NSBundle* mcmBundle = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/MobileContainerManager.framework"]; 34 | [mcmBundle load]; 35 | }); 36 | } 37 | 38 | extern char*** _NSGetArgv(); 39 | NSString* safe_getExecutablePath() 40 | { 41 | char* executablePathC = **_NSGetArgv(); 42 | return [NSString stringWithUTF8String:executablePathC]; 43 | } 44 | 45 | #ifdef EMBEDDED_ROOT_HELPER 46 | NSString* rootHelperPath(void) 47 | { 48 | return safe_getExecutablePath(); 49 | } 50 | #else 51 | NSString* rootHelperPath(void) 52 | { 53 | return [[NSBundle mainBundle].bundlePath stringByAppendingPathComponent:@"trollstorehelper"]; 54 | } 55 | #endif 56 | 57 | int fd_is_valid(int fd) 58 | { 59 | return fcntl(fd, F_GETFD) != -1 || errno != EBADF; 60 | } 61 | 62 | NSString* getNSStringFromFile(int fd) 63 | { 64 | NSMutableString* ms = [NSMutableString new]; 65 | ssize_t num_read; 66 | char c; 67 | if(!fd_is_valid(fd)) return @""; 68 | while((num_read = read(fd, &c, sizeof(c)))) 69 | { 70 | [ms appendString:[NSString stringWithFormat:@"%c", c]]; 71 | if(c == '\n') break; 72 | } 73 | return ms.copy; 74 | } 75 | 76 | void printMultilineNSString(NSString* stringToPrint) 77 | { 78 | NSCharacterSet *separator = [NSCharacterSet newlineCharacterSet]; 79 | NSArray* lines = [stringToPrint componentsSeparatedByCharactersInSet:separator]; 80 | for(NSString* line in lines) 81 | { 82 | NSLog(@"%@", line); 83 | } 84 | } 85 | 86 | int spawnRoot(NSString* path, NSArray* args, NSString** stdOut, NSString** stdErr) 87 | { 88 | NSMutableArray* argsM = args.mutableCopy ?: [NSMutableArray new]; 89 | [argsM insertObject:path atIndex:0]; 90 | 91 | NSUInteger argCount = [argsM count]; 92 | char **argsC = (char **)malloc((argCount + 1) * sizeof(char*)); 93 | 94 | for (NSUInteger i = 0; i < argCount; i++) 95 | { 96 | argsC[i] = strdup([[argsM objectAtIndex:i] UTF8String]); 97 | } 98 | argsC[argCount] = NULL; 99 | 100 | posix_spawnattr_t attr; 101 | posix_spawnattr_init(&attr); 102 | 103 | posix_spawnattr_set_persona_np(&attr, 99, POSIX_SPAWN_PERSONA_FLAGS_OVERRIDE); 104 | posix_spawnattr_set_persona_uid_np(&attr, 0); 105 | posix_spawnattr_set_persona_gid_np(&attr, 0); 106 | 107 | posix_spawn_file_actions_t action; 108 | posix_spawn_file_actions_init(&action); 109 | 110 | int outErr[2]; 111 | if(stdErr) 112 | { 113 | pipe(outErr); 114 | posix_spawn_file_actions_adddup2(&action, outErr[1], STDERR_FILENO); 115 | posix_spawn_file_actions_addclose(&action, outErr[0]); 116 | } 117 | 118 | int out[2]; 119 | if(stdOut) 120 | { 121 | pipe(out); 122 | posix_spawn_file_actions_adddup2(&action, out[1], STDOUT_FILENO); 123 | posix_spawn_file_actions_addclose(&action, out[0]); 124 | } 125 | 126 | pid_t task_pid; 127 | int status = -200; 128 | int spawnError = posix_spawn(&task_pid, [path UTF8String], &action, &attr, (char* const*)argsC, NULL); 129 | posix_spawnattr_destroy(&attr); 130 | for (NSUInteger i = 0; i < argCount; i++) 131 | { 132 | free(argsC[i]); 133 | } 134 | free(argsC); 135 | 136 | if(spawnError != 0) 137 | { 138 | NSLog(@"posix_spawn error %d\n", spawnError); 139 | return spawnError; 140 | } 141 | 142 | __block volatile BOOL _isRunning = YES; 143 | NSMutableString* outString = [NSMutableString new]; 144 | NSMutableString* errString = [NSMutableString new]; 145 | dispatch_semaphore_t sema = 0; 146 | dispatch_queue_t logQueue; 147 | if(stdOut || stdErr) 148 | { 149 | logQueue = dispatch_queue_create("com.opa334.TrollStore.LogCollector", NULL); 150 | sema = dispatch_semaphore_create(0); 151 | 152 | int outPipe = out[0]; 153 | int outErrPipe = outErr[0]; 154 | 155 | __block BOOL outEnabled = (BOOL)stdOut; 156 | __block BOOL errEnabled = (BOOL)stdErr; 157 | dispatch_async(logQueue, ^ 158 | { 159 | while(_isRunning) 160 | { 161 | @autoreleasepool 162 | { 163 | if(outEnabled) 164 | { 165 | [outString appendString:getNSStringFromFile(outPipe)]; 166 | } 167 | if(errEnabled) 168 | { 169 | [errString appendString:getNSStringFromFile(outErrPipe)]; 170 | } 171 | } 172 | } 173 | dispatch_semaphore_signal(sema); 174 | }); 175 | } 176 | 177 | do 178 | { 179 | if (waitpid(task_pid, &status, 0) != -1) { 180 | NSLog(@"Child status %d", WEXITSTATUS(status)); 181 | } else 182 | { 183 | perror("waitpid"); 184 | _isRunning = NO; 185 | return -222; 186 | } 187 | } while (!WIFEXITED(status) && !WIFSIGNALED(status)); 188 | 189 | _isRunning = NO; 190 | if(stdOut || stdErr) 191 | { 192 | if(stdOut) 193 | { 194 | close(out[1]); 195 | } 196 | if(stdErr) 197 | { 198 | close(outErr[1]); 199 | } 200 | 201 | // wait for logging queue to finish 202 | dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER); 203 | 204 | if(stdOut) 205 | { 206 | *stdOut = outString.copy; 207 | } 208 | if(stdErr) 209 | { 210 | *stdErr = errString.copy; 211 | } 212 | } 213 | 214 | return WEXITSTATUS(status); 215 | } 216 | 217 | void enumerateProcessesUsingBlock(void (^enumerator)(pid_t pid, NSString* executablePath, BOOL* stop)) 218 | { 219 | static int maxArgumentSize = 0; 220 | if (maxArgumentSize == 0) { 221 | size_t size = sizeof(maxArgumentSize); 222 | if (sysctl((int[]){ CTL_KERN, KERN_ARGMAX }, 2, &maxArgumentSize, &size, NULL, 0) == -1) { 223 | perror("sysctl argument size"); 224 | maxArgumentSize = 4096; // Default 225 | } 226 | } 227 | int mib[3] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL}; 228 | struct kinfo_proc *info; 229 | size_t length; 230 | int count; 231 | 232 | if (sysctl(mib, 3, NULL, &length, NULL, 0) < 0) 233 | return; 234 | if (!(info = malloc(length))) 235 | return; 236 | if (sysctl(mib, 3, info, &length, NULL, 0) < 0) { 237 | free(info); 238 | return; 239 | } 240 | count = length / sizeof(struct kinfo_proc); 241 | for (int i = 0; i < count; i++) { 242 | @autoreleasepool { 243 | pid_t pid = info[i].kp_proc.p_pid; 244 | if (pid == 0) { 245 | continue; 246 | } 247 | size_t size = maxArgumentSize; 248 | char* buffer = (char *)malloc(length); 249 | if (sysctl((int[]){ CTL_KERN, KERN_PROCARGS2, pid }, 3, buffer, &size, NULL, 0) == 0) { 250 | NSString* executablePath = [NSString stringWithCString:(buffer+sizeof(int)) encoding:NSUTF8StringEncoding]; 251 | 252 | BOOL stop = NO; 253 | enumerator(pid, executablePath, &stop); 254 | if(stop) 255 | { 256 | free(buffer); 257 | break; 258 | } 259 | } 260 | free(buffer); 261 | } 262 | } 263 | free(info); 264 | } 265 | 266 | void killall(NSString* processName, BOOL softly) 267 | { 268 | enumerateProcessesUsingBlock(^(pid_t pid, NSString* executablePath, BOOL* stop) 269 | { 270 | if([executablePath.lastPathComponent isEqualToString:processName]) 271 | { 272 | if(softly) 273 | { 274 | kill(pid, SIGTERM); 275 | } 276 | else 277 | { 278 | kill(pid, SIGKILL); 279 | } 280 | } 281 | }); 282 | } 283 | 284 | void respring(void) 285 | { 286 | killall(@"SpringBoard", YES); 287 | exit(0); 288 | } 289 | 290 | void fetchLatestTrollStoreVersion(void (^completionHandler)(NSString* latestVersion)) 291 | { 292 | NSURL* githubLatestAPIURL = [NSURL URLWithString:@"https://api.github.com/repos/opa334/TrollStore/releases/latest"]; 293 | 294 | NSURLSessionDataTask* task = [NSURLSession.sharedSession dataTaskWithURL:githubLatestAPIURL completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) 295 | { 296 | if(!error) 297 | { 298 | if ([response isKindOfClass:[NSHTTPURLResponse class]]) 299 | { 300 | NSError *jsonError; 301 | NSDictionary *jsonResponse = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError]; 302 | 303 | if (!jsonError) 304 | { 305 | completionHandler(jsonResponse[@"tag_name"]); 306 | } 307 | } 308 | } 309 | }]; 310 | 311 | [task resume]; 312 | } 313 | 314 | NSArray* trollStoreInstalledAppContainerPaths() 315 | { 316 | NSMutableArray* appContainerPaths = [NSMutableArray new]; 317 | 318 | NSString* appContainersPath = @"/var/containers/Bundle/Application"; 319 | 320 | NSError* error; 321 | NSArray* containers = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:appContainersPath error:&error]; 322 | if(error) 323 | { 324 | NSLog(@"error getting app bundles paths %@", error); 325 | } 326 | if(!containers) return nil; 327 | 328 | for(NSString* container in containers) 329 | { 330 | NSString* containerPath = [appContainersPath stringByAppendingPathComponent:container]; 331 | BOOL isDirectory = NO; 332 | BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:containerPath isDirectory:&isDirectory]; 333 | if(exists && isDirectory) 334 | { 335 | NSString* trollStoreMark = [containerPath stringByAppendingPathComponent:@"_TrollStore"]; 336 | if([[NSFileManager defaultManager] fileExistsAtPath:trollStoreMark]) 337 | { 338 | NSString* trollStoreApp = [containerPath stringByAppendingPathComponent:@"TrollStore.app"]; 339 | if(![[NSFileManager defaultManager] fileExistsAtPath:trollStoreApp]) 340 | { 341 | [appContainerPaths addObject:containerPath]; 342 | } 343 | } 344 | } 345 | } 346 | 347 | return appContainerPaths.copy; 348 | } 349 | 350 | NSArray* trollStoreInstalledAppBundlePaths() 351 | { 352 | NSMutableArray* appPaths = [NSMutableArray new]; 353 | for(NSString* containerPath in trollStoreInstalledAppContainerPaths()) 354 | { 355 | NSArray* items = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:containerPath error:nil]; 356 | if(!items) return nil; 357 | 358 | for(NSString* item in items) 359 | { 360 | if([item.pathExtension isEqualToString:@"app"]) 361 | { 362 | [appPaths addObject:[containerPath stringByAppendingPathComponent:item]]; 363 | } 364 | } 365 | } 366 | return appPaths.copy; 367 | } 368 | 369 | NSString* trollStorePath() 370 | { 371 | loadMCMFramework(); 372 | NSError* mcmError; 373 | MCMAppContainer* appContainer = [NSClassFromString(@"MCMAppContainer") containerWithIdentifier:@"com.opa334.TrollStore" createIfNecessary:NO existed:NULL error:&mcmError]; 374 | if(!appContainer) return nil; 375 | return appContainer.url.path; 376 | } 377 | 378 | NSString* trollStoreAppPath() 379 | { 380 | return [trollStorePath() stringByAppendingPathComponent:@"TrollStore.app"]; 381 | } 382 | 383 | BOOL isRemovableSystemApp(NSString* appId) 384 | { 385 | return [[NSFileManager defaultManager] fileExistsAtPath:[@"/System/Library/AppSignatures" stringByAppendingPathComponent:appId]]; 386 | } 387 | 388 | LSApplicationProxy* findPersistenceHelperApp(PERSISTENCE_HELPER_TYPE allowedTypes) 389 | { 390 | __block LSApplicationProxy* outProxy; 391 | 392 | void (^searchBlock)(LSApplicationProxy* appProxy) = ^(LSApplicationProxy* appProxy) 393 | { 394 | if(appProxy.installed && !appProxy.restricted) 395 | { 396 | if([appProxy.bundleURL.path hasPrefix:@"/private/var/containers"]) 397 | { 398 | NSURL* trollStorePersistenceMarkURL = [appProxy.bundleURL URLByAppendingPathComponent:@".TrollStorePersistenceHelper"]; 399 | if([trollStorePersistenceMarkURL checkResourceIsReachableAndReturnError:nil]) 400 | { 401 | outProxy = appProxy; 402 | } 403 | } 404 | } 405 | }; 406 | 407 | if(allowedTypes & PERSISTENCE_HELPER_TYPE_USER) 408 | { 409 | [[LSApplicationWorkspace defaultWorkspace] enumerateApplicationsOfType:0 block:searchBlock]; 410 | } 411 | if(allowedTypes & PERSISTENCE_HELPER_TYPE_SYSTEM) 412 | { 413 | [[LSApplicationWorkspace defaultWorkspace] enumerateApplicationsOfType:1 block:searchBlock]; 414 | } 415 | 416 | return outProxy; 417 | } 418 | 419 | SecStaticCodeRef getStaticCodeRef(NSString *binaryPath) 420 | { 421 | if(binaryPath == nil) 422 | { 423 | return NULL; 424 | } 425 | 426 | CFURLRef binaryURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (__bridge CFStringRef)binaryPath, kCFURLPOSIXPathStyle, false); 427 | if(binaryURL == NULL) 428 | { 429 | NSLog(@"[getStaticCodeRef] failed to get URL to binary %@", binaryPath); 430 | return NULL; 431 | } 432 | 433 | SecStaticCodeRef codeRef = NULL; 434 | OSStatus result; 435 | 436 | result = SecStaticCodeCreateWithPathAndAttributes(binaryURL, kSecCSDefaultFlags, NULL, &codeRef); 437 | 438 | CFRelease(binaryURL); 439 | 440 | if(result != errSecSuccess) 441 | { 442 | NSLog(@"[getStaticCodeRef] failed to create static code for binary %@", binaryPath); 443 | return NULL; 444 | } 445 | 446 | return codeRef; 447 | } 448 | 449 | NSDictionary* dumpEntitlements(SecStaticCodeRef codeRef) 450 | { 451 | if(codeRef == NULL) 452 | { 453 | NSLog(@"[dumpEntitlements] attempting to dump entitlements without a StaticCodeRef"); 454 | return nil; 455 | } 456 | 457 | CFDictionaryRef signingInfo = NULL; 458 | OSStatus result; 459 | 460 | result = SecCodeCopySigningInformation(codeRef, kSecCSRequirementInformation, &signingInfo); 461 | 462 | if(result != errSecSuccess) 463 | { 464 | NSLog(@"[dumpEntitlements] failed to copy signing info from static code"); 465 | return nil; 466 | } 467 | 468 | NSDictionary *entitlementsNSDict = nil; 469 | 470 | CFDictionaryRef entitlements = CFDictionaryGetValue(signingInfo, kSecCodeInfoEntitlementsDict); 471 | if(entitlements == NULL) 472 | { 473 | NSLog(@"[dumpEntitlements] no entitlements specified"); 474 | } 475 | else if(CFGetTypeID(entitlements) != CFDictionaryGetTypeID()) 476 | { 477 | NSLog(@"[dumpEntitlements] invalid entitlements"); 478 | } 479 | else 480 | { 481 | entitlementsNSDict = (__bridge NSDictionary *)(entitlements); 482 | NSLog(@"[dumpEntitlements] dumped %@", entitlementsNSDict); 483 | } 484 | 485 | CFRelease(signingInfo); 486 | return entitlementsNSDict; 487 | } 488 | 489 | NSDictionary* dumpEntitlementsFromBinaryAtPath(NSString *binaryPath) 490 | { 491 | // This function is intended for one-shot checks. Main-event functions should retain/release their own SecStaticCodeRefs 492 | 493 | if(binaryPath == nil) 494 | { 495 | return nil; 496 | } 497 | 498 | SecStaticCodeRef codeRef = getStaticCodeRef(binaryPath); 499 | if(codeRef == NULL) 500 | { 501 | return nil; 502 | } 503 | 504 | NSDictionary *entitlements = dumpEntitlements(codeRef); 505 | CFRelease(codeRef); 506 | 507 | return entitlements; 508 | } 509 | 510 | NSDictionary* dumpEntitlementsFromBinaryData(NSData* binaryData) 511 | { 512 | NSDictionary* entitlements; 513 | NSString* tmpPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSUUID UUID].UUIDString]; 514 | NSURL* tmpURL = [NSURL fileURLWithPath:tmpPath]; 515 | if([binaryData writeToURL:tmpURL options:NSDataWritingAtomic error:nil]) 516 | { 517 | entitlements = dumpEntitlementsFromBinaryAtPath(tmpPath); 518 | [[NSFileManager defaultManager] removeItemAtURL:tmpURL error:nil]; 519 | } 520 | return entitlements; 521 | } -------------------------------------------------------------------------------- /palera1nHelper/TrollStoreCock/uicache.h: -------------------------------------------------------------------------------- 1 | @import Foundation; 2 | 3 | extern void registerPath(NSString* path, BOOL unregister, BOOL system); 4 | -------------------------------------------------------------------------------- /palera1nHelper/TrollStoreCock/uicache.m: -------------------------------------------------------------------------------- 1 | @import Foundation; 2 | @import CoreServices; 3 | #import "CoreServices.h" 4 | #import 5 | #import "dlfcn.h" 6 | #import "TSUtil.h" 7 | #import "version.h" 8 | 9 | // uicache on steroids 10 | 11 | extern NSDictionary* dumpEntitlementsFromBinaryAtPath(NSString* binaryPath); 12 | 13 | NSDictionary* constructGroupsContainersForEntitlements(NSDictionary* entitlements, BOOL systemGroups) 14 | { 15 | if(!entitlements) return nil; 16 | 17 | NSString* entitlementForGroups; 18 | NSString* mcmClass; 19 | if(systemGroups) 20 | { 21 | entitlementForGroups = @"com.apple.security.system-groups"; 22 | mcmClass = @"MCMSystemDataContainer"; 23 | } 24 | else 25 | { 26 | entitlementForGroups = @"com.apple.security.application-groups"; 27 | mcmClass = @"MCMSharedDataContainer"; 28 | } 29 | 30 | NSArray* groupIDs = entitlements[entitlementForGroups]; 31 | if(groupIDs && [groupIDs isKindOfClass:[NSArray class]]) 32 | { 33 | NSMutableDictionary* groupContainers = [NSMutableDictionary new]; 34 | 35 | for(NSString* groupID in groupIDs) 36 | { 37 | MCMContainer* container = [NSClassFromString(mcmClass) containerWithIdentifier:groupID createIfNecessary:YES existed:nil error:nil]; 38 | if(container.url) 39 | { 40 | groupContainers[groupID] = container.url.path; 41 | } 42 | } 43 | 44 | return groupContainers.copy; 45 | } 46 | 47 | return nil; 48 | } 49 | 50 | BOOL constructContainerizationForEntitlements(NSDictionary* entitlements) 51 | { 52 | NSNumber* noContainer = entitlements[@"com.apple.private.security.no-container"]; 53 | if(noContainer && [noContainer isKindOfClass:[NSNumber class]]) 54 | { 55 | if(noContainer.boolValue) 56 | { 57 | return NO; 58 | } 59 | } 60 | 61 | NSNumber* containerRequired = entitlements[@"com.apple.private.security.container-required"]; 62 | if(containerRequired && [containerRequired isKindOfClass:[NSNumber class]]) 63 | { 64 | if(!containerRequired.boolValue) 65 | { 66 | return NO; 67 | } 68 | } 69 | 70 | return YES; 71 | } 72 | 73 | NSString* constructTeamIdentifierForEntitlements(NSDictionary* entitlements) 74 | { 75 | NSString* teamIdentifier = entitlements[@"com.apple.developer.team-identifier"]; 76 | if(teamIdentifier && [teamIdentifier isKindOfClass:[NSString class]]) 77 | { 78 | return teamIdentifier; 79 | } 80 | return nil; 81 | } 82 | 83 | NSDictionary* constructEnvironmentVariablesForContainerPath(NSString* containerPath) 84 | { 85 | NSString* tmpDir = [containerPath stringByAppendingPathComponent:@"tmp"]; 86 | return @{ 87 | @"CFFIXED_USER_HOME" : containerPath, 88 | @"HOME" : containerPath, 89 | @"TMPDIR" : tmpDir 90 | }; 91 | } 92 | 93 | void registerPath(NSString* path, BOOL unregister, BOOL system) 94 | { 95 | if(!path) return; 96 | loadMCMFramework(); 97 | 98 | LSApplicationWorkspace* workspace = [LSApplicationWorkspace defaultWorkspace]; 99 | if(unregister && ![[NSFileManager defaultManager] fileExistsAtPath:path]) 100 | { 101 | LSApplicationProxy* app = [LSApplicationProxy applicationProxyForIdentifier:path]; 102 | if(app.bundleURL) 103 | { 104 | path = [app bundleURL].path; 105 | } 106 | } 107 | 108 | path = [path stringByResolvingSymlinksInPath]; 109 | 110 | NSDictionary* appInfoPlist = [NSDictionary dictionaryWithContentsOfFile:[path stringByAppendingPathComponent:@"Info.plist"]]; 111 | NSString* appBundleID = [appInfoPlist objectForKey:@"CFBundleIdentifier"]; 112 | 113 | if(appBundleID && !unregister) 114 | { 115 | MCMContainer* appContainer = [NSClassFromString(@"MCMAppDataContainer") containerWithIdentifier:appBundleID createIfNecessary:YES existed:nil error:nil]; 116 | NSString* containerPath = [appContainer url].path; 117 | 118 | NSMutableDictionary* dictToRegister = [NSMutableDictionary dictionary]; 119 | 120 | // Add entitlements 121 | 122 | NSString* appExecutablePath = [path stringByAppendingPathComponent:appInfoPlist[@"CFBundleExecutable"]]; 123 | NSDictionary* entitlements = dumpEntitlementsFromBinaryAtPath(appExecutablePath); 124 | if(entitlements) 125 | { 126 | dictToRegister[@"Entitlements"] = entitlements; 127 | } 128 | 129 | // Misc 130 | 131 | dictToRegister[@"ApplicationType"] = system ? @"System" : @"User"; 132 | dictToRegister[@"CFBundleIdentifier"] = appBundleID; 133 | dictToRegister[@"CodeInfoIdentifier"] = appBundleID; 134 | dictToRegister[@"CompatibilityState"] = @0; 135 | if(containerPath) 136 | { 137 | dictToRegister[@"Container"] = containerPath; 138 | dictToRegister[@"EnvironmentVariables"] = constructEnvironmentVariablesForContainerPath(containerPath); 139 | } 140 | dictToRegister[@"IsDeletable"] = @(![appBundleID isEqualToString:@"com.opa334.TrollStore"] && kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_15_0); 141 | dictToRegister[@"Path"] = path; 142 | dictToRegister[@"IsContainerized"] = @(constructContainerizationForEntitlements(entitlements)); 143 | dictToRegister[@"SignerOrganization"] = @"Apple Inc."; 144 | dictToRegister[@"SignatureVersion"] = @132352; 145 | dictToRegister[@"SignerIdentity"] = @"Apple iPhone OS Application Signing"; 146 | dictToRegister[@"IsAdHocSigned"] = @YES; 147 | dictToRegister[@"LSInstallType"] = @1; 148 | dictToRegister[@"HasMIDBasedSINF"] = @0; 149 | dictToRegister[@"MissingSINF"] = @0; 150 | dictToRegister[@"FamilyID"] = @0; 151 | dictToRegister[@"IsOnDemandInstallCapable"] = @0; 152 | 153 | NSString* teamIdentifier = constructTeamIdentifierForEntitlements(entitlements); 154 | if(teamIdentifier) dictToRegister[@"TeamIdentifier"] = teamIdentifier; 155 | 156 | // Add group containers 157 | 158 | NSDictionary* appGroupContainers = constructGroupsContainersForEntitlements(entitlements, NO); 159 | NSDictionary* systemGroupContainers = constructGroupsContainersForEntitlements(entitlements, YES); 160 | NSMutableDictionary* groupContainers = [NSMutableDictionary new]; 161 | [groupContainers addEntriesFromDictionary:appGroupContainers]; 162 | [groupContainers addEntriesFromDictionary:systemGroupContainers]; 163 | if(groupContainers.count) 164 | { 165 | if(appGroupContainers.count) 166 | { 167 | dictToRegister[@"HasAppGroupContainers"] = @YES; 168 | } 169 | if(systemGroupContainers.count) 170 | { 171 | dictToRegister[@"HasSystemGroupContainers"] = @YES; 172 | } 173 | dictToRegister[@"GroupContainers"] = groupContainers.copy; 174 | } 175 | 176 | // Add plugins 177 | 178 | NSString* pluginsPath = [path stringByAppendingPathComponent:@"PlugIns"]; 179 | NSArray* plugins = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:pluginsPath error:nil]; 180 | 181 | NSMutableDictionary* bundlePlugins = [NSMutableDictionary dictionary]; 182 | for (NSString* pluginName in plugins) 183 | { 184 | NSString* pluginPath = [pluginsPath stringByAppendingPathComponent:pluginName]; 185 | 186 | NSDictionary* pluginInfoPlist = [NSDictionary dictionaryWithContentsOfFile:[pluginPath stringByAppendingPathComponent:@"Info.plist"]]; 187 | NSString* pluginBundleID = [pluginInfoPlist objectForKey:@"CFBundleIdentifier"]; 188 | 189 | if(!pluginBundleID) continue; 190 | MCMContainer* pluginContainer = [NSClassFromString(@"MCMPluginKitPluginDataContainer") containerWithIdentifier:pluginBundleID createIfNecessary:YES existed:nil error:nil]; 191 | NSString* pluginContainerPath = [pluginContainer url].path; 192 | 193 | NSMutableDictionary* pluginDict = [NSMutableDictionary dictionary]; 194 | 195 | // Add entitlements 196 | 197 | NSString* pluginExecutablePath = [pluginPath stringByAppendingPathComponent:pluginInfoPlist[@"CFBundleExecutable"]]; 198 | NSDictionary* pluginEntitlements = dumpEntitlementsFromBinaryAtPath(pluginExecutablePath); 199 | if(pluginEntitlements) 200 | { 201 | pluginDict[@"Entitlements"] = pluginEntitlements; 202 | } 203 | 204 | // Misc 205 | 206 | pluginDict[@"ApplicationType"] = @"PluginKitPlugin"; 207 | pluginDict[@"CFBundleIdentifier"] = pluginBundleID; 208 | pluginDict[@"CodeInfoIdentifier"] = pluginBundleID; 209 | pluginDict[@"CompatibilityState"] = @0; 210 | if(pluginContainerPath) 211 | { 212 | pluginDict[@"Container"] = pluginContainerPath; 213 | pluginDict[@"EnvironmentVariables"] = constructEnvironmentVariablesForContainerPath(pluginContainerPath); 214 | } 215 | pluginDict[@"Path"] = pluginPath; 216 | pluginDict[@"PluginOwnerBundleID"] = appBundleID; 217 | pluginDict[@"IsContainerized"] = @(constructContainerizationForEntitlements(pluginEntitlements)); 218 | pluginDict[@"SignerOrganization"] = @"Apple Inc."; 219 | pluginDict[@"SignatureVersion"] = @132352; 220 | pluginDict[@"SignerIdentity"] = @"Apple iPhone OS Application Signing"; 221 | 222 | NSString* pluginTeamIdentifier = constructTeamIdentifierForEntitlements(pluginEntitlements); 223 | if(pluginTeamIdentifier) pluginDict[@"TeamIdentifier"] = pluginTeamIdentifier; 224 | 225 | // Add plugin group containers 226 | 227 | NSDictionary* pluginAppGroupContainers = constructGroupsContainersForEntitlements(pluginEntitlements, NO); 228 | NSDictionary* pluginSystemGroupContainers = constructGroupsContainersForEntitlements(pluginEntitlements, NO); 229 | NSMutableDictionary* pluginGroupContainers = [NSMutableDictionary new]; 230 | [pluginGroupContainers addEntriesFromDictionary:pluginAppGroupContainers]; 231 | [pluginGroupContainers addEntriesFromDictionary:pluginSystemGroupContainers]; 232 | if(pluginGroupContainers.count) 233 | { 234 | if(pluginAppGroupContainers.count) 235 | { 236 | pluginDict[@"HasAppGroupContainers"] = @YES; 237 | } 238 | if(pluginSystemGroupContainers.count) 239 | { 240 | pluginDict[@"HasSystemGroupContainers"] = @YES; 241 | } 242 | pluginDict[@"GroupContainers"] = pluginGroupContainers.copy; 243 | } 244 | 245 | [bundlePlugins setObject:pluginDict forKey:pluginBundleID]; 246 | } 247 | [dictToRegister setObject:bundlePlugins forKey:@"_LSBundlePlugins"]; 248 | 249 | if(![workspace registerApplicationDictionary:dictToRegister]) 250 | { 251 | NSLog(@"Error: Unable to register %@", path); 252 | } 253 | } 254 | else 255 | { 256 | NSURL* url = [NSURL fileURLWithPath:path]; 257 | if(![workspace unregisterApplication:url]) 258 | { 259 | NSLog(@"Error: Unable to unregister %@", path); 260 | } 261 | } 262 | } 263 | -------------------------------------------------------------------------------- /palera1nHelper/TrollStoreCock/version.h: -------------------------------------------------------------------------------- 1 | /** 2 | * CoreFoundation Version Header 3 | * 4 | * by HASHBANG Productions 5 | * Public Domain 6 | * 7 | * 2.0 478.23 8 | * 2.1 478.26 9 | * 2.2 478.29 10 | * 3.0 478.47 11 | * 3.1 478.52 12 | * 3.2 478.61 13 | * 4.0 550.32 14 | * 4.1 550.38 15 | * 4.2 550.52 16 | * 4.3 550.58 17 | * 5.0 675.00 18 | * 5.1 690.10 19 | * 6.x 793.00 20 | * 7.0 847.20 21 | * 7.0.3 847.21 22 | * 7.1 847.26 23 | * 8.0 1140.10 24 | * 8.1 1141.14 25 | * 8.2 1142.16 26 | * 8.3 1144.17 27 | * 8.4 1145.15 28 | * 9.0 1240.1 29 | * 9.1 1241.11 30 | * 9.2 1242.13 31 | * 9.3 1280.30 32 | * 10.0 1348.00 33 | * 10.1 1348.00 34 | * 10.2 1348.22 35 | * 10.3 1349.56 36 | * 11.0 1443.00 37 | * 11.1 1445.32 38 | * 11.2 1450.14 39 | * 11.3 1452.23 40 | * 11.4 1452.23 41 | * 12.0 1556.00 42 | * 12.1 1560.10 43 | * 12.2 1570.15 44 | * 12.3 1575.13 45 | * 12.4 1575.17 46 | * 12.5 1575.23 47 | * 13.0 1665.15 48 | * 13.1 1671.101 49 | * 13.2 1673.126 50 | * 13.3 1674.102 51 | * 13.4 1675.129 52 | * 13.5 1676.104 53 | * 14.0 1751.108 54 | * 14.1 1751.108 55 | * 14.2 1770.106 56 | * 14.3 1770.300 57 | * 14.4 1774.101 58 | * 14.5 1775.118 59 | * 14.6 1776.103 60 | * 14.7 1777.103 61 | * 14.8 1778.101 62 | * 15.0 1854 63 | * 15.1 1855.105 64 | * 15.2 1856.105 65 | * 15.3 1856.105 66 | * 15.4 1858.112 67 | * 68 | * Reference: 69 | * https://iphonedev.wiki/index.php/CoreFoundation.framework#Versions 70 | */ 71 | 72 | // iOS 2.0 – 4.2 are defined in . The format prior to 4.0 is 73 | // kCFCoreFoundationVersionNumber_iPhoneOS_X_Y. 4.0 and newer have the format 74 | // kCFCoreFoundationVersionNumber_iOS_X_Y. 75 | 76 | #import 77 | 78 | // Newer version number #defines may or may not be defined. For instance, the iOS 5, 6, 7 SDKs 79 | // didn’t define any newer version than iOS 4.2. 9.3 SDK defines versions up to iOS 8.4. 10.1 SDK 80 | // defines versions up to 9.4(!) but not 10.0 81 | 82 | #ifndef kCFCoreFoundationVersionNumber_iOS_4_3 83 | #define kCFCoreFoundationVersionNumber_iOS_4_3 550.58 84 | #endif 85 | 86 | #ifndef kCFCoreFoundationVersionNumber_iOS_5_0 87 | #define kCFCoreFoundationVersionNumber_iOS_5_0 675.00 88 | #endif 89 | 90 | #ifndef kCFCoreFoundationVersionNumber_iOS_5_1 91 | #define kCFCoreFoundationVersionNumber_iOS_5_1 690.10 92 | #endif 93 | 94 | #ifndef kCFCoreFoundationVersionNumber_iOS_6_0 95 | #define kCFCoreFoundationVersionNumber_iOS_6_0 793.00 96 | #endif 97 | 98 | #ifndef kCFCoreFoundationVersionNumber_iOS_6_1 99 | #define kCFCoreFoundationVersionNumber_iOS_6_1 793.00 100 | #endif 101 | 102 | #ifndef kCFCoreFoundationVersionNumber_iOS_7_0 103 | #define kCFCoreFoundationVersionNumber_iOS_7_0 847.20 104 | #endif 105 | 106 | #ifndef kCFCoreFoundationVersionNumber_iOS_7_0_3 107 | #define kCFCoreFoundationVersionNumber_iOS_7_0_3 847.21 108 | #endif 109 | 110 | #ifndef kCFCoreFoundationVersionNumber_iOS_7_1 111 | #define kCFCoreFoundationVersionNumber_iOS_7_1 847.26 112 | #endif 113 | 114 | #ifndef kCFCoreFoundationVersionNumber_iOS_8_0 115 | #define kCFCoreFoundationVersionNumber_iOS_8_0 1140.10 116 | #endif 117 | 118 | #ifndef kCFCoreFoundationVersionNumber_iOS_8_1 119 | #define kCFCoreFoundationVersionNumber_iOS_8_1 1141.14 120 | #endif 121 | 122 | #ifndef kCFCoreFoundationVersionNumber_iOS_8_2 123 | #define kCFCoreFoundationVersionNumber_iOS_8_2 1142.16 124 | #endif 125 | 126 | #ifndef kCFCoreFoundationVersionNumber_iOS_8_3 127 | #define kCFCoreFoundationVersionNumber_iOS_8_3 1144.17 128 | #endif 129 | 130 | #ifndef kCFCoreFoundationVersionNumber_iOS_8_4 131 | #define kCFCoreFoundationVersionNumber_iOS_8_4 1145.15 132 | #endif 133 | 134 | #ifndef kCFCoreFoundationVersionNumber_iOS_9_0 135 | #define kCFCoreFoundationVersionNumber_iOS_9_0 1240.1 136 | #endif 137 | 138 | #ifndef kCFCoreFoundationVersionNumber_iOS_9_1 139 | #define kCFCoreFoundationVersionNumber_iOS_9_1 1241.11 140 | #endif 141 | 142 | #ifndef kCFCoreFoundationVersionNumber_iOS_9_2 143 | #define kCFCoreFoundationVersionNumber_iOS_9_2 1242.13 144 | #endif 145 | 146 | #ifndef kCFCoreFoundationVersionNumber_iOS_9_3 147 | #define kCFCoreFoundationVersionNumber_iOS_9_3 1280.30 148 | #endif 149 | 150 | #ifndef kCFCoreFoundationVersionNumber_iOS_10_0 151 | #define kCFCoreFoundationVersionNumber_iOS_10_0 1348.00 152 | #endif 153 | 154 | #ifndef kCFCoreFoundationVersionNumber_iOS_10_1 155 | #define kCFCoreFoundationVersionNumber_iOS_10_1 1348.00 156 | #endif 157 | 158 | #ifndef kCFCoreFoundationVersionNumber_iOS_10_2 159 | #define kCFCoreFoundationVersionNumber_iOS_10_2 1348.22 160 | #endif 161 | 162 | #ifndef kCFCoreFoundationVersionNumber_iOS_10_3 163 | #define kCFCoreFoundationVersionNumber_iOS_10_3 1349.56 164 | #endif 165 | 166 | #ifndef kCFCoreFoundationVersionNumber_iOS_11_0 167 | #define kCFCoreFoundationVersionNumber_iOS_11_0 1443.00 168 | #endif 169 | 170 | #ifndef kCFCoreFoundationVersionNumber_iOS_11_1 171 | #define kCFCoreFoundationVersionNumber_iOS_11_1 1445.32 172 | #endif 173 | 174 | #ifndef kCFCoreFoundationVersionNumber_iOS_11_2 175 | #define kCFCoreFoundationVersionNumber_iOS_11_2 1450.14 176 | #endif 177 | 178 | #ifndef kCFCoreFoundationVersionNumber_iOS_11_3 179 | #define kCFCoreFoundationVersionNumber_iOS_11_3 1452.23 180 | #endif 181 | 182 | #ifndef kCFCoreFoundationVersionNumber_iOS_11_4 183 | #define kCFCoreFoundationVersionNumber_iOS_11_4 1452.23 184 | #endif 185 | 186 | #ifndef kCFCoreFoundationVersionNumber_iOS_12_0 187 | #define kCFCoreFoundationVersionNumber_iOS_12_0 1556.00 188 | #endif 189 | 190 | #ifndef kCFCoreFoundationVersionNumber_iOS_12_1 191 | #define kCFCoreFoundationVersionNumber_iOS_12_1 1560.10 192 | #endif 193 | 194 | #ifndef kCFCoreFoundationVersionNumber_iOS_12_2 195 | #define kCFCoreFoundationVersionNumber_iOS_12_2 1570.15 196 | #endif 197 | 198 | #ifndef kCFCoreFoundationVersionNumber_iOS_12_3 199 | #define kCFCoreFoundationVersionNumber_iOS_12_3 1575.13 200 | #endif 201 | 202 | #ifndef kCFCoreFoundationVersionNumber_iOS_12_4 203 | #define kCFCoreFoundationVersionNumber_iOS_12_4 1575.17 204 | #endif 205 | 206 | #ifndef kCFCoreFoundationVersionNumber_iOS_12_5 207 | #define kCFCoreFoundationVersionNumber_iOS_12_5 1575.23 208 | #endif 209 | 210 | #ifndef kCFCoreFoundationVersionNumber_iOS_13_0 211 | #define kCFCoreFoundationVersionNumber_iOS_13_0 1665.15 212 | #endif 213 | 214 | #ifndef kCFCoreFoundationVersionNumber_iOS_13_1 215 | #define kCFCoreFoundationVersionNumber_iOS_13_1 1671.101 216 | #endif 217 | 218 | #ifndef kCFCoreFoundationVersionNumber_iOS_13_2 219 | #define kCFCoreFoundationVersionNumber_iOS_13_2 1673.126 220 | #endif 221 | 222 | #ifndef kCFCoreFoundationVersionNumber_iOS_13_3 223 | #define kCFCoreFoundationVersionNumber_iOS_13_3 1674.102 224 | #endif 225 | 226 | #ifndef kCFCoreFoundationVersionNumber_iOS_13_4 227 | #define kCFCoreFoundationVersionNumber_iOS_13_4 1675.129 228 | #endif 229 | 230 | #ifndef kCFCoreFoundationVersionNumber_iOS_13_5 231 | #define kCFCoreFoundationVersionNumber_iOS_13_5 1676.104 232 | #endif 233 | 234 | #ifndef kCFCoreFoundationVersionNumber_iOS_13_6 235 | #define kCFCoreFoundationVersionNumber_iOS_13_6 1677.104 236 | #endif 237 | 238 | #ifndef kCFCoreFoundationVersionNumber_iOS_13_7 239 | #define kCFCoreFoundationVersionNumber_iOS_13_7 1677.104 240 | #endif 241 | 242 | #ifndef kCFCoreFoundationVersionNumber_iOS_14_0 243 | #define kCFCoreFoundationVersionNumber_iOS_14_0 1751.108 244 | #endif 245 | 246 | #ifndef kCFCoreFoundationVersionNumber_iOS_14_1 247 | #define kCFCoreFoundationVersionNumber_iOS_14_1 1751.108 248 | #endif 249 | 250 | #ifndef kCFCoreFoundationVersionNumber_iOS_14_2 251 | #define kCFCoreFoundationVersionNumber_iOS_14_2 1770.106 252 | #endif 253 | 254 | #ifndef kCFCoreFoundationVersionNumber_iOS_14_3 255 | #define kCFCoreFoundationVersionNumber_iOS_14_3 1770.300 256 | #endif 257 | 258 | #ifndef kCFCoreFoundationVersionNumber_iOS_14_4 259 | #define kCFCoreFoundationVersionNumber_iOS_14_4 1774.101 260 | #endif 261 | 262 | #ifndef kCFCoreFoundationVersionNumber_iOS_14_5 263 | #define kCFCoreFoundationVersionNumber_iOS_14_5 1775.118 264 | #endif 265 | 266 | #ifndef kCFCoreFoundationVersionNumber_iOS_14_6 267 | #define kCFCoreFoundationVersionNumber_iOS_14_6 1776.103 268 | #endif 269 | 270 | #ifndef kCFCoreFoundationVersionNumber_iOS_14_7 271 | #define kCFCoreFoundationVersionNumber_iOS_14_7 1777.103 272 | #endif 273 | 274 | #ifndef kCFCoreFoundationVersionNumber_iOS_14_8 275 | #define kCFCoreFoundationVersionNumber_iOS_14_8 1778.101 276 | #endif 277 | 278 | #ifndef kCFCoreFoundationVersionNumber_iOS_15_0 279 | #define kCFCoreFoundationVersionNumber_iOS_15_0 1854 280 | #endif 281 | 282 | #ifndef kCFCoreFoundationVersionNumber_iOS_15_1 283 | #define kCFCoreFoundationVersionNumber_iOS_15_1 1855.105 284 | #endif 285 | 286 | #ifndef kCFCoreFoundationVersionNumber_iOS_15_2 287 | #define kCFCoreFoundationVersionNumber_iOS_15_2 1856.105 288 | #endif 289 | 290 | #ifndef kCFCoreFoundationVersionNumber_iOS_15_3 291 | #define kCFCoreFoundationVersionNumber_iOS_15_3 1856.105 292 | #endif 293 | 294 | #ifndef kCFCoreFoundationVersionNumber_iOS_15_4 295 | #define kCFCoreFoundationVersionNumber_iOS_15_4 1858.112 296 | #endif 297 | 298 | #ifndef kCFCoreFoundationVersionNumber10_10 299 | #define kCFCoreFoundationVersionNumber10_10 1151.16 300 | #endif 301 | 302 | // Let’s also define some useful functions to check which firmware the user is on. (Note that 303 | // feature detection is highly recommended where possible) 304 | 305 | #define IS_IOS_OR_OLDER(version) (kCFCoreFoundationVersionNumber <= kCFCoreFoundationVersionNumber_##version) 306 | #define IS_IOS_OR_NEWER(version) (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_##version) 307 | #define IS_IOS_BETWEEN(start, end) (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_##start && kCFCoreFoundationVersionNumber <= kCFCoreFoundationVersionNumber_##end) 308 | 309 | // And let’s make equivalent macros for macOS so it doesn’t feel lonely. 310 | 311 | #define IS_MACOS_OR_OLDER(version) (kCFCoreFoundationVersionNumber <= kCFCoreFoundationVersionNumber##version) 312 | #define IS_MACOS_OR_NEWER(version) (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber##version) 313 | #define IS_MACOS_BETWEEN(start, end) (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber##start && kCFCoreFoundationVersionNumber <= kCFCoreFoundationVersionNumber##end) 314 | 315 | #define IS_OSX_OR_OLDER(version) IS_MACOS_OR_OLDER(version) 316 | #define IS_OSX_OR_NEWER(version) IS_MACOS_OR_NEWER(version) 317 | #define IS_OSX_BETWEEN(version) IS_MACOS_BETWEEN(version) 318 | -------------------------------------------------------------------------------- /palera1nHelper/main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // main.swift 3 | // palera1nHelper 4 | // 5 | // Created by Lakhan Lothiyi on 12/11/2022. 6 | // 7 | // This code belongs to Amy While and is from https://github.com/elihwyma/Pogo/blob/main/PogoHelper/main.swift 8 | 9 | import Foundation 10 | import ArgumentParser 11 | import SWCompression 12 | 13 | struct Strap: ParsableCommand { 14 | @Option(name: .shortAndLong, help: "The path to the .tar file you want to strap with") 15 | var input: String? 16 | 17 | @Flag(name: .shortAndLong, help: "Remove the bootstrap") 18 | var remove: Bool = false 19 | 20 | @Flag(name: .shortAndLong, help: "Does trollstore uicache") 21 | var uicache: Bool = false 22 | 23 | mutating func run() throws { 24 | NSLog("[palera1n helper] Spawned!") 25 | guard getuid() == 0 else { fatalError() } 26 | 27 | if uicache { 28 | uicacheTool() 29 | } else if let input = input { 30 | strapTool(input) 31 | } 32 | } 33 | 34 | 35 | func uicacheTool() { 36 | 37 | } 38 | 39 | func strapTool(_ input: String) { 40 | NSLog("[palera1n helper] Attempting to install \(input)") 41 | let dest = "/" 42 | do { 43 | try autoreleasepool { 44 | let data = try Data(contentsOf: URL(fileURLWithPath: input)) 45 | let container = try TarContainer.open(container: data) 46 | NSLog("[palera1n helper] Opened Container") 47 | for entry in container { 48 | do { 49 | var path = entry.info.name 50 | if path.first == "." { 51 | path.removeFirst() 52 | } 53 | if path == "/" || path == "/var" { 54 | continue 55 | } 56 | path = path.replacingOccurrences(of: "", with: dest) 57 | switch entry.info.type { 58 | case .symbolicLink: 59 | var linkName = entry.info.linkName 60 | if !linkName.contains("/") || linkName.contains("..") { 61 | var tmp = path.split(separator: "/").map { String($0) } 62 | tmp.removeLast() 63 | tmp.append(linkName) 64 | linkName = tmp.joined(separator: "/") 65 | if linkName.first != "/" { 66 | linkName = "/" + linkName 67 | } 68 | linkName = linkName.replacingOccurrences(of: "", with: dest) 69 | } else { 70 | linkName = linkName.replacingOccurrences(of: "", with: dest) 71 | } 72 | NSLog("[palera1n helper] \(entry.info.linkName) at \(linkName) to \(path)") 73 | try FileManager.default.createSymbolicLink(atPath: path, withDestinationPath: linkName) 74 | case .directory: 75 | try FileManager.default.createDirectory(atPath: path, withIntermediateDirectories: true) 76 | case .regular: 77 | guard let data = entry.data else { continue } 78 | try data.write(to: URL(fileURLWithPath: path)) 79 | default: 80 | NSLog("[palera1n helper] Unknown Action for \(entry.info.type)") 81 | } 82 | var attributes = [FileAttributeKey: Any]() 83 | attributes[.posixPermissions] = entry.info.permissions?.rawValue 84 | attributes[.ownerAccountName] = entry.info.ownerUserName 85 | var ownerGroupName = entry.info.ownerGroupName 86 | if ownerGroupName == "staff" && entry.info.ownerUserName == "root" { 87 | ownerGroupName = "wheel" 88 | } 89 | attributes[.groupOwnerAccountName] = ownerGroupName 90 | do { 91 | try FileManager.default.setAttributes(attributes, ofItemAtPath: path) 92 | } catch { 93 | continue 94 | } 95 | } catch { 96 | NSLog("[palera1n helper] error \(error.localizedDescription)") 97 | } 98 | } 99 | } 100 | } catch { 101 | NSLog("[palera1n helper] Failed with error \(error.localizedDescription)") 102 | return 103 | } 104 | NSLog("[palera1n helper] Strapped to \(dest)") 105 | var attributes = [FileAttributeKey: Any]() 106 | attributes[.posixPermissions] = 0o755 107 | attributes[.ownerAccountName] = "mobile" 108 | attributes[.groupOwnerAccountName] = "mobile" 109 | do { 110 | try FileManager.default.setAttributes(attributes, ofItemAtPath: "/var/mobile") 111 | } catch { 112 | NSLog("[palera1n helper] thats wild") 113 | } 114 | } 115 | } 116 | 117 | Strap.main() 118 | -------------------------------------------------------------------------------- /palera1nHelper/palera1nHelper-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import "TrollStoreCock/uicache.h" 6 | -------------------------------------------------------------------------------- /palera1nLoader.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 331E9B752932C42400363FA9 /* Makefile in Sources */ = {isa = PBXBuildFile; fileRef = 331E9B742932C42300363FA9 /* Makefile */; }; 11 | 331E9B842932CBC000363FA9 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA95DBC82920590B0055F1C0 /* main.swift */; }; 12 | 331E9B862932CBED00363FA9 /* SWCompression in Frameworks */ = {isa = PBXBuildFile; productRef = 331E9B852932CBED00363FA9 /* SWCompression */; }; 13 | 331E9B8A2932CD1000363FA9 /* SWCompression in Frameworks */ = {isa = PBXBuildFile; productRef = 331E9B892932CD1000363FA9 /* SWCompression */; }; 14 | 331E9B8C2932CD1700363FA9 /* ArgumentParser in Frameworks */ = {isa = PBXBuildFile; productRef = 331E9B8B2932CD1700363FA9 /* ArgumentParser */; }; 15 | 336B30D22933E35C004BE6AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 336B30D12933E35C004BE6AA /* Foundation.framework */; }; 16 | AA95DBCC292059980055F1C0 /* BitByteData in Frameworks */ = {isa = PBXBuildFile; productRef = AA95DBCB292059980055F1C0 /* BitByteData */; }; 17 | AA95DBD829205AB90055F1C0 /* CommandRunner.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA95DBD729205AB90055F1C0 /* CommandRunner.swift */; }; 18 | AAA74201293D2DC6000243C2 /* TSUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = AAA74200293D2DC6000243C2 /* TSUtil.m */; }; 19 | AAA74205293D339A000243C2 /* uicache.m in Sources */ = {isa = PBXBuildFile; fileRef = AAA74203293D339A000243C2 /* uicache.m */; }; 20 | AAC38B5929356A1F00796F04 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAC38B5829356A1F00796F04 /* Utilities.swift */; }; 21 | AAC7DE33291F1AED000CD15B /* IrregularGradient in Frameworks */ = {isa = PBXBuildFile; productRef = AAC7DE32291F1AED000CD15B /* IrregularGradient */; }; 22 | AAC7DE36291F1EBD000CD15B /* SDWebImageSwiftUI in Frameworks */ = {isa = PBXBuildFile; productRef = AAC7DE35291F1EBD000CD15B /* SDWebImageSwiftUI */; }; 23 | AAD65B0D2932EBF000DF88E6 /* ArgumentParser in Frameworks */ = {isa = PBXBuildFile; productRef = AAD65B0C2932EBF000DF88E6 /* ArgumentParser */; }; 24 | AAEF9D5C291ED9F90089149B /* palera1nLoaderApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAEF9D5B291ED9F90089149B /* palera1nLoaderApp.swift */; }; 25 | AAEF9D5E291ED9F90089149B /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAEF9D5D291ED9F90089149B /* ContentView.swift */; }; 26 | AAEF9D60291ED9FB0089149B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AAEF9D5F291ED9FB0089149B /* Assets.xcassets */; }; 27 | AAEF9D75291EE9370089149B /* SysInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAEF9D74291EE9370089149B /* SysInfo.swift */; }; 28 | AAEF9D86291EEBF70089149B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AAEF9D85291EEBF70089149B /* IOKit.framework */; }; 29 | /* End PBXBuildFile section */ 30 | 31 | /* Begin PBXCopyFilesBuildPhase section */ 32 | 331E9B792932CABC00363FA9 /* CopyFiles */ = { 33 | isa = PBXCopyFilesBuildPhase; 34 | buildActionMask = 2147483647; 35 | dstPath = "include/$(PRODUCT_NAME)"; 36 | dstSubfolderSpec = 16; 37 | files = ( 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXCopyFilesBuildPhase section */ 42 | 43 | /* Begin PBXFileReference section */ 44 | 331E9B742932C42300363FA9 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; 45 | 331E9B7B2932CABC00363FA9 /* palera1nHelper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = palera1nHelper; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 331E9B8D2932D07C00363FA9 /* Info.plist */ = {isa = PBXFileReference; explicitFileType = text.xml; path = Info.plist; sourceTree = ""; }; 47 | 336B30D12933E35C004BE6AA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 48 | 6F6E28BC297332C500012B45 /* BridgingHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BridgingHeader.h; sourceTree = ""; }; 49 | AA95DBC82920590B0055F1C0 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 50 | AA95DBD729205AB90055F1C0 /* CommandRunner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommandRunner.swift; sourceTree = ""; }; 51 | AAA741FB293D1CCA000243C2 /* palera1nLoader.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = palera1nLoader.entitlements; sourceTree = ""; }; 52 | AAA741FD293D2DC5000243C2 /* palera1nHelper-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "palera1nHelper-Bridging-Header.h"; sourceTree = ""; }; 53 | AAA741FE293D2DC6000243C2 /* CoreServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreServices.h; sourceTree = ""; }; 54 | AAA741FF293D2DC6000243C2 /* TSUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSUtil.h; sourceTree = ""; }; 55 | AAA74200293D2DC6000243C2 /* TSUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSUtil.m; sourceTree = ""; }; 56 | AAA74203293D339A000243C2 /* uicache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = uicache.m; sourceTree = ""; }; 57 | AAA74204293D339A000243C2 /* uicache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uicache.h; sourceTree = ""; }; 58 | AAA74206293D4818000243C2 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = version.h; path = ../../../../theos/vendor/include/version.h; sourceTree = ""; }; 59 | AAA74207293D4827000243C2 /* version.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = ""; }; 60 | AAC38B5829356A1F00796F04 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = ""; }; 61 | AAEF9D58291ED9F80089149B /* palera1nLoader.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = palera1nLoader.app; sourceTree = BUILT_PRODUCTS_DIR; }; 62 | AAEF9D5B291ED9F90089149B /* palera1nLoaderApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = palera1nLoaderApp.swift; sourceTree = ""; }; 63 | AAEF9D5D291ED9F90089149B /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 64 | AAEF9D5F291ED9FB0089149B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 65 | AAEF9D74291EE9370089149B /* SysInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SysInfo.swift; sourceTree = ""; }; 66 | AAEF9D85291EEBF70089149B /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; 67 | /* End PBXFileReference section */ 68 | 69 | /* Begin PBXFrameworksBuildPhase section */ 70 | 331E9B782932CABC00363FA9 /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | AAD65B0D2932EBF000DF88E6 /* ArgumentParser in Frameworks */, 75 | 336B30D22933E35C004BE6AA /* Foundation.framework in Frameworks */, 76 | 331E9B862932CBED00363FA9 /* SWCompression in Frameworks */, 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | AAEF9D55291ED9F80089149B /* Frameworks */ = { 81 | isa = PBXFrameworksBuildPhase; 82 | buildActionMask = 2147483647; 83 | files = ( 84 | 331E9B8C2932CD1700363FA9 /* ArgumentParser in Frameworks */, 85 | AA95DBCC292059980055F1C0 /* BitByteData in Frameworks */, 86 | AAC7DE36291F1EBD000CD15B /* SDWebImageSwiftUI in Frameworks */, 87 | 331E9B8A2932CD1000363FA9 /* SWCompression in Frameworks */, 88 | AAC7DE33291F1AED000CD15B /* IrregularGradient in Frameworks */, 89 | AAEF9D86291EEBF70089149B /* IOKit.framework in Frameworks */, 90 | ); 91 | runOnlyForDeploymentPostprocessing = 0; 92 | }; 93 | /* End PBXFrameworksBuildPhase section */ 94 | 95 | /* Begin PBXGroup section */ 96 | 331E9B762932C51300363FA9 /* Required */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | ); 100 | path = Required; 101 | sourceTree = ""; 102 | }; 103 | 331E9B7C2932CABD00363FA9 /* palera1nHelper */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | AA95DBC82920590B0055F1C0 /* main.swift */, 107 | AAA741FD293D2DC5000243C2 /* palera1nHelper-Bridging-Header.h */, 108 | AAA74202293D2DCC000243C2 /* TrollStoreCock */, 109 | ); 110 | path = palera1nHelper; 111 | sourceTree = ""; 112 | }; 113 | AA95DB8929204FFC0055F1C0 /* Bootstrapping */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | AA95DBD729205AB90055F1C0 /* CommandRunner.swift */, 117 | ); 118 | name = Bootstrapping; 119 | sourceTree = ""; 120 | }; 121 | AAA74202293D2DCC000243C2 /* TrollStoreCock */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | AAA741FE293D2DC6000243C2 /* CoreServices.h */, 125 | AAA741FF293D2DC6000243C2 /* TSUtil.h */, 126 | AAA74200293D2DC6000243C2 /* TSUtil.m */, 127 | AAA74204293D339A000243C2 /* uicache.h */, 128 | AAA74203293D339A000243C2 /* uicache.m */, 129 | AAA74207293D4827000243C2 /* version.h */, 130 | ); 131 | path = TrollStoreCock; 132 | sourceTree = ""; 133 | }; 134 | AAA74208293D4D0A000243C2 /* Shared */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | ); 138 | path = Shared; 139 | sourceTree = ""; 140 | }; 141 | AAC7DE2C291F1203000CD15B /* Views */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | AAEF9D5D291ED9F90089149B /* ContentView.swift */, 145 | ); 146 | name = Views; 147 | sourceTree = ""; 148 | }; 149 | AAEF9D4F291ED9F80089149B = { 150 | isa = PBXGroup; 151 | children = ( 152 | AAEF9D5A291ED9F80089149B /* palera1nLoader */, 153 | AAA74208293D4D0A000243C2 /* Shared */, 154 | 331E9B742932C42300363FA9 /* Makefile */, 155 | 331E9B7C2932CABD00363FA9 /* palera1nHelper */, 156 | AAEF9D59291ED9F80089149B /* Products */, 157 | AAEF9D84291EEBF70089149B /* Frameworks */, 158 | ); 159 | sourceTree = ""; 160 | }; 161 | AAEF9D59291ED9F80089149B /* Products */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | AAEF9D58291ED9F80089149B /* palera1nLoader.app */, 165 | 331E9B7B2932CABC00363FA9 /* palera1nHelper */, 166 | ); 167 | name = Products; 168 | sourceTree = ""; 169 | }; 170 | AAEF9D5A291ED9F80089149B /* palera1nLoader */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 6F6E28BC297332C500012B45 /* BridgingHeader.h */, 174 | AAA741FB293D1CCA000243C2 /* palera1nLoader.entitlements */, 175 | 331E9B8D2932D07C00363FA9 /* Info.plist */, 176 | 331E9B762932C51300363FA9 /* Required */, 177 | AA95DB8929204FFC0055F1C0 /* Bootstrapping */, 178 | AAEF9D5B291ED9F90089149B /* palera1nLoaderApp.swift */, 179 | AAC7DE2C291F1203000CD15B /* Views */, 180 | AAEF9D6F291EDDAD0089149B /* Utilities */, 181 | AAEF9D6E291EDD980089149B /* Class */, 182 | AAEF9D5F291ED9FB0089149B /* Assets.xcassets */, 183 | ); 184 | path = palera1nLoader; 185 | sourceTree = ""; 186 | }; 187 | AAEF9D6E291EDD980089149B /* Class */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | AAC38B5829356A1F00796F04 /* Utilities.swift */, 191 | ); 192 | name = Class; 193 | sourceTree = ""; 194 | }; 195 | AAEF9D6F291EDDAD0089149B /* Utilities */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | AAA74206293D4818000243C2 /* version.h */, 199 | AAEF9D74291EE9370089149B /* SysInfo.swift */, 200 | ); 201 | name = Utilities; 202 | sourceTree = ""; 203 | }; 204 | AAEF9D84291EEBF70089149B /* Frameworks */ = { 205 | isa = PBXGroup; 206 | children = ( 207 | 336B30D12933E35C004BE6AA /* Foundation.framework */, 208 | AAEF9D85291EEBF70089149B /* IOKit.framework */, 209 | ); 210 | name = Frameworks; 211 | sourceTree = ""; 212 | }; 213 | /* End PBXGroup section */ 214 | 215 | /* Begin PBXNativeTarget section */ 216 | 331E9B7A2932CABC00363FA9 /* palera1nHelper */ = { 217 | isa = PBXNativeTarget; 218 | buildConfigurationList = 331E9B7F2932CABD00363FA9 /* Build configuration list for PBXNativeTarget "palera1nHelper" */; 219 | buildPhases = ( 220 | 331E9B772932CABC00363FA9 /* Sources */, 221 | 331E9B782932CABC00363FA9 /* Frameworks */, 222 | 331E9B792932CABC00363FA9 /* CopyFiles */, 223 | ); 224 | buildRules = ( 225 | ); 226 | dependencies = ( 227 | ); 228 | name = palera1nHelper; 229 | packageProductDependencies = ( 230 | 331E9B852932CBED00363FA9 /* SWCompression */, 231 | AAD65B0C2932EBF000DF88E6 /* ArgumentParser */, 232 | ); 233 | productName = palera1nHelper; 234 | productReference = 331E9B7B2932CABC00363FA9 /* palera1nHelper */; 235 | productType = "com.apple.product-type.library.dynamic"; 236 | }; 237 | AAEF9D57291ED9F80089149B /* palera1nLoader */ = { 238 | isa = PBXNativeTarget; 239 | buildConfigurationList = AAEF9D66291ED9FB0089149B /* Build configuration list for PBXNativeTarget "palera1nLoader" */; 240 | buildPhases = ( 241 | AAEF9D54291ED9F80089149B /* Sources */, 242 | AAEF9D55291ED9F80089149B /* Frameworks */, 243 | AAEF9D56291ED9F80089149B /* Resources */, 244 | ); 245 | buildRules = ( 246 | ); 247 | dependencies = ( 248 | ); 249 | name = palera1nLoader; 250 | packageProductDependencies = ( 251 | AAC7DE32291F1AED000CD15B /* IrregularGradient */, 252 | AAC7DE35291F1EBD000CD15B /* SDWebImageSwiftUI */, 253 | AA95DBCB292059980055F1C0 /* BitByteData */, 254 | 331E9B892932CD1000363FA9 /* SWCompression */, 255 | 331E9B8B2932CD1700363FA9 /* ArgumentParser */, 256 | ); 257 | productName = palera1nLoader; 258 | productReference = AAEF9D58291ED9F80089149B /* palera1nLoader.app */; 259 | productType = "com.apple.product-type.application"; 260 | }; 261 | /* End PBXNativeTarget section */ 262 | 263 | /* Begin PBXProject section */ 264 | AAEF9D50291ED9F80089149B /* Project object */ = { 265 | isa = PBXProject; 266 | attributes = { 267 | BuildIndependentTargetsInParallel = 1; 268 | LastSwiftUpdateCheck = 1400; 269 | LastUpgradeCheck = 1410; 270 | TargetAttributes = { 271 | 331E9B7A2932CABC00363FA9 = { 272 | CreatedOnToolsVersion = 14.0; 273 | LastSwiftMigration = 1410; 274 | }; 275 | AAEF9D57291ED9F80089149B = { 276 | CreatedOnToolsVersion = 14.1; 277 | }; 278 | }; 279 | }; 280 | buildConfigurationList = AAEF9D53291ED9F80089149B /* Build configuration list for PBXProject "palera1nLoader" */; 281 | compatibilityVersion = "Xcode 14.0"; 282 | developmentRegion = en; 283 | hasScannedForEncodings = 0; 284 | knownRegions = ( 285 | en, 286 | Base, 287 | ); 288 | mainGroup = AAEF9D4F291ED9F80089149B; 289 | packageReferences = ( 290 | AAC7DE31291F1AED000CD15B /* XCRemoteSwiftPackageReference "IrregularGradient" */, 291 | AAC7DE34291F1EBD000CD15B /* XCRemoteSwiftPackageReference "SDWebImageswiftui" */, 292 | AA95DBCA292059980055F1C0 /* XCRemoteSwiftPackageReference "BitByteData" */, 293 | AA95DBCD292059B60055F1C0 /* XCRemoteSwiftPackageReference "SWCompression" */, 294 | AA95DBD0292059DC0055F1C0 /* XCRemoteSwiftPackageReference "swift-argument-parser" */, 295 | ); 296 | productRefGroup = AAEF9D59291ED9F80089149B /* Products */; 297 | projectDirPath = ""; 298 | projectRoot = ""; 299 | targets = ( 300 | AAEF9D57291ED9F80089149B /* palera1nLoader */, 301 | 331E9B7A2932CABC00363FA9 /* palera1nHelper */, 302 | ); 303 | }; 304 | /* End PBXProject section */ 305 | 306 | /* Begin PBXResourcesBuildPhase section */ 307 | AAEF9D56291ED9F80089149B /* Resources */ = { 308 | isa = PBXResourcesBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | AAEF9D60291ED9FB0089149B /* Assets.xcassets in Resources */, 312 | ); 313 | runOnlyForDeploymentPostprocessing = 0; 314 | }; 315 | /* End PBXResourcesBuildPhase section */ 316 | 317 | /* Begin PBXSourcesBuildPhase section */ 318 | 331E9B772932CABC00363FA9 /* Sources */ = { 319 | isa = PBXSourcesBuildPhase; 320 | buildActionMask = 2147483647; 321 | files = ( 322 | AAA74205293D339A000243C2 /* uicache.m in Sources */, 323 | AAA74201293D2DC6000243C2 /* TSUtil.m in Sources */, 324 | 331E9B842932CBC000363FA9 /* main.swift in Sources */, 325 | ); 326 | runOnlyForDeploymentPostprocessing = 0; 327 | }; 328 | AAEF9D54291ED9F80089149B /* Sources */ = { 329 | isa = PBXSourcesBuildPhase; 330 | buildActionMask = 2147483647; 331 | files = ( 332 | AA95DBD829205AB90055F1C0 /* CommandRunner.swift in Sources */, 333 | AAEF9D75291EE9370089149B /* SysInfo.swift in Sources */, 334 | AAC38B5929356A1F00796F04 /* Utilities.swift in Sources */, 335 | AAEF9D5E291ED9F90089149B /* ContentView.swift in Sources */, 336 | AAEF9D5C291ED9F90089149B /* palera1nLoaderApp.swift in Sources */, 337 | 331E9B752932C42400363FA9 /* Makefile in Sources */, 338 | ); 339 | runOnlyForDeploymentPostprocessing = 0; 340 | }; 341 | /* End PBXSourcesBuildPhase section */ 342 | 343 | /* Begin XCBuildConfiguration section */ 344 | 331E9B802932CABD00363FA9 /* Debug */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | CLANG_ENABLE_MODULES = YES; 348 | CODE_SIGN_STYLE = Automatic; 349 | DYLIB_COMPATIBILITY_VERSION = ""; 350 | DYLIB_CURRENT_VERSION = ""; 351 | EXECUTABLE_PREFIX = ""; 352 | EXECUTABLE_SUFFIX = ""; 353 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 354 | LD_RUNPATH_SEARCH_PATHS = ( 355 | "$(inherited)", 356 | "@executable_path/Frameworks", 357 | "@loader_path/Frameworks", 358 | ); 359 | MACH_O_TYPE = mh_execute; 360 | OTHER_LDFLAGS = "-ObjC"; 361 | PRODUCT_NAME = "$(TARGET_NAME)"; 362 | SKIP_INSTALL = YES; 363 | SUPPORTS_MACCATALYST = NO; 364 | SWIFT_OBJC_BRIDGING_HEADER = "palera1nHelper/palera1nHelper-Bridging-Header.h"; 365 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 366 | SWIFT_VERSION = 5.0; 367 | TARGETED_DEVICE_FAMILY = "1,2"; 368 | }; 369 | name = Debug; 370 | }; 371 | 331E9B812932CABD00363FA9 /* Release */ = { 372 | isa = XCBuildConfiguration; 373 | buildSettings = { 374 | CLANG_ENABLE_MODULES = YES; 375 | CODE_SIGN_STYLE = Automatic; 376 | DYLIB_COMPATIBILITY_VERSION = ""; 377 | DYLIB_CURRENT_VERSION = ""; 378 | EXECUTABLE_PREFIX = ""; 379 | EXECUTABLE_SUFFIX = ""; 380 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 381 | LD_RUNPATH_SEARCH_PATHS = ( 382 | "$(inherited)", 383 | "@executable_path/Frameworks", 384 | "@loader_path/Frameworks", 385 | ); 386 | MACH_O_TYPE = mh_execute; 387 | OTHER_LDFLAGS = "-ObjC"; 388 | PRODUCT_NAME = "$(TARGET_NAME)"; 389 | SKIP_INSTALL = YES; 390 | SUPPORTS_MACCATALYST = NO; 391 | SWIFT_OBJC_BRIDGING_HEADER = "palera1nHelper/palera1nHelper-Bridging-Header.h"; 392 | SWIFT_VERSION = 5.0; 393 | TARGETED_DEVICE_FAMILY = "1,2"; 394 | }; 395 | name = Release; 396 | }; 397 | AAEF9D64291ED9FB0089149B /* Debug */ = { 398 | isa = XCBuildConfiguration; 399 | buildSettings = { 400 | ALWAYS_SEARCH_USER_PATHS = NO; 401 | CLANG_ANALYZER_NONNULL = YES; 402 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 403 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 404 | CLANG_ENABLE_MODULES = YES; 405 | CLANG_ENABLE_OBJC_ARC = YES; 406 | CLANG_ENABLE_OBJC_WEAK = YES; 407 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 408 | CLANG_WARN_BOOL_CONVERSION = YES; 409 | CLANG_WARN_COMMA = YES; 410 | CLANG_WARN_CONSTANT_CONVERSION = YES; 411 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 412 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 413 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 414 | CLANG_WARN_EMPTY_BODY = YES; 415 | CLANG_WARN_ENUM_CONVERSION = YES; 416 | CLANG_WARN_INFINITE_RECURSION = YES; 417 | CLANG_WARN_INT_CONVERSION = YES; 418 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 419 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 420 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 421 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 422 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 423 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 424 | CLANG_WARN_STRICT_PROTOTYPES = YES; 425 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 426 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 427 | CLANG_WARN_UNREACHABLE_CODE = YES; 428 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 429 | COPY_PHASE_STRIP = NO; 430 | DEBUG_INFORMATION_FORMAT = dwarf; 431 | ENABLE_STRICT_OBJC_MSGSEND = YES; 432 | ENABLE_TESTABILITY = YES; 433 | GCC_C_LANGUAGE_STANDARD = gnu11; 434 | GCC_DYNAMIC_NO_PIC = NO; 435 | GCC_NO_COMMON_BLOCKS = YES; 436 | GCC_OPTIMIZATION_LEVEL = 0; 437 | GCC_PREPROCESSOR_DEFINITIONS = ( 438 | "DEBUG=1", 439 | "$(inherited)", 440 | ); 441 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 442 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 443 | GCC_WARN_UNDECLARED_SELECTOR = YES; 444 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 445 | GCC_WARN_UNUSED_FUNCTION = YES; 446 | GCC_WARN_UNUSED_VARIABLE = YES; 447 | IPHONEOS_DEPLOYMENT_TARGET = 16.0; 448 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 449 | MTL_FAST_MATH = YES; 450 | ONLY_ACTIVE_ARCH = YES; 451 | SDKROOT = iphoneos; 452 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 453 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 454 | }; 455 | name = Debug; 456 | }; 457 | AAEF9D65291ED9FB0089149B /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | ALWAYS_SEARCH_USER_PATHS = NO; 461 | CLANG_ANALYZER_NONNULL = YES; 462 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 463 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 464 | CLANG_ENABLE_MODULES = YES; 465 | CLANG_ENABLE_OBJC_ARC = YES; 466 | CLANG_ENABLE_OBJC_WEAK = YES; 467 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 468 | CLANG_WARN_BOOL_CONVERSION = YES; 469 | CLANG_WARN_COMMA = YES; 470 | CLANG_WARN_CONSTANT_CONVERSION = YES; 471 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 472 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 473 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 474 | CLANG_WARN_EMPTY_BODY = YES; 475 | CLANG_WARN_ENUM_CONVERSION = YES; 476 | CLANG_WARN_INFINITE_RECURSION = YES; 477 | CLANG_WARN_INT_CONVERSION = YES; 478 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 479 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 480 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 481 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 482 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 483 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 484 | CLANG_WARN_STRICT_PROTOTYPES = YES; 485 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 486 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 487 | CLANG_WARN_UNREACHABLE_CODE = YES; 488 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 489 | COPY_PHASE_STRIP = NO; 490 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 491 | ENABLE_NS_ASSERTIONS = NO; 492 | ENABLE_STRICT_OBJC_MSGSEND = YES; 493 | GCC_C_LANGUAGE_STANDARD = gnu11; 494 | GCC_NO_COMMON_BLOCKS = YES; 495 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 496 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 497 | GCC_WARN_UNDECLARED_SELECTOR = YES; 498 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 499 | GCC_WARN_UNUSED_FUNCTION = YES; 500 | GCC_WARN_UNUSED_VARIABLE = YES; 501 | IPHONEOS_DEPLOYMENT_TARGET = 16.0; 502 | MTL_ENABLE_DEBUG_INFO = NO; 503 | MTL_FAST_MATH = YES; 504 | SDKROOT = iphoneos; 505 | SWIFT_COMPILATION_MODE = wholemodule; 506 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 507 | VALIDATE_PRODUCT = YES; 508 | }; 509 | name = Release; 510 | }; 511 | AAEF9D67291ED9FB0089149B /* Debug */ = { 512 | isa = XCBuildConfiguration; 513 | buildSettings = { 514 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 515 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 516 | CODE_SIGN_ENTITLEMENTS = palera1nLoader/palera1nLoader.entitlements; 517 | CODE_SIGN_STYLE = Automatic; 518 | CURRENT_PROJECT_VERSION = 1; 519 | DEVELOPMENT_TEAM = M485NQ89DK; 520 | ENABLE_PREVIEWS = YES; 521 | GENERATE_INFOPLIST_FILE = YES; 522 | INFOPLIST_FILE = palera1nLoader/Info.plist; 523 | INFOPLIST_KEY_CFBundleDisplayName = bakera1n; 524 | INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools"; 525 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 526 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 527 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 528 | INFOPLIST_KEY_UIRequiresFullScreen = YES; 529 | INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDarkContent; 530 | INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; 531 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; 532 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 533 | LD_RUNPATH_SEARCH_PATHS = ( 534 | "$(inherited)", 535 | "@executable_path/Frameworks", 536 | ); 537 | MARKETING_VERSION = 1.0; 538 | PRODUCT_BUNDLE_IDENTIFIER = com.bakera1n.bakera1n; 539 | PRODUCT_NAME = "$(TARGET_NAME)"; 540 | SWIFT_EMIT_LOC_STRINGS = YES; 541 | SWIFT_OBJC_BRIDGING_HEADER = palera1nLoader/BridgingHeader.h; 542 | SWIFT_VERSION = 5.0; 543 | TARGETED_DEVICE_FAMILY = "1,2"; 544 | }; 545 | name = Debug; 546 | }; 547 | AAEF9D68291ED9FB0089149B /* Release */ = { 548 | isa = XCBuildConfiguration; 549 | buildSettings = { 550 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 551 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 552 | CODE_SIGN_ENTITLEMENTS = palera1nLoader/palera1nLoader.entitlements; 553 | CODE_SIGN_STYLE = Automatic; 554 | CURRENT_PROJECT_VERSION = 1; 555 | DEVELOPMENT_TEAM = M485NQ89DK; 556 | ENABLE_PREVIEWS = YES; 557 | GENERATE_INFOPLIST_FILE = YES; 558 | INFOPLIST_FILE = palera1nLoader/Info.plist; 559 | INFOPLIST_KEY_CFBundleDisplayName = bakera1n; 560 | INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools"; 561 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 562 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 563 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 564 | INFOPLIST_KEY_UIRequiresFullScreen = YES; 565 | INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleDarkContent; 566 | INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; 567 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; 568 | IPHONEOS_DEPLOYMENT_TARGET = 15.0; 569 | LD_RUNPATH_SEARCH_PATHS = ( 570 | "$(inherited)", 571 | "@executable_path/Frameworks", 572 | ); 573 | MARKETING_VERSION = 1.0; 574 | PRODUCT_BUNDLE_IDENTIFIER = com.bakera1n.bakera1n; 575 | PRODUCT_NAME = "$(TARGET_NAME)"; 576 | SWIFT_EMIT_LOC_STRINGS = YES; 577 | SWIFT_OBJC_BRIDGING_HEADER = palera1nLoader/BridgingHeader.h; 578 | SWIFT_VERSION = 5.0; 579 | TARGETED_DEVICE_FAMILY = "1,2"; 580 | }; 581 | name = Release; 582 | }; 583 | /* End XCBuildConfiguration section */ 584 | 585 | /* Begin XCConfigurationList section */ 586 | 331E9B7F2932CABD00363FA9 /* Build configuration list for PBXNativeTarget "palera1nHelper" */ = { 587 | isa = XCConfigurationList; 588 | buildConfigurations = ( 589 | 331E9B802932CABD00363FA9 /* Debug */, 590 | 331E9B812932CABD00363FA9 /* Release */, 591 | ); 592 | defaultConfigurationIsVisible = 0; 593 | defaultConfigurationName = Release; 594 | }; 595 | AAEF9D53291ED9F80089149B /* Build configuration list for PBXProject "palera1nLoader" */ = { 596 | isa = XCConfigurationList; 597 | buildConfigurations = ( 598 | AAEF9D64291ED9FB0089149B /* Debug */, 599 | AAEF9D65291ED9FB0089149B /* Release */, 600 | ); 601 | defaultConfigurationIsVisible = 0; 602 | defaultConfigurationName = Release; 603 | }; 604 | AAEF9D66291ED9FB0089149B /* Build configuration list for PBXNativeTarget "palera1nLoader" */ = { 605 | isa = XCConfigurationList; 606 | buildConfigurations = ( 607 | AAEF9D67291ED9FB0089149B /* Debug */, 608 | AAEF9D68291ED9FB0089149B /* Release */, 609 | ); 610 | defaultConfigurationIsVisible = 0; 611 | defaultConfigurationName = Release; 612 | }; 613 | /* End XCConfigurationList section */ 614 | 615 | /* Begin XCRemoteSwiftPackageReference section */ 616 | AA95DBCA292059980055F1C0 /* XCRemoteSwiftPackageReference "BitByteData" */ = { 617 | isa = XCRemoteSwiftPackageReference; 618 | repositoryURL = "https://github.com/tsolomko/BitByteData"; 619 | requirement = { 620 | kind = upToNextMajorVersion; 621 | minimumVersion = 2.0.0; 622 | }; 623 | }; 624 | AA95DBCD292059B60055F1C0 /* XCRemoteSwiftPackageReference "SWCompression" */ = { 625 | isa = XCRemoteSwiftPackageReference; 626 | repositoryURL = "https://github.com/tsolomko/SWCompression.git"; 627 | requirement = { 628 | branch = develop; 629 | kind = branch; 630 | }; 631 | }; 632 | AA95DBD0292059DC0055F1C0 /* XCRemoteSwiftPackageReference "swift-argument-parser" */ = { 633 | isa = XCRemoteSwiftPackageReference; 634 | repositoryURL = "https://github.com/apple/swift-argument-parser.git"; 635 | requirement = { 636 | kind = upToNextMajorVersion; 637 | minimumVersion = 1.0.0; 638 | }; 639 | }; 640 | AAC7DE31291F1AED000CD15B /* XCRemoteSwiftPackageReference "IrregularGradient" */ = { 641 | isa = XCRemoteSwiftPackageReference; 642 | repositoryURL = "https://github.com/joogps/IrregularGradient"; 643 | requirement = { 644 | kind = upToNextMajorVersion; 645 | minimumVersion = 2.0.0; 646 | }; 647 | }; 648 | AAC7DE34291F1EBD000CD15B /* XCRemoteSwiftPackageReference "SDWebImageswiftui" */ = { 649 | isa = XCRemoteSwiftPackageReference; 650 | repositoryURL = "https://github.com/SDWebImage/SDWebImageswiftui"; 651 | requirement = { 652 | kind = upToNextMajorVersion; 653 | minimumVersion = 2.0.0; 654 | }; 655 | }; 656 | /* End XCRemoteSwiftPackageReference section */ 657 | 658 | /* Begin XCSwiftPackageProductDependency section */ 659 | 331E9B852932CBED00363FA9 /* SWCompression */ = { 660 | isa = XCSwiftPackageProductDependency; 661 | package = AA95DBCD292059B60055F1C0 /* XCRemoteSwiftPackageReference "SWCompression" */; 662 | productName = SWCompression; 663 | }; 664 | 331E9B892932CD1000363FA9 /* SWCompression */ = { 665 | isa = XCSwiftPackageProductDependency; 666 | package = AA95DBCD292059B60055F1C0 /* XCRemoteSwiftPackageReference "SWCompression" */; 667 | productName = SWCompression; 668 | }; 669 | 331E9B8B2932CD1700363FA9 /* ArgumentParser */ = { 670 | isa = XCSwiftPackageProductDependency; 671 | package = AA95DBD0292059DC0055F1C0 /* XCRemoteSwiftPackageReference "swift-argument-parser" */; 672 | productName = ArgumentParser; 673 | }; 674 | AA95DBCB292059980055F1C0 /* BitByteData */ = { 675 | isa = XCSwiftPackageProductDependency; 676 | package = AA95DBCA292059980055F1C0 /* XCRemoteSwiftPackageReference "BitByteData" */; 677 | productName = BitByteData; 678 | }; 679 | AAC7DE32291F1AED000CD15B /* IrregularGradient */ = { 680 | isa = XCSwiftPackageProductDependency; 681 | package = AAC7DE31291F1AED000CD15B /* XCRemoteSwiftPackageReference "IrregularGradient" */; 682 | productName = IrregularGradient; 683 | }; 684 | AAC7DE35291F1EBD000CD15B /* SDWebImageSwiftUI */ = { 685 | isa = XCSwiftPackageProductDependency; 686 | package = AAC7DE34291F1EBD000CD15B /* XCRemoteSwiftPackageReference "SDWebImageswiftui" */; 687 | productName = SDWebImageSwiftUI; 688 | }; 689 | AAD65B0C2932EBF000DF88E6 /* ArgumentParser */ = { 690 | isa = XCSwiftPackageProductDependency; 691 | package = AA95DBD0292059DC0055F1C0 /* XCRemoteSwiftPackageReference "swift-argument-parser" */; 692 | productName = ArgumentParser; 693 | }; 694 | /* End XCSwiftPackageProductDependency section */ 695 | }; 696 | rootObject = AAEF9D50291ED9F80089149B /* Project object */; 697 | } 698 | -------------------------------------------------------------------------------- /palera1nLoader.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /palera1nLoader.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /palera1nLoader.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "pins" : [ 3 | { 4 | "identity" : "bitbytedata", 5 | "kind" : "remoteSourceControl", 6 | "location" : "https://github.com/tsolomko/BitByteData", 7 | "state" : { 8 | "revision" : "b4b41619522aacd7aae7b02fa8360833e796a03d", 9 | "version" : "2.0.2" 10 | } 11 | }, 12 | { 13 | "identity" : "irregulargradient", 14 | "kind" : "remoteSourceControl", 15 | "location" : "https://github.com/joogps/IrregularGradient", 16 | "state" : { 17 | "revision" : "104d51be2eeb2b3c3db67c0aced7bda0f2239075", 18 | "version" : "2.0.1" 19 | } 20 | }, 21 | { 22 | "identity" : "sdwebimage", 23 | "kind" : "remoteSourceControl", 24 | "location" : "https://github.com/SDWebImage/SDWebImage.git", 25 | "state" : { 26 | "revision" : "3312bf5e67b52fbce7c3caf431b0cda721a9f7bb", 27 | "version" : "5.14.2" 28 | } 29 | }, 30 | { 31 | "identity" : "sdwebimageswiftui", 32 | "kind" : "remoteSourceControl", 33 | "location" : "https://github.com/SDWebImage/SDWebImageswiftui", 34 | "state" : { 35 | "revision" : "ed288667c909c89127ab1b690113a3e397af3098", 36 | "version" : "2.2.1" 37 | } 38 | }, 39 | { 40 | "identity" : "swcompression", 41 | "kind" : "remoteSourceControl", 42 | "location" : "https://github.com/tsolomko/SWCompression.git", 43 | "state" : { 44 | "branch" : "develop", 45 | "revision" : "c7f4665394dd668c1953817c4567c314eb97fda9" 46 | } 47 | }, 48 | { 49 | "identity" : "swift-argument-parser", 50 | "kind" : "remoteSourceControl", 51 | "location" : "https://github.com/apple/swift-argument-parser.git", 52 | "state" : { 53 | "revision" : "fddd1c00396eed152c45a46bea9f47b98e59301d", 54 | "version" : "1.2.0" 55 | } 56 | } 57 | ], 58 | "version" : 2 59 | } 60 | -------------------------------------------------------------------------------- /palera1nLoader.xcodeproj/project.xcworkspace/xcuserdata/llsc12.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mineek/bakera1n_loader/88b577ac587a7613ac2df218b9f30af25ae6f507/palera1nLoader.xcodeproj/project.xcworkspace/xcuserdata/llsc12.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /palera1nLoader.xcodeproj/project.xcworkspace/xcuserdata/mineek.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mineek/bakera1n_loader/88b577ac587a7613ac2df218b9f30af25ae6f507/palera1nLoader.xcodeproj/project.xcworkspace/xcuserdata/mineek.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /palera1nLoader.xcodeproj/project.xcworkspace/xcuserdata/nebula.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mineek/bakera1n_loader/88b577ac587a7613ac2df218b9f30af25ae6f507/palera1nLoader.xcodeproj/project.xcworkspace/xcuserdata/nebula.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /palera1nLoader.xcodeproj/xcuserdata/llsc12.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 21 | 22 | 36 | 37 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /palera1nLoader.xcodeproj/xcuserdata/llsc12.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | palera1nHelper.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | palera1nLoader.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /palera1nLoader.xcodeproj/xcuserdata/mineek.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | palera1nHelper.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 1 11 | 12 | palera1nLoader.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /palera1nLoader.xcodeproj/xcuserdata/nebula.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | palera1nHelper.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | palera1nLoader.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /palera1nLoader/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.976", 9 | "green" : "0.000", 10 | "red" : "1.000" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | } 15 | ], 16 | "info" : { 17 | "author" : "xcode", 18 | "version" : 1 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /palera1nLoader/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "platform" : "ios", 6 | "size" : "1024x1024" 7 | } 8 | ], 9 | "info" : { 10 | "author" : "xcode", 11 | "version" : 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /palera1nLoader/Assets.xcassets/CellBackground.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "extended-gray", 6 | "components" : { 7 | "alpha" : "0.500", 8 | "white" : "0.000" 9 | } 10 | }, 11 | "idiom" : "universal" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /palera1nLoader/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /palera1nLoader/Assets.xcassets/palera1n-white.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "palera1n-white.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /palera1nLoader/Assets.xcassets/palera1n-white.imageset/palera1n-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mineek/bakera1n_loader/88b577ac587a7613ac2df218b9f30af25ae6f507/palera1nLoader/Assets.xcassets/palera1n-white.imageset/palera1n-white.png -------------------------------------------------------------------------------- /palera1nLoader/BridgingHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // Pogo-BridgingHeader.h 3 | // Pogo 4 | // 5 | // Created by Amy While on 12/09/2022. 6 | // 7 | 8 | #ifndef Pogo_BridgingHeader_h 9 | #define Pogo_BridgingHeader_h 10 | 11 | #include 12 | 13 | #define POSIX_SPAWN_PERSONA_FLAGS_OVERRIDE 1 14 | int posix_spawnattr_set_persona_np(const posix_spawnattr_t* __restrict, uid_t, uint32_t); 15 | int posix_spawnattr_set_persona_uid_np(const posix_spawnattr_t* __restrict, uid_t); 16 | int posix_spawnattr_set_persona_gid_np(const posix_spawnattr_t* __restrict, uid_t); 17 | 18 | 19 | #endif /* Pogo_BridgingHeader_h */ 20 | -------------------------------------------------------------------------------- /palera1nLoader/CommandRunner.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CommandRunner.swift 3 | // palera1nLoader 4 | // 5 | // Created by Lakhan Lothiyi on 12/11/2022. 6 | // 7 | // This code belongs to Amy While and is from https://github.com/elihwyma/Pogo/blob/main/Pogo/CommandRunner.swift 8 | 9 | import Foundation 10 | import Darwin.POSIX 11 | 12 | @discardableResult func spawn(command: String, args: [String], root: Bool) -> Int { 13 | var pipestdout: [Int32] = [0, 0] 14 | var pipestderr: [Int32] = [0, 0] 15 | 16 | let bufsiz = Int(BUFSIZ) 17 | 18 | pipe(&pipestdout) 19 | pipe(&pipestderr) 20 | 21 | guard fcntl(pipestdout[0], F_SETFL, O_NONBLOCK) != -1 else { 22 | NSLog("[palera1n] Could not open stdout") 23 | return -1 24 | } 25 | guard fcntl(pipestderr[0], F_SETFL, O_NONBLOCK) != -1 else { 26 | NSLog("[palera1n] Could not open stderr") 27 | return -1 28 | } 29 | 30 | let args: [String] = [String(command.split(separator: "/").last!)] + args 31 | let argv: [UnsafeMutablePointer?] = args.map { $0.withCString(strdup) } 32 | defer { for case let arg? in argv { free(arg) } } 33 | 34 | var fileActions: posix_spawn_file_actions_t? 35 | if root { 36 | posix_spawn_file_actions_init(&fileActions) 37 | posix_spawn_file_actions_addclose(&fileActions, pipestdout[0]) 38 | posix_spawn_file_actions_addclose(&fileActions, pipestderr[0]) 39 | posix_spawn_file_actions_adddup2(&fileActions, pipestdout[1], STDOUT_FILENO) 40 | posix_spawn_file_actions_adddup2(&fileActions, pipestderr[1], STDERR_FILENO) 41 | posix_spawn_file_actions_addclose(&fileActions, pipestdout[1]) 42 | posix_spawn_file_actions_addclose(&fileActions, pipestderr[1]) 43 | } 44 | 45 | var attr: posix_spawnattr_t? 46 | posix_spawnattr_init(&attr) 47 | posix_spawnattr_set_persona_np(&attr, 99, UInt32(POSIX_SPAWN_PERSONA_FLAGS_OVERRIDE)); 48 | posix_spawnattr_set_persona_uid_np(&attr, 0); 49 | posix_spawnattr_set_persona_gid_np(&attr, 0); 50 | 51 | /* 52 | export PATH='/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/sbin:/usr/sbin:/usr/bin:/usr/bin:/sbin:/sbin:/bin:/bin:/usr/bin/X11:/usr/bin/X11:/usr/games:/usr/games' 53 | */ 54 | 55 | let env = [ "PATH=/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/sbin:/usr/sbin:/usr/bin:/usr/bin:/sbin:/sbin:/bin:/bin:/usr/bin/X11:/usr/bin/X11:/usr/games:/usr/games" ] 56 | let proenv: [UnsafeMutablePointer?] = env.map { $0.withCString(strdup) } 57 | defer { for case let pro? in proenv { free(pro) } } 58 | 59 | var pid: pid_t = 0 60 | let spawnStatus = posix_spawn(&pid, command, &fileActions, &attr, argv + [nil], proenv + [nil]) 61 | if spawnStatus != 0 { 62 | NSLog("[palera1n] Spawn Status = \(spawnStatus)") 63 | return -1 64 | } 65 | 66 | close(pipestdout[1]) 67 | close(pipestderr[1]) 68 | 69 | var stdoutStr = "" 70 | var stderrStr = "" 71 | 72 | let mutex = DispatchSemaphore(value: 0) 73 | 74 | let readQueue = DispatchQueue(label: "com.amywhile.pogo.command", 75 | qos: .userInitiated, 76 | attributes: .concurrent, 77 | autoreleaseFrequency: .inherit, 78 | target: nil) 79 | 80 | let stdoutSource = DispatchSource.makeReadSource(fileDescriptor: pipestdout[0], queue: readQueue) 81 | let stderrSource = DispatchSource.makeReadSource(fileDescriptor: pipestderr[0], queue: readQueue) 82 | 83 | stdoutSource.setCancelHandler { 84 | close(pipestdout[0]) 85 | mutex.signal() 86 | } 87 | stderrSource.setCancelHandler { 88 | close(pipestderr[0]) 89 | mutex.signal() 90 | } 91 | 92 | stdoutSource.setEventHandler { 93 | let buffer = UnsafeMutablePointer.allocate(capacity: bufsiz) 94 | defer { buffer.deallocate() } 95 | 96 | let bytesRead = read(pipestdout[0], buffer, bufsiz) 97 | guard bytesRead > 0 else { 98 | if bytesRead == -1 && errno == EAGAIN { 99 | return 100 | } 101 | 102 | stdoutSource.cancel() 103 | return 104 | } 105 | 106 | let array = Array(UnsafeBufferPointer(start: buffer, count: bytesRead)) + [UInt8(0)] 107 | array.withUnsafeBufferPointer { ptr in 108 | let str = String(cString: unsafeBitCast(ptr.baseAddress, to: UnsafePointer.self)) 109 | stdoutStr += str 110 | } 111 | } 112 | stderrSource.setEventHandler { 113 | let buffer = UnsafeMutablePointer.allocate(capacity: bufsiz) 114 | defer { buffer.deallocate() } 115 | 116 | let bytesRead = read(pipestderr[0], buffer, bufsiz) 117 | guard bytesRead > 0 else { 118 | if bytesRead == -1 && errno == EAGAIN { 119 | return 120 | } 121 | 122 | stderrSource.cancel() 123 | return 124 | } 125 | 126 | let array = Array(UnsafeBufferPointer(start: buffer, count: bytesRead)) + [UInt8(0)] 127 | array.withUnsafeBufferPointer { ptr in 128 | let str = String(cString: unsafeBitCast(ptr.baseAddress, to: UnsafePointer.self)) 129 | stderrStr += str 130 | } 131 | } 132 | 133 | stdoutSource.resume() 134 | stderrSource.resume() 135 | 136 | mutex.wait() 137 | mutex.wait() 138 | var status: Int32 = 0 139 | waitpid(pid, &status, 0) 140 | NSLog("[palera1n] \(status) \(stdoutStr) \(stderrStr)") 141 | return Int(status) 142 | } 143 | -------------------------------------------------------------------------------- /palera1nLoader/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // bakera1nLoader 4 | // 5 | // Created by Lakhan Lothiyi on 11/11/2022. 6 | // 7 | 8 | import SwiftUI 9 | import SDWebImageSwiftUI 10 | 11 | struct ContentView: View { 12 | @State private var bootstrapping = false 13 | private var serverURL = "https://static.palera.in/" 14 | var body: some View { 15 | VStack { 16 | Text("bakera1n Loader") 17 | .font(.largeTitle) 18 | .fontWeight(.bold) 19 | .padding(.top, 20) 20 | Text("by bakera1n developer") 21 | .font(.caption) 22 | .padding(.bottom, 20) 23 | 24 | List { 25 | Section(header: Text("Install")) { 26 | Button(action: { 27 | let alert = UIAlertController(title: "Install Sileo", message: "Are you sure you want to install Sileo?", preferredStyle: .actionSheet) 28 | alert.addAction(UIAlertAction(title: "Install", style: .destructive, handler: { _ in 29 | bootstrapping = true 30 | strap() 31 | })) 32 | alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil)) 33 | UIApplication.shared.windows.first?.rootViewController?.present(alert, animated: true, completion: nil) 34 | }) { 35 | HStack { 36 | // web image view 37 | WebImage(url: URL(string: "https://upload.wikimedia.org/wikipedia/commons/f/fb/Icon_Sileo.png")) 38 | .resizable() 39 | .frame(width: 50, height: 50) 40 | .cornerRadius(10) 41 | Text("Sileo") 42 | .font(.title2) 43 | .fontWeight(.semibold) 44 | .foregroundColor(.white) 45 | } 46 | } 47 | } 48 | } 49 | .listStyle(GroupedListStyle()) 50 | } 51 | // if we're bootstrapping, show a spinner 52 | .overlay( 53 | Group { 54 | if bootstrapping { 55 | ProgressView() 56 | } 57 | } 58 | ) 59 | } 60 | 61 | private func strap() -> Void { 62 | let msg = "Failed to find bootstrap, downloading..." 63 | NSLog("[palera1n] \(msg)") 64 | let url = URL(string: serverURL + "bootstrap.tar")! 65 | // remove old bootstrap if it exists 66 | let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] 67 | let fileURL = documentsURL.appendingPathComponent("bootstrap.tar") 68 | try? FileManager.default.removeItem(at: fileURL) 69 | let task = URLSession.shared.downloadTask(with: url) { location, response, error in 70 | guard let location = location, error == nil else { return } 71 | do { 72 | let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] 73 | let fileURL = documentsURL.appendingPathComponent("bootstrap.tar") 74 | try FileManager.default.moveItem(at: location, to: fileURL) 75 | let tar = fileURL.path 76 | NSLog("[palera1n] Downloaded bootstrap") 77 | guard let helper = Bundle.main.path(forAuxiliaryExecutable: "palera1nHelper") else { 78 | let msg = "Could not find Helper" 79 | NSLog("[palera1n] \(msg)") 80 | return 81 | } 82 | 83 | guard let deb = Bundle.main.path(forResource: "sileo", ofType: "deb") else { 84 | let msg = "Could not find Sileo" 85 | NSLog("[palera1n] \(msg)") 86 | return 87 | } 88 | 89 | guard let libswift = Bundle.main.path(forResource: "libswift", ofType: "deb") else { 90 | let msg = "Could not find libswift deb" 91 | NSLog("[palera1n] \(msg)") 92 | return 93 | } 94 | 95 | guard let safemode = Bundle.main.path(forResource: "safemode", ofType: "deb") else { 96 | let msg = "Could not find SafeMode" 97 | NSLog("[palera1n] \(msg)") 98 | return 99 | } 100 | 101 | guard let preferenceloader = Bundle.main.path(forResource: "preferenceloader", ofType: "deb") else { 102 | let msg = "Could not find PreferenceLoader" 103 | NSLog("[palera1n] \(msg)") 104 | return 105 | } 106 | 107 | guard let substitute = Bundle.main.path(forResource: "substitute", ofType: "deb") else { 108 | let msg = "Could not find Substitute" 109 | NSLog("[palera1n] \(msg)") 110 | return 111 | } 112 | 113 | guard let strapRepo = Bundle.main.path(forResource: "straprepo", ofType: "deb") else { 114 | let msg = "Could not find strap repo deb" 115 | NSLog("[palera1n] \(msg)") 116 | return 117 | } 118 | 119 | DispatchQueue.global(qos: .utility).async { [self] in 120 | spawn(command: "/sbin/mount", args: ["-uw", "/private/preboot"], root: true) 121 | spawn(command: "/sbin/mount", args: ["-uw", "/"], root: true) 122 | 123 | let ret = spawn(command: helper, args: ["-i", tar], root: true) 124 | 125 | spawn(command: "/usr/bin/chmod", args: ["4755", "/usr/bin/sudo"], root: true) 126 | spawn(command: "/usr/bin/chown", args: ["root:wheel", "/usr/bin/sudo"], root: true) 127 | 128 | DispatchQueue.main.async { 129 | if ret != 0 { 130 | return 131 | } 132 | DispatchQueue.global(qos: .utility).async { 133 | let ret = spawn(command: "/usr/bin/sh", args: ["/prep_bootstrap.sh"], root: true) 134 | DispatchQueue.main.async { 135 | if ret != 0 { 136 | return 137 | } 138 | DispatchQueue.global(qos: .utility).async { 139 | let ret = spawn(command: "/usr/bin/dpkg", args: ["-i", deb, libswift, safemode, preferenceloader, substitute], root: true) 140 | DispatchQueue.main.async { 141 | if ret != 0 { 142 | return 143 | } 144 | DispatchQueue.global(qos: .utility).async { 145 | let ret = spawn(command: "/usr/bin/uicache", args: ["-a"], root: true) 146 | DispatchQueue.main.async { 147 | if ret != 0 { 148 | return 149 | } 150 | DispatchQueue.global(qos: .utility).async { 151 | let ret = spawn(command: "/usr/bin/dpkg", args: ["-i", strapRepo], root: true) 152 | DispatchQueue.main.async { 153 | if ret != 0 { 154 | return 155 | } 156 | DispatchQueue.main.asyncAfter(deadline: .now() + 5) { 157 | bootstrapping = false 158 | UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) 159 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { 160 | exit(0) 161 | } 162 | } 163 | } 164 | } 165 | } 166 | } 167 | } 168 | } 169 | } 170 | } 171 | } 172 | } 173 | } catch { 174 | NSLog("[palera1n] Failed to download bootstrap") 175 | } 176 | } 177 | task.resume() 178 | } 179 | } 180 | 181 | struct ContentView_Previews: PreviewProvider { 182 | static var previews: some View { 183 | ContentView() 184 | .preferredColorScheme(.dark) 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /palera1nLoader/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TSRootBinaries 6 | 7 | palera1nHelper 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /palera1nLoader/SysInfo.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SysInfo.swift 3 | // palera1nLoader 4 | // 5 | // Created by Lakhan Lothiyi on 11/11/2022. 6 | // 7 | 8 | import Foundation 9 | 10 | func uname() -> String { 11 | var unameData = utsname() 12 | uname(&unameData) 13 | let machineMirror = Mirror(reflecting: unameData.version) 14 | let unamestr = machineMirror.children.reduce("") { identifier, element in 15 | guard let value = element.value as? Int8 , value != 0 else { return identifier } 16 | return identifier + String(UnicodeScalar(UInt8(value))) 17 | } 18 | return unamestr 19 | } 20 | -------------------------------------------------------------------------------- /palera1nLoader/Utilities.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Utilities.swift 3 | // palera1nLoader 4 | // 5 | // Created by Lakhan Lothiyi on 28/11/2022. 6 | // 7 | 8 | import Foundation 9 | import SwiftUI 10 | 11 | 12 | class utils { 13 | 14 | static func respring() { 15 | guard let window = UIApplication.shared.windows.first else { fatalError() } 16 | while true { 17 | window.snapshotView(afterScreenUpdates: false) 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /palera1nLoader/palera1nLoader.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /palera1nLoader/palera1nLoaderApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // palera1nLoaderApp.swift 3 | // palera1nLoader 4 | // 5 | // Created by Lakhan Lothiyi on 11/11/2022. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct palera1nLoaderApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | .preferredColorScheme(.dark) 16 | } 17 | } 18 | } 19 | --------------------------------------------------------------------------------