Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 805 lines (605 sloc) 19.36 kB
2336b1e 0.6.7 changes
FireCore, LLC authored
1 //
2 // FWBundle.m
3 // tetherKit
4 //
5 // Created by Kevin Bradley on 1/14/11.
6 // Copyright 2011 FireCore, LLC. All rights reserved.
7 //
8
9 #import "FWBundle.h"
10 #import "nitoUtility.h"
1cb68d2 latest and greatest 0.8.2 441
Kevin Bradley authored
11 #import "TSSManager.h"
2336b1e 0.6.7 changes
FireCore, LLC authored
12
13
14 @implementation FWBundle
15
16 @synthesize fwRoot;
17
1cb68d2 latest and greatest 0.8.2 441
Kevin Bradley authored
18
19
2336b1e 0.6.7 changes
FireCore, LLC authored
20 + (FWBundle *)bundleWithName:(NSString *)bundleName
21 {
22
23 NSString *thePath = [[NSBundle mainBundle] pathForResource:bundleName ofType:@"bundle" inDirectory:@"bundles"];
24 if (![FM fileExistsAtPath:thePath])
25 return nil;
26 FWBundle *theBundle = [[FWBundle alloc] initWithPath:thePath];
27 theBundle.fwRoot = TMP_ROOT;
28 return [theBundle autorelease];
29 }
30
31 + (FWBundle *)bundleForFile:(NSString *)theFile
32 {
33 NSString *filename = [[theFile lastPathComponent] stringByDeletingPathExtension];
34 NSArray *filenameSplit = [filename componentsSeparatedByString:@"_Restore"];
35 NSString *newName = [filenameSplit objectAtIndex:0];
36 //NSLog(@"checking for: %@", newName);
37 FWBundle *theBundle = [FWBundle bundleWithName:newName];
38 //NSLog(@"theBundle: %@", theBundle);
39 return theBundle;
40 }
41
42 /*
43
44 BuildIdentities - > object at index 0 - > Manifest (dict) - > KernelCache
45 BuildIdentities - > object at index 0 - > Manifest (dict) - > iBSS
46
47 */
48
c25ea5e @lechium major cleanup work
lechium authored
49 //DownloadUrl
50
51 - (NSString *)downloadURL
52 {
53 NSString *url = [[self infoDictionary] valueForKey:DOWNLOAD_URL];
54 if ([url length] > 1)
55 return url;
56
57 return nil;
58 }
59
60 - (NSString *)SHA
61 {
62 return [[self infoDictionary] valueForKey:SHA_ONE];
63 }
64
476eb6e tried to make some fixes for partition sizes, may not have worked, ma…
Kevin Bradley authored
65
2336b1e 0.6.7 changes
FireCore, LLC authored
66 - (NSDictionary *)buildManifest
67 {
68 NSArray *buildIdentities = [[self fwDictionary] objectForKey:@"BuildIdentities"];
69 NSDictionary *one = [buildIdentities lastObject];
70 return [one valueForKey:@"Manifest"];
71
72 }
73
74 - (NSString *)kernelCacheName
75 {
76 return [[[[self buildManifest] valueForKey:@"KernelCache"] valueForKey:@"Info"] valueForKey:@"Path"];
77 }
78
79 - (NSString *)iBSSName
80 {
81 return [[[[self buildManifest] valueForKey:@"iBSS"] valueForKey:@"Info"] valueForKey:@"Path"];
82 }
83
1d3c9f8 latest goodness
kevin bradley authored
84
85 - (NSString *)iBECName
86 {
87 return [[[[self buildManifest] valueForKey:@"iBEC"] valueForKey:@"Info"] valueForKey:@"Path"];
88 }
89
476eb6e tried to make some fixes for partition sizes, may not have worked, ma…
Kevin Bradley authored
90 - (NSString *)buildManifestPath
91 {
92 NSString *buildM = [TMP_ROOT stringByAppendingPathComponent:@"BuildManifest.plist"];
93 if ([FM fileExistsAtPath:buildM])
94 {
95 return buildM;
96
97 }
98 return nil;
99 }
100
101 - (NSString *)restoreDictionaryPath
102 {
103 NSString *restore = [TMP_ROOT stringByAppendingPathComponent:@"Restore.plist"];
104 if ([FM fileExistsAtPath:restore])
105 {
106 return restore;
107
108 }
109 return nil;
110 }
111
112 - (NSMutableDictionary *)mutableFWDictionary
113 {
114 NSString *buildM = [TMP_ROOT stringByAppendingPathComponent:@"BuildManifest.plist"];
115 if ([FM fileExistsAtPath:buildM])
116 {
117 NSMutableDictionary *outputDict = [[NSMutableDictionary alloc] initWithContentsOfFile:buildM];
118 return [outputDict autorelease];
119
120 }
121 return nil;
122 }
1d3c9f8 latest goodness
kevin bradley authored
123
2336b1e 0.6.7 changes
FireCore, LLC authored
124 - (NSDictionary *)fwDictionary
125 {
126 NSString *buildM = [TMP_ROOT stringByAppendingPathComponent:@"BuildManifest.plist"];
127 if ([FM fileExistsAtPath:buildM])
128 {
129 return [NSDictionary dictionaryWithContentsOfFile:buildM];
130
131 } else {
132 buildM = [IPSW_TMP stringByAppendingPathComponent:@"BuildManifest.plist"];
133 if ([FM fileExistsAtPath:buildM])
134 {
135 return [NSDictionary dictionaryWithContentsOfFile:buildM];
136
137 }
138 }
139 return nil;
140 }
141
142 - (NSString *)localBundlePath
143 {
144 return [[nitoUtility applicationSupportFolder] stringByAppendingPathComponent:[[self bundleName] stringByAppendingPathExtension:@"bundle"]];
145 }
146
147 - (NSDictionary *)localManifest
148 {
149 NSString *bundlePath = [self localBundlePath];
150 NSString *bm = [bundlePath stringByAppendingPathComponent:@"BuildManifest.plist"];
151 if ([FM fileExistsAtPath:bm])
152 {
153 return [NSDictionary dictionaryWithContentsOfFile:bm];
154
155 }
156 return nil;
157 }
158
159 - (NSString *)localiBSS
160 {
161 if ([self localManifest] != nil)
162 {
163 return [[self localBundlePath] stringByAppendingPathComponent:[[self localManifest] valueForKey:@"iBSS"]];
164 }
165 return nil;
166 }
167
1d3c9f8 latest goodness
kevin bradley authored
168 - (NSString *)localiBEC
169 {
170 if ([self localManifest] != nil)
171 {
172 return [[self localBundlePath] stringByAppendingPathComponent:[[self localManifest] valueForKey:@"iBEC"]];
173 }
174 return nil;
175 }
176
2336b1e 0.6.7 changes
FireCore, LLC authored
177 - (NSString *)localKernel
178 {
179 if ([self localManifest] != nil)
180 {
181 return [[self localBundlePath] stringByAppendingPathComponent:[[self localManifest] valueForKey:@"KernelCache"]];
182 }
183 return nil;
184 }
185
c25ea5e @lechium major cleanup work
lechium authored
186 - (NSString *)oldOutputFile
187 {
188 return [NSHomeDirectory() stringByAppendingPathComponent:self.outputName];
189 }
190
191 - (NSString *)outputFile
192 {
193 NSString *newOutputFile = [[nitoUtility firmwareFolder] stringByAppendingPathComponent:self.outputName];
194 NSString *oldOutputFile = [self oldOutputFile];
195 NSFileManager *man = [NSFileManager defaultManager];
196 if ([man fileExistsAtPath:oldOutputFile])
197 {
198 if (![man fileExistsAtPath:newOutputFile]) //we have the file in the old location, but not the new. migrate that shit!!
199 {
200 if ([man moveItemAtPath:oldOutputFile toPath:newOutputFile error:nil])
201 {
202 NSLog(@"migrated: %@ to proper location, returning now!", self.outputName);
203 return newOutputFile;
204 } else {
205 NSLog(@"failed to migrate the file, but we still have the old one, so return it anyways");
206 return oldOutputFile;
207 }
208 }
209 }
210
211 //if we got this far, we dont have teh old deprecated file, but we are still not sure if we have hte new proper location either.
c94950d @lechium major show stopping bug fixed for latest release re: new users
lechium authored
212
c25ea5e @lechium major cleanup work
lechium authored
213
c94950d @lechium major show stopping bug fixed for latest release re: new users
lechium authored
214 return newOutputFile; //we got nothing!!!
c25ea5e @lechium major cleanup work
lechium authored
215
216 }
2336b1e 0.6.7 changes
FireCore, LLC authored
217
218 - (NSString *)outputName
219 {
220 return [[self bundleName] stringByAppendingString:@"_SP_Restore.ipsw"];
221 }
222
476eb6e tried to make some fixes for partition sizes, may not have worked, ma…
Kevin Bradley authored
223 /*
224
225 BuildManifest.plist -> BuildIdentities - > Item 01 -> info -> MinimumSystemPartition
226 BuildManifest.plist -> BuildIdentities - > Item 01 -> info -> MinimumSystemPartition
227
228 Restore.plist -> MinimumSystemPartition -> DMG_NAME
229
230 */
231
232 - (BOOL)shouldUpdatePartitionSize
233 {
234 return [self is4point4];
235 }
236
237 - (void)setMinimumSystemPartition:(int)newSize
238 {
239 NSFileManager *man = [NSFileManager defaultManager];
240 NSString *outputFile = [self buildManifestPath];
241
242 if ([man fileExistsAtPath:outputFile])
243 {
244 NSMutableDictionary *fullDict = [self mutableFWDictionary];
245 id buildIdentities = [fullDict objectForKey:@"BuildIdentities"];
246 id one = [buildIdentities lastObject];
247 id infoDict = [one valueForKey:@"Info"];
248 int buildIndex = [buildIdentities count]-1;
249
250 [infoDict setValue:[NSNumber numberWithInt:newSize] forKey:@"MinimumSystemPartition"];
251 [one setObject:infoDict forKey:@"Info"];
252 [buildIdentities replaceObjectAtIndex:buildIndex withObject:one];
253 [fullDict setObject:buildIdentities forKey:@"BuildIdentities"];
254
255 [fullDict writeToFile:outputFile atomically:YES];
256
257 //On to the restore file
258
259 NSString *restoreFile = [self restoreDictionaryPath];
260 if ([man fileExistsAtPath:restoreFile])
261 {
262 NSMutableDictionary *restoreDict = [[NSMutableDictionary alloc] initWithContentsOfFile:restoreFile];
263 id msp = [restoreDict valueForKey:@"MinimumSystemPartition"];
264 NSString *fsKey = [[msp allKeys] lastObject];
265 [msp setValue:[NSNumber numberWithInt:newSize] forKey:fsKey];
266 [restoreDict writeToFile:restoreFile atomically:YES];
267
268 [restoreDict release];
269 restoreDict = nil;
270
271 } else {
272
273 NSLog(@"no file at %@", restoreFile);
274
275 }
276
277
278 } else {
279
280 NSLog(@"editing build manifest for setMinimumSystemPartition failed!!!!! BAIL");
281 }
282
283 }
284
3660578 think for yourself, question authority
FireCore, LLC authored
285 - (NSString *)oldramdiskSize
2336b1e 0.6.7 changes
FireCore, LLC authored
286 {
287 if ([[self bundleName] isEqualToString:@"AppleTV2,1_4.3_8F5148c"])
288 {
289 return @"24676576";
bfdcf83 version 067 (25) added b2 bundle
FireCore, LLC authored
290 } else if ([[self bundleName] isEqualToString:@"AppleTV2,1_4.3_8F5153d"]){
291 return @"24676576";
3660578 think for yourself, question authority
FireCore, LLC authored
292 } else if ([[self bundleName] isEqualToString:@"AppleTV2,1_4.3_8F5166b"]) {
293 return @"24676576";
294 } else {
295 return @"16541920";
296 }
297 }
8111256 4.3 GM support bundle + code added
FireCore, LLC authored
298 //26067520
3660578 think for yourself, question authority
FireCore, LLC authored
299 - (NSString *)ramdiskSize
300 {
301 if ([self is4point3])
8bf24cf its a sekrit
FireCore, LLC authored
302 {//23529796
8111256 4.3 GM support bundle + code added
FireCore, LLC authored
303 return @"26067520";
2336b1e 0.6.7 changes
FireCore, LLC authored
304 } else {
3660578 think for yourself, question authority
FireCore, LLC authored
305 return @"16541920";
306 }
307 }
308
1cb68d2 latest and greatest 0.8.2 441
Kevin Bradley authored
309 - (NSString *)osVersion
310 {
311 NSString *clippedPath = nil;
312 int deviceInteger = [self deviceInt];
313
314 switch (deviceInteger) {
315
316
317 case kAppleTVDevice:
318
319 clippedPath = [[self bundleName] substringWithRange:NSMakeRange(11, 3)];
320 break;
321
322 case kiPadDevice:
323 case kiPodDevice:
324 //iPad1,1_4.3.1_8G4_Restore.ipsw
325 clippedPath = [[self bundleName] substringWithRange:NSMakeRange(8, 3)];
326 break;
327
328 case kiPhoneDevice:
329
330 clippedPath = [[self bundleName] substringWithRange:NSMakeRange(10, 3)];
331 break;
332
333 }
334
335 return clippedPath;
336 }
337
9179d70 0.7.0 updates
FireCore, LLC authored
338 - (BOOL)untethered
339 {
1cb68d2 latest and greatest 0.8.2 441
Kevin Bradley authored
340
341 return [[[self infoDictionary] valueForKey:@"Untethered"] boolValue];
342
343 //code below is deprecated for now..
344
b6e1094 wow way behind on committing
Kevin Bradley authored
345 NSString *comparisonVersion = @"5.0"; //yes pandering to appletv2, what of it? ;-P
346
347 NSString *clippedPath = nil;
348 int deviceInteger = [self deviceInt];
349
350 switch (deviceInteger) {
351
352
353 case kAppleTVDevice:
354
355 clippedPath = [[self bundleName] substringWithRange:NSMakeRange(11, 3)];
356 break;
357
358 case kiPadDevice:
359 case kiPodDevice:
360 //iPad1,1_4.3.1_8G4_Restore.ipsw
361 clippedPath = [[self bundleName] substringWithRange:NSMakeRange(8, 3)];
362 comparisonVersion = @"5.0";
363 break;
364
365 case kiPhoneDevice:
366
367 clippedPath = [[self bundleName] substringWithRange:NSMakeRange(10, 3)];
368 comparisonVersion = @"5.0";
369 break;
370
371 }
372
373 NSComparisonResult theResult = [clippedPath compare:comparisonVersion options:NSNumericSearch];
374 //NSLog(@"theversion: %@ installed version %@", theVersion, installedVersion);
375 if ( theResult == NSOrderedDescending )
376 {
377 NSLog(@"%@ is greater than %@ NO", clippedPath, @"4.4");
378
9179d70 0.7.0 updates
FireCore, LLC authored
379 return NO;
b6e1094 wow way behind on committing
Kevin Bradley authored
380
381 } else if ( theResult == NSOrderedAscending ){
382
383 NSLog(@"%@ is greater than %@ YES", @"4.4", clippedPath);
384 return YES;
385
386 } else if ( theResult == NSOrderedSame ) {
387
388 NSLog(@"%@ is equal to %@ NO", clippedPath, @"4.4");
389 return NO;
390 }
9179d70 0.7.0 updates
FireCore, LLC authored
391
b6e1094 wow way behind on committing
Kevin Bradley authored
392 return NO;
9179d70 0.7.0 updates
FireCore, LLC authored
393 }
394
c3241f4 more device detection fixes
Kevin Bradley authored
395 - (NSString *)fullDeviceType
396 {
397 NSString *firstLetter = [[self bundleName] substringToIndex:1];
398 if ([firstLetter isEqualToString:@"i"]) //ipad or iphone oops forgot ipod dummy!! ;-P
399 {
400 NSString *clippedPath = [[self bundleName] substringToIndex:9];
401 if ([clippedPath isEqualToString:@"iPhone"])
402 {
403 return clippedPath;
404
405 } else {
406
407 return [[self bundleName] substringToIndex:7]; //since iPod/iPad are both 4 letters this should return either one.
408 }
409
410 }
411
412 return [[self bundleName] substringToIndex:10];
413
414 //iPhone 5
415 //iPad 5
416 //AppleTV 7
417 }
8bf24cf its a sekrit
FireCore, LLC authored
418
419 - (NSString *)deviceType
420 {
421 NSString *firstLetter = [[self bundleName] substringToIndex:1];
d6c6555 more UI tweak nonsense and whatnot
Kevin Bradley authored
422 if ([firstLetter isEqualToString:@"i"]) //ipad or iphone oops forgot ipod dummy!! ;-P
8bf24cf its a sekrit
FireCore, LLC authored
423 {
424 NSString *clippedPath = [[self bundleName] substringToIndex:5];
425 if ([clippedPath isEqualToString:@"iPhone"])
426 {
427 return clippedPath;
428
429 } else {
d6c6555 more UI tweak nonsense and whatnot
Kevin Bradley authored
430
431 return [[self bundleName] substringToIndex:3]; //since iPod/iPad are both 4 letters this should return either one.
8bf24cf its a sekrit
FireCore, LLC authored
432 }
433
434 }
435
436 return @"AppleTV";
437
438 //iPhone 5
439 //iPad 5
440 //AppleTV 7
441 }
442
443 - (int)deviceInt
444 {
445 if ([[self deviceType] isEqualToString:@"iPhone"])
446 {
447 return kiPhoneDevice;
448
449 } else if ([[self deviceType] isEqualToString:@"iPad"]){
450
451 return kiPadDevice;
452
d6c6555 more UI tweak nonsense and whatnot
Kevin Bradley authored
453 } else if ([[self deviceType] isEqualToString:@"AppleTV"]) {
8bf24cf its a sekrit
FireCore, LLC authored
454
455 return kAppleTVDevice;
d6c6555 more UI tweak nonsense and whatnot
Kevin Bradley authored
456
457 } else if ([[self deviceType] isEqualToString:@"iPod"]) {
458
459 return kiPodDevice;
460
8bf24cf its a sekrit
FireCore, LLC authored
461 }
d6c6555 more UI tweak nonsense and whatnot
Kevin Bradley authored
462
8bf24cf its a sekrit
FireCore, LLC authored
463 return kUnknownDevice;
464 }
465
1cb68d2 latest and greatest 0.8.2 441
Kevin Bradley authored
466 - (NSString *)allFlashLocation
467 {
468 //BuildIdentities - > Manifest -> AppleLogo -> Info -> Path
469 return [[self unzippedPathForFirmwareKey:@"AppleLogo"] stringByDeletingLastPathComponent];
470
471 }
472
51fe6a0 latest changes with updated saffron, not safe for apt update right now
Kevin Bradley authored
473 - (NSString *)buildVersion
474 {
475 NSString *name = [self bundleName];
476 NSArray *objects = [name componentsSeparatedByString:@"_"];
477 return [objects lastObject];
478 }
479
65236af please fix
Kevin Bradley authored
480 - (BOOL)is50B7 //pretty much whether or not we listen to fileSystemSize in the plist... obvious, no?
51fe6a0 latest changes with updated saffron, not safe for apt update right now
Kevin Bradley authored
481 {
d6c6555 more UI tweak nonsense and whatnot
Kevin Bradley authored
482
483 if ([[self buildVersion] isEqualToString:@"9A334"])
484 return YES;
485
51fe6a0 latest changes with updated saffron, not safe for apt update right now
Kevin Bradley authored
486 if ([[self buildVersion] isEqualToString:@"9A5313e"])
487 return YES;
488
489 return NO;
490 }
491
1350c1d @lechium latest and greatest
lechium authored
492 - (BOOL)is8F455
493 {
494 if ([[self bundleName] isEqualToString:@"AppleTV2,1_4.3_8F455"])
495 {
496 return YES;
497 }
498 return NO;
499 }
500
65236af please fix
Kevin Bradley authored
501 - (BOOL)is4point4 //5.0 for other, 4.4 for AppleTV 2
1d3c9f8 latest goodness
kevin bradley authored
502 {
d6c6555 more UI tweak nonsense and whatnot
Kevin Bradley authored
503 NSString *comparisonVersion = @"4.4"; //yes pandering to appletv2, what of it? ;-P
504
1d3c9f8 latest goodness
kevin bradley authored
505 NSString *clippedPath = nil;
506 int deviceInteger = [self deviceInt];
507
508 switch (deviceInteger) {
509
510
511 case kAppleTVDevice:
512
513 clippedPath = [[self bundleName] substringWithRange:NSMakeRange(11, 3)];
514 break;
515
516 case kiPadDevice:
d6c6555 more UI tweak nonsense and whatnot
Kevin Bradley authored
517 case kiPodDevice:
1d3c9f8 latest goodness
kevin bradley authored
518 //iPad1,1_4.3.1_8G4_Restore.ipsw
519 clippedPath = [[self bundleName] substringWithRange:NSMakeRange(8, 3)];
d6c6555 more UI tweak nonsense and whatnot
Kevin Bradley authored
520 comparisonVersion = @"5.0";
1d3c9f8 latest goodness
kevin bradley authored
521 break;
522
523 case kiPhoneDevice:
524
525 clippedPath = [[self bundleName] substringWithRange:NSMakeRange(10, 3)];
d6c6555 more UI tweak nonsense and whatnot
Kevin Bradley authored
526 comparisonVersion = @"5.0";
1d3c9f8 latest goodness
kevin bradley authored
527 break;
528
529 }
530
d6c6555 more UI tweak nonsense and whatnot
Kevin Bradley authored
531 NSComparisonResult theResult = [clippedPath compare:comparisonVersion options:NSNumericSearch];
1d3c9f8 latest goodness
kevin bradley authored
532 //NSLog(@"theversion: %@ installed version %@", theVersion, installedVersion);
533 if ( theResult == NSOrderedDescending )
534 {
535 // NSLog(@"%@ is greater than %@", clippedPath, @"4.4");
536
537 return YES;
538
539 } else if ( theResult == NSOrderedAscending ){
540
541 // NSLog(@"%@ is greater than %@", @"4.4", clippedPath);
542 return NO;
543
544 } else if ( theResult == NSOrderedSame ) {
545
546 // NSLog(@"%@ is equal to %@", clippedPath, @"4.4");
547 return YES;
548 }
549
550 return NO;
551 }
552
3660578 think for yourself, question authority
FireCore, LLC authored
553 - (BOOL)is4point3
554 {
8bf24cf its a sekrit
FireCore, LLC authored
555 NSString *clippedPath = nil;
556 int deviceInteger = [self deviceInt];
557
558 switch (deviceInteger) {
559
560
561 case kAppleTVDevice:
562
563 clippedPath = [[self bundleName] substringWithRange:NSMakeRange(11, 3)];
564 break;
565
566 case kiPadDevice:
567 //iPad1,1_4.3.1_8G4_Restore.ipsw
568 clippedPath = [[self bundleName] substringWithRange:NSMakeRange(8, 3)];
569 break;
570
571 case kiPhoneDevice:
572
573 clippedPath = [[self bundleName] substringWithRange:NSMakeRange(10, 3)];
574
575 break;
576
577 }
578
579 NSComparisonResult theResult = [clippedPath compare:@"4.3" options:NSNumericSearch];
580 //NSLog(@"theversion: %@ installed version %@", theVersion, installedVersion);
581 if ( theResult == NSOrderedDescending )
582 {
1d3c9f8 latest goodness
kevin bradley authored
583 //NSLog(@"%@ is greater than %@", clippedPath, @"4.3");
8bf24cf its a sekrit
FireCore, LLC authored
584
585 return YES;
586
587 } else if ( theResult == NSOrderedAscending ){
588
1d3c9f8 latest goodness
kevin bradley authored
589 //NSLog(@"%@ is greater than %@", @"4.3", clippedPath);
8bf24cf its a sekrit
FireCore, LLC authored
590 return NO;
591
592 } else if ( theResult == NSOrderedSame ) {
593
1d3c9f8 latest goodness
kevin bradley authored
594 // NSLog(@"%@ is equal to %@", clippedPath, @"4.3");
8bf24cf its a sekrit
FireCore, LLC authored
595 return YES;
596 }
597
598 return NO;
599 }
600
601
602 - (BOOL)is4point3old
603 {
3660578 think for yourself, question authority
FireCore, LLC authored
604 NSString *clippedPath = [[self bundleName] substringToIndex:14];
605 if ([clippedPath isEqualToString:@"AppleTV2,1_4.3"])
606 {
607 return YES;
608 } else {
609 return NO;
610 }
611 return NO;
2336b1e 0.6.7 changes
FireCore, LLC authored
612 }
613
614 - (NSDictionary *)extraPatch
615 {
3660578 think for yourself, question authority
FireCore, LLC authored
616 if ([self is4point3])
617 {
618 NSDictionary *thePatch = [NSDictionary dictionaryWithObjectsAndKeys:[[NSBundle mainBundle] pathForResource:@"status" ofType:@"patch" inDirectory:@"patches"], @"Patch", @"private/var/lib/dpkg/status", @"Target", @"7945d79f0dad7c3397b930877ba92ec4", @"md5", nil];
8111256 4.3 GM support bundle + code added
FireCore, LLC authored
619 //NSLog(@"extraPatch: %@", thePatch);
3660578 think for yourself, question authority
FireCore, LLC authored
620 return thePatch;
621 }
9179d70 0.7.0 updates
FireCore, LLC authored
622 return nil;
3660578 think for yourself, question authority
FireCore, LLC authored
623 }
624
625 - (NSDictionary *)oldextraPatch
626 {
627
628 NSString *clippedPath = [[self bundleName] substringToIndex:14];
629 NSLog(@"clippedPath: %@", clippedPath);
630
631 if ([[self bundleName] isEqualToString:@"AppleTV2,1_4.3_8F5166b"])
632 {
633 NSDictionary *thePatch = [NSDictionary dictionaryWithObjectsAndKeys:[[NSBundle mainBundle] pathForResource:@"status" ofType:@"patch" inDirectory:@"patches"], @"Patch", @"private/var/lib/dpkg/status", @"Target", @"7945d79f0dad7c3397b930877ba92ec4", @"md5", nil];
634 //NSLog(@"extraPatch: %@", thePatch);
635 return thePatch;
636 }
637
2336b1e 0.6.7 changes
FireCore, LLC authored
638 if ([[self bundleName] isEqualToString:@"AppleTV2,1_4.3_8F5148c"])
639 {
640 NSDictionary *thePatch = [NSDictionary dictionaryWithObjectsAndKeys:[[NSBundle mainBundle] pathForResource:@"status" ofType:@"patch" inDirectory:@"patches"], @"Patch", @"private/var/lib/dpkg/status", @"Target", @"7945d79f0dad7c3397b930877ba92ec4", @"md5", nil];
3660578 think for yourself, question authority
FireCore, LLC authored
641 //NSLog(@"extraPatch: %@", thePatch);
2336b1e 0.6.7 changes
FireCore, LLC authored
642 return thePatch;
643 }
bfdcf83 version 067 (25) added b2 bundle
FireCore, LLC authored
644
645 if ([[self bundleName] isEqualToString:@"AppleTV2,1_4.3_8F5153d"])
646 {
647 NSDictionary *thePatch = [NSDictionary dictionaryWithObjectsAndKeys:[[NSBundle mainBundle] pathForResource:@"status" ofType:@"patch" inDirectory:@"patches"], @"Patch", @"private/var/lib/dpkg/status", @"Target", @"7945d79f0dad7c3397b930877ba92ec4", @"md5", nil];
3660578 think for yourself, question authority
FireCore, LLC authored
648 //NSLog(@"extraPatch: %@", thePatch);
bfdcf83 version 067 (25) added b2 bundle
FireCore, LLC authored
649 return thePatch;
650 }
651
2336b1e 0.6.7 changes
FireCore, LLC authored
652 return nil;
653 }
654
655 - (NSDictionary *)coreFilesInstallation
656 {
657 return [[self filesystemPatches] valueForKey:CORE_FILES];
658 }
659
660 - (NSString *)restoreRamdiskVolume
661 {
662 return [[self infoDictionary] valueForKey:MOUNTED_RAMDISK];
663 }
664
665 - (void)logDescription
666 {
667 NSLog(@"filename: %@", [self filename]);
668 NSLog(@"iBSS: %@", [self iBSS]);
669 NSLog(@"Restore Ramdisk: %@", [self restoreRamdisk]);
670 NSLog(@"Update Ramdisk: %@", [self updateRamdisk]);
671 NSLog(@"RootFilesystem: %@", [self rootFilesystem]);
672 NSLog(@"Filesystem Patches: %@", [self filesystemPatches]);
673 NSLog(@"bundlePath: %@", [self bundlePath]);
674 NSLog(@"fwRoot: %@", [self fwRoot]);
675 NSLog(@"bundleName: %@", [self bundleName]);
676 NSLog(@"kernelCache: %@", [self kernelCacheName]);
677 NSLog(@"iBSS: %@", [self iBSSName]);
0428559 0.6.9 changes
FireCore, LLC authored
678 NSLog(@"AppleLogo: %@", [self appleLogo]);
2336b1e 0.6.7 changes
FireCore, LLC authored
679 }
680
681 - (NSString *)bundleName
682 {
683 return [[self infoDictionary] valueForKey:@"Name"];
684 }
685
b884aa5 update for 4.3 untether, big thanks to Stefan (i0n1c) for 4.3.x untether
FireCore, LLC authored
686 - (NSString *)filesystemSize
687 {
688 //RootFilesystemSize
689 return [[self infoDictionary] valueForKey:@"RootFilesystemSize"];
690
691 }
692
2336b1e 0.6.7 changes
FireCore, LLC authored
693 - (NSString *)restoreRamdiskFile
694 {
695 return [[self restoreRamdisk] valueForKey:@"File"];
696 }
697
698 - (NSString *)updateRamdiskFile
699 {
700 return [[self updateRamdisk] valueForKey:@"File"];
701 }
702
703 - (NSDictionary *)restoreRamdisk;
704 {
705 return [[self firmwarePatches] valueForKey:RESTORE_RD];
706 }
707
708 - (NSDictionary *)updateRamdisk
709 {
710
711 return [[self firmwarePatches] valueForKey:UPDATE_RD];
712 }
713
1d3c9f8 latest goodness
kevin bradley authored
714 - (NSDictionary *)iBEC
715 {
716 return [[self firmwarePatches] valueForKey:@"iBEC"];
717 }
718
2336b1e 0.6.7 changes
FireCore, LLC authored
719 - (NSDictionary *)iBSS
720 {
721 return [[self firmwarePatches] valueForKey:@"iBSS"];
722 }
723
0428559 0.6.9 changes
FireCore, LLC authored
724 - (NSDictionary *)appleLogo
725 {
726 return [[self firmwarePatches] valueForKey:@"AppleLogo"];
727 }
728
1d3c9f8 latest goodness
kevin bradley authored
729 - (NSDictionary *)kernelcache
730 {
731 return [[self firmwarePatches] valueForKey:@"kernelcache"];
732 }
733
1350c1d @lechium latest and greatest
lechium authored
734 - (NSDictionary *)sbkernel
735 {
736 return [[self supportBundlePatches] valueForKey:@"kernelcache"];
737 }
0428559 0.6.9 changes
FireCore, LLC authored
738
2336b1e 0.6.7 changes
FireCore, LLC authored
739 - (NSString *)rootFilesystem
740 {
741 return [[self infoDictionary] valueForKey:ROOT_FS];
742 }
743
744 - (NSString *)filesystemKey
745 {
746 return [[self infoDictionary] valueForKey:FS_KEY];
747 }
748
749 - (NSString *)filename
750 {
751 return [[self infoDictionary] valueForKey:FILE_NAME];
752 }
753
754 - (NSDictionary *)filesystemPatches
755 {
756 return [[self infoDictionary] valueForKey:FS_PATCHES];
757 }
758
759 - (NSArray *)filesystemJailbreak
760 {
761 return [[self filesystemPatches] valueForKey:FS_JB];
762 }
763
764 - (NSDictionary *)firmwarePatches
765 {
766 return [[self infoDictionary] valueForKey:FW_PATCHES];
767
768 }
769
1350c1d @lechium latest and greatest
lechium authored
770 - (NSDictionary *)supportBundlePatches
771 {
772 return [[self infoDictionary] valueForKey:SB_PATCHES];
773
774 }
775
2336b1e 0.6.7 changes
FireCore, LLC authored
776 - (NSDictionary *)ramdiskPatches
777 {
778 return [[self infoDictionary] valueForKey:RD_PATCHES];
779 }
780
781 - (NSDictionary *)preInstalledPackages
782 {
783 return [[self infoDictionary] valueForKey:PREINST_PACKAGES];
784 }
785
1cb68d2 latest and greatest 0.8.2 441
Kevin Bradley authored
786 - (NSString *)unzippedPathForFirmwareKey:(NSString *)firmwareKey
787 {
788 return [TMP_ROOT stringByAppendingPathComponent:[[[[self buildManifest] valueForKey:firmwareKey] valueForKey:@"Info"] valueForKey:@"Path"]];
789 }
790
791 + (NSArray *)signKeyArray
792 {
793
794 return [NSArray arrayWithObjects:@"AppleLogo", @"BatteryCharging", @"BatteryCharging0", @"BatteryCharging1", @"BatteryFull", @"BatteryLow0", @"BatteryLow1", @"BatteryPlugin", @"DeviceTree", @"LLB", @"RecoveryMode", @"iBoot", nil];
795 }
796
2336b1e 0.6.7 changes
FireCore, LLC authored
797 - (void)dealloc
798 {
799 [fwRoot release];
800 fwRoot = nil;
801 [super dealloc];
802 }
803
804 @end
Something went wrong with that request. Please try again.