Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NSSpiral committed Dec 21, 2021
1 parent c6fbcea commit 226a1e6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Blackb0x/Files/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ apt-get install -f -y

if [ ! -d /Applications/Kodi.frappliance ]; then
echo "Installing Kodi" >> /var/mobile/Media/blackb0x.log
apt-get -y --force-yes install org.xbmc.kodi-atv2 &&
/bin/mv /kodi.png /private/var/stash/Applications/AppleTV.app/com.apple.frontrow.appliance.kodi\@1080.png
/bin/mv /kodi.png /private/var/stash/Applications/AppleTV.app/com.apple.frontrow.appliance.kodi\@1080.png &&
apt-get -y --force-yes install org.xbmc.kodi-atv2
fi


Expand Down
2 changes: 1 addition & 1 deletion Blackb0x/Source/DeviceManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ + (instancetype) createWithUDID:(NSString *) udid orECID:(uint64_t) ecid {
icon.udid = udid;

icon.pwnedDFU = -1;
icon.jailbroken = -1;
icon.jailbroken = 0;
icon.jailbreakRunning = -1;
icon.needsPostInstall = 1;
icon.waitForRecovery = 0;
Expand Down
20 changes: 16 additions & 4 deletions Blackb0x/Source/IPSW.mm
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,40 @@ - (void) downloadComponent:(NSString *) componentName withCompletion:(void (^)(N
NSUserName(),
[[_URL lastPathComponent] stringByDeletingPathExtension],
componentName];

/*
if([[NSFileManager defaultManager] fileExistsAtPath:fileLocation]) {
printf("File exists, no need to download.\n");
completionBlock(fileLocation, -1);
return;
}
*/

BOOL fileExists = NO;

if([[NSFileManager defaultManager] fileExistsAtPath:fileLocation]) {
printf("File exists, no need to download.\n");
fileExists = YES;

//completionBlock(fileLocation, -1);
//return;
}

__block FragmentDownloader *dl;

if((dl = [FragmentDownloader downloaderForComponent:componentName])) {
dl.componentName = componentName;

dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){

[dl downloadComponent:componentName];
if(fileExists == NO) {
[dl downloadComponent:componentName];
}

int slot = [FragmentDownloader downloadNumberForComponent:componentName];
NSString *path = [NSString stringWithFormat:@"%@/%@", dl.ipsw_folder, componentName];

printf("Downloaded %s on slot %i\n", [componentName UTF8String], slot);

dl.componentName = nil;
if([componentName isEqual:@"BuildManifest.plist"]) dl.componentName = nil;

if([[NSFileManager defaultManager] fileExistsAtPath:path]) completionBlock(path, slot);
else completionBlock(nil, slot);
Expand Down
1 change: 1 addition & 0 deletions Blackb0x/Source/MainView.m
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ - (void) downloadComponentsForBuildID:(NSString *) build {
self.select_device.stringValue = @"Downloading firmware components...";
});


NSColor *patchColor = [NSColor colorWithRed:0.8 green:0.2 blue:0.0 alpha:1.0];
[ipsw_fetcher downloadComponent:iBSS withCompletion:^(NSString *file, int slot) {
printf("iBSS downloaded - %s\n", [file UTF8String]);
Expand Down
2 changes: 1 addition & 1 deletion Blackb0x/Source/Patcher.mm
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ - (NSString *) getRealVersion:(NSString *) version {

- (void) loadKeysForDevice:(NSString *) deviceID buildID:(NSString *) buildID {

printf("Finding firmware keys for %s, %s", [deviceID UTF8String], [buildID UTF8String]);
printf("Finding firmware keys for %s, %s\n", [deviceID UTF8String], [buildID UTF8String]);

self.keys = [_ipsw_fetcher keysForDevice:deviceID buildID:buildID];

Expand Down

0 comments on commit 226a1e6

Please sign in to comment.