From: Yishen Miao Date: Wed, 15 Feb 2012 05:59:42 +0000 (-0800) Subject: Remove support of Mac OS X 10.3 and earlier system, change codes for Mac OS X 10.7. X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=cd317fe26f0deee1697ea5454fcb74135e507e61;p=chaz%2Fthecheat Remove support of Mac OS X 10.3 and earlier system, change codes for Mac OS X 10.7. --- diff --git a/AppController.m b/AppController.m index 1a787a2..14c7863 100644 --- a/AppController.m +++ b/AppController.m @@ -112,10 +112,11 @@ - (IBAction)newSearchWindow:(id)sender { - NSDocumentController *controller = [NSDocumentController sharedDocumentController]; - CheatDocument *doc = [controller makeUntitledDocumentOfType:@"Cheat Document"]; + NSError *error = nil; + NSDocumentController *controller = [NSDocumentController sharedDocumentController]; + CheatDocument *doc = [controller makeUntitledDocumentOfType:@"Cheat Document" error:&error]; if ( !doc ) { - ChazLog( @"nil document" ); + ChazLog( @"nil document, error=%@", error); } [doc setMode:TCSearchMode]; [controller addDocument:doc]; @@ -125,10 +126,11 @@ - (IBAction)newBlankCheatWindow:(id)sender { + NSError *error = nil; NSDocumentController *controller = [NSDocumentController sharedDocumentController]; - CheatDocument *doc = [controller makeUntitledDocumentOfType:@"Cheat Document"]; + CheatDocument *doc = [controller makeUntitledDocumentOfType:@"Cheat Document" error:&error]; if ( !doc ) { - ChazLog( @"nil document" ); + ChazLog( @"nil document, error=%@", error); } [doc setMode:TCCheatMode]; [controller addDocument:doc]; diff --git a/BetterTableView.m b/BetterTableView.m index e6c4124..05f03f5 100644 --- a/BetterTableView.m +++ b/BetterTableView.m @@ -195,7 +195,7 @@ - (NSArray *)selectedRows { - return [[self selectedRowEnumerator] allObjects]; + return [[self selectedRowIndexes] allObjects]; } diff --git a/ChazLog.m b/ChazLog.m index 0f4d037..2f8eaa6 100644 --- a/ChazLog.m +++ b/ChazLog.m @@ -49,7 +49,7 @@ void ChazDebugSetup() FILE *file; // look for debug file - file = fopen( [filepath lossyCString], "r+" ); + file = fopen( [filepath cStringUsingEncoding:NSUTF8StringEncoding], "r+" ); if ( !file ) { // there is no debug file or we don't have permissions @@ -58,7 +58,7 @@ void ChazDebugSetup() fclose( file ); - _gDebugFile = fopen( [filepath lossyCString], "w" ); + _gDebugFile = fopen( [filepath cStringUsingEncoding:NSUTF8StringEncoding], "w" ); ChazDebug( @"Debug log found (obviously). Entering debug mode." ); } @@ -150,7 +150,7 @@ void _ChazPrint( FILE *output, NSString *format, va_list args ) fprintf( output, "[%s] %s\n", [[[NSDate date] descriptionWithCalendarFormat:@"%Y-%m-%d %H:%M:%S.%F" timeZone:nil - locale:nil] lossyCString], [string lossyCString] ); + locale:nil] cStringUsingEncoding:NSUTF8StringEncoding], [string cStringUsingEncoding:NSUTF8StringEncoding] ); fflush( output ); [string release]; diff --git a/ChazUpdate.m b/ChazUpdate.m index 0d628b6..9f6432c 100644 --- a/ChazUpdate.m +++ b/ChazUpdate.m @@ -184,7 +184,7 @@ } // see if the version information for this app is in another file - if ( appRedirect = [appDictionary objectForKey:@"Redirect"] ) { + if ( (appRedirect = [appDictionary objectForKey:@"Redirect"]) ) { // recursively follow the redirection [[ChazUpdate alloc] initWithURL:appRedirect name:_name verbose:_verbose]; [self kill]; diff --git a/CheatDocument.m b/CheatDocument.m index 719737b..d8fcb89 100644 --- a/CheatDocument.m +++ b/CheatDocument.m @@ -454,7 +454,7 @@ Process static *_tc_target = nil; - (BOOL)isLoadedFromFile { - return ([self fileName] != nil); + return ([self fileURL] != nil); } @@ -1010,12 +1010,7 @@ Process static *_tc_target = nil; lastRow = [_cheatData variableCount]-1; [tableView reloadData]; - if ( MacOSXVersion() >= 0x1030 ) { - [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:lastRow] byExtendingSelection:NO]; - } - else { - [tableView selectRow:lastRow byExtendingSelection:NO]; - } + [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:lastRow] byExtendingSelection:NO]; [tableView scrollRowToVisible:lastRow]; [self setDocumentChanged]; @@ -1034,12 +1029,8 @@ Process static *_tc_target = nil; // reselect the last item if the selection is now invalid len = [_cheatData variableCount] - 1; if ( [tableView selectedRow] > len ) { - if ( MacOSXVersion() >= 0x1030 ) { + [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:len] byExtendingSelection:NO]; - } - else { - [tableView selectRow:len byExtendingSelection:NO]; - } } [tableView reloadData]; diff --git a/CheatURLCommand.m b/CheatURLCommand.m index 576231d..9d00f25 100644 --- a/CheatURLCommand.m +++ b/CheatURLCommand.m @@ -18,7 +18,7 @@ - (id)performDefaultImplementation { NSDocumentController *controller = [NSDocumentController sharedDocumentController]; - CheatDocument *doc = [controller makeUntitledDocumentOfType:@"Cheat Document"]; + CheatDocument *doc = [controller makeUntitledDocumentOfType:@"Cheat Document" error:nil]; if ( !doc ) { ChazLog( @"nil document" ); } diff --git a/DocCheaterDelegate.m b/DocCheaterDelegate.m index 0ba9ce4..d48aa79 100644 --- a/DocCheaterDelegate.m +++ b/DocCheaterDelegate.m @@ -105,7 +105,7 @@ [_cheater setTarget:selectThis]; } // otherwise, select the global target - else if ( selectThis = [CheatDocument globalTarget] ) { + else if ( (selectThis = [CheatDocument globalTarget]) ) { ChazLog( @"setting global target" ); [_cheater setTarget:selectThis]; } @@ -282,13 +282,10 @@ _status = TCIdleStatus; panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:@"dump"]; + [panel setAllowedFileTypes:[NSArray arrayWithObjects: @"dump", nil]]; [panel setExtensionHidden:NO]; [panel setCanSelectHiddenExtension:YES]; - if ( MacOSXVersion() >= 0x1030 ) { - [panel setMessage:@"Dump files are huge! Exercise patience while saving."]; - } - + [panel setMessage:@"Dump files are huge! Exercise patience while saving."]; [panel beginSheetForDirectory:nil file:[NSString stringWithFormat:[NSString stringWithFormat:@"%@.dump", [_process name]]] modalForWindow:ibWindow diff --git a/DocInterfaceActions.m b/DocInterfaceActions.m index 26542d6..b2e1208 100644 --- a/DocInterfaceActions.m +++ b/DocInterfaceActions.m @@ -52,7 +52,8 @@ - (IBAction)ibSetRemoteCheater:(id)sender { - ChazLog( @"Selected %@", sender ); + int timeout=5; + ChazLog( @"Selected %@", sender ); if ( ![self shouldConnectWithServer:sender] ) { return; @@ -62,7 +63,7 @@ _resolvingService = [[sender representedObject] retain]; [_resolvingService setDelegate:self]; - [_resolvingService resolve]; + [_resolvingService resolveWithTimeout:timeout]; } - (void)netServiceDidResolveAddress:(NSNetService *)sender @@ -292,25 +293,11 @@ [self switchToCheatMode]; int rowIndex = [_cheatData variableCount]-1; - if ( MacOSXVersion() >= 0x1030 ) { - [ibCheatVariableTable selectRowIndexes:[NSIndexSet indexSetWithIndex:rowIndex] byExtendingSelection:NO]; - } - else { - [ibCheatVariableTable selectRow:rowIndex byExtendingSelection:NO]; - } + [ibCheatVariableTable selectRowIndexes:[NSIndexSet indexSetWithIndex:rowIndex] byExtendingSelection:NO]; // start editing the last added variable if ( [[NSUserDefaults standardUserDefaults] boolForKey:TCAutoStartEditingVarsPref] ) { if ( top > 1 ) { - // edit multiple - if ( MacOSXVersion() >= 0x1030 ) { - [ibCheatVariableTable selectRowIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(rowIndex-top+1,top-1)] - byExtendingSelection:YES]; - } - else { - for ( i = 1; i < top; i++ ) { - [ibCheatVariableTable selectRow:rowIndex-i byExtendingSelection:YES]; - } - } + [ibCheatVariableTable selectRowIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(rowIndex-top+1,top-1)] byExtendingSelection:YES]; [ibCheatVariableTable scrollRowToVisible:rowIndex]; [self ibRunEditVariablesSheet:nil]; } @@ -547,12 +534,7 @@ [self switchToCheatMode]; int row = [_cheatData variableCount]-1; - if ( MacOSXVersion() >= 0x1030 ) { - [ibCheatVariableTable selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; - } - else { - [ibCheatVariableTable selectRow:row byExtendingSelection:NO]; - } + [ibCheatVariableTable selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; // start editing new variable if ( [[NSUserDefaults standardUserDefaults] boolForKey:TCAutoStartEditingVarsPref] ) { [ibCheatVariableTable editColumn:[ibCheatVariableTable columnWithIdentifier:@"address"] row:row withEvent:nil select:YES]; diff --git a/English.lproj/AboutBox.nib/classes.nib b/English.lproj/AboutBox.nib/classes.nib deleted file mode 100644 index f9f3920..0000000 --- a/English.lproj/AboutBox.nib/classes.nib +++ /dev/null @@ -1,18 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {ibEmailButton = id; ibWebsiteButton = id; }; - CLASS = AboutBoxController; - LANGUAGE = ObjC; - OUTLETS = { - ibDateText = NSTextField; - ibEmailButton = NSButton; - ibNameVersionText = NSTextField; - ibWebsiteButton = NSButton; - }; - SUPERCLASS = NSWindowController; - }, - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/English.lproj/AboutBox.nib/info.nib b/English.lproj/AboutBox.nib/info.nib deleted file mode 100644 index 4c7b4ef..0000000 --- a/English.lproj/AboutBox.nib/info.nib +++ /dev/null @@ -1,37 +0,0 @@ - - - - - IBDocumentLocation - 124 93 356 241 0 0 1280 938 - IBFramework Version - 364.0 - IBGroupedObjects - - 3 - - 93 - 91 - - 7 - - 77 - 80 - 87 - - 8 - - 89 - 81 - - - IBLastGroupID - 9 - IBOpenObjects - - 85 - - IBSystem Version - 7U16 - - diff --git a/English.lproj/AboutBox.nib/keyedobjects.nib b/English.lproj/AboutBox.nib/keyedobjects.nib index 7ef2eec..a4805a0 100644 Binary files a/English.lproj/AboutBox.nib/keyedobjects.nib and b/English.lproj/AboutBox.nib/keyedobjects.nib differ diff --git a/English.lproj/CheatDocument.nib/classes.nib b/English.lproj/CheatDocument.nib/classes.nib deleted file mode 100644 index ae50211..0000000 --- a/English.lproj/CheatDocument.nib/classes.nib +++ /dev/null @@ -1,96 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {copy = id; cut = id; delete = id; paste = id; }; - CLASS = BetterTableView; - LANGUAGE = ObjC; - SUPERCLASS = NSTableView; - }, - { - ACTIONS = { - ibAddCheatVariable = id; - ibAddSearchVariable = id; - ibCancelDump = id; - ibCancelSearch = id; - ibCheat = id; - ibClearSearch = id; - ibDumpMemory = id; - ibEndCustomServerSheet = id; - ibEndEditVariablesSheet = id; - ibEndPasswordSheet = id; - ibEndPropertiesSheet = id; - ibPauseTarget = id; - ibRedo = id; - ibResumeTarget = id; - ibRunCustomServerSheet = id; - ibRunEditVariablesSheet = id; - ibRunPasswordSheet = id; - ibRunPropertiesSheet = id; - ibSearch = id; - ibSetCheatRepeats = id; - ibSetCustomCheater = id; - ibSetIntegerSign = id; - ibSetLocalCheater = id; - ibSetNoCheater = id; - ibSetOperator = id; - ibSetProcess = id; - ibSetRemoteCheater = id; - ibSetRepeatInterval = id; - ibSetValueUsed = id; - ibSetVariableEnabled = id; - ibSetVariableType = id; - ibStopCheat = id; - ibToggleSearchCheat = id; - ibUndo = id; - }; - CLASS = CheatDocument; - LANGUAGE = ObjC; - OUTLETS = { - ibCheatButton = NSButton; - ibCheatContentView = NSView; - ibCheatInfoField = NSTextField; - ibCheatInfoText = NSTextField; - ibCheatRepeatAuxText = NSTextField; - ibCheatRepeatButton = NSButton; - ibCheatRepeatField = NSTextField; - ibCheatVariableTable = BetterTableView; - ibCustomServerSheet = NSWindow; - ibEditVariablesSheet = NSWindow; - ibNewValueField = NSTextField; - ibPasswordField = NSTextField; - ibPasswordSheet = NSWindow; - ibPlaceView = NSView; - ibPortField = NSTextField; - ibProcessPopup = NSPopUpButton; - ibPropertiesSheet = NSWindow; - ibSearchButton = NSButton; - ibSearchClearButton = NSButton; - ibSearchContentView = NSView; - ibSearchIntegerSignMatrix = NSMatrix; - ibSearchOperatorPopup = NSPopUpButton; - ibSearchTypePopup = NSPopUpButton; - ibSearchValueField = NSTextField; - ibSearchValueUsedMatrix = NSMatrix; - ibSearchVariableButton = NSButton; - ibSearchVariableTable = VariableTable; - ibServerField = NSTextField; - ibServerPopup = NSPopUpButton; - ibStatusBar = NSProgressIndicator; - ibStatusText = StatusTextField; - ibWindow = NSWindow; - ibWindowTitleField = NSTextField; - }; - SUPERCLASS = NSDocument; - }, - { - ACTIONS = {fadeToCheatMode = id; fadeToSessionMode = id; }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - {CLASS = NSObject; LANGUAGE = ObjC; }, - {CLASS = StatusTextField; LANGUAGE = ObjC; SUPERCLASS = NSTextField; }, - {CLASS = VariableTable; LANGUAGE = ObjC; SUPERCLASS = BetterTableView; } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/English.lproj/CheatDocument.nib/info.nib b/English.lproj/CheatDocument.nib/info.nib deleted file mode 100644 index 08b8173..0000000 --- a/English.lproj/CheatDocument.nib/info.nib +++ /dev/null @@ -1,29 +0,0 @@ - - - - - IBDocumentLocation - 540 85 356 394 0 0 1280 938 - IBEditorPositions - - 24 - 420 519 440 253 0 0 1280 938 - 45 - 420 519 440 253 0 0 1280 938 - - IBFramework Version - 437.0 - IBOpenObjects - - 122 - 757 - 643 - 45 - 5 - 24 - 483 - - IBSystem Version - 8B15 - - diff --git a/English.lproj/CheatDocument.nib/keyedobjects.nib b/English.lproj/CheatDocument.nib/keyedobjects.nib index da680c8..17ef4b2 100644 Binary files a/English.lproj/CheatDocument.nib/keyedobjects.nib and b/English.lproj/CheatDocument.nib/keyedobjects.nib differ diff --git a/English.lproj/Help.nib/classes.nib b/English.lproj/Help.nib/classes.nib deleted file mode 100644 index cd782fb..0000000 --- a/English.lproj/Help.nib/classes.nib +++ /dev/null @@ -1,12 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - CLASS = HelpController; - LANGUAGE = ObjC; - OUTLETS = {helpWindow = NSWindow; webView = WebView; }; - SUPERCLASS = NSWindowController; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/English.lproj/Help.nib/info.nib b/English.lproj/Help.nib/info.nib deleted file mode 100644 index f188829..0000000 --- a/English.lproj/Help.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBDocumentLocation - 69 61 356 241 0 0 1280 1002 - IBFramework Version - 364.0 - IBOpenObjects - - 18 - - IBSystem Version - 7U16 - - diff --git a/English.lproj/Help.nib/keyedobjects.nib b/English.lproj/Help.nib/keyedobjects.nib index 4c75545..4172d49 100644 Binary files a/English.lproj/Help.nib/keyedobjects.nib and b/English.lproj/Help.nib/keyedobjects.nib differ diff --git a/English.lproj/MainMenu.nib/classes.nib b/English.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index 6fcccc7..0000000 --- a/English.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,255 +0,0 @@ - - - - - IBClasses - - - ACTIONS - - ibAddCheatVariable - id - ibAddSearchVariable - id - ibCancelDump - id - ibCancelSearch - id - ibCheat - id - ibClearSearch - id - ibDumpMemory - id - ibEndCustomServerSheet - id - ibEndEditVariablesSheet - id - ibEndPasswordSheet - id - ibEndPropertiesSheet - id - ibPauseTarget - id - ibRedo - id - ibResumeTarget - id - ibRunCustomServerSheet - id - ibRunEditVariablesSheet - id - ibRunPasswordSheet - id - ibRunPropertiesSheet - id - ibSearch - id - ibSetCheatRepeats - id - ibSetCustomCheater - id - ibSetIntegerSign - id - ibSetLocalCheater - id - ibSetNoCheater - id - ibSetOperator - id - ibSetProcess - id - ibSetRemoteCheater - id - ibSetRepeatInterval - id - ibSetValueUsed - id - ibSetVariableEnabled - id - ibSetVariableType - id - ibStopCheat - id - ibToggleSearchCheat - id - ibUndo - id - - CLASS - CheatDocument - LANGUAGE - ObjC - OUTLETS - - ibCheatButton - NSButton - ibCheatContentView - NSView - ibCheatInfoField - NSTextField - ibCheatInfoText - NSTextField - ibCheatRepeatAuxText - NSTextField - ibCheatRepeatButton - NSButton - ibCheatRepeatField - NSTextField - ibCheatVariableTable - BetterTableView - ibCustomServerSheet - NSWindow - ibEditVariablesSheet - NSWindow - ibNewValueField - NSTextField - ibPasswordField - NSTextField - ibPasswordSheet - NSWindow - ibPlaceView - NSView - ibPortField - NSTextField - ibProcessPopup - NSPopUpButton - ibPropertiesSheet - NSWindow - ibSearchButton - NSButton - ibSearchClearButton - NSButton - ibSearchContentView - NSView - ibSearchIntegerSignMatrix - NSMatrix - ibSearchOperatorPopup - NSPopUpButton - ibSearchTypePopup - NSPopUpButton - ibSearchValueField - NSTextField - ibSearchValueUsedMatrix - NSMatrix - ibSearchVariableButton - NSButton - ibSearchVariableTable - VariableTable - ibServerField - NSTextField - ibServerPopup - NSPopUpButton - ibStatusBar - NSProgressIndicator - ibStatusText - StatusTextField - ibWindow - NSWindow - ibWindowTitleField - NSTextField - - SUPERCLASS - NSDocument - - - CLASS - BetterTableView - LANGUAGE - ObjC - SUPERCLASS - NSTableView - - - CLASS - NSMenu - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - StatusTextField - LANGUAGE - ObjC - SUPERCLASS - NSTextField - - - ACTIONS - - ibAddCheatVariable - id - ibCancelSearch - id - ibClearSearch - id - ibDumpMemory - id - ibPauseTarget - id - ibRedo - id - ibRunEditVariablesSheet - id - ibRunPropertiesSheet - id - ibToggleSearchCheat - id - ibUndo - id - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - CLASS - VariableTable - LANGUAGE - ObjC - SUPERCLASS - BetterTableView - - - ACTIONS - - checkForUpdate - id - launchEmailMenu - id - launchHelpFile - id - launchWebsiteMenu - id - newBlankCheatWindow - id - newSearchWindow - id - showAboutBoxWindow - id - showPreferenceWindow - id - - CLASS - AppController - LANGUAGE - ObjC - SUPERCLASS - NSApplication - - - IBVersion - 1 - - diff --git a/English.lproj/MainMenu.nib/info.nib b/English.lproj/MainMenu.nib/info.nib deleted file mode 100644 index 5056bdd..0000000 --- a/English.lproj/MainMenu.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 677 - IBLastKnownRelativeProjectPath - ../The Cheat.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 370 - - IBSystem Version - 9J61 - targetFramework - IBCocoaFramework - - diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib index d2e9b95..7de3ab6 100644 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/English.lproj/Preferences.nib/classes.nib b/English.lproj/Preferences.nib/classes.nib deleted file mode 100644 index 4ee476b..0000000 --- a/English.lproj/Preferences.nib/classes.nib +++ /dev/null @@ -1,66 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {copy = id; cut = id; delete = id; paste = id; }; - CLASS = BetterTableView; - LANGUAGE = ObjC; - SUPERCLASS = NSTableView; - }, - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = { - ibDisplayValuesButton = id; - ibSetAskForSave = id; - ibSetFadeSmoothly = id; - ibSetResultsDisplayed = id; - ibSetValueUpdate = id; - ibStartEditingVarsButton = id; - ibSwitchVariablesButton = id; - ibWindowOrderButton = id; - }; - CLASS = GeneralPrefs; - LANGUAGE = ObjC; - OUTLETS = { - ibAskForSaveButton = NSButton; - ibDisplayValuesButton = NSButton; - ibFadeSmoothlyButton = NSButton; - ibResultsDisplayedField = NSTextField; - ibStartEditingVarsButton = NSButton; - ibSwitchVariablesButton = NSButton; - ibValueUpdateField = NSTextField; - ibWindowOrderButton = NSButton; - }; - SUPERCLASS = NSObject; - }, - {CLASS = NSObject; LANGUAGE = ObjC; }, - { - CLASS = PreferenceController; - LANGUAGE = ObjC; - OUTLETS = {ibGeneralView = NSView; ibServerView = NSView; ibUpdateCheckView = NSView; }; - SUPERCLASS = NSWindowController; - }, - { - ACTIONS = {ibSetBroadcast = id; ibSetListenPort = id; ibStartServer = id; }; - CLASS = ServerPrefs; - LANGUAGE = ObjC; - OUTLETS = { - ibDefaultPortText = NSTextField; - ibNameField = NSTextField; - ibPortField = NSTextField; - ibSessionTable = NSTableView; - ibStartButton = NSButton; - ibStatusField = StatusTextField; - }; - SUPERCLASS = NSObject; - }, - {CLASS = StatusTextField; LANGUAGE = ObjC; SUPERCLASS = NSTextField; }, - { - ACTIONS = {ibAutoCheckButton = id; ibCheckNowButton = id; }; - CLASS = UpdatePrefs; - LANGUAGE = ObjC; - OUTLETS = {ibAutoCheckButton = NSButton; }; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/English.lproj/Preferences.nib/info.nib b/English.lproj/Preferences.nib/info.nib deleted file mode 100644 index 1dd0f12..0000000 --- a/English.lproj/Preferences.nib/info.nib +++ /dev/null @@ -1,27 +0,0 @@ - - - - - IBDocumentLocation - 333 104 431 282 0 0 1280 938 - IBEditorPositions - - 441 - 325 550 476 321 0 0 1280 938 - 463 - 402 570 476 210 0 0 1280 938 - 478 - 402 433 476 420 0 0 1280 938 - - IBFramework Version - 437.0 - IBLockedObjects - - IBOpenObjects - - 441 - - IBSystem Version - 8A428 - - diff --git a/English.lproj/Preferences.nib/keyedobjects.nib b/English.lproj/Preferences.nib/keyedobjects.nib index 407c805..761dc75 100644 Binary files a/English.lproj/Preferences.nib/keyedobjects.nib and b/English.lproj/Preferences.nib/keyedobjects.nib differ diff --git a/Info.plist b/Info.plist index cd8ee2b..6c7dfda 100644 --- a/Info.plist +++ b/Info.plist @@ -35,8 +35,6 @@ icon.icns CFBundleIdentifier com.brokenzipper.TheCheat - SecTaskAccess - allowed CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -44,7 +42,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.2.5 + 1.2.6 CFBundleSignature chœt CFBundleURLTypes @@ -59,12 +57,14 @@ CFBundleVersion - 1.2.5 + 1.2.6 NSAppleScriptEnabled YES NSMainNibFile MainMenu NSPrincipalClass AppController + SecTaskAccess + allowed diff --git a/LocalCheater.m b/LocalCheater.m index 06796a1..157b43a 100644 --- a/LocalCheater.m +++ b/LocalCheater.m @@ -420,13 +420,13 @@ int _MemoryDumpTask( ThreadedTask *task, unsigned iteration ) TCArray variables; TCArray values; - if ( searchContext = [_searchResults lastObject] ) { + if ( (searchContext = [_searchResults lastObject]) ) { [_savedResults addObject:searchContext]; [_searchResults removeLastObject]; [self stopWatchingVariables]; - if ( searchContext = [_searchResults lastObject] ) { + if ( (searchContext = [_searchResults lastObject]) ) { if ( _shouldCopy ) { variables = TCArrayCopyElements( searchContext->addresses, _returnLimit ); values = TCArrayCopyElements( searchContext->values, _returnLimit ); @@ -452,7 +452,7 @@ int _MemoryDumpTask( ThreadedTask *task, unsigned iteration ) [self stopWatchingVariables]; - if ( searchContext = [_savedResults lastObject] ) { + if ( (searchContext = [_savedResults lastObject]) ) { [_searchResults addObject:searchContext]; [_savedResults removeLastObject]; @@ -486,7 +486,7 @@ int _MemoryDumpTask( ThreadedTask *task, unsigned iteration ) return; } - if ( context = [_searchResults lastObject] ) { + if ( (context = [_searchResults lastObject]) ) { TCArray addresses = context->addresses; TCArray values = context->values; // check the index & count diff --git a/MySocket.m b/MySocket.m index fdbee92..091e30d 100644 --- a/MySocket.m +++ b/MySocket.m @@ -222,7 +222,8 @@ struct _mySocketGlobals { addr.sin_family = AF_INET; addr.sin_port = htons( (short)port ); addr.sin_addr.s_addr = INADDR_ANY; - memset( &(addr.sin_zero), NULL, 8 ); + // Use 0 replace NULL + memset( &(addr.sin_zero), 0, 8 ); err = bind( _sockfd, (struct sockaddr *)(&addr), sizeof(addr) ); if ( err == -1 ) { @@ -394,7 +395,7 @@ struct _mySocketGlobals { if ( err == -1 ) { return @""; } - return [NSString stringWithCString:host]; + return [NSString stringWithCString:host encoding:NSUTF8StringEncoding]; } - (int)localPort @@ -406,20 +407,20 @@ struct _mySocketGlobals { { int err; struct sockaddr_in addr; - int len = sizeof(addr); + unsigned int len = sizeof(addr); err = getpeername( _sockfd, (struct sockaddr *)(&addr), &len ); if ( err == -1 ) { return @"Unknown"; } - return [NSString stringWithCString:inet_ntoa(addr.sin_addr)]; + return [NSString stringWithCString:inet_ntoa(addr.sin_addr) encoding:NSUTF8StringEncoding]; } - (int)remotePort { int err; struct sockaddr_in addr; - int len = sizeof(addr); + unsigned int len = sizeof(addr); err = getpeername( _sockfd, (struct sockaddr *)(&addr), &len ); if ( err == -1 ) { @@ -446,7 +447,7 @@ struct _mySocketGlobals { struct sockaddr_in addr; // resolve the host - h = gethostbyname( [host lossyCString] ); + h = gethostbyname( [host cStringUsingEncoding:NSUTF8StringEncoding] ); if ( h == NULL ) { // host not found return nil; @@ -456,7 +457,8 @@ struct _mySocketGlobals { addr.sin_family = AF_INET; addr.sin_port = htons( (short)port ); memcpy( &(addr.sin_addr), h->h_addr, sizeof(struct in_addr) ); - memset( &(addr.sin_zero), NULL, 8 ); + // Use 0 replace NULL + memset( &(addr.sin_zero), 0, 8 ); return [NSData dataWithBytes:&addr length:sizeof(addr)]; } @@ -803,7 +805,7 @@ DONE:; MySocket *newSocket; int newsockfd; struct sockaddr addr; - int addrlen = sizeof(addr); + unsigned int addrlen = sizeof(addr); newsockfd = accept( _sockfd, &addr, &addrlen ); if ( newsockfd >= 0 ) { @@ -866,7 +868,7 @@ DONE:; [_writeLock lock]; if ( [_writeQueue count] > 0 ) { int buflen = 0; - int len = sizeof(buflen); + unsigned int len = sizeof(buflen); int err; err = getsockopt( _sockfd, SOL_SOCKET, SO_SNDBUF, &buflen, &len ); // write data @@ -1013,7 +1015,7 @@ DONE:; NSMutableData *buffer; unsigned packetLen = *len; - if ( buffer = _unclaimedData ) { + if ( (buffer = _unclaimedData) ) { // claim the bytes int unclaimedLen = [_unclaimedData length]; if ( unclaimedLen > packetLen ) { diff --git a/PreferenceController.m b/PreferenceController.m index 8a55810..3416d17 100644 --- a/PreferenceController.m +++ b/PreferenceController.m @@ -56,9 +56,7 @@ NSWindow *window = [self window]; [self switchToView:ibGeneralView]; [window setTitle:@"General"]; - if ( MacOSXVersion() >= 0x1030 ) { - [_toolbar setSelectedItemIdentifier:@"General"]; - } + [_toolbar setSelectedItemIdentifier:@"General"]; } - (void)chooseServer:(id)object @@ -66,9 +64,7 @@ NSWindow *window = [self window]; [self switchToView:ibServerView]; [window setTitle:@"Server"]; - if ( MacOSXVersion() >= 0x1030 ) { - [_toolbar setSelectedItemIdentifier:@"Server"]; - } + [_toolbar setSelectedItemIdentifier:@"Server"]; } - (void)chooseUpdate:(id)object @@ -76,9 +72,7 @@ NSWindow *window = [self window]; [self switchToView:ibUpdateCheckView]; [window setTitle:@"Update Check"]; - if ( MacOSXVersion() >= 0x1030 ) { - [_toolbar setSelectedItemIdentifier:@"Update Check"]; - } + [_toolbar setSelectedItemIdentifier:@"Update Check"]; } - (void)switchToView:(NSView *)view diff --git a/ServerPrefs.m b/ServerPrefs.m index b034218..3d2637f 100644 --- a/ServerPrefs.m +++ b/ServerPrefs.m @@ -149,7 +149,7 @@ // reselect the last item if the selection is now invalid len = [[NSApp cheatServer] childCount] - 1; if ( [aTableView selectedRow] > len ) { - [aTableView selectRow:len byExtendingSelection:NO]; + [aTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:len] byExtendingSelection:NO]; } [aTableView reloadData]; } diff --git a/The Cheat.xcodeproj/project.pbxproj b/The Cheat.xcodeproj/project.pbxproj index 948bf26..d6af02a 100644 --- a/The Cheat.xcodeproj/project.pbxproj +++ b/The Cheat.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -514,8 +514,11 @@ /* Begin PBXProject section */ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; buildConfigurationList = 779E59840EB52C64000C6482 /* Build configuration list for PBXProject "The Cheat" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -523,6 +526,7 @@ Japanese, French, German, + "zh-Hans", ); mainGroup = 29B97314FDCFA39411CA2CEA /* The Cheat */; projectDirPath = ""; @@ -677,14 +681,14 @@ 779E59810EB52C64000C6482 /* Development */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; DEBUGGING_SYMBOLS = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_AUTO_VECTORIZATION = YES; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_ENABLE_TRIGRAPHS = NO; GCC_FAST_OBJC_DISPATCH = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -696,9 +700,9 @@ GCC_WARN_UNKNOWN_PRAGMAS = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; + INSTALL_PATH = /Applications; LIBRARY_SEARCH_PATHS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.2; + MACOSX_DEPLOYMENT_TARGET = 10.7; OTHER_CFLAGS = "-D_DEBUG"; OTHER_LDFLAGS = ( "-sectcreate", @@ -707,6 +711,7 @@ Info.plist, ); PRODUCT_NAME = "The Cheat"; + SDKROOT = macosx; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( "-Wmost", @@ -721,15 +726,14 @@ 779E59820EB52C64000C6482 /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = YES; DEAD_CODE_STRIPPING = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_AUTO_VECTORIZATION = YES; GCC_DYNAMIC_NO_PIC = YES; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_ENABLE_TRIGRAPHS = NO; GCC_FAST_OBJC_DISPATCH = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -740,9 +744,9 @@ GCC_WARN_UNKNOWN_PRAGMAS = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; + INSTALL_PATH = /Applications; LIBRARY_SEARCH_PATHS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.2; + MACOSX_DEPLOYMENT_TARGET = 10.7; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ( "-sectcreate", @@ -751,10 +755,7 @@ Info.plist, ); PRODUCT_NAME = "The Cheat"; - PROVISIONING_PROFILE = ""; - SDKROOT = macosx10.3.9; - "SDKROOT[arch=i386]" = macosx10.4; - "SDKROOT[arch=ppc]" = macosx10.3.9; + SDKROOT = macosx; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( "-Wmost", @@ -769,12 +770,13 @@ 779E59830EB52C64000C6482 /* Default */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = YES; DEAD_CODE_STRIPPING = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_AUTO_VECTORIZATION = YES; GCC_DYNAMIC_NO_PIC = YES; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_ENABLE_TRIGRAPHS = NO; GCC_FAST_OBJC_DISPATCH = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -785,11 +787,13 @@ GCC_WARN_UNKNOWN_PRAGMAS = NO; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; + INSTALL_PATH = /Applications; LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.7; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; PRODUCT_NAME = "The Cheat"; + SDKROOT = macosx; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( "-Wmost", diff --git a/ThreadedTask.m b/ThreadedTask.m index eefe568..6deef52 100644 --- a/ThreadedTask.m +++ b/ThreadedTask.m @@ -81,7 +81,7 @@ - (id)initWithTarget:(id)target selector:(SEL)selector context:(id)context delegate:(id)delegate { - if ( self = [self _initWithContext:context delegate:delegate] ) { + if ( (self = [self _initWithContext:context delegate:delegate]) ) { // set initial values [self setTarget:target selector:selector]; } @@ -95,7 +95,7 @@ - (id)initWithFunction:(int (*)(ThreadedTask *, unsigned))function context:(id)context delegate:(id)delegate { - if ( self = [self _initWithContext:context delegate:delegate] ) { + if ( (self = [self _initWithContext:context delegate:delegate]) ) { // set initial values [self setFunction:function]; } diff --git a/Variable.m b/Variable.m index 536d94f..4630ad0 100644 --- a/Variable.m +++ b/Variable.m @@ -274,11 +274,7 @@ NSScanner *scanner = [NSScanner scannerWithString:string]; TCAddress address; -#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED if ( [scanner scanHexLongLong:(unsigned long long *)(&address)] ) { -#else - if ( [scanner scanHexInt:(unsigned *)(&address)] ) { -#endif [self setAddress:address]; return YES; } @@ -324,7 +320,7 @@ switch ( _type ) { case TCDouble: return [NSString stringWithFormat:@"%.1lf", *(double *)[self value]]; case TCFloat: return [NSString stringWithFormat:@"%.1f", *(float *)[self value]]; - case TCString: return [NSString stringWithCString:[self value] length:[self valueSize]]; + case TCString: return [[[NSString alloc] initWithBytes:[self value] length:[self valueSize] encoding:NSUTF8StringEncoding] autorelease]; } if ( _integerSign == TCUnsigned ) { switch ( _type ) { @@ -394,7 +390,7 @@ } case TCString: { - char *str = (char *)[string lossyCString]; + char *str = (char *)[string cStringUsingEncoding:NSUTF8StringEncoding]; unsigned len = strlen( str ); [self setValue:str size:len]; break; @@ -474,21 +470,13 @@ void bigEndianValue(void *buffer, Variable *variable) _enabled = enabled; } - -#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED - (NSInteger)tag -#else -- (int)tag -#endif { return _tag; } -#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED + - (void)setTag:(NSInteger)tag -#else -- (void)setTag:(int)tag -#endif { _tag = tag; } diff --git a/VariableTable.m b/VariableTable.m index bf76767..2c75381 100644 --- a/VariableTable.m +++ b/VariableTable.m @@ -31,7 +31,8 @@ TrackerScroller *scroller = [[TrackerScroller alloc] initWithFrame:[oldScroller frame]]; [scroller setControlSize:[oldScroller controlSize]]; - [scroller setFloatValue:[oldScroller floatValue] knobProportion:[oldScroller knobProportion]]; + [scroller setDoubleValue:[oldScroller floatValue]]; + [scroller setKnobProportion:[oldScroller knobProportion]]; [scroller setControlTint:[oldScroller controlTint]]; // set the new scroller diff --git a/main.m b/main.m index a984ac2..cc9de3e 100644 --- a/main.m +++ b/main.m @@ -106,18 +106,7 @@ int main( int argc, char *argv[] ) ChazDebugSetup(); ChazMapLogToDebug(); - -#ifdef __ppc__ - // PPC machines whose operating system is below leopard do not need authorization - SInt32 osxMajorVersion; - Gestalt(gestaltSystemVersionMinor, &osxMajorVersion); - if (osxMajorVersion < 5) - { - [pool release]; - return NSApplicationMain(argc, (const char **) argv); - } -#endif - + if (amIWorthy()) { #ifndef _DEBUG