mirror of
https://github.com/insidegui/VirtualBuddy.git
synced 2026-12-02 01:19:24 +08:00
* Move ECID getter into VZMacMachineIdentifier * Implement a custom macOS restore backend to work around macOS 27 issues on macOS 26 hosts * Add virtual installation requirement set and enforce during VM restore * Change requirement for macOS 27 Virtual Installation to min host macOS 26 * Add CI script that sets CURRENT_PROJECT_VERSION to the Xcode Cloud build number
41 lines
1.4 KiB
Objective-C
41 lines
1.4 KiB
Objective-C
#import "MobileDeviceHelper.h"
|
|
|
|
#import <VirtualInstallation/MobileDeviceSPI.h>
|
|
|
|
#define ShouldTestMobileDeviceFailure [[NSUserDefaults standardUserDefaults] boolForKey:@"VITestMobileDeviceFailure"]
|
|
|
|
#define CheckMobileDeviceSymbol( sym ) \
|
|
if (sym == NULL) { \
|
|
if (!ShouldTestMobileDeviceFailure) NSAssert(NO, @"MobileDevice symbol not available: " #sym); \
|
|
_result = NO; \
|
|
return; \
|
|
}
|
|
|
|
@implementation MobileDeviceHelper
|
|
|
|
+ (BOOL)verifyMobileDeviceSoftLink
|
|
{
|
|
static dispatch_once_t onceToken;
|
|
static BOOL _result;
|
|
dispatch_once(&onceToken, ^{
|
|
if (ShouldTestMobileDeviceFailure) CheckMobileDeviceSymbol(NULL);
|
|
|
|
CheckMobileDeviceSymbol(AMRestorableDeviceRegisterForNotifications);
|
|
CheckMobileDeviceSymbol(AMRestorableDeviceUnregisterForNotifications);
|
|
CheckMobileDeviceSymbol(&kAMRestorableInvalidClientID);
|
|
CheckMobileDeviceSymbol(AMRestorableDeviceGetDeviceClass);
|
|
CheckMobileDeviceSymbol(AMRestorableDeviceGetDeviceClass);
|
|
CheckMobileDeviceSymbol(AMRestorableDeviceGetECID);
|
|
CheckMobileDeviceSymbol(AMRestorableDeviceGetState);
|
|
CheckMobileDeviceSymbol(AMRestorableSetGlobalLogFileURL);
|
|
CheckMobileDeviceSymbol(AMRestorableDeviceSetLogFileURL);
|
|
CheckMobileDeviceSymbol(AMRestorableDeviceRestore);
|
|
CheckMobileDeviceSymbol(AMRLocalizedCopyStringForAMROperation);
|
|
|
|
_result = YES;
|
|
});
|
|
return _result;
|
|
}
|
|
|
|
@end
|