diff --git a/Installer.xcodeproj/project.pbxproj b/Installer.xcodeproj/project.pbxproj index 81a6c66..4dace5b 100644 --- a/Installer.xcodeproj/project.pbxproj +++ b/Installer.xcodeproj/project.pbxproj @@ -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 = ""; }; /* 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 = ""; }; - 7D17C5051D658F3E0066232A /* Images */ = { - isa = PBXGroup; - children = ( - ); - name = Images; - sourceTree = ""; - }; 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 */, diff --git a/Installer/Assets.xcassets/AppIcon.appiconset/icon_128x128.png b/Installer/Assets.xcassets/AppIcon.appiconset/icon_128x128.png deleted file mode 100644 index c7a427e..0000000 Binary files a/Installer/Assets.xcassets/AppIcon.appiconset/icon_128x128.png and /dev/null differ diff --git a/Installer/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png b/Installer/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png deleted file mode 100644 index 89229fe..0000000 Binary files a/Installer/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png and /dev/null differ diff --git a/Installer/Assets.xcassets/AppIcon.appiconset/icon_16x16.png b/Installer/Assets.xcassets/AppIcon.appiconset/icon_16x16.png deleted file mode 100644 index 9f69728..0000000 Binary files a/Installer/Assets.xcassets/AppIcon.appiconset/icon_16x16.png and /dev/null differ diff --git a/Installer/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png b/Installer/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png deleted file mode 100644 index 278302a..0000000 Binary files a/Installer/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png and /dev/null differ diff --git a/Installer/Assets.xcassets/AppIcon.appiconset/icon_256x256.png b/Installer/Assets.xcassets/AppIcon.appiconset/icon_256x256.png deleted file mode 100644 index 89229fe..0000000 Binary files a/Installer/Assets.xcassets/AppIcon.appiconset/icon_256x256.png and /dev/null differ diff --git a/Installer/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png b/Installer/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png deleted file mode 100644 index 01f73b6..0000000 Binary files a/Installer/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png and /dev/null differ diff --git a/Installer/Assets.xcassets/AppIcon.appiconset/icon_32x32.png b/Installer/Assets.xcassets/AppIcon.appiconset/icon_32x32.png deleted file mode 100644 index 278302a..0000000 Binary files a/Installer/Assets.xcassets/AppIcon.appiconset/icon_32x32.png and /dev/null differ diff --git a/Installer/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png b/Installer/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png deleted file mode 100644 index 775b68b..0000000 Binary files a/Installer/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png and /dev/null differ diff --git a/Installer/Assets.xcassets/AppIcon.appiconset/icon_512x512.png b/Installer/Assets.xcassets/AppIcon.appiconset/icon_512x512.png deleted file mode 100644 index 01f73b6..0000000 Binary files a/Installer/Assets.xcassets/AppIcon.appiconset/icon_512x512.png and /dev/null differ diff --git a/Installer/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png b/Installer/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png deleted file mode 100644 index a442ac7..0000000 Binary files a/Installer/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png and /dev/null differ diff --git a/LoginItem/AVMonitor.m b/LoginItem/AVMonitor.m index 1246600..58d3603 100644 --- a/LoginItem/AVMonitor.m +++ b/LoginItem/AVMonitor.m @@ -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 diff --git a/LoginItem/AppDelegate.h b/LoginItem/AppDelegate.h index f74f218..ff9aba7 100644 --- a/LoginItem/AppDelegate.h +++ b/LoginItem/AppDelegate.h @@ -9,6 +9,7 @@ #import "AVMonitor.h" #import "EventMonitor.h" #import "StatusBarMenu.h" +#import "InfoWindowController.h" #import @@ -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 diff --git a/LoginItem/AppDelegate.m b/LoginItem/AppDelegate.m index be24f6a..ffeb469 100644 --- a/LoginItem/AppDelegate.m +++ b/LoginItem/AppDelegate.m @@ -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 diff --git a/MainApp/AppDelegate.h b/MainApp/AppDelegate.h index 9acca4d..10b695a 100644 --- a/MainApp/AppDelegate.h +++ b/MainApp/AppDelegate.h @@ -7,10 +7,36 @@ // #import +#import "InfoWindowController.h" +#import "AboutWindowController.h" @interface AppDelegate : NSObject -@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 diff --git a/MainApp/AppDelegate.m b/MainApp/AppDelegate.m index 544a75c..598a795 100644 --- a/MainApp/AppDelegate.m +++ b/MainApp/AppDelegate.m @@ -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 + @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 diff --git a/MainApp/Base.lproj/MainMenu.xib b/MainApp/Base.lproj/MainMenu.xib index c4a35cd..dc9cf80 100644 --- a/MainApp/Base.lproj/MainMenu.xib +++ b/MainApp/Base.lproj/MainMenu.xib @@ -14,661 +14,17 @@ - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -678,17 +34,27 @@ + - + @@ -696,13 +62,44 @@ - + - + + + + + + + diff --git a/MainApp/Images.xcassets/AppIcon.appiconset/Contents.json b/MainApp/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 2db2b1c..0000000 --- a/MainApp/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -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" - } -} \ No newline at end of file diff --git a/MainApp/Info.plist b/MainApp/Info.plist index 042ed6c..79b6bf7 100644 --- a/MainApp/Info.plist +++ b/MainApp/Info.plist @@ -17,17 +17,19 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + 1.0.0 CFBundleSignature ???? CFBundleVersion - 1 + 1.0.0 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright Copyright (c) 2016 Objective-See. All rights reserved. NSMainNibFile MainMenu + LSUIElement + NSPrincipalClass NSApplication diff --git a/OverSight.xcodeproj/project.pbxproj b/OverSight.xcodeproj/project.pbxproj index a9127a6..3572f28 100644 --- a/OverSight.xcodeproj/project.pbxproj +++ b/OverSight.xcodeproj/project.pbxproj @@ -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 = ""; }; 7D17C5151D658FEB0066232A /* statusIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "statusIcon@2x.png"; path = "Images/statusIcon@2x.png"; sourceTree = ""; }; 7D17C52C1D659E580066232A /* AboutWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AboutWindow.xib; sourceTree = ""; }; @@ -115,6 +110,10 @@ 7D62457B1D84FB8900870565 /* Enumerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Enumerator.m; sourceTree = ""; }; 7D62457E1D85348E00870565 /* Utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utilities.h; sourceTree = ""; }; 7D62457F1D85348E00870565 /* Utilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Utilities.m; sourceTree = ""; }; + 7D6245841D87C43900870565 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Images/Images.xcassets; sourceTree = ""; }; + 7D62458C1D87D38400870565 /* InfoWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InfoWindow.xib; sourceTree = ""; }; + 7D62458D1D87D38400870565 /* InfoWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfoWindowController.m; sourceTree = ""; }; + 7D62458E1D87D38400870565 /* InfoWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoWindowController.h; sourceTree = ""; }; 7DAF4B7C1D656FD3000DA31A /* StatusBarMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusBarMenu.h; sourceTree = ""; }; 7DAF4B7D1D656FD3000DA31A /* StatusBarMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatusBarMenu.m; sourceTree = ""; }; 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 = ""; }; 8B5755A219DA3E9500799E6B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 8B5755A319DA3E9500799E6B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 8B5755A519DA3E9500799E6B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 8B5755A819DA3E9500799E6B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 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 = ""; }; 8B5755C619DA3F9300799E6B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 8B5755C819DA3F9300799E6B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 8B5755C919DA3F9300799E6B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 8B5755CB19DA3F9300799E6B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 8B5755CE19DA3F9300799E6B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; - 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 = ""; - }; 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 = ""; }; + 7D6245861D87C53500870565 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 7DC9C8181D641A350017D143 /* main.m */, + 7DC9C81A1D641A350017D143 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; 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 = ""; @@ -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; diff --git a/OverSightXPC/Enumerator.m b/OverSightXPC/Enumerator.m index 446a6e0..c806f99 100644 --- a/OverSightXPC/Enumerator.m +++ b/OverSightXPC/Enumerator.m @@ -258,6 +258,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) @@ -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 diff --git a/Shared/AboutWindowController.m b/Shared/AboutWindowController.m index 1c11c93..304818f 100644 --- a/Shared/AboutWindowController.m +++ b/Shared/AboutWindowController.m @@ -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 diff --git a/Shared/Consts.h b/Shared/Consts.h index 7eccc84..d69477a 100644 --- a/Shared/Consts.h +++ b/Shared/Consts.h @@ -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 diff --git a/Installer/Assets.xcassets/AppIcon.appiconset/Contents.json b/Shared/Images/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Installer/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Shared/Images/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_128x128.png b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_128x128.png new file mode 100644 index 0000000..4c087ba Binary files /dev/null and b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_128x128.png differ diff --git a/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_128x128@2x.png b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_128x128@2x.png new file mode 100644 index 0000000..d46f3de Binary files /dev/null and b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_128x128@2x.png differ diff --git a/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_16x16.png b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_16x16.png new file mode 100644 index 0000000..d654908 Binary files /dev/null and b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_16x16.png differ diff --git a/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_16x16@2x.png b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_16x16@2x.png new file mode 100644 index 0000000..c79bfe2 Binary files /dev/null and b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_16x16@2x.png differ diff --git a/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_256x256.png b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_256x256.png new file mode 100644 index 0000000..d46f3de Binary files /dev/null and b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_256x256.png differ diff --git a/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_256x256@2x.png b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_256x256@2x.png new file mode 100644 index 0000000..1be6220 Binary files /dev/null and b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_256x256@2x.png differ diff --git a/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_32x32.png b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_32x32.png new file mode 100644 index 0000000..c79bfe2 Binary files /dev/null and b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_32x32.png differ diff --git a/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_32x32@2x.png b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_32x32@2x.png new file mode 100644 index 0000000..d6fc17c Binary files /dev/null and b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_32x32@2x.png differ diff --git a/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_512x512.png b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_512x512.png new file mode 100644 index 0000000..1be6220 Binary files /dev/null and b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_512x512.png differ diff --git a/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_512x512@2x.png b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_512x512@2x.png new file mode 100644 index 0000000..65b6339 Binary files /dev/null and b/Shared/Images/Images.xcassets/AppIcon.appiconset/icon_512x512@2x.png differ diff --git a/Installer/Assets.xcassets/Contents.json b/Shared/Images/Images.xcassets/Contents.json similarity index 100% rename from Installer/Assets.xcassets/Contents.json rename to Shared/Images/Images.xcassets/Contents.json diff --git a/Shared/InfoWindow.xib b/Shared/InfoWindow.xib new file mode 100644 index 0000000..0a999c1 --- /dev/null +++ b/Shared/InfoWindow.xib @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Shared/InfoWindowController.h b/Shared/InfoWindowController.h new file mode 100644 index 0000000..512c8a0 --- /dev/null +++ b/Shared/InfoWindowController.h @@ -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 + +@interface InfoWindowController : NSWindowController +{ + +} + +/* 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 diff --git a/Shared/InfoWindowController.m b/Shared/InfoWindowController.m new file mode 100644 index 0000000..6d61cf8 --- /dev/null +++ b/Shared/InfoWindowController.m @@ -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 diff --git a/Shared/Utilities.h b/Shared/Utilities.h index 529c5c0..012f180 100644 --- a/Shared/Utilities.h +++ b/Shared/Utilities.h @@ -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 diff --git a/Shared/Utilities.m b/Shared/Utilities.m index d2ed2a0..8cabc9e 100644 --- a/Shared/Utilities.m +++ b/Shared/Utilities.m @@ -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; +} +