diff --git a/Easydict/Feature/Utility/EZAudioUtils/EZAudioUtils.m b/Easydict/Feature/Utility/EZAudioUtils/EZAudioUtils.m index c18ed7160..59ed2348d 100644 --- a/Easydict/Feature/Utility/EZAudioUtils/EZAudioUtils.m +++ b/Easydict/Feature/Utility/EZAudioUtils/EZAudioUtils.m @@ -34,7 +34,7 @@ + (float)getSystemVolume { AudioObjectPropertyAddress address = { kAudioDevicePropertyVolumeScalar, kAudioDevicePropertyScopeOutput, - kAudioObjectPropertyElementMaster}; + kAudioObjectPropertyElementMain}; if (!AudioObjectHasProperty(outputDeviceID, &address)) { NSLog(@"No volume returned for device 0x%0x", outputDeviceID); @@ -72,7 +72,7 @@ + (void)setSystemVolume:(float)volume { AudioObjectPropertyAddress address = { kAudioDevicePropertyVolumeScalar, kAudioDevicePropertyScopeOutput, - kAudioObjectPropertyElementMaster}; + kAudioObjectPropertyElementMain}; if (!AudioObjectHasProperty(outputDeviceID, &address)) { NSLog(@"No volume returned for device 0x%0x", outputDeviceID); @@ -92,7 +92,7 @@ + (AudioDeviceID)getDefaultOutputDeviceID { AudioObjectPropertyAddress address = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, - kAudioObjectPropertyElementMaster}; + kAudioObjectPropertyElementMain}; UInt32 dataSize = sizeof(AudioDeviceID); OSStatus status = AudioObjectGetPropertyData(kAudioObjectSystemObject, &address, 0, NULL, &dataSize, &outputDeviceID); diff --git a/Easydict/Feature/Utility/EZDeviceSystemInfo/EZDeviceSystemInfo.m b/Easydict/Feature/Utility/EZDeviceSystemInfo/EZDeviceSystemInfo.m index 79e11eb56..148da924f 100644 --- a/Easydict/Feature/Utility/EZDeviceSystemInfo/EZDeviceSystemInfo.m +++ b/Easydict/Feature/Utility/EZDeviceSystemInfo/EZDeviceSystemInfo.m @@ -57,7 +57,7 @@ + (NSString *)getDeviceModel { /// Get device UUID, 4F07896A-1580-5270-A0E8-D7FA9DFA6868 + (NSString *)getDeviceUUID { - io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); + io_service_t platformExpert = IOServiceGetMatchingService(kIOMainPortDefault, IOServiceMatching("IOPlatformExpertDevice")); CFStringRef uuidString = (CFStringRef)IORegistryEntryCreateCFProperty(platformExpert, CFSTR("IOPlatformUUID"), kCFAllocatorDefault, 0); NSString *uuid = (__bridge NSString *)(uuidString); IOObjectRelease(platformExpert);