- project cleanup

- preferences window implementation (logging, update check, etc)
This commit is contained in:
Patrick Wardle 2016-09-12 21:27:45 -10:00
parent d63410b772
commit 5b0f6633c7
40 changed files with 920 additions and 834 deletions

View File

@ -21,9 +21,9 @@
7D17C4FD1D658DB90066232A /* ErrorWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D17C4F31D658DB90066232A /* ErrorWindowController.m */; };
7D17C4FE1D658DB90066232A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D17C4F41D658DB90066232A /* main.m */; };
7D17C4FF1D658DB90066232A /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7D17C4F51D658DB90066232A /* Info.plist */; };
7D17C5001D658DB90066232A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7D17C4F71D658DB90066232A /* Assets.xcassets */; };
7D17C5011D658DB90066232A /* ErrorWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D17C4F81D658DB90066232A /* ErrorWindowController.xib */; };
7D17C5041D658DEC0066232A /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D17C5021D658DEC0066232A /* MainMenu.xib */; };
7D6245831D87C3D700870565 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7D6245821D87C3D700870565 /* Images.xcassets */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@ -50,10 +50,10 @@
7D17C4F41D658DB90066232A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Installer/main.m; sourceTree = SOURCE_ROOT; };
7D17C4F51D658DB90066232A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Installer/Info.plist; sourceTree = SOURCE_ROOT; };
7D17C4F61D658DB90066232A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Installer/AppDelegate.h; sourceTree = SOURCE_ROOT; };
7D17C4F71D658DB90066232A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Installer/Assets.xcassets; sourceTree = SOURCE_ROOT; };
7D17C4F81D658DB90066232A /* ErrorWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = ErrorWindowController.xib; path = Installer/ErrorWindowController.xib; sourceTree = SOURCE_ROOT; };
7D17C5031D658DEC0066232A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Installer/Base.lproj/MainMenu.xib; sourceTree = SOURCE_ROOT; };
7D24C8651D2CDEA7009932EE /* Installer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Installer.app; sourceTree = BUILT_PRODUCTS_DIR; };
7D6245821D87C3D700870565 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Images/Images.xcassets; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -70,6 +70,7 @@
7D17C4D71D658D9F0066232A /* Shared */ = {
isa = PBXGroup;
children = (
7D6245821D87C3D700870565 /* Images.xcassets */,
7D17C4D81D658D9F0066232A /* AboutWindow.xib */,
7D17C4D91D658D9F0066232A /* AboutWindowController.h */,
7D17C4DA1D658D9F0066232A /* AboutWindowController.m */,
@ -94,17 +95,9 @@
path = Images;
sourceTree = "<group>";
};
7D17C5051D658F3E0066232A /* Images */ = {
isa = PBXGroup;
children = (
);
name = Images;
sourceTree = "<group>";
};
7D24C85C1D2CDEA7009932EE = {
isa = PBXGroup;
children = (
7D17C5051D658F3E0066232A /* Images */,
7D17C4D71D658D9F0066232A /* Shared */,
7D24C8671D2CDEA7009932EE /* Source */,
7D24C8661D2CDEA7009932EE /* Products */,
@ -132,7 +125,6 @@
7D17C4F21D658DB90066232A /* ErrorWindowController.h */,
7D17C4F31D658DB90066232A /* ErrorWindowController.m */,
7D17C4F61D658DB90066232A /* AppDelegate.h */,
7D17C4F71D658DB90066232A /* Assets.xcassets */,
7D17C4F81D658DB90066232A /* ErrorWindowController.xib */,
7D24C86B1D2CDEA7009932EE /* Supporting Files */,
);
@ -208,10 +200,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7D6245831D87C3D700870565 /* Images.xcassets in Resources */,
7D17C4E91D658D9F0066232A /* overSight.png in Resources */,
7D17C4FF1D658DB90066232A /* Info.plist in Resources */,
7D17C5011D658DB90066232A /* ErrorWindowController.xib in Resources */,
7D17C5001D658DB90066232A /* Assets.xcassets in Resources */,
7D17C4E81D658D9F0066232A /* icon.png in Resources */,
7D17C4FC1D658DB90066232A /* ConfigureWindowController.xib in Resources */,
7D17C4E51D658D9F0066232A /* AboutWindow.xib in Resources */,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 KiB

View File

@ -141,7 +141,6 @@ AVCaptureDevice* findAppleMic()
// ->wait, since want this to compelete before doing other things!
[[xpcConnection remoteObjectProxy] initialize:^
{
//signal sema
dispatch_semaphore_signal(waitSema);
@ -670,6 +669,9 @@ bail:
//process name
NSString* processName = nil;
//log msg
NSMutableString* logMsg = nil;
//alloc notificaiton
notification = [[NSUserNotification alloc] init];
@ -679,6 +681,9 @@ bail:
//alloc details
details = [NSMutableString string];
//alloc log msg
logMsg = [NSMutableString string];
//set title
// ->audio device
if(YES == [event[EVENT_DEVICE] isKindOfClass:NSClassFromString(@"AVCaptureHALDevice")])
@ -742,7 +747,33 @@ bail:
//set details
// ->name of process using it / icon too?
[notification setInformativeText:[NSString stringWithFormat:@"%@ (%@)", processName, event[EVENT_PROCESS_ID]]];
}
//log event?
// TODO: test will final apps/prefs
if(YES == [[NSUserDefaults standardUserDefaults] boolForKey:LOG_ACTIVITY])
{
//init msg
[logMsg appendString:@"OVERSIGHT: "];
//no process?
// ->just add title / details
if(nil == processName)
{
//add
[logMsg appendFormat:@"%@ (%@)", title, details];
}
//process
// ->add title / details / process
else
{
//add
[logMsg appendFormat:@"%@ (%@, %@)", title, details, processName];
}
//write it out to syslog
syslog(LOG_ERR, "%s\n", logMsg.UTF8String);
}
//icon issues

View File

@ -9,6 +9,7 @@
#import "AVMonitor.h"
#import "EventMonitor.h"
#import "StatusBarMenu.h"
#import "InfoWindowController.h"
#import <Cocoa/Cocoa.h>
@ -16,13 +17,14 @@
/* PROPERTIES */
//av monitor class
@property(nonatomic, retain)AVMonitor* avMonitor;
//status bar menu
@property(nonatomic, retain)StatusBarMenu* statusBarMenuController;
//(camera event) monitor class
@property(nonatomic, retain)EventMonitor* monitor;
@property(nonatomic, retain)AVMonitor* avMonitor;
//info window
@property(nonatomic, retain)InfoWindowController* infoWindowController;
@end

View File

@ -6,8 +6,9 @@
// Copyright (c) 2016 Objective-See. All rights reserved.
//
#import "Consts.h"
#import "Logging.h"
#import "Utilities.h"
#import "AppDelegate.h"
@ -19,8 +20,8 @@
@implementation AppDelegate
@synthesize monitor;
@synthesize avMonitor;
@synthesize infoWindowController;
@synthesize statusBarMenuController;
@ -37,6 +38,25 @@
//dbg msg
logMsg(LOG_DEBUG, @"initialized/loaded status bar (icon/menu)");
//check for updates
// ->but only when user has not disabled that feature
// TODO: change to YES
if(NO == [[NSUserDefaults standardUserDefaults] boolForKey:CHECK_4_UPDATES])
{
//TODO: make a min!
//after a minute
//->check for updates in background
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 3 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^
{
//dbg msg
logMsg(LOG_DEBUG, @"checking for update");
//check
[self isThereAndUpdate];
});
}
//create/init av event monitor
avMonitor = [[AVMonitor alloc] init];
@ -65,4 +85,59 @@
return;
}
//check for an update
//TODO: test to make sure window shows up!
-(void)isThereAndUpdate
{
//version string
NSMutableString* versionString = nil;
//alloc string
versionString = [NSMutableString string];
//check if available version is newer
// ->show update window
if(YES == isNewVersion(versionString))
{
//new version!
// ->show update popup on main thread
dispatch_sync(dispatch_get_main_queue(), ^{
//dbg msg
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"a new version (%@) is available", versionString]);
//alloc/init about window
infoWindowController = [[InfoWindowController alloc] initWithWindowNibName:@"InfoWindow"];
//configure
[self.infoWindowController configure:[NSString stringWithFormat:@"a new version (%@) is available!", versionString] buttonTitle:@"update"];
//center window
[[self.infoWindowController window] center];
//show it
[self.infoWindowController showWindow:self];
//invoke function in background that will make window modal
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
//make modal
makeModal(self.infoWindowController);
});
});
}
//no new version
// ->just (debug) log msg
else
{
//dbg msg
logMsg(LOG_DEBUG, @"no updates available");
}
return;
}
@end

View File

@ -7,10 +7,36 @@
//
#import <Cocoa/Cocoa.h>
#import "InfoWindowController.h"
#import "AboutWindowController.h"
@interface AppDelegate : NSObject <NSApplicationDelegate>
@property (weak) IBOutlet NSButton *loginButton;
/* PROPERTIES */
//about button
@property (weak) IBOutlet NSButton *about;
//log activity button
@property (weak) IBOutlet NSButton *logActivity;
//check for updates automatically button
@property (weak) IBOutlet NSButton *check4Updates;
//check for updates now button
@property (weak) IBOutlet NSButton *check4UpdatesNow;
//check for updates spinner
@property (weak) IBOutlet NSProgressIndicator *spinner;
//version label
@property (weak) IBOutlet NSTextField *versionLabel;
//info window
@property(nonatomic, retain)InfoWindowController* infoWindowController;
//about window controller
@property(nonatomic, retain)AboutWindowController* aboutWindowController;
@end

View File

@ -6,44 +6,188 @@
// Copyright (c) 2016 Objective-See. All rights reserved.
//
#import "Consts.h"
#import "Logging.h"
#import "Utilities.h"
#import "AppDelegate.h"
#import <ServiceManagement/ServiceManagement.h>
@interface AppDelegate ()
@property (weak) IBOutlet NSWindow *window;
@end
//TODO: add uninstall?
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
@synthesize infoWindowController;
@synthesize aboutWindowController;
//center window
// ->also make front, init title bar, etc
-(void)awakeFromNib
{
// Insert code here to initialize your application
//center
[self.window center];
self.loginButton.state = [[NSUserDefaults standardUserDefaults] boolForKey:@"LoginEnabled"];
//make it key window
[self.window makeKeyAndOrderFront:self];
//make window front
[NSApp activateIgnoringOtherApps:YES];
//set title
self.window.title = [NSString stringWithFormat:@"OverSight Preferences (v. %@)", getAppVersion()];
return;
}
- (void)applicationWillTerminate:(NSNotification *)aNotification
//app interface
// ->init user interface
-(void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to tear down your application
//set 'log activity' button state
self.logActivity.state = [[NSUserDefaults standardUserDefaults] boolForKey:LOG_ACTIVITY];
//set 'automatically check for updates' button state
self.check4Updates.state = [[NSUserDefaults standardUserDefaults] boolForKey:CHECK_4_UPDATES];
return;
}
//automatically close when user closes window
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
-(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
{
return YES;
}
- (IBAction)loginButtonPressed:(NSButton *)sender
//toggle/set preferences
-(IBAction)togglePreference:(NSButton *)sender
{
if (!SMLoginItemSetEnabled((__bridge CFStringRef)@"com.objective-see.OverSightHelper", [sender state])) {
NSLog(@"Login Item Was Not Successful");
//set 'log activity' button
if(sender == self.logActivity)
{
//set
[[NSUserDefaults standardUserDefaults] setBool:[sender state] forKey:LOG_ACTIVITY];
}
[[NSUserDefaults standardUserDefaults] setBool:[sender state] forKey:@"LoginEnabled"];
//set 'automatically check for updates'
else if (sender == self.check4Updates)
{
//set
[[NSUserDefaults standardUserDefaults] setBool:[sender state] forKey:CHECK_4_UPDATES];
}
return;
}
//'about' button handler
-(IBAction)about:(id)sender
{
//alloc/init settings window
if(nil == self.aboutWindowController)
{
//alloc/init
aboutWindowController = [[AboutWindowController alloc] initWithWindowNibName:@"AboutWindow"];
}
//center window
[[self.aboutWindowController window] center];
//show it
[self.aboutWindowController showWindow:self];
//invoke function in background that will make window modal
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
//make modal
makeModal(self.aboutWindowController);
});
return;
}
//'check for update' (now) button handler
-(IBAction)check4Update:(id)sender
{
//disable button
self.check4UpdatesNow.enabled = NO;
//hide version msg
self.versionLabel.hidden = YES;
//show spinner
[self.spinner startAnimation:self];
//check for update
[self isThereAndUpdate];
return;
}
//check for an update
-(void)isThereAndUpdate
{
//version string
NSMutableString* versionString = nil;
//alloc string
versionString = [NSMutableString string];
//check if available version is newer
// ->show update window
if(YES == isNewVersion(versionString))
{
//dbg msg
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"a new version (%@) is available", versionString]);
//alloc/init about window
infoWindowController = [[InfoWindowController alloc] initWithWindowNibName:@"InfoWindow"];
//configure
[self.infoWindowController configure:[NSString stringWithFormat:@"a new version (%@) is available!", versionString] buttonTitle:@"update"];
//center window
[[self.infoWindowController window] center];
//show it
[self.infoWindowController showWindow:self];
//invoke function in background that will make window modal
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
//make modal
makeModal(self.infoWindowController);
});
//stop/hide spinner
[self.spinner stopAnimation:self];
//re-enable button
self.check4UpdatesNow.enabled = YES;
}
//no new version
// ->just (debug) log msg
else
{
//dbg msg
logMsg(LOG_DEBUG, @"no updates available");
//stop/hide spinner
[self.spinner stopAnimation:self];
//re-enable button
self.check4UpdatesNow.enabled = YES;
//show now new version message
self.versionLabel.hidden = NO;
}
return;
}
@end

View File

@ -14,661 +14,17 @@
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate">
<connections>
<outlet property="loginButton" destination="rVS-uv-DNf" id="uR0-zX-h7m"/>
<outlet property="about" destination="D1u-ER-JrL" id="GCg-51-bW7"/>
<outlet property="check4Updates" destination="Twr-YX-0dG" id="PsA-vI-UHz"/>
<outlet property="check4UpdatesNow" destination="M9W-tZ-0Z8" id="PKA-ah-dde"/>
<outlet property="logActivity" destination="rVS-uv-DNf" id="5XJ-Ec-mNt"/>
<outlet property="spinner" destination="sph-QU-dL4" id="uwr-2X-sg8"/>
<outlet property="versionLabel" destination="pGb-eI-7vA" id="asA-QR-qQV"/>
<outlet property="window" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
</connections>
</customObject>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
<items>
<menuItem title="OverSight" id="1Xt-HY-uBw">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="OverSight" systemMenu="apple" id="uQy-DD-JDr">
<items>
<menuItem title="About OverSight" id="5kV-Vb-QxS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
<menuItem title="Services" id="NMo-om-nkz">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
<menuItem title="Hide OverSight" keyEquivalent="h" id="Olw-nP-bQN">
<connections>
<action selector="hide:" target="-1" id="PnN-Uc-m68"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/>
</connections>
</menuItem>
<menuItem title="Show All" id="Kd2-mp-pUS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
<menuItem title="Quit OverSight" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
<action selector="terminate:" target="-1" id="Te7-pn-YzF"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="File" id="dMs-cI-mzQ">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="File" id="bib-Uj-vzu">
<items>
<menuItem title="New" keyEquivalent="n" id="Was-JA-tGl">
<connections>
<action selector="newDocument:" target="-1" id="4Si-XN-c54"/>
</connections>
</menuItem>
<menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9">
<connections>
<action selector="openDocument:" target="-1" id="bVn-NM-KNZ"/>
</connections>
</menuItem>
<menuItem title="Open Recent" id="tXI-mr-wws">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ">
<items>
<menuItem title="Clear Menu" id="vNY-rz-j42">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="clearRecentDocuments:" target="-1" id="Daa-9d-B3U"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
<menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG">
<connections>
<action selector="performClose:" target="-1" id="HmO-Ls-i7Q"/>
</connections>
</menuItem>
<menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV">
<connections>
<action selector="saveDocument:" target="-1" id="teZ-XB-qJY"/>
</connections>
</menuItem>
<menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A">
<connections>
<action selector="saveDocumentAs:" target="-1" id="mDf-zr-I0C"/>
</connections>
</menuItem>
<menuItem title="Revert to Saved" id="KaW-ft-85H">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="revertDocumentToSaved:" target="-1" id="iJ3-Pv-kwq"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="aJh-i4-bef"/>
<menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="runPageLayout:" target="-1" id="Din-rz-gC5"/>
</connections>
</menuItem>
<menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS">
<connections>
<action selector="print:" target="-1" id="qaZ-4w-aoO"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Edit" id="5QF-Oa-p0T">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Edit" id="W48-6f-4Dl">
<items>
<menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
<connections>
<action selector="undo:" target="-1" id="M6e-cu-g7V"/>
</connections>
</menuItem>
<menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
<connections>
<action selector="redo:" target="-1" id="oIA-Rs-6OD"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
<menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
<connections>
<action selector="cut:" target="-1" id="YJe-68-I9s"/>
</connections>
</menuItem>
<menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
<connections>
<action selector="copy:" target="-1" id="G1f-GL-Joy"/>
</connections>
</menuItem>
<menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
<connections>
<action selector="paste:" target="-1" id="UvS-8e-Qdg"/>
</connections>
</menuItem>
<menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteAsPlainText:" target="-1" id="cEh-KX-wJQ"/>
</connections>
</menuItem>
<menuItem title="Delete" id="pa3-QI-u2k">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="delete:" target="-1" id="0Mk-Ml-PaM"/>
</connections>
</menuItem>
<menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
<connections>
<action selector="selectAll:" target="-1" id="VNm-Mi-diN"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
<menuItem title="Find" id="4EN-yA-p0u">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Find" id="1b7-l0-nxx">
<items>
<menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
<connections>
<action selector="performFindPanelAction:" target="-1" id="cD7-Qs-BN4"/>
</connections>
</menuItem>
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="performFindPanelAction:" target="-1" id="WD3-Gg-5AJ"/>
</connections>
</menuItem>
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
<connections>
<action selector="performFindPanelAction:" target="-1" id="NDo-RZ-v9R"/>
</connections>
</menuItem>
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
<connections>
<action selector="performFindPanelAction:" target="-1" id="HOh-sY-3ay"/>
</connections>
</menuItem>
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
<connections>
<action selector="performFindPanelAction:" target="-1" id="U76-nv-p5D"/>
</connections>
</menuItem>
<menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
<connections>
<action selector="centerSelectionInVisibleArea:" target="-1" id="IOG-6D-g5B"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
<items>
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
<connections>
<action selector="showGuessPanel:" target="-1" id="vFj-Ks-hy3"/>
</connections>
</menuItem>
<menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
<connections>
<action selector="checkSpelling:" target="-1" id="fz7-VC-reM"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
<menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleContinuousSpellChecking:" target="-1" id="7w6-Qz-0kB"/>
</connections>
</menuItem>
<menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleGrammarChecking:" target="-1" id="muD-Qn-j4w"/>
</connections>
</menuItem>
<menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticSpellingCorrection:" target="-1" id="2lM-Qi-WAP"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Substitutions" id="9ic-FL-obx">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
<items>
<menuItem title="Show Substitutions" id="z6F-FW-3nz">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontSubstitutionsPanel:" target="-1" id="oku-mr-iSq"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
<menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleSmartInsertDelete:" target="-1" id="3IJ-Se-DZD"/>
</connections>
</menuItem>
<menuItem title="Smart Quotes" id="hQb-2v-fYv">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="ptq-xd-QOA"/>
</connections>
</menuItem>
<menuItem title="Smart Dashes" id="rgM-f4-ycn">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticDashSubstitution:" target="-1" id="oCt-pO-9gS"/>
</connections>
</menuItem>
<menuItem title="Smart Links" id="cwL-P1-jid">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticLinkDetection:" target="-1" id="Gip-E3-Fov"/>
</connections>
</menuItem>
<menuItem title="Data Detectors" id="tRr-pd-1PS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticDataDetection:" target="-1" id="R1I-Nq-Kbl"/>
</connections>
</menuItem>
<menuItem title="Text Replacement" id="HFQ-gK-NFA">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticTextReplacement:" target="-1" id="DvP-Fe-Py6"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Transformations" id="2oI-Rn-ZJC">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Transformations" id="c8a-y6-VQd">
<items>
<menuItem title="Make Upper Case" id="vmV-6d-7jI">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="uppercaseWord:" target="-1" id="sPh-Tk-edu"/>
</connections>
</menuItem>
<menuItem title="Make Lower Case" id="d9M-CD-aMd">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="lowercaseWord:" target="-1" id="iUZ-b5-hil"/>
</connections>
</menuItem>
<menuItem title="Capitalize" id="UEZ-Bs-lqG">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="capitalizeWord:" target="-1" id="26H-TL-nsh"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Speech" id="xrE-MZ-jX0">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Speech" id="3rS-ZA-NoH">
<items>
<menuItem title="Start Speaking" id="Ynk-f8-cLZ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="startSpeaking:" target="-1" id="654-Ng-kyl"/>
</connections>
</menuItem>
<menuItem title="Stop Speaking" id="Oyz-dy-DGm">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="stopSpeaking:" target="-1" id="dX8-6p-jy9"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Format" id="jxT-CU-nIS">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Format" id="GEO-Iw-cKr">
<items>
<menuItem title="Font" id="Gi5-1S-RQB">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Font" systemMenu="font" id="aXa-aM-Jaq">
<items>
<menuItem title="Show Fonts" keyEquivalent="t" id="Q5e-8K-NDq">
<connections>
<action selector="orderFrontFontPanel:" target="YLy-65-1bz" id="WHr-nq-2xA"/>
</connections>
</menuItem>
<menuItem title="Bold" tag="2" keyEquivalent="b" id="GB9-OM-e27">
<connections>
<action selector="addFontTrait:" target="YLy-65-1bz" id="hqk-hr-sYV"/>
</connections>
</menuItem>
<menuItem title="Italic" tag="1" keyEquivalent="i" id="Vjx-xi-njq">
<connections>
<action selector="addFontTrait:" target="YLy-65-1bz" id="IHV-OB-c03"/>
</connections>
</menuItem>
<menuItem title="Underline" keyEquivalent="u" id="WRG-CD-K1S">
<connections>
<action selector="underline:" target="-1" id="FYS-2b-JAY"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="5gT-KC-WSO"/>
<menuItem title="Bigger" tag="3" keyEquivalent="+" id="Ptp-SP-VEL">
<connections>
<action selector="modifyFont:" target="YLy-65-1bz" id="Uc7-di-UnL"/>
</connections>
</menuItem>
<menuItem title="Smaller" tag="4" keyEquivalent="-" id="i1d-Er-qST">
<connections>
<action selector="modifyFont:" target="YLy-65-1bz" id="HcX-Lf-eNd"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kx3-Dk-x3B"/>
<menuItem title="Kern" id="jBQ-r6-VK2">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Kern" id="tlD-Oa-oAM">
<items>
<menuItem title="Use Default" id="GUa-eO-cwY">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useStandardKerning:" target="-1" id="6dk-9l-Ckg"/>
</connections>
</menuItem>
<menuItem title="Use None" id="cDB-IK-hbR">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="turnOffKerning:" target="-1" id="U8a-gz-Maa"/>
</connections>
</menuItem>
<menuItem title="Tighten" id="46P-cB-AYj">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="tightenKerning:" target="-1" id="hr7-Nz-8ro"/>
</connections>
</menuItem>
<menuItem title="Loosen" id="ogc-rX-tC1">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="loosenKerning:" target="-1" id="8i4-f9-FKE"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Ligatures" id="o6e-r0-MWq">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Ligatures" id="w0m-vy-SC9">
<items>
<menuItem title="Use Default" id="agt-UL-0e3">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useStandardLigatures:" target="-1" id="7uR-wd-Dx6"/>
</connections>
</menuItem>
<menuItem title="Use None" id="J7y-lM-qPV">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="turnOffLigatures:" target="-1" id="iX2-gA-Ilz"/>
</connections>
</menuItem>
<menuItem title="Use All" id="xQD-1f-W4t">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useAllLigatures:" target="-1" id="KcB-kA-TuK"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Baseline" id="OaQ-X3-Vso">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Baseline" id="ijk-EB-dga">
<items>
<menuItem title="Use Default" id="3Om-Ey-2VK">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unscript:" target="-1" id="0vZ-95-Ywn"/>
</connections>
</menuItem>
<menuItem title="Superscript" id="Rqc-34-cIF">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="superscript:" target="-1" id="3qV-fo-wpU"/>
</connections>
</menuItem>
<menuItem title="Subscript" id="I0S-gh-46l">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="subscript:" target="-1" id="Q6W-4W-IGz"/>
</connections>
</menuItem>
<menuItem title="Raise" id="2h7-ER-AoG">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="raiseBaseline:" target="-1" id="4sk-31-7Q9"/>
</connections>
</menuItem>
<menuItem title="Lower" id="1tx-W0-xDw">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="lowerBaseline:" target="-1" id="OF1-bc-KW4"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="Ndw-q3-faq"/>
<menuItem title="Show Colors" keyEquivalent="C" id="bgn-CT-cEk">
<connections>
<action selector="orderFrontColorPanel:" target="-1" id="mSX-Xz-DV3"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="iMs-zA-UFJ"/>
<menuItem title="Copy Style" keyEquivalent="c" id="5Vv-lz-BsD">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="copyFont:" target="-1" id="GJO-xA-L4q"/>
</connections>
</menuItem>
<menuItem title="Paste Style" keyEquivalent="v" id="vKC-jM-MkH">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteFont:" target="-1" id="JfD-CL-leO"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Text" id="Fal-I4-PZk">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Text" id="d9c-me-L2H">
<items>
<menuItem title="Align Left" keyEquivalent="{" id="ZM1-6Q-yy1">
<connections>
<action selector="alignLeft:" target="-1" id="zUv-R1-uAa"/>
</connections>
</menuItem>
<menuItem title="Center" keyEquivalent="|" id="VIY-Ag-zcb">
<connections>
<action selector="alignCenter:" target="-1" id="spX-mk-kcS"/>
</connections>
</menuItem>
<menuItem title="Justify" id="J5U-5w-g23">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="alignJustified:" target="-1" id="ljL-7U-jND"/>
</connections>
</menuItem>
<menuItem title="Align Right" keyEquivalent="}" id="wb2-vD-lq4">
<connections>
<action selector="alignRight:" target="-1" id="r48-bG-YeY"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="4s2-GY-VfK"/>
<menuItem title="Writing Direction" id="H1b-Si-o9J">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Writing Direction" id="8mr-sm-Yjd">
<items>
<menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem id="YGs-j5-SAR">
<string key="title"> Default</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionNatural:" target="-1" id="qtV-5e-UBP"/>
</connections>
</menuItem>
<menuItem id="Lbh-J2-qVU">
<string key="title"> Left to Right</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionLeftToRight:" target="-1" id="S0X-9S-QSf"/>
</connections>
</menuItem>
<menuItem id="jFq-tB-4Kx">
<string key="title"> Right to Left</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionRightToLeft:" target="-1" id="5fk-qB-AqJ"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="swp-gr-a21"/>
<menuItem title="Selection" enabled="NO" id="cqv-fj-IhA">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem id="Nop-cj-93Q">
<string key="title"> Default</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionNatural:" target="-1" id="lPI-Se-ZHp"/>
</connections>
</menuItem>
<menuItem id="BgM-ve-c93">
<string key="title"> Left to Right</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionLeftToRight:" target="-1" id="caW-Bv-w94"/>
</connections>
</menuItem>
<menuItem id="RB4-Sm-HuC">
<string key="title"> Right to Left</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionRightToLeft:" target="-1" id="EXD-6r-ZUu"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="fKy-g9-1gm"/>
<menuItem title="Show Ruler" id="vLm-3I-IUL">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleRuler:" target="-1" id="FOx-HJ-KwY"/>
</connections>
</menuItem>
<menuItem title="Copy Ruler" keyEquivalent="c" id="MkV-Pr-PK5">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="copyRuler:" target="-1" id="71i-fW-3W2"/>
</connections>
</menuItem>
<menuItem title="Paste Ruler" keyEquivalent="v" id="LVM-kO-fVI">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="pasteRuler:" target="-1" id="cSh-wd-qM2"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="View" id="H8h-7b-M4v">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="View" id="HyV-fh-RgO">
<items>
<menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="toggleToolbarShown:" target="-1" id="BXY-wc-z0C"/>
</connections>
</menuItem>
<menuItem title="Customize Toolbar…" id="1UK-8n-QPP">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="runToolbarCustomizationPalette:" target="-1" id="pQI-g3-MTW"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Window" id="aUF-d1-5bR">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
<items>
<menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
<connections>
<action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/>
</connections>
</menuItem>
<menuItem title="Zoom" id="R4o-n2-Eq4">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="performZoom:" target="-1" id="DIl-cC-cCs"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Help" id="wpr-3q-Mcd">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
<items>
<menuItem title="OverSight Help" keyEquivalent="?" id="FKE-Sm-Kum">
<connections>
<action selector="showHelp:" target="-1" id="y7X-2Q-9no"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
<window title="OverSight Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="335" y="390" width="480" height="360"/>
@ -678,17 +34,27 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="rVS-uv-DNf">
<rect key="frame" x="307" y="61" width="119" height="18"/>
<buttonCell key="cell" type="check" title="Launch at login" bezelStyle="regularSquare" imagePosition="left" inset="2" id="3gA-J8-849">
<rect key="frame" x="175" y="318" width="136" height="18"/>
<buttonCell key="cell" type="check" title="Log activity" bezelStyle="regularSquare" imagePosition="left" inset="2" id="3gA-J8-849">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
<font key="font" size="13" name="Menlo-Regular"/>
</buttonCell>
<connections>
<action selector="loginButtonPressed:" target="Voe-Tx-rLC" id="rb1-Gh-rcU"/>
<action selector="togglePreference:" target="Voe-Tx-rLC" id="mmD-hC-ydp"/>
</connections>
</button>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Twr-YX-0dG">
<rect key="frame" x="175" y="260" width="280" height="19"/>
<buttonCell key="cell" type="check" title="Automatically check for updates" bezelStyle="regularSquare" imagePosition="left" inset="2" id="rbp-Uw-Gy1">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" size="13" name="Menlo-Regular"/>
</buttonCell>
<connections>
<action selector="togglePreference:" target="Voe-Tx-rLC" id="77r-mm-9ek"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nf3-YB-f25">
<rect key="frame" x="0.0" y="0.0" width="201" height="360"/>
<rect key="frame" x="0.0" y="0.0" width="155" height="360"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" drawsBackground="YES" id="zOz-NV-pht">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
@ -696,13 +62,44 @@
</textFieldCell>
</textField>
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kVc-EA-5LL">
<rect key="frame" x="46" y="0.0" width="325" height="65"/>
<rect key="frame" x="1" y="0.0" width="325" height="65"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" animates="YES" imageScaling="proportionallyDown" image="overSight" id="WbC-HV-n62"/>
</imageView>
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ks1-o6-l6E">
<rect key="frame" x="9" y="169" width="183" height="183"/>
<rect key="frame" x="-14" y="167" width="183" height="183"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" animates="YES" imageScaling="proportionallyDown" image="icon" id="Cv4-hx-zrt"/>
</imageView>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="D1u-ER-JrL">
<rect key="frame" x="39" y="117" width="77" height="32"/>
<buttonCell key="cell" type="push" title="About" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Jm9-ma-n5o">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" size="13" name="Menlo-Regular"/>
</buttonCell>
<connections>
<action selector="about:" target="Voe-Tx-rLC" id="Bf6-4p-Q3A"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="M9W-tZ-0Z8">
<rect key="frame" x="171" y="214" width="109" height="32"/>
<buttonCell key="cell" type="push" title="Check Now" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Jld-yC-ZCR">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" size="13" name="Menlo-Regular"/>
</buttonCell>
<connections>
<action selector="check4Update:" target="Voe-Tx-rLC" id="pFd-Ah-19f"/>
</connections>
</button>
<progressIndicator wantsLayer="YES" fixedFrame="YES" maxValue="100" displayedWhenStopped="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="sph-QU-dL4">
<rect key="frame" x="282" y="223" width="16" height="16"/>
</progressIndicator>
<textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pGb-eI-7vA">
<rect key="frame" x="280" y="225" width="150" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="No new versions" id="S6D-6d-JiZ">
<font key="font" size="13" name="Menlo-Bold"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
</window>

View File

@ -1,58 +0,0 @@
{
"images" : [
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -17,17 +17,19 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>1.0.0</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright (c) 2016 Objective-See. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>LSUIElement</key>
<true/>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>

View File

@ -7,9 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
7D17C4941D658A790066232A /* AboutWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D17C48C1D658A790066232A /* AboutWindow.xib */; };
7D17C4951D658A790066232A /* AboutWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D17C48E1D658A790066232A /* AboutWindowController.m */; };
7D17C4971D658A790066232A /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D17C4931D658A790066232A /* Logging.m */; };
7D17C5271D6592FE0066232A /* statusIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D17C5141D658FEB0066232A /* statusIcon.png */; };
7D17C5281D6592FE0066232A /* statusIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D17C5151D658FEB0066232A /* statusIcon@2x.png */; };
7D17C5391D659E580066232A /* AboutWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D17C52C1D659E580066232A /* AboutWindow.xib */; };
@ -21,22 +18,28 @@
7D17CFE51D8133840017B475 /* AVMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D17CFE11D81121E0017B475 /* AVMonitor.m */; };
7D17D0101D8136C60017B475 /* OverSightXPC.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = 7DC9C8121D641A350017D143 /* OverSightXPC.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
7D62457C1D84FB8900870565 /* Enumerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D62457B1D84FB8900870565 /* Enumerator.m */; };
7D62457D1D8517F500870565 /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D17C4931D658A790066232A /* Logging.m */; };
7D6245801D85348E00870565 /* Utilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D62457F1D85348E00870565 /* Utilities.m */; };
7D6245811D8537CF00870565 /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D17C4931D658A790066232A /* Logging.m */; };
7D6245851D87C43900870565 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7D6245841D87C43900870565 /* Images.xcassets */; };
7D6245871D87C55F00870565 /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D17C5361D659E580066232A /* Logging.m */; };
7D6245881D87C57600870565 /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D17C5361D659E580066232A /* Logging.m */; };
7D6245891D87C58400870565 /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D17C5361D659E580066232A /* Logging.m */; };
7D62458B1D87CE0900870565 /* AboutWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D17C52E1D659E580066232A /* AboutWindowController.m */; };
7D62458F1D87D38400870565 /* InfoWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D62458C1D87D38400870565 /* InfoWindow.xib */; };
7D6245901D87D38400870565 /* InfoWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D62458D1D87D38400870565 /* InfoWindowController.m */; };
7D6245911D87D39E00870565 /* InfoWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D62458D1D87D38400870565 /* InfoWindowController.m */; };
7D6245921D87D46800870565 /* InfoWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D62458C1D87D38400870565 /* InfoWindow.xib */; };
7D6245931D87E13200870565 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D17C5331D659E580066232A /* icon.png */; };
7D6245941D87E13200870565 /* overSight.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D17C5341D659E580066232A /* overSight.png */; };
7D6245951D87E14800870565 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8B5755CD19DA3F9300799E6B /* MainMenu.xib */; };
7DAF4B7F1D657192000DA31A /* StatusBarMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DAF4B7D1D656FD3000DA31A /* StatusBarMenu.m */; };
7DC9C8171D641A350017D143 /* OverSightXPC.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DC9C8161D641A350017D143 /* OverSightXPC.m */; };
7DC9C8191D641A350017D143 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DC9C8181D641A350017D143 /* main.m */; };
7DC9C81D1D641A350017D143 /* OverSightXPC.xpc in Embed XPC Services */ = {isa = PBXBuildFile; fileRef = 7DC9C8121D641A350017D143 /* OverSightXPC.xpc */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
8B5755A119DA3E9500799E6B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B5755A019DA3E9500799E6B /* main.m */; };
8B5755A419DA3E9500799E6B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B5755A319DA3E9500799E6B /* AppDelegate.m */; };
8B5755A619DA3E9500799E6B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8B5755A519DA3E9500799E6B /* Images.xcassets */; };
8B5755A919DA3E9500799E6B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8B5755A719DA3E9500799E6B /* MainMenu.xib */; };
8B5755C719DA3F9300799E6B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B5755C619DA3F9300799E6B /* main.m */; };
8B5755CA19DA3F9300799E6B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B5755C919DA3F9300799E6B /* AppDelegate.m */; };
8B5755CC19DA3F9300799E6B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8B5755CB19DA3F9300799E6B /* Images.xcassets */; };
8B5755CF19DA3F9300799E6B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8B5755CD19DA3F9300799E6B /* MainMenu.xib */; };
8B5755E319DA41D300799E6B /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B5755E219DA41D300799E6B /* ServiceManagement.framework */; };
8B5755E619DA432000799E6B /* OverSight Helper.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8B5755C219DA3F9300799E6B /* OverSight Helper.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
@ -86,14 +89,6 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
7D17C48C1D658A790066232A /* AboutWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = AboutWindow.xib; path = Shared/AboutWindow.xib; sourceTree = SOURCE_ROOT; };
7D17C48D1D658A790066232A /* AboutWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AboutWindowController.h; path = Shared/AboutWindowController.h; sourceTree = SOURCE_ROOT; };
7D17C48E1D658A790066232A /* AboutWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AboutWindowController.m; path = Shared/AboutWindowController.m; sourceTree = SOURCE_ROOT; };
7D17C48F1D658A790066232A /* Consts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Consts.h; path = Shared/Consts.h; sourceTree = SOURCE_ROOT; };
7D17C4901D658A790066232A /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Exception.h; path = Shared/Exception.h; sourceTree = SOURCE_ROOT; };
7D17C4911D658A790066232A /* Exception.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Exception.m; path = Shared/Exception.m; sourceTree = SOURCE_ROOT; };
7D17C4921D658A790066232A /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = Shared/Logging.h; sourceTree = SOURCE_ROOT; };
7D17C4931D658A790066232A /* Logging.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Logging.m; path = Shared/Logging.m; sourceTree = SOURCE_ROOT; };
7D17C5141D658FEB0066232A /* statusIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = statusIcon.png; path = Images/statusIcon.png; sourceTree = "<group>"; };
7D17C5151D658FEB0066232A /* statusIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "statusIcon@2x.png"; path = "Images/statusIcon@2x.png"; sourceTree = "<group>"; };
7D17C52C1D659E580066232A /* AboutWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AboutWindow.xib; sourceTree = "<group>"; };
@ -115,6 +110,10 @@
7D62457B1D84FB8900870565 /* Enumerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Enumerator.m; sourceTree = "<group>"; };
7D62457E1D85348E00870565 /* Utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utilities.h; sourceTree = "<group>"; };
7D62457F1D85348E00870565 /* Utilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Utilities.m; sourceTree = "<group>"; };
7D6245841D87C43900870565 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Images/Images.xcassets; sourceTree = "<group>"; };
7D62458C1D87D38400870565 /* InfoWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InfoWindow.xib; sourceTree = "<group>"; };
7D62458D1D87D38400870565 /* InfoWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfoWindowController.m; sourceTree = "<group>"; };
7D62458E1D87D38400870565 /* InfoWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoWindowController.h; sourceTree = "<group>"; };
7DAF4B7C1D656FD3000DA31A /* StatusBarMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusBarMenu.h; sourceTree = "<group>"; };
7DAF4B7D1D656FD3000DA31A /* StatusBarMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatusBarMenu.m; sourceTree = "<group>"; };
7DC9C8121D641A350017D143 /* OverSightXPC.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = OverSightXPC.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
@ -127,16 +126,13 @@
8B5755A019DA3E9500799E6B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
8B5755A219DA3E9500799E6B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
8B5755A319DA3E9500799E6B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
8B5755A519DA3E9500799E6B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
8B5755A819DA3E9500799E6B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
8B5755C219DA3F9300799E6B /* OverSight Helper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "OverSight Helper.app"; sourceTree = BUILT_PRODUCTS_DIR; };
8B5755C519DA3F9300799E6B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8B5755C619DA3F9300799E6B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
8B5755C819DA3F9300799E6B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
8B5755C919DA3F9300799E6B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
8B5755CB19DA3F9300799E6B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
8B5755CE19DA3F9300799E6B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
8B5755E219DA41D300799E6B /* ServiceManagement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ServiceManagement.framework; path = System/Library/Frameworks/ServiceManagement.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -151,7 +147,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8B5755E319DA41D300799E6B /* ServiceManagement.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -165,24 +160,10 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
7D17C48B1D658A670066232A /* Shared */ = {
isa = PBXGroup;
children = (
7D17C48C1D658A790066232A /* AboutWindow.xib */,
7D17C48D1D658A790066232A /* AboutWindowController.h */,
7D17C48E1D658A790066232A /* AboutWindowController.m */,
7D17C48F1D658A790066232A /* Consts.h */,
7D17C4901D658A790066232A /* Exception.h */,
7D17C4911D658A790066232A /* Exception.m */,
7D17C4921D658A790066232A /* Logging.h */,
7D17C4931D658A790066232A /* Logging.m */,
);
name = Shared;
sourceTree = "<group>";
};
7D17C5131D658FE20066232A /* Images */ = {
isa = PBXGroup;
children = (
7D17CFE21D81121E0017B475 /* AVMonitor.h */,
7D17C5141D658FEB0066232A /* statusIcon.png */,
7D17C5151D658FEB0066232A /* statusIcon@2x.png */,
);
@ -192,6 +173,10 @@
7D17C52B1D659E580066232A /* Shared */ = {
isa = PBXGroup;
children = (
7D62458C1D87D38400870565 /* InfoWindow.xib */,
7D62458D1D87D38400870565 /* InfoWindowController.m */,
7D62458E1D87D38400870565 /* InfoWindowController.h */,
7D6245841D87C43900870565 /* Images.xcassets */,
7D17C52C1D659E580066232A /* AboutWindow.xib */,
7D17C52D1D659E580066232A /* AboutWindowController.h */,
7D17C52E1D659E580066232A /* AboutWindowController.m */,
@ -218,6 +203,15 @@
path = Images;
sourceTree = "<group>";
};
7D6245861D87C53500870565 /* Supporting Files */ = {
isa = PBXGroup;
children = (
7DC9C8181D641A350017D143 /* main.m */,
7DC9C81A1D641A350017D143 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
7DC9C8131D641A350017D143 /* OverSightXPC */ = {
isa = PBXGroup;
children = (
@ -226,8 +220,7 @@
7D17CFDE1D810D6D0017B475 /* XPCProtocol.h */,
7DC9C8151D641A350017D143 /* OverSightXPC.h */,
7DC9C8161D641A350017D143 /* OverSightXPC.m */,
7DC9C8181D641A350017D143 /* main.m */,
7DC9C81A1D641A350017D143 /* Info.plist */,
7D6245861D87C53500870565 /* Supporting Files */,
);
path = OverSightXPC;
sourceTree = "<group>";
@ -236,7 +229,6 @@
isa = PBXGroup;
children = (
7D17C52B1D659E580066232A /* Shared */,
8B5755E219DA41D300799E6B /* ServiceManagement.framework */,
8B57559D19DA3E9500799E6B /* MainApp */,
8B5755C319DA3F9300799E6B /* LoginItem */,
7DC9C8131D641A350017D143 /* OverSightXPC */,
@ -259,7 +251,6 @@
children = (
8B5755A219DA3E9500799E6B /* AppDelegate.h */,
8B5755A319DA3E9500799E6B /* AppDelegate.m */,
8B5755A519DA3E9500799E6B /* Images.xcassets */,
8B5755A719DA3E9500799E6B /* MainMenu.xib */,
8B57559E19DA3E9500799E6B /* Supporting Files */,
);
@ -279,14 +270,11 @@
isa = PBXGroup;
children = (
7D17C5131D658FE20066232A /* Images */,
7D17C48B1D658A670066232A /* Shared */,
7DAF4B7C1D656FD3000DA31A /* StatusBarMenu.h */,
7DAF4B7D1D656FD3000DA31A /* StatusBarMenu.m */,
8B5755C819DA3F9300799E6B /* AppDelegate.h */,
8B5755C919DA3F9300799E6B /* AppDelegate.m */,
7D17CFE11D81121E0017B475 /* AVMonitor.m */,
7D17CFE21D81121E0017B475 /* AVMonitor.h */,
8B5755CB19DA3F9300799E6B /* Images.xcassets */,
8B5755CD19DA3F9300799E6B /* MainMenu.xib */,
8B5755C419DA3F9300799E6B /* Supporting Files */,
);
@ -425,11 +413,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8B5755A619DA3E9500799E6B /* Images.xcassets in Resources */,
7D6245921D87D46800870565 /* InfoWindow.xib in Resources */,
7D17C53C1D659E580066232A /* icon.png in Resources */,
8B5755A919DA3E9500799E6B /* MainMenu.xib in Resources */,
7D17C53D1D659E580066232A /* overSight.png in Resources */,
7D17C4941D658A790066232A /* AboutWindow.xib in Resources */,
7D17C5391D659E580066232A /* AboutWindow.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -438,10 +425,13 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7D6245951D87E14800870565 /* MainMenu.xib in Resources */,
7D6245931D87E13200870565 /* icon.png in Resources */,
7D6245941D87E13200870565 /* overSight.png in Resources */,
7D17C5271D6592FE0066232A /* statusIcon.png in Resources */,
7D62458F1D87D38400870565 /* InfoWindow.xib in Resources */,
7D6245851D87C43900870565 /* Images.xcassets in Resources */,
7D17C5281D6592FE0066232A /* statusIcon@2x.png in Resources */,
8B5755CC19DA3F9300799E6B /* Images.xcassets in Resources */,
8B5755CF19DA3F9300799E6B /* MainMenu.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -452,7 +442,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7D6245811D8537CF00870565 /* Logging.m in Sources */,
7D6245871D87C55F00870565 /* Logging.m in Sources */,
7D17CFE41D811B4E0017B475 /* Utilities.m in Sources */,
7D62457C1D84FB8900870565 /* Enumerator.m in Sources */,
7DC9C8191D641A350017D143 /* main.m in Sources */,
@ -464,12 +454,13 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7D6245911D87D39E00870565 /* InfoWindowController.m in Sources */,
7D62458B1D87CE0900870565 /* AboutWindowController.m in Sources */,
7D6245891D87C58400870565 /* Logging.m in Sources */,
8B5755A419DA3E9500799E6B /* AppDelegate.m in Sources */,
8B5755A119DA3E9500799E6B /* main.m in Sources */,
7D17C4971D658A790066232A /* Logging.m in Sources */,
7D17C53B1D659E580066232A /* Exception.m in Sources */,
7D17C53F1D659E580066232A /* Utilities.m in Sources */,
7D17C4951D658A790066232A /* AboutWindowController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -477,9 +468,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7D6245881D87C57600870565 /* Logging.m in Sources */,
7D6245801D85348E00870565 /* Utilities.m in Sources */,
7D62457D1D8517F500870565 /* Logging.m in Sources */,
7D17CFE51D8133840017B475 /* AVMonitor.m in Sources */,
7D6245901D87D38400870565 /* InfoWindowController.m in Sources */,
7DAF4B7F1D657192000DA31A /* StatusBarMenu.m in Sources */,
8B5755CA19DA3F9300799E6B /* AppDelegate.m in Sources */,
8B5755C719DA3F9300799E6B /* main.m in Sources */,
@ -520,7 +512,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CODE_SIGN_IDENTITY = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
CODE_SIGN_IDENTITY = "Developer ID Application";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
@ -538,7 +530,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CODE_SIGN_IDENTITY = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
CODE_SIGN_IDENTITY = "Developer ID Application";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
@ -630,8 +622,7 @@
8B5755B919DA3E9500799E6B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
CODE_SIGN_IDENTITY = "Developer ID Application";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
@ -646,8 +637,7 @@
8B5755BA19DA3E9500799E6B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
CODE_SIGN_IDENTITY = "Developer ID Application";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
@ -663,7 +653,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
CODE_SIGN_IDENTITY = "Developer ID Application";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
COMBINE_HIDPI_IMAGES = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
@ -683,7 +673,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
CODE_SIGN_IDENTITY = "Developer ID Application";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = LoginItem/Info.plist;

View File

@ -259,6 +259,9 @@ bail:
//dbg msg
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"candidate video procs: %@", candidateVideoProcs]);
//TODO: ignore self!!
//Sample analysis of process 18340 written to file /tmp/OverSight_Helper_2016-09-12_211234_StAd.sample.txt
//save to baseline
// TODO: test that this works, esp if cnt goes down!! (facetime battery mode)
//[self.machSenders addEntriesFromDictionary:currentSenders];
@ -391,7 +394,7 @@ bail:
}
//for now, just check for 'CMIOGraph::DoWork'
// TODO: could look for dylibs, other calls, etc
// ->TODO: could look for dylibs, other calls, etc
if(YES != [results containsString:@"CMIOGraph::DoWork"])
{
//skip

View File

@ -38,6 +38,16 @@
return;
}
//automatically invoked when window is closing
// ->make ourselves unmodal
-(void)windowWillClose:(NSNotification *)notification
{
//make un-modal
[[NSApplication sharedApplication] stopModal];
return;
}
//automatically invoked when user clicks 'more info'
// ->load products webpage view their default browser
-(IBAction)moreInfo:(id)sender

View File

@ -8,26 +8,18 @@
//TODO: update!
#ifndef WYS_Consts_h
#define WYS_Consts_h
#ifndef OS_Consts_h
#define OS_Consts_h
//success
#define STATUS_SUCCESS 0
//product url
#define PRODUCT_URL @"https://objective-see.com/products/whatsyoursign.html"
#define PRODUCT_URL @"https://objective-see.com/products/oversight.html"
//installed extensions
#define INSTALLED_EXTENSIONS @"~/Library/Preferences/com.apple.preferences.extensions.FinderSync.plist"
//bundle ID of finder sync extension
#define EXTENSION_BUNDLE_ID @"com.objective-see.WhatsYourSignExt.FinderSync"
//extension folder
#define EXTENSION_FOLDER @"~/Library/WhatsYourSign"
//extension name
#define EXTENSION_NAME @"WhatsYourSign.appex"
//product version url
//TODO: change back!
#define PRODUCT_VERSION_URL @"https://objective-see.com/products/versions/ransomwhere.json"
//frame shift
// ->for status msg to avoid activity indicator
@ -63,15 +55,6 @@
//OS minor version el capitan
#define OS_MINOR_VERSION_EL_CAPITAN 11
//path to file binary
#define FILE @"/usr/bin/file"
//path to pluginkit binary
#define PLUGIN_KIT @"/usr/bin/pluginkit"
//path to pkgutil
#define PKG_UTIL @"/usr/sbin/pkgutil"
//action to install
// ->also button title
#define ACTION_INSTALL @"Install"
@ -104,4 +87,10 @@
//general error URL
#define FATAL_ERROR_URL @"https://objective-see.com/errors.html"
//log activity button
#define LOG_ACTIVITY @"logActivity"
//automatically check for updates button
#define CHECK_4_UPDATES @"check4Updates"
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

84
Shared/InfoWindow.xib Normal file
View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="InfoWindowController">
<connections>
<outlet property="actionButton" destination="tDD-5C-L8e" id="VA6-H5-ZZO"/>
<outlet property="firstButton" destination="Igd-bt-R7A" id="ocU-Rd-7oX"/>
<outlet property="infoLabel" destination="OSm-xS-Dmd" id="Ffv-9q-5a6"/>
<outlet property="overlayView" destination="afp-ji-No6" id="qDV-BW-3l3"/>
<outlet property="progressIndicator" destination="1oq-WT-B5T" id="f6G-ch-c3m"/>
<outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" animationBehavior="default" id="F0z-JX-Cv5">
<windowStyleMask key="styleMask" titled="YES" closable="YES" texturedBackground="YES" unifiedTitleAndToolbar="YES"/>
<rect key="contentRect" x="196" y="240" width="422" height="123"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1057"/>
<view key="contentView" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="422" height="123"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lEv-Wj-6S5">
<rect key="frame" x="10" y="12" width="110" height="106"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="icon" id="xKf-GK-m0k"/>
</imageView>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Eaf-yA-bbe">
<rect key="frame" x="141" y="63" width="180" height="50"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="overSight" id="Ws8-bD-j2R"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OSm-xS-Dmd">
<rect key="frame" x="142" y="51" width="263" height="19"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" id="bBK-v0-ypq">
<font key="font" size="12" name="Menlo-Regular"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button wantsLayer="YES" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tDD-5C-L8e">
<rect key="frame" x="272" y="13" width="136" height="32"/>
<buttonCell key="cell" type="push" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="nMV-1f-RyK">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" size="13" name="Menlo-Regular"/>
</buttonCell>
<connections>
<action selector="buttonHandler:" target="-2" id="tap-If-b45"/>
</connections>
</button>
<button wantsLayer="YES" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Igd-bt-R7A">
<rect key="frame" x="135" y="13" width="136" height="32"/>
<buttonCell key="cell" type="push" title="update check" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="xCE-Fi-OFb">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" size="13" name="Menlo-Regular"/>
</buttonCell>
<connections>
<action selector="updateBtnHandler:" target="-2" id="Vk0-Tx-f5d"/>
</connections>
</button>
<customView hidden="YES" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="afp-ji-No6">
<rect key="frame" x="0.0" y="0.0" width="422" height="123"/>
<subviews>
<progressIndicator hidden="YES" wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" maxValue="100" bezeled="NO" indeterminate="YES" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="1oq-WT-B5T">
<rect key="frame" x="195" y="45" width="32" height="32"/>
</progressIndicator>
</subviews>
</customView>
</subviews>
</view>
<connections>
<outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
</connections>
<point key="canvasLocation" x="318" y="246.5"/>
</window>
</objects>
<resources>
<image name="icon" width="512" height="512"/>
<image name="overSight" width="1396" height="286"/>
</resources>
</document>

View File

@ -0,0 +1,48 @@
//
// PrefsWindowController.h
// DHS
//
// Created by Patrick Wardle on 2/6/15.
// Copyright (c) 2015 Objective-See, LLC. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface InfoWindowController : NSWindowController <NSWindowDelegate>
{
}
/* PROPERTIES */
//version label/string
@property(weak)IBOutlet NSTextField *infoLabel;
//action button
@property(weak)IBOutlet NSButton *actionButton;
//label string
@property(nonatomic, retain)NSString* infoLabelString;
//first button ('update check')
@property(weak)IBOutlet NSView *firstButton;
//button title
@property(nonatomic, retain)NSString* actionButtonTitle;
//overlay view
@property(weak)IBOutlet NSView *overlayView;
//spinner
@property(weak)IBOutlet NSProgressIndicator *progressIndicator;
/* METHODS */
//save the main label's & button title's text
-(void)configure:(NSString*)label buttonTitle:(NSString*)buttonTitle;
//invoked when user clicks button
// ->trigger action such as opening product website, updating, etc
-(IBAction)buttonHandler:(id)sender;
@end

View File

@ -0,0 +1,224 @@
//
// PrefsWindowController.m
// KnockKnock
//
// Created by Patrick Wardle on 2/6/15.
// Copyright (c) 2015 Objective-See, LLC. All rights reserved.
//
#import "Consts.h"
#import "Logging.h"
#import "Utilities.h"
#import "AppDelegate.h"
#import "InfoWindowController.h"
@implementation InfoWindowController
@synthesize infoLabel;
@synthesize overlayView;
@synthesize firstButton;
@synthesize actionButton;
@synthesize infoLabelString;
@synthesize actionButtonTitle;
@synthesize progressIndicator;
//automatically called when nib is loaded
// ->center window
-(void)awakeFromNib
{
//center
[self.window center];
return;
}
//automatically invoked when window is loaded
// ->set to white
-(void)windowDidLoad
{
//super
[super windowDidLoad];
//make white
[self.window setBackgroundColor: NSColor.whiteColor];
//set main label
[self.infoLabel setStringValue:self.infoLabelString];
//set button text
self.actionButton.title = self.actionButtonTitle;
//hide first button when action is 'update'
// ->don't need update check button ;)
if(YES == [self.actionButton.title isEqualToString:@"update"])
{
//hide
self.firstButton.hidden = YES;
}
//make it key window
[self.window makeKeyAndOrderFront:self];
//make window front
[NSApp activateIgnoringOtherApps:YES];
return;
}
//automatically invoked when window is closing
// ->make ourselves unmodal
-(void)windowWillClose:(NSNotification *)notification
{
//make un-modal
[[NSApplication sharedApplication] stopModal];
return;
}
//save the main label's & button title's text
// ->invoked before window is loaded (and thus buttons, etc are nil)
-(void)configure:(NSString*)label buttonTitle:(NSString*)buttonTitle
{
//save label's string
self.infoLabelString = label;
//save button's title
self.actionButtonTitle = buttonTitle;
return;
}
//invoked when user clicks 'check for updates' button
// ->invoke method on app delegate that checks/displays result
-(IBAction)updateBtnHandler:(id)sender
{
//version string
NSMutableString* versionString = nil;
//version flag
__block NSInteger versionFlag = -1;
//alloc string
versionString = [NSMutableString string];
//pre-req
[self.overlayView setWantsLayer:YES];
//set overlay's view color to black
self.overlayView.layer.backgroundColor = [NSColor whiteColor].CGColor;
//make it semi-transparent
self.overlayView.alphaValue = 0.75;
//show it
self.overlayView.hidden = NO;
//disable 'update' check button
((NSButton*)sender).enabled = NO;
//disable close button
self.actionButton.enabled = NO;
//remove detailed textz
self.infoLabel.stringValue = @"";
//show spinner
self.progressIndicator.hidden = NO;
//animate it
[self.progressIndicator startAnimation:nil];
//delay so UI shows spinner, etc
// ->then process version logic
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^
{
//get version flag
versionFlag = isNewVersion(versionString);
//run on main thread for UI updates, etc
dispatch_sync(dispatch_get_main_queue(), ^{
//hide spinner
self.progressIndicator.hidden = YES;
//hide overlay
self.overlayView.hidden = YES;
//take action based on version
// ->show error, new version msg, etc
switch(versionFlag)
{
//error
// ->show err msg
case -1:
//red for error
self.infoLabel.textColor = [NSColor redColor];
//set label
self.infoLabel.stringValue = @"error, update check failed :(";
//set button title
self.actionButton.title = @"close";
break;
//new version
case YES:
//set label
self.infoLabel.stringValue = [NSString stringWithFormat:@"a new version (%@) is available!", versionString];
//set button title
self.actionButton.title = @"update";
break;
//no new version
case NO:
//set label
// ->versions should be the same, but we'll use getAppVersion() (since beta's might be newer than what's live)
self.infoLabel.stringValue = [NSString stringWithFormat:@"your version, (%@), is current", getAppVersion()];
//set button title
self.actionButton.title = @"close";
break;
default:
break;
}
//always enable action button
self.actionButton.enabled = YES;
}); //dispatch on main thread
}); //dispatch for delay
return;
}
//invoked when user clicks button
// ->trigger action such as opening product website, updating, etc
-(IBAction)buttonHandler:(id)sender
{
//handle 'update' / 'more info', etc
// ->open BB's webpage
if(YES != [((NSButton*)sender).title isEqualToString:@"close"])
{
//open URL
// ->invokes user's default browser
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:PRODUCT_URL]];
}
//always close window
[[self window] close];
return;
}
@end

View File

@ -14,6 +14,8 @@
/* FUNCTIONS */
//TODO: cleanup/remove un-needed
//get app's version
// ->extracted from Info.plist
NSString* getAppVersion();
@ -39,11 +41,22 @@ NSDictionary* hashFile(NSString* filePath);
// ->extracted from Info.plist
NSString* getAppVersion();
//query interwebz to get latest version
NSString* getLatestVersion();
//determine if there is a new version
// -1, YES or NO
NSInteger isNewVersion(NSMutableString* versionString);
//exec a process and grab it's output
NSData* execTask(NSString* binaryPath, NSArray* arguments);
//get process's path
NSString* getProcessPath(pid_t pid);
//wait until a window is non nil
// ->then make it modal
void makeModal(NSWindowController* windowController);
#endif

View File

@ -271,3 +271,117 @@ bail:
return taskPath;
}
//determine if there is a new version
// -1, YES or NO
NSInteger isNewVersion(NSMutableString* versionString)
{
//flag
NSInteger newVersionExists = -1;
//installed version
NSString* installedVersion = nil;
//latest version
NSString* latestVersion = nil;
//get installed version
installedVersion = getAppVersion();
//get latest version
// ->will query internet (bb's website)
latestVersion = getLatestVersion();
if(nil == latestVersion)
{
//set error msg
[versionString setString:@"failed to get latest version"];
//bail
goto bail;
}
//save version
[versionString setString:latestVersion];
//set version flag
// ->YES/NO
newVersionExists = (NSOrderedAscending == [installedVersion compare:latestVersion options:NSNumericSearch]);
//bail
bail:
return newVersionExists;
}
//query interwebz to get latest version
NSString* getLatestVersion()
{
//version data
NSData* versionData = nil;
//version dictionary
NSDictionary* versionDictionary = nil;
//latest version
NSString* latestVersion = nil;
//get version from remote URL
versionData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:PRODUCT_VERSION_URL]];
//sanity check
if(nil == versionData)
{
//bail
goto bail;
}
//convert JSON to dictionary
versionDictionary = [NSJSONSerialization JSONObjectWithData:versionData options:0 error:nil];
//sanity check
if(nil == versionDictionary)
{
//bail
goto bail;
}
//extract latest version
latestVersion = versionDictionary[@"latestVersion"];
//bail
bail:
return latestVersion;
}
//wait until a window is non nil
// ->then make it modal
void makeModal(NSWindowController* windowController)
{
//wait up to 1 second window to be non-nil
// ->then make modal
for(int i=0; i<20; i++)
{
//can make it modal once we have a window
if(nil != windowController.window)
{
//make modal on main thread
dispatch_sync(dispatch_get_main_queue(), ^{
//modal
[[NSApplication sharedApplication] runModalForWindow:windowController.window];
});
//all done
break;
}
//nap
[NSThread sleepForTimeInterval:0.05f];
}//until 1 second
return;
}