Difference between revisions of "LibMobileGestalt.dylib"

From iPhone Development Wiki
Jump to: navigation, search
m (Reword.)
m (MGGetBoolAnswer(CFStringRef);)
Line 3: Line 3:
 
'''libMobileGestalt''' is a library that can be used to get various system values such as the UDID, disk usage, device version and much more. It is comparable to [[liblockdown.dylib]].
 
'''libMobileGestalt''' is a library that can be used to get various system values such as the UDID, disk usage, device version and much more. It is comparable to [[liblockdown.dylib]].
  
== Example Usage ==
+
== MGCopyAnswer ==
 
<source lang=c>
 
<source lang=c>
 +
// Common form: MGCopyAnswer(CFStringRef string);
 
CFStringRef value = MGCopyAnswer(kMGDeviceColor);
 
CFStringRef value = MGCopyAnswer(kMGDeviceColor);
 
NSLog(@"Value: %@", value);
 
NSLog(@"Value: %@", value);
Line 10: Line 11:
 
</source>
 
</source>
  
*'''Note''': You are responsible for freeing the value returned by MGCopyAnswer.
+
== MGGetBoolAnswer (iOS 7+) ==
 +
<source lang=c>
 +
// CFBooleanRef MGGetBoolAnswer(CFStringRef string);
 +
CFBooleanRef value = MGGetBoolAnswer(CFSTR("UIProceduralWallpaperCapability"));
 +
NSLog(@"Value: %i", value);
 +
CFRelease(value);
 +
</source>
 +
 
 +
*'''Note''': You are responsible for freeing the value returned by MGCopyAnswer and MGGetBoolAnswer.
 
== References ==
 
== References ==
 
* Header: https://github.com/Cykey/ios-reversed-headers/blob/master/MobileGestalt/MobileGestalt.h
 
* Header: https://github.com/Cykey/ios-reversed-headers/blob/master/MobileGestalt/MobileGestalt.h

Revision as of 12:41, 16 January 2014


libMobileGestalt is a library that can be used to get various system values such as the UDID, disk usage, device version and much more. It is comparable to liblockdown.dylib.

MGCopyAnswer

// Common form: MGCopyAnswer(CFStringRef string);
CFStringRef value = MGCopyAnswer(kMGDeviceColor);
NSLog(@"Value: %@", value);
CFRelease(value);

MGGetBoolAnswer (iOS 7+)

// CFBooleanRef MGGetBoolAnswer(CFStringRef string);
CFBooleanRef value = MGGetBoolAnswer(CFSTR("UIProceduralWallpaperCapability"));
NSLog(@"Value: %i", value);
CFRelease(value);
  • Note: You are responsible for freeing the value returned by MGCopyAnswer and MGGetBoolAnswer.

References