From ba4a3e40f9cb83ba8818ba0c7cf6de5b6ed6ebb1 Mon Sep 17 00:00:00 2001 From: GRMrGecko Date: Sat, 1 Dec 2012 10:09:01 -0600 Subject: [PATCH] Updated MGMSystemInfo to include Mountain Lion. Updated to version 0.2.1. Apparently fixed some issues in the PHP script. --- Classes/Framework/MGMSystemInfo.h | 2 ++ Classes/Framework/MGMSystemInfo.m | 22 ++++++++++++++++++++-- GeckoReporter.xcodeproj/project.pbxproj | 4 ++-- Resources/Framework/Info.plist | 2 +- sendreport.php | 6 +++--- 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Classes/Framework/MGMSystemInfo.h b/Classes/Framework/MGMSystemInfo.h index ec83d42..13d88e4 100644 --- a/Classes/Framework/MGMSystemInfo.h +++ b/Classes/Framework/MGMSystemInfo.h @@ -44,6 +44,8 @@ - (BOOL)isAfterTiger; - (BOOL)isAfterLeopard; - (BOOL)isAfterSnowLeopard; +- (BOOL)isAfterLion; +- (BOOL)isAfterMountainLion; - (NSString *)language; - (NSString *)applicationIdentifier; - (NSString *)applicationName; diff --git a/Classes/Framework/MGMSystemInfo.m b/Classes/Framework/MGMSystemInfo.m index 8dcc8a8..2ea271d 100644 --- a/Classes/Framework/MGMSystemInfo.m +++ b/Classes/Framework/MGMSystemInfo.m @@ -213,10 +213,12 @@ NSString * const MGMModel = @"hw.model"; if (minorVersion==7) return @"Lion"; if (minorVersion==8) - return @"Lynx"; + return @"Mountain Lion"; if (minorVersion==9) - return @"Garfield"; + return @"Lynx"; if (minorVersion==10) + return @"Garfield"; + if (minorVersion==11) return @"Liger"; } return @"Unknown"; @@ -278,6 +280,22 @@ NSString * const MGMModel = @"hw.model"; return NO; } +- (BOOL)isAfterLion { + if ([self OSMajorVersion]==10) { + int minorVersion = [self OSMinorVersion]; + return (minorVersion>=7); + } + return NO; +} + +- (BOOL)isAfterMountainLion { + if ([self OSMajorVersion]==10) { + int minorVersion = [self OSMinorVersion]; + return (minorVersion>=8); + } + return NO; +} + - (NSString *)language { NSArray *languages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"]; if (languages!=nil && [languages count]>=1) diff --git a/GeckoReporter.xcodeproj/project.pbxproj b/GeckoReporter.xcodeproj/project.pbxproj index d267094..4b08e03 100644 --- a/GeckoReporter.xcodeproj/project.pbxproj +++ b/GeckoReporter.xcodeproj/project.pbxproj @@ -641,7 +641,7 @@ "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; - SDKROOT = macosx10.6; + SDKROOT = macosx10.5; VALID_ARCHS = "ppc i386 x86_64"; }; name = Debug; @@ -661,7 +661,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.4; "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5; PREBINDING = NO; - SDKROOT = macosx10.6; + SDKROOT = macosx10.5; VALID_ARCHS = "ppc i386 x86_64"; }; name = Release; diff --git a/Resources/Framework/Info.plist b/Resources/Framework/Info.plist index ad3d1f8..57ac3dc 100644 --- a/Resources/Framework/Info.plist +++ b/Resources/Framework/Info.plist @@ -8,7 +8,7 @@ CFBundlePackageType = FMWK; "CFBundleShortVersionString" = "0.2"; CFBundleSignature = "????"; - CFBundleVersion = "0.2"; + CFBundleVersion = "0.2.1"; "NSHumanReadableCopyright" = "Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/"; NSPrincipalClass = ""; } \ No newline at end of file diff --git a/sendreport.php b/sendreport.php index 53bbdcf..e50dab8 100644 --- a/sendreport.php +++ b/sendreport.php @@ -23,7 +23,7 @@ function buildBody($FILES, $BOUNDARY) { $FILESIZE = $_FILES[$KEY]['size']; $BODY .= "--$BOUNDARY\r\n"; $BODY .= "Content-Disposition: attachment; filename=\"{$FILENAME}\"\r\n"; - $BODY .= "Content-Type: {$FILETYPE} name=\"{$FILENAME}\"\r\n"; + $BODY .= "Content-Type: {$FILETYPE}; name=\"{$FILENAME}\"\r\n"; $BODY .= "Content-Transfer-Encoding: binary\r\n\r\n"; $FILEPIPE = fopen($FILE, "r"); $BODY .= fread($FILEPIPE, $FILESIZE); @@ -34,7 +34,7 @@ function buildBody($FILES, $BOUNDARY) { return $BODY; } -//Word of warning, IP is for debugging, do not include the IP of your user without the knowledge that your user may not user your application afterword. +//Word of warning, IP is for debugging, do not include the IP of your user without the knowledge that your user may not use your application. //$_POST['IP'] = $_SERVER['HTTP_PC_REMOTE_ADDR']!="" ? $_SERVER['HTTP_PC_REMOTE_ADDR'] : $_SERVER['REMOTE_ADDR']; $_POST['User_Agent'] = urldecode($_SERVER['HTTP_USER_AGENT']); @@ -81,7 +81,7 @@ if ($_POST['GRType']=="crash") { $headers .= "{$NAME}: {$_POST[$KEY]}\n"; } if ($userReport!="") - $headers .= "\nThe user was\n$userReport"; + $headers .= "\nThe user was\n$userReport\n"; $headers .= buildBody($_FILES, $boundary);