|
13 | 13 |
|
14 | 14 | int getCFMajorVersion() |
15 | 15 | { |
| 16 | + if(@available(iOS 16.0, *)) { |
| 17 | + return 1900; |
| 18 | + } |
| 19 | + |
16 | 20 | return ((int)kCFCoreFoundationVersionNumber / 100) * 100; |
17 | 21 | } |
18 | 22 |
|
@@ -80,6 +84,43 @@ int disableRootHideBlacklist() |
80 | 84 | return 0; |
81 | 85 | } |
82 | 86 |
|
| 87 | +int fixPackageSources() |
| 88 | +{ |
| 89 | + NSArray* sileoSources = [NSFileManager.defaultManager directoryContentsAtPath:jbroot(@"/etc/apt/sources.list.d")]; |
| 90 | + ASSERT(sileoSources != NULL); |
| 91 | + for(NSString* item in sileoSources) |
| 92 | + { |
| 93 | + NSString* source = [jbroot(@"/etc/apt/sources.list.d") stringByAppendingPathComponent:item]; |
| 94 | + NSString* sileoList = [NSString stringWithContentsOfFile:source encoding:NSUTF8StringEncoding error:nil]; |
| 95 | + ASSERT(sileoList != NULL); |
| 96 | + |
| 97 | + if([sileoList containsString:@"iphoneos-arm64e/2000"]) { |
| 98 | + if([NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/var/lib/apt/lists")]) |
| 99 | + ASSERT([NSFileManager.defaultManager removeItemAtPath:jbroot(@"/var/lib/apt/lists") error:nil]); |
| 100 | + if([NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/var/lib/apt/sileolists")]) |
| 101 | + ASSERT([NSFileManager.defaultManager removeItemAtPath:jbroot(@"/var/lib/apt/sileolists") error:nil]); |
| 102 | + } |
| 103 | + |
| 104 | + sileoList = [sileoList stringByReplacingOccurrencesOfString:@"iphoneos-arm64e/2000" withString:@"iphoneos-arm64e/1900"]; |
| 105 | + |
| 106 | + ASSERT([sileoList writeToFile:source atomically:YES encoding:NSUTF8StringEncoding error:nil]); |
| 107 | + } |
| 108 | + |
| 109 | + |
| 110 | + NSString* zebraList = [NSString stringWithContentsOfFile:jbroot(@"/var/mobile/Library/Application Support/xyz.willy.Zebra/sources.list") encoding:NSUTF8StringEncoding error:nil]; |
| 111 | + ASSERT(zebraList != NULL); |
| 112 | + if([zebraList containsString:@"iphoneos-arm64e/2000"]) { |
| 113 | + if([NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/var/mobile/Library/Application Support/xyz.willy.Zebra/lists")]) |
| 114 | + ASSERT([NSFileManager.defaultManager removeItemAtPath:jbroot(@"/var/mobile/Library/Application Support/xyz.willy.Zebra/lists") error:nil]); |
| 115 | + if([NSFileManager.defaultManager fileExistsAtPath:jbroot(@"/var/mobile/Library/Application Support/xyz.willy.Zebra/zebra.db")]) |
| 116 | + ASSERT([NSFileManager.defaultManager removeItemAtPath:jbroot(@"/var/mobile/Library/Application Support/xyz.willy.Zebra/zebra.db") error:nil]); |
| 117 | + } |
| 118 | + zebraList = [zebraList stringByReplacingOccurrencesOfString:@"iphoneos-arm64e/2000" withString:@"iphoneos-arm64e/1900"]; |
| 119 | + ASSERT([zebraList writeToFile:jbroot(@"/var/mobile/Library/Application Support/xyz.willy.Zebra/sources.list") atomically:YES encoding:NSUTF8StringEncoding error:nil]); |
| 120 | + |
| 121 | + return 0; |
| 122 | +} |
| 123 | + |
83 | 124 | int buildPackageSources() |
84 | 125 | { |
85 | 126 | NSFileManager* fm = NSFileManager.defaultManager; |
@@ -239,6 +280,9 @@ int InstallBootstrap(NSString* jbroot_path) |
239 | 280 |
|
240 | 281 | STRAPLOG("Status: Bootstrap Installed"); |
241 | 282 |
|
| 283 | + if(@available(iOS 16.0, *)) { |
| 284 | + ASSERT([[NSString new] writeToFile:jbroot(@"/var/mobile/.allow_url_schemes") atomically:YES encoding:NSUTF8StringEncoding error:nil]); |
| 285 | + } |
242 | 286 |
|
243 | 287 | return 0; |
244 | 288 | } |
@@ -319,6 +363,8 @@ int ReRandomizeBootstrap() |
319 | 363 | ASSERT(fixBootstrapSymlink(@"/usr/bin/sh") == 0); |
320 | 364 | ASSERT(spawnBootstrap((char*[]){"/bin/sh", "/usr/libexec/updatelinks.sh", NULL}, nil, nil) == 0); |
321 | 365 |
|
| 366 | + ASSERT(fixPackageSources() == 0); |
| 367 | + |
322 | 368 | return 0; |
323 | 369 | } |
324 | 370 |
|
|
0 commit comments