From d4b957db23b230e52c1663c560d250543c99fbd2 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Thu, 24 Jun 2021 12:56:44 -0700 Subject: [PATCH] [AltServer] Fixes isDeveloperDiskImageMountedForDevice() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, we returned YES when there was no error. Instead, we should return YES only when there’s no error _and_ the developer disk image is installed. --- AltServer/Devices/ALTDeviceManager.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AltServer/Devices/ALTDeviceManager.mm b/AltServer/Devices/ALTDeviceManager.mm index 7ab11b77..d8e048f2 100644 --- a/AltServer/Devices/ALTDeviceManager.mm +++ b/AltServer/Devices/ALTDeviceManager.mm @@ -999,6 +999,8 @@ NSNotificationName const ALTDeviceManagerDeviceDidDisconnectNotification = @"ALT __block lockdownd_client_t client = NULL; __block lockdownd_service_descriptor_t service = NULL; __block mobile_image_mounter_client_t mim = NULL; + + __block BOOL isMounted = NO; void (^finish)(NSError *) = ^(NSError *error) { if (mim) { @@ -1022,7 +1024,7 @@ NSNotificationName const ALTDeviceManagerDeviceDidDisconnectNotification = @"ALT idevice_free(device); } - completionHandler(error == nil, error); + completionHandler(isMounted, error); }; dispatch_async(self.installationQueue, ^{ @@ -1058,8 +1060,6 @@ NSNotificationName const ALTDeviceManagerDeviceDidDisconnectNotification = @"ALT return finish([NSError errorWithMobileImageMounterError:err device:altDevice]); } - bool isMounted = false; - plist_dict_iter it = NULL; plist_dict_new_iter(result, &it);