Skip to content

Commit

Permalink
Implement applicationSupportsSecureRestorableState to silence warning
Browse files Browse the repository at this point in the history
  • Loading branch information
zorgiepoo committed Jul 1, 2024
1 parent cede7f8 commit 9a103d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions Bit Slicer/ZGAppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@ + (void)restoreWindowWithIdentifier:(NSString *)identifier state:(NSCoder *)__un
}
}

- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)application
{
return YES;
}

- (BOOL)setRestorationForWindowController:(NSWindowController *)windowController withWindowIdentifier:(NSString *)windowIdentifier
{
BOOL firstTimeLoading = (windowController.window.restorationClass == nil);
Expand Down
12 changes: 6 additions & 6 deletions Bit Slicer/ZGDebuggerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ - (void)encodeRestorableStateWithCoder:(NSCoder *)coder
[coder encodeObject:self.addressTextField.stringValue forKey:ZGDebuggerAddressField];
[coder encodeObject:[(ZGProcess *)self.runningApplicationsPopUpButton.selectedItem.representedObject internalName] forKey:ZGDebuggerProcessInternalName];
[coder encodeObject:@(_offsetFromBase) forKey:ZGDebuggerOffsetFromBase];
[coder encodeObject:_mappedFilePath == nil ? [NSNull null] : _mappedFilePath forKey:ZGDebuggerMappedFilePath];

if (_mappedFilePath != nil)
{
[coder encodeObject:_mappedFilePath forKey:ZGDebuggerMappedFilePath];
}
}

- (void)restoreStateWithCoder:(NSCoder *)coder
Expand All @@ -252,11 +256,7 @@ - (void)restoreStateWithCoder:(NSCoder *)coder

_offsetFromBase = [(NSNumber *)[coder decodeObjectOfClass:[NSNumber class] forKey:ZGDebuggerOffsetFromBase] unsignedLongLongValue];

_mappedFilePath = [coder decodeObjectOfClass:[NSObject class] forKey:ZGDebuggerMappedFilePath];
if ((id)_mappedFilePath == [NSNull null])
{
_mappedFilePath = nil;
}
_mappedFilePath = [coder decodeObjectOfClass:[NSString class] forKey:ZGDebuggerMappedFilePath];

self.desiredProcessInternalName = [coder decodeObjectForKey:ZGDebuggerProcessInternalName];
[self updateRunningProcesses];
Expand Down

0 comments on commit 9a103d5

Please sign in to comment.