├── .gitignore ├── Application ├── Application.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── Application.xcscheme ├── Application │ ├── AVMonitor.h │ ├── AVMonitor.m │ ├── AboutWindowController.h │ ├── AboutWindowController.m │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── icon_128x128.png │ │ │ ├── icon_128x128@2x.png │ │ │ ├── icon_16x16.png │ │ │ ├── icon_16x16@2x.png │ │ │ ├── icon_256x256.png │ │ │ ├── icon_256x256@2x.png │ │ │ ├── icon_32x32.png │ │ │ ├── icon_32x32@2x.png │ │ │ ├── icon_512x512.png │ │ │ └── icon_512x512@2x.png │ │ ├── Contents.json │ │ ├── Icon.imageset │ │ │ ├── Contents.json │ │ │ └── icon.png │ │ ├── OverSight.imageset │ │ │ ├── Contents.json │ │ │ └── overSight.png │ │ ├── PrefsAction.imageset │ │ │ ├── Contents.json │ │ │ └── action.png │ │ ├── PrefsMode.imageset │ │ │ ├── Contents.json │ │ │ ├── prefsMode Any.pdf │ │ │ ├── prefsMode Dark.pdf │ │ │ └── prefsMode Light.pdf │ │ ├── PrefsUpdate.imageset │ │ │ ├── Contents.json │ │ │ ├── prefsUpdate Any.pdf │ │ │ ├── prefsUpdate Dark.pdf │ │ │ └── prefsUpdate Light.pdf │ │ ├── StatusActive.imageset │ │ │ ├── Contents.json │ │ │ ├── active.png │ │ │ └── active@2x.png │ │ ├── StatusInactive.imageset │ │ │ ├── Contents.json │ │ │ ├── inactive.png │ │ │ └── inactive@2x.png │ │ ├── allow.imageset │ │ │ ├── Contents.json │ │ │ ├── rulesAllow Any.pdf │ │ │ ├── rulesAllow Dark.pdf │ │ │ └── rulesAllow Light.pdf │ │ └── block.imageset │ │ │ ├── Contents.json │ │ │ ├── block Any.pdf │ │ │ ├── block Dark.pdf │ │ │ └── block Light.pdf │ ├── Base.lproj │ │ ├── AboutWindow.xib │ │ ├── MainMenu.xib │ │ ├── Preferences.xib │ │ ├── Rules.xib │ │ ├── StatusBarPopover.xib │ │ └── UpdateWindow.xib │ ├── Client.h │ ├── Client.m │ ├── Event.h │ ├── Event.m │ ├── Info.plist │ ├── LogMonitor.h │ ├── LogMonitor.m │ ├── NSApplicationKeyEvents.h │ ├── NSApplicationKeyEvents.m │ ├── PrefsWindowController.h │ ├── PrefsWindowController.m │ ├── RuleRow.h │ ├── RuleRow.m │ ├── RuleRowCell.h │ ├── RuleRowCell.m │ ├── RulesWindowController.h │ ├── RulesWindowController.m │ ├── Rules_old.xib │ ├── StatusBarItem.h │ ├── StatusBarItem.m │ ├── StatusBarPopoverController.h │ ├── StatusBarPopoverController.m │ ├── Update.h │ ├── Update.m │ ├── UpdateWindowController.h │ ├── UpdateWindowController.m │ ├── es.lproj │ │ └── InfoPlist.strings │ ├── main.m │ ├── mul.lproj │ │ ├── AboutWindow.xcstrings │ │ ├── MainMenu.xcstrings │ │ ├── Preferences.xcstrings │ │ ├── Rules.xcstrings │ │ ├── StatusBarPopover.xcstrings │ │ └── UpdateWindow.xcstrings │ └── security.plist └── Localizable.xcstrings ├── Installer ├── Helper │ ├── Helper.m │ ├── HelperInterface.h │ ├── HelperInterface.m │ ├── HelperListener.h │ ├── HelperListener.m │ ├── Info.plist │ └── Launchd.plist ├── Installer.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ ├── Installer Helper.xcscheme │ │ └── Installer.xcscheme ├── Localizable.xcstrings ├── Shared │ └── XPCProtocol.h └── Source │ ├── AboutWindowController.h │ ├── AboutWindowController.m │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── icon_128x128.png │ │ ├── icon_128x128@2x.png │ │ ├── icon_16x16.png │ │ ├── icon_16x16@2x.png │ │ ├── icon_256x256.png │ │ ├── icon_256x256@2x.png │ │ ├── icon_32x32.png │ │ ├── icon_32x32@2x.png │ │ ├── icon_512x512.png │ │ └── icon_512x512@2x.png │ ├── Contents.json │ ├── DoNotDisturb.imageset │ │ ├── Contents.json │ │ ├── darkMode.png │ │ ├── darkMode_es.png │ │ ├── lightMode.png │ │ └── lightMode_es.png │ ├── Friends1Password.imageset │ │ ├── Contents.json │ │ ├── darkMode.png │ │ └── lightMode.png │ ├── FriendsHuntress.imageset │ │ ├── Contents.json │ │ ├── darkMode.png │ │ └── lightMode.png │ ├── FriendsJamf.imageset │ │ ├── Contents.json │ │ ├── darkMode.png │ │ └── lightMode.png │ ├── FriendsKandji.imageset │ │ ├── Contents.json │ │ ├── darkMode.png │ │ └── lightMode.png │ ├── FriendsKolide.imageset │ │ ├── Contents.json │ │ ├── darkMode.png │ │ └── lightMode.png │ ├── FriendsMacPaw.imageset │ │ ├── Contents.json │ │ ├── darkMode.png │ │ └── lightMode.png │ ├── FriendsMalwarebytes.imageset │ │ ├── Contents.json │ │ └── malwarebytes.png │ ├── FriendsMosyle.imageset │ │ ├── Contents.json │ │ ├── darkMode.png │ │ └── lightMode.png │ ├── FriendsPANW.imageset │ │ ├── Contents.json │ │ ├── darkMode.png │ │ └── lightMode.png │ ├── FriendsiVerify.imageset │ │ ├── Contents.json │ │ └── iVerify.png │ ├── Icon.imageset │ │ ├── Contents.json │ │ └── icon.png │ ├── Love.imageset │ │ ├── Contents.json │ │ ├── heart_dark.pdf │ │ ├── heart_light-1.pdf │ │ └── heart_light.pdf │ ├── Notifications.imageset │ │ ├── Contents.json │ │ ├── darkMode.png │ │ ├── darkMode_es.png │ │ ├── lightMode.png │ │ └── lightMode_es.png │ ├── OverSight.imageset │ │ ├── Contents.json │ │ └── overSight.png │ └── icon.png │ ├── Base.lproj │ ├── AboutWindow.xib │ ├── ConfigureWindowController.xib │ └── MainMenu.xib │ ├── Configure.h │ ├── Configure.m │ ├── ConfigureWindowController.h │ ├── ConfigureWindowController.m │ ├── HelperComms.h │ ├── HelperComms.m │ ├── Info.plist │ ├── Script │ └── configure.sh │ ├── en.lproj │ └── AboutWindow.xib │ ├── es.lproj │ └── InfoPlist.strings │ ├── main.h │ ├── main.m │ └── mul.lproj │ ├── AboutWindow.xcstrings │ ├── ConfigureWindowController.xcstrings │ └── MainMenu.xcstrings ├── LICENSE.md ├── OverSight.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── README.md ├── Shared ├── Consts.h ├── Images │ └── overSight.png ├── Libraries │ └── libFileMonitor.a ├── Utilities.h ├── Utilities.m ├── images │ ├── objectiveSeeLogo.png │ └── objectiveSeeText.png └── patrons.txt └── contributors.txt /.gitignore: -------------------------------------------------------------------------------- 1 | ## macOS 2 | .DS_Store 3 | 4 | ## Build generated 5 | build/ 6 | DerivedData/ 7 | 8 | ## Various settings 9 | *.pbxuser 10 | !default.pbxuser 11 | *.mode1v3 12 | !default.mode1v3 13 | *.mode2v3 14 | !default.mode2v3 15 | *.perspectivev3 16 | !default.perspectivev3 17 | xcuserdata/ 18 | 19 | 20 | # Carthage 21 | Carthage/Build/ 22 | Carthage/Checkouts 23 | Application/Uninstaller/ 24 | -------------------------------------------------------------------------------- /Application/Application.xcodeproj/xcshareddata/xcschemes/Application.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 44 | 46 | 52 | 53 | 54 | 55 | 59 | 60 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Application/Application/AVMonitor.h: -------------------------------------------------------------------------------- 1 | // 2 | // AVMonitor.h 3 | // Application 4 | // 5 | // Created by Patrick Wardle on 4/30/21. 6 | // Copyright © 2021 Objective-See. All rights reserved. 7 | // 8 | 9 | @import Cocoa; 10 | @import Foundation; 11 | @import UserNotifications; 12 | 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | 19 | #import "Event.h" 20 | #import "LogMonitor.h" 21 | 22 | @interface AVMonitor : NSObject 23 | 24 | //log monitor 25 | @property(nonatomic, retain)LogMonitor* logMonitor; 26 | 27 | //camera attributions 28 | @property(nonatomic, retain)NSMutableArray* cameraAttributions; 29 | 30 | //audio attributions 31 | @property(nonatomic, retain)NSMutableArray* audioAttributions; 32 | 33 | //built in mic 34 | @property(nonatomic, retain)AVCaptureDevice* builtInMic; 35 | 36 | //built in camera 37 | @property(nonatomic, retain)AVCaptureDevice* builtInCamera; 38 | 39 | //inital mic state 40 | @property NSControlStateValue initialMicState; 41 | 42 | //initial camera state 43 | @property NSControlStateValue initialCameraState; 44 | 45 | //last camera client 46 | @property NSInteger lastCameraClient; 47 | 48 | //last camera off 49 | @property(nonatomic, retain)AVCaptureDevice* lastCameraOff; 50 | 51 | //last mic client 52 | @property NSInteger lastMicClient; 53 | 54 | //last mic off 55 | @property(nonatomic, retain)AVCaptureDevice* lastMicOff; 56 | 57 | //audio listeners 58 | @property(nonatomic, retain)NSMutableDictionary* audioListeners; 59 | 60 | //camera listeners 61 | @property(nonatomic, retain)NSMutableDictionary* cameraListeners; 62 | 63 | //per device events 64 | @property(nonatomic, retain)NSMutableDictionary* deviceEvents; 65 | 66 | //last alert (default) interaction 67 | @property(nonatomic, retain)NSDate* lastNotificationDefaultAction; 68 | 69 | //listener queue 70 | @property(nonatomic, retain)dispatch_queue_t eventQueue; 71 | 72 | /* METHODS */ 73 | 74 | //start 75 | -(void)start; 76 | 77 | //enumerate active devices 78 | -(NSMutableArray*)enumerateActiveDevices; 79 | 80 | //stop 81 | -(void)stop; 82 | 83 | @end 84 | 85 | -------------------------------------------------------------------------------- /Application/Application/AboutWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: AboutWindowController.h 3 | // project: OverSight (login item) 4 | // description: 'about' window controller (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Cocoa; 11 | 12 | @interface AboutWindowController : NSWindowController 13 | { 14 | 15 | } 16 | 17 | /* PROPERTIES */ 18 | 19 | //version label/string 20 | @property (weak) IBOutlet NSTextField *versionLabel; 21 | 22 | //patrons 23 | @property (unsafe_unretained) IBOutlet NSTextView *patrons; 24 | 25 | /* METHODS */ 26 | 27 | //automatically invoked when user clicks any of the buttons 28 | // ->perform actions, such as loading patreon or products URL 29 | -(IBAction)buttonHandler:(id)sender; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Application/Application/AboutWindowController.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: AboutWindowController.m 3 | // project: OverSight (login item) 4 | // description: 'about' window controller 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | #import "consts.h" 11 | #import "utilities.h" 12 | #import "AboutWindowController.h" 13 | 14 | @implementation AboutWindowController 15 | 16 | @synthesize patrons; 17 | @synthesize versionLabel; 18 | 19 | //automatically called when nib is loaded 20 | // ->center window 21 | -(void)awakeFromNib 22 | { 23 | //center 24 | [self.window center]; 25 | } 26 | 27 | //automatically invoked when window is loaded 28 | // set to window to white, set app version, patrons, etc 29 | -(void)windowDidLoad 30 | { 31 | //version 32 | NSString* version = nil; 33 | 34 | //super 35 | [super windowDidLoad]; 36 | 37 | //not in dark mode? 38 | // make window white 39 | if(YES != isDarkMode()) 40 | { 41 | //make white 42 | self.window.backgroundColor = NSColor.whiteColor; 43 | } 44 | 45 | //grab app version 46 | version = getAppVersion(); 47 | if(nil == version) 48 | { 49 | //default 50 | version = NSLocalizedString(@"unknown",@"unknown"); 51 | } 52 | 53 | //set version sting 54 | self.versionLabel.stringValue = version; 55 | 56 | //load patrons 57 | // <3 you guys & girls 58 | self.patrons.string = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"patrons" ofType:@"txt"] encoding:NSUTF8StringEncoding error:NULL]; 59 | if(nil == self.patrons.string) 60 | { 61 | //default 62 | self.patrons.string = NSLocalizedString(@"error: failed to load patrons :/", @"error: failed to load patrons :/"); 63 | } 64 | 65 | return; 66 | } 67 | 68 | //automatically invoked when window is closing 69 | // ->make window unmodal 70 | -(void)windowWillClose:(NSNotification *)notification 71 | { 72 | //make un-modal 73 | [[NSApplication sharedApplication] stopModal]; 74 | 75 | return; 76 | } 77 | 78 | //automatically invoked when user clicks any of the buttons 79 | // ->perform actions, such as loading patreon or products URL 80 | -(IBAction)buttonHandler:(id)sender 81 | { 82 | //support us button 83 | if(((NSButton*)sender).tag == BUTTON_SUPPORT_US) 84 | { 85 | //open URL 86 | // ->invokes user's default browser 87 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:PATREON_URL]]; 88 | } 89 | 90 | //more info button 91 | else if(((NSButton*)sender).tag == BUTTON_MORE_INFO) 92 | { 93 | //open URL 94 | // ->invokes user's default browser 95 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:PRODUCT_URL]]; 96 | } 97 | 98 | return; 99 | } 100 | @end 101 | -------------------------------------------------------------------------------- /Application/Application/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: AppDelegate.h 3 | // project: OverSight (login item) 4 | // description: app delegate for login item (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2020 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Cocoa; 11 | @import OSLog; 12 | 13 | #import "AVMonitor.h" 14 | 15 | #import "StatusBarItem.h" 16 | #import "AboutWindowController.h" 17 | #import "PrefsWindowController.h" 18 | #import "RulesWindowController.h" 19 | #import "UpdateWindowController.h" 20 | 21 | @interface AppDelegate : NSObject 22 | 23 | 24 | /* PROPERTIES */ 25 | 26 | //status bar menu 27 | @property(strong) IBOutlet NSMenu* statusMenu; 28 | 29 | //status bar menu controller 30 | @property(nonatomic, retain)StatusBarItem* statusBarItemController; 31 | 32 | //about window controller 33 | @property(nonatomic, retain)AboutWindowController* aboutWindowController; 34 | 35 | //preferences window controller 36 | @property(nonatomic, retain)PrefsWindowController* prefsWindowController; 37 | 38 | //rules window controller 39 | @property(nonatomic, retain)RulesWindowController* rulesWindowController; 40 | 41 | //update window controller 42 | @property(nonatomic, retain)UpdateWindowController* updateWindowController; 43 | 44 | //AV monitor 45 | @property(nonatomic, retain)AVMonitor* avMonitor; 46 | 47 | 48 | /* METHODS */ 49 | 50 | //set app foreground/background 51 | // determined by the app's window count 52 | -(void)setActivationPolicy; 53 | 54 | //'rules' menu item handler 55 | // alloc and show rules window 56 | -(IBAction)showRules:(id)sender; 57 | 58 | //'preferences' menu item handler 59 | // alloc and show preferences window 60 | -(IBAction)showPreferences:(id)sender; 61 | 62 | //toggle (status) bar icon 63 | -(void)toggleIcon:(BOOL)state; 64 | 65 | 66 | @end 67 | 68 | -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_16x16.png", 5 | "idiom" : "mac", 6 | "scale" : "1x", 7 | "size" : "16x16" 8 | }, 9 | { 10 | "filename" : "icon_16x16@2x.png", 11 | "idiom" : "mac", 12 | "scale" : "2x", 13 | "size" : "16x16" 14 | }, 15 | { 16 | "filename" : "icon_32x32.png", 17 | "idiom" : "mac", 18 | "scale" : "1x", 19 | "size" : "32x32" 20 | }, 21 | { 22 | "filename" : "icon_32x32@2x.png", 23 | "idiom" : "mac", 24 | "scale" : "2x", 25 | "size" : "32x32" 26 | }, 27 | { 28 | "filename" : "icon_128x128.png", 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "filename" : "icon_128x128@2x.png", 35 | "idiom" : "mac", 36 | "scale" : "2x", 37 | "size" : "128x128" 38 | }, 39 | { 40 | "filename" : "icon_256x256.png", 41 | "idiom" : "mac", 42 | "scale" : "1x", 43 | "size" : "256x256" 44 | }, 45 | { 46 | "filename" : "icon_256x256@2x.png", 47 | "idiom" : "mac", 48 | "scale" : "2x", 49 | "size" : "256x256" 50 | }, 51 | { 52 | "filename" : "icon_512x512.png", 53 | "idiom" : "mac", 54 | "scale" : "1x", 55 | "size" : "512x512" 56 | }, 57 | { 58 | "filename" : "icon_512x512@2x.png", 59 | "idiom" : "mac", 60 | "scale" : "2x", 61 | "size" : "512x512" 62 | } 63 | ], 64 | "info" : { 65 | "author" : "xcode", 66 | "version" : 1 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/AppIcon.appiconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/AppIcon.appiconset/icon_128x128.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/AppIcon.appiconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/AppIcon.appiconset/icon_16x16.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/AppIcon.appiconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/AppIcon.appiconset/icon_256x256.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/AppIcon.appiconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/AppIcon.appiconset/icon_32x32.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/AppIcon.appiconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/AppIcon.appiconset/icon_512x512.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/Icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac" 5 | }, 6 | { 7 | "appearances" : [ 8 | { 9 | "appearance" : "luminosity", 10 | "value" : "light" 11 | } 12 | ], 13 | "filename" : "icon.png", 14 | "idiom" : "mac" 15 | }, 16 | { 17 | "appearances" : [ 18 | { 19 | "appearance" : "luminosity", 20 | "value" : "dark" 21 | } 22 | ], 23 | "filename" : "icon.png", 24 | "idiom" : "mac" 25 | } 26 | ], 27 | "info" : { 28 | "author" : "xcode", 29 | "version" : 1 30 | }, 31 | "properties" : { 32 | "preserves-vector-representation" : true 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/Icon.imageset/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/Icon.imageset/icon.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/OverSight.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "overSight.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/OverSight.imageset/overSight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/OverSight.imageset/overSight.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/PrefsAction.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "action.png", 5 | "idiom" : "mac" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "light" 12 | } 13 | ], 14 | "filename" : "action.png", 15 | "idiom" : "mac" 16 | }, 17 | { 18 | "appearances" : [ 19 | { 20 | "appearance" : "luminosity", 21 | "value" : "dark" 22 | } 23 | ], 24 | "filename" : "action.png", 25 | "idiom" : "mac" 26 | } 27 | ], 28 | "info" : { 29 | "author" : "xcode", 30 | "version" : 1 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/PrefsAction.imageset/action.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/PrefsAction.imageset/action.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/PrefsMode.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "filename" : "prefsMode Any.pdf" 6 | }, 7 | { 8 | "idiom" : "mac", 9 | "filename" : "prefsMode Light.pdf", 10 | "appearances" : [ 11 | { 12 | "appearance" : "luminosity", 13 | "value" : "light" 14 | } 15 | ] 16 | }, 17 | { 18 | "idiom" : "mac", 19 | "filename" : "prefsMode Dark.pdf", 20 | "appearances" : [ 21 | { 22 | "appearance" : "luminosity", 23 | "value" : "dark" 24 | } 25 | ] 26 | } 27 | ], 28 | "info" : { 29 | "version" : 1, 30 | "author" : "xcode" 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/PrefsMode.imageset/prefsMode Any.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/PrefsMode.imageset/prefsMode Any.pdf -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/PrefsMode.imageset/prefsMode Dark.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/PrefsMode.imageset/prefsMode Dark.pdf -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/PrefsMode.imageset/prefsMode Light.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/PrefsMode.imageset/prefsMode Light.pdf -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/PrefsUpdate.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "filename" : "prefsUpdate Any.pdf" 6 | }, 7 | { 8 | "idiom" : "mac", 9 | "filename" : "prefsUpdate Light.pdf", 10 | "appearances" : [ 11 | { 12 | "appearance" : "luminosity", 13 | "value" : "light" 14 | } 15 | ] 16 | }, 17 | { 18 | "idiom" : "mac", 19 | "filename" : "prefsUpdate Dark.pdf", 20 | "appearances" : [ 21 | { 22 | "appearance" : "luminosity", 23 | "value" : "dark" 24 | } 25 | ] 26 | } 27 | ], 28 | "info" : { 29 | "version" : 1, 30 | "author" : "xcode" 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/PrefsUpdate.imageset/prefsUpdate Any.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/PrefsUpdate.imageset/prefsUpdate Any.pdf -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/PrefsUpdate.imageset/prefsUpdate Dark.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/PrefsUpdate.imageset/prefsUpdate Dark.pdf -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/PrefsUpdate.imageset/prefsUpdate Light.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/PrefsUpdate.imageset/prefsUpdate Light.pdf -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/StatusActive.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "active.png", 5 | "idiom" : "mac", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "active@2x.png", 10 | "idiom" : "mac", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | }, 18 | "properties" : { 19 | "preserves-vector-representation" : true, 20 | "template-rendering-intent" : "template" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/StatusActive.imageset/active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/StatusActive.imageset/active.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/StatusActive.imageset/active@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/StatusActive.imageset/active@2x.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/StatusInactive.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "inactive.png", 5 | "idiom" : "mac", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "inactive@2x.png", 10 | "idiom" : "mac", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | }, 18 | "properties" : { 19 | "preserves-vector-representation" : true, 20 | "template-rendering-intent" : "template" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/StatusInactive.imageset/inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/StatusInactive.imageset/inactive.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/StatusInactive.imageset/inactive@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/StatusInactive.imageset/inactive@2x.png -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/allow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "filename" : "rulesAllow Any.pdf" 6 | }, 7 | { 8 | "idiom" : "mac", 9 | "filename" : "rulesAllow Light.pdf", 10 | "appearances" : [ 11 | { 12 | "appearance" : "luminosity", 13 | "value" : "light" 14 | } 15 | ] 16 | }, 17 | { 18 | "idiom" : "mac", 19 | "filename" : "rulesAllow Dark.pdf", 20 | "appearances" : [ 21 | { 22 | "appearance" : "luminosity", 23 | "value" : "dark" 24 | } 25 | ] 26 | } 27 | ], 28 | "info" : { 29 | "version" : 1, 30 | "author" : "xcode" 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/allow.imageset/rulesAllow Any.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/allow.imageset/rulesAllow Any.pdf -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/allow.imageset/rulesAllow Dark.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/allow.imageset/rulesAllow Dark.pdf -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/allow.imageset/rulesAllow Light.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/allow.imageset/rulesAllow Light.pdf -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/block.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "filename" : "block Any.pdf" 6 | }, 7 | { 8 | "idiom" : "mac", 9 | "filename" : "block Light.pdf", 10 | "appearances" : [ 11 | { 12 | "appearance" : "luminosity", 13 | "value" : "light" 14 | } 15 | ] 16 | }, 17 | { 18 | "idiom" : "mac", 19 | "filename" : "block Dark.pdf", 20 | "appearances" : [ 21 | { 22 | "appearance" : "luminosity", 23 | "value" : "dark" 24 | } 25 | ] 26 | } 27 | ], 28 | "info" : { 29 | "version" : 1, 30 | "author" : "xcode" 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/block.imageset/block Any.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/block.imageset/block Any.pdf -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/block.imageset/block Dark.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/block.imageset/block Dark.pdf -------------------------------------------------------------------------------- /Application/Application/Assets.xcassets/block.imageset/block Light.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Application/Application/Assets.xcassets/block.imageset/block Light.pdf -------------------------------------------------------------------------------- /Application/Application/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /Application/Application/Base.lproj/StatusBarPopover.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Application/Application/Base.lproj/UpdateWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 58 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Application/Application/Client.h: -------------------------------------------------------------------------------- 1 | // 2 | // Client.h 3 | // Application 4 | // 5 | // Created by Patrick Wardle on 4/30/21. 6 | // Copyright © 2021 Objective-See. All rights reserved. 7 | // 8 | 9 | @import Foundation; 10 | 11 | @interface Client : NSObject 12 | 13 | /* PROPERTIES */ 14 | 15 | //pid 16 | @property(nonatomic, retain)NSNumber* pid; 17 | 18 | //path 19 | @property(nonatomic, retain)NSString* path; 20 | 21 | //name 22 | @property(nonatomic, retain)NSString* name; 23 | 24 | @end 25 | 26 | -------------------------------------------------------------------------------- /Application/Application/Client.m: -------------------------------------------------------------------------------- 1 | // 2 | // Client.m 3 | // Application 4 | // 5 | // Created by Patrick Wardle on 4/30/21. 6 | // Copyright © 2021 Objective-See. All rights reserved. 7 | // 8 | 9 | #import "Client.h" 10 | 11 | @implementation Client 12 | 13 | //override description method 14 | -(NSString*)description 15 | { 16 | //description 17 | return [NSString stringWithFormat:@"CLIENT: pid: %@, path: %@", self.pid, self.path]; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Application/Application/Event.h: -------------------------------------------------------------------------------- 1 | // 2 | // Event.h 3 | // Application 4 | // 5 | // Created by Patrick Wardle on 5/10/21. 6 | // Copyright © 2021 Objective-See. All rights reserved. 7 | // 8 | 9 | @import Cocoa; 10 | @import Foundation; 11 | 12 | #import 13 | 14 | #import "Client.h" 15 | 16 | @interface Event : NSObject 17 | 18 | /* METHODS */ 19 | 20 | //init 21 | -(id)init:(Client*)client device:(AVCaptureDevice*)device deviceType:(int)deviceType state:(NSControlStateValue)state; 22 | 23 | /* PROPERTIES */ 24 | 25 | //client 26 | @property(nonatomic, retain)Client* client; 27 | 28 | //device 29 | @property(nonatomic, retain)AVCaptureDevice* device; 30 | 31 | //device 32 | @property int deviceType; 33 | 34 | //state 35 | @property NSControlStateValue state; 36 | 37 | //time stamp 38 | @property(nonatomic, retain)NSDate* timestamp; 39 | 40 | //was shown 41 | @property BOOL wasShown; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Application/Application/Event.m: -------------------------------------------------------------------------------- 1 | // 2 | // Event.m 3 | // Application 4 | // 5 | // Created by Patrick Wardle on 5/10/21. 6 | // Copyright © 2021 Objective-See. All rights reserved. 7 | // 8 | 9 | #import "Event.h" 10 | 11 | @implementation Event 12 | 13 | //init 14 | -(id)init:(Client*)client device:(AVCaptureDevice*)device deviceType:(int)deviceType state:(NSControlStateValue)state 15 | { 16 | //super 17 | self = [super init]; 18 | if(nil != self) 19 | { 20 | //save client 21 | self.client = client; 22 | 23 | //set device 24 | self.device = device; 25 | 26 | //set device type 27 | self.deviceType = deviceType; 28 | 29 | //set state 30 | self.state = state; 31 | 32 | //set timestamp 33 | self.timestamp = [NSDate date]; 34 | } 35 | 36 | return self; 37 | } 38 | 39 | //override description method 40 | -(NSString*)description 41 | { 42 | //description 43 | return [NSString stringWithFormat:@"EVENT: device: %@, device type: %d, state: %ld, timestamp: %@", self.device.localizedName, self.deviceType, (long)self.state, self.timestamp]; 44 | } 45 | 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Application/Application/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(CURRENT_PROJECT_VERSION) 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | LSUIElement 28 | 29 | NSHumanReadableCopyright 30 | Copyright (c) 2021 Objective-See. All rights reserved. 31 | NSMainNibFile 32 | MainMenu 33 | NSPrincipalClass 34 | NSApplicationKeyEvents 35 | NSUserNotificationAlertStyle 36 | alert 37 | 38 | 39 | -------------------------------------------------------------------------------- /Application/Application/LogMonitor.h: -------------------------------------------------------------------------------- 1 | // 2 | // logMonitor.h 3 | // logAPI 4 | // 5 | // Created by Patrick Wardle on 4/30/21. 6 | // Copyright © 2021 Objective-See. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | #define LOGGING_SUPPORT @"/System/Library/PrivateFrameworks/LoggingSupport.framework" 14 | 15 | // public OSLogEvent object 16 | @interface OSLogEvent : NSObject 17 | @property NSString *process; 18 | @property NSNumber* processIdentifier; 19 | @property NSString *processImagePath; 20 | @property NSString *sender; 21 | @property NSString *senderImagePath; 22 | @property NSString *category; 23 | @property NSString *subsystem; 24 | @property NSDate *date; 25 | @property NSString *composedMessage; 26 | @end 27 | 28 | //private log stream object 29 | @interface OSLogEventLiveStream : NSObject 30 | 31 | - (void)activate; 32 | - (void)invalidate; 33 | - (void)setFilterPredicate:(NSPredicate*)predicate; 34 | - (void)setDroppedEventHandler:(void(^)(id))callback; 35 | - (void)setInvalidationHandler:(void(^)(int, id))callback; 36 | - (void)setEventHandler:(void(^)(id))callback; 37 | 38 | @property(nonatomic) unsigned long long flags; 39 | 40 | @end 41 | 42 | //private log event object 43 | //implementation in framework 44 | @interface OSLogEventProxy : NSObject 45 | 46 | @property(readonly, nonatomic) NSString *process; 47 | @property(readonly, nonatomic) int processIdentifier; 48 | @property(readonly, nonatomic) NSString *processImagePath; 49 | 50 | @property(readonly, nonatomic) NSString *sender; 51 | @property(readonly, nonatomic) NSString *senderImagePath; 52 | 53 | @property(readonly, nonatomic) NSString *category; 54 | @property(readonly, nonatomic) NSString *subsystem; 55 | 56 | @property(readonly, nonatomic) NSDate *date; 57 | 58 | @property(readonly, nonatomic) NSString *composedMessage; 59 | 60 | @end 61 | 62 | 63 | //(our) log monitor object 64 | @interface LogMonitor : NSObject 65 | 66 | //instance of live stream 67 | @property(nonatomic, retain, nullable)OSLogEventLiveStream* liveStream; 68 | 69 | /* METHODS */ 70 | 71 | //start 72 | -(BOOL)start:(NSPredicate*)predicate level:(NSUInteger)level callback:(void(^)(OSLogEvent*))callback; 73 | 74 | //stop 75 | -(void)stop; 76 | 77 | @end 78 | 79 | NS_ASSUME_NONNULL_END 80 | -------------------------------------------------------------------------------- /Application/Application/LogMonitor.m: -------------------------------------------------------------------------------- 1 | // 2 | // logMonitor.m 3 | // logAPI 4 | // 5 | // Created by Patrick Wardle on 4/30/21. 6 | // Copyright © 2021 Objective-See. All rights reserved. 7 | // 8 | 9 | @import OSLog; 10 | 11 | #import "LogMonitor.h" 12 | 13 | /* GLOBALS */ 14 | 15 | //log handle 16 | extern os_log_t logHandle; 17 | 18 | @implementation OSLogEvent 19 | + (instancetype) OSLogEvent { 20 | return [[self alloc] init]; 21 | } 22 | @end 23 | 24 | //parse the private OSLogEventProxy event 25 | // pull out items of interest, and save into our defined event 26 | static OSLogEvent* parseEvent(OSLogEventProxy* event) 27 | { 28 | OSLogEvent *logEvent = [OSLogEvent OSLogEvent]; 29 | logEvent.process = event.process; 30 | logEvent.processImagePath = event.processImagePath; 31 | logEvent.processIdentifier = [NSNumber numberWithInt:event.processIdentifier]; 32 | logEvent.sender = event.sender; 33 | logEvent.senderImagePath = event.senderImagePath; 34 | logEvent.category = event.category; 35 | logEvent.subsystem = event.subsystem; 36 | logEvent.date = event.date; 37 | logEvent.composedMessage = event.composedMessage; 38 | return logEvent; 39 | } 40 | 41 | @implementation LogMonitor 42 | 43 | //init 44 | // load private framework, etc 45 | -(id)init 46 | { 47 | //error 48 | NSError* error = nil; 49 | 50 | //super 51 | self = [super init]; 52 | if(nil != self) 53 | { 54 | //ensure `LoggingSupport.framework` is loaded 55 | if(YES != [[NSBundle bundleWithPath:LOGGING_SUPPORT] loadAndReturnError:&error]) 56 | { 57 | //err msg 58 | os_log_error(logHandle, "ERROR: failed to load logging framework %{public}@ (error: %{public}@)", LOGGING_SUPPORT, error); 59 | 60 | //unset 61 | self = nil; 62 | 63 | //bail 64 | goto bail; 65 | } 66 | } 67 | 68 | bail: 69 | 70 | return self; 71 | } 72 | 73 | //start logging 74 | // pass in predicate to match, and callback 75 | -(BOOL)start:(NSPredicate*)predicate level:(NSUInteger)level callback:(void(^)(OSLogEvent*))callback 76 | { 77 | //flag 78 | BOOL started = NO; 79 | 80 | //live stream class 81 | Class LiveStream = nil; 82 | 83 | //event handler callback 84 | void (^eventHandler)(OSLogEventProxy* event) = ^void(OSLogEventProxy* event) { 85 | 86 | //Return the raw event 87 | callback(parseEvent(event)); 88 | }; 89 | 90 | //get 'OSLogEventLiveStream' class 91 | if(nil == (LiveStream = NSClassFromString(@"OSLogEventLiveStream"))) 92 | { 93 | //bail 94 | goto bail; 95 | } 96 | 97 | //init live stream 98 | self.liveStream = [[LiveStream alloc] init]; 99 | if(nil == self.liveStream) 100 | { 101 | //bail 102 | goto bail; 103 | } 104 | 105 | //sanity check 106 | // obj responds to `setFilterPredicate:`? 107 | if(YES != [self.liveStream respondsToSelector:NSSelectorFromString(@"setFilterPredicate:")]) 108 | { 109 | //bail 110 | goto bail; 111 | } 112 | 113 | //set predicate 114 | [self.liveStream setFilterPredicate:predicate]; 115 | 116 | //sanity check 117 | // obj responds to `setInvalidationHandler:`? 118 | if(YES != [self.liveStream respondsToSelector:NSSelectorFromString(@"setInvalidationHandler:")]) 119 | { 120 | //bail 121 | goto bail; 122 | } 123 | 124 | //set invalidation handler 125 | // note: need to have somethigng set as this get called (indirectly) when 126 | // the 'invalidate' method is called ... but don't need to do anything 127 | [self.liveStream setInvalidationHandler:^void (int reason, id streamPosition) { 128 | //NSLog(@"invalidation handler called with %d!", reason); 129 | ; 130 | }]; 131 | 132 | //sanity check 133 | // obj responds to `setDroppedEventHandler:`? 134 | if(YES != [self.liveStream respondsToSelector:NSSelectorFromString(@"setDroppedEventHandler:")]) 135 | { 136 | //bail 137 | goto bail; 138 | } 139 | 140 | //set dropped msg handler 141 | // note: need to have somethigng set as this get called (indirectly) 142 | [self.liveStream setDroppedEventHandler:^void (id droppedMessage) 143 | { 144 | //NSLog(@"invalidation handler called with %d!", reason); 145 | ; 146 | }]; 147 | 148 | //sanity check 149 | // obj responds to `setEventHandler:`? 150 | if(YES != [self.liveStream respondsToSelector:NSSelectorFromString(@"setEventHandler:")]) 151 | { 152 | //bail 153 | goto bail; 154 | } 155 | 156 | //set event handler 157 | [self.liveStream setEventHandler:eventHandler]; 158 | 159 | //sanity check 160 | // obj responds to `activate:`? 161 | if(YES != [self.liveStream respondsToSelector:NSSelectorFromString(@"activate")]) 162 | { 163 | //bail 164 | goto bail; 165 | } 166 | 167 | // 168 | if(YES != [self.liveStream respondsToSelector:NSSelectorFromString(@"setFlags:")]) 169 | { 170 | //bail 171 | goto bail; 172 | } 173 | 174 | //set debug & info flags 175 | [self.liveStream setFlags:level]; 176 | 177 | //activate 178 | [self.liveStream activate]; 179 | 180 | //happy 181 | started = YES; 182 | 183 | bail: 184 | 185 | return started; 186 | } 187 | 188 | //stop stream 189 | // invalidates live stream 190 | -(void)stop 191 | { 192 | //sanity check 193 | // obj responds to `invalidate`? 194 | if(YES != [self.liveStream respondsToSelector:NSSelectorFromString(@"invalidate")]) 195 | { 196 | //bail 197 | goto bail; 198 | } 199 | 200 | //not nil? 201 | // invalidate 202 | if(nil != self.liveStream) 203 | { 204 | //invalidate 205 | [self.liveStream invalidate]; 206 | } 207 | 208 | bail: 209 | 210 | return; 211 | } 212 | 213 | @end 214 | -------------------------------------------------------------------------------- /Application/Application/NSApplicationKeyEvents.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: NSApplicationKeyEvents.h 3 | // project: OverSight (login item) 4 | // description: adds support for keyboard shortcuts (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Cocoa; 11 | 12 | @interface NSApplicationKeyEvents : NSApplication 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Application/Application/NSApplicationKeyEvents.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: NSApplicationKeyEvents.h 3 | // project: OverSight (login item) 4 | // description: adds support for keyboard shortcuts (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | #import "NSApplicationKeyEvents.h" 11 | 12 | @implementation NSApplicationKeyEvents 13 | 14 | //to enable copy/paste etc even though we don't have an 'Edit' menu 15 | // details: http://stackoverflow.com/questions/970707/cocoa-keyboard-shortcuts-in-dialog-without-an-edit-menu 16 | -(void) sendEvent:(NSEvent *)event 17 | { 18 | //keydown? 19 | if([event type] == NSEventTypeKeyDown) 20 | { 21 | //command? 22 | if(([event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask) == NSEventModifierFlagCommand) 23 | { 24 | //+c 25 | // copy 26 | if(YES == [[event charactersIgnoringModifiers] isEqualToString:@"c"]) 27 | { 28 | //copy 29 | if([self sendAction:@selector(copy:) to:nil from:self]) 30 | { 31 | return; 32 | } 33 | } 34 | 35 | //+v 36 | // paste 37 | else if ([[event charactersIgnoringModifiers] isEqualToString:@"v"]) 38 | { 39 | //paste 40 | if([self sendAction:@selector(paste:) to:nil from:self]) 41 | { 42 | return; 43 | } 44 | } 45 | 46 | //+x 47 | // cut 48 | else if ([[event charactersIgnoringModifiers] isEqualToString:@"x"]) 49 | { 50 | //cut 51 | if([self sendAction:@selector(cut:) to:nil from:self]) 52 | { 53 | return; 54 | } 55 | } 56 | 57 | //+a 58 | // select all 59 | else if([[event charactersIgnoringModifiers] isEqualToString:@"a"]) 60 | { 61 | if ([self sendAction:@selector(selectAll:) to:nil from:self]) 62 | { 63 | return; 64 | } 65 | } 66 | } 67 | } 68 | 69 | //super 70 | [super sendEvent:event]; 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Application/Application/PrefsWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: PrefsWindowController.h 3 | // project: OverSight (main app) 4 | // description: preferences window controller (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Cocoa; 11 | 12 | #import "UpdateWindowController.h" 13 | 14 | /* CONSTS */ 15 | 16 | //modes view 17 | #define TOOLBAR_MODES 0 18 | 19 | //action view 20 | #define TOOLBAR_ACTION 1 21 | 22 | //update view 23 | #define TOOLBAR_UPDATE 2 24 | 25 | //to select, need string ID 26 | #define TOOLBAR_MODES_ID @"mode" 27 | 28 | @interface PrefsWindowController : NSWindowController 29 | 30 | /* PROPERTIES */ 31 | 32 | //preferences 33 | @property(nonatomic, retain)NSDictionary* preferences; 34 | 35 | //toolbar 36 | @property (weak) IBOutlet NSToolbar* toolbar; 37 | 38 | //modes view 39 | @property (strong) IBOutlet NSView* modesView; 40 | 41 | //action view 42 | @property (strong) IBOutlet NSView* actionView; 43 | 44 | //execute path button 45 | @property (weak) IBOutlet NSButton* executePathButton; 46 | 47 | //path to action 48 | @property (weak) IBOutlet NSSearchField* executePath; 49 | 50 | //browse button 51 | @property (weak) IBOutlet NSButton* browseButton; 52 | 53 | //execute args button 54 | @property (weak) IBOutlet NSButton* executeArgsButton; 55 | 56 | //update view 57 | @property (weak) IBOutlet NSView* updateView; 58 | 59 | //update button 60 | @property (weak) IBOutlet NSButton *updateButton; 61 | 62 | //update indicator (spinner) 63 | @property (weak) IBOutlet NSProgressIndicator *updateIndicator; 64 | 65 | //update label 66 | @property (weak) IBOutlet NSTextField *updateLabel; 67 | 68 | //update window controller 69 | @property(nonatomic, retain)UpdateWindowController* updateWindowController; 70 | 71 | /* METHODS */ 72 | 73 | //toolbar button handler 74 | -(IBAction)toolbarButtonHandler:(id)sender; 75 | 76 | //button handler for all preference buttons 77 | -(IBAction)togglePreference:(id)sender; 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Application/Application/RuleRow.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: RuleRow.h 3 | // project: OverSight (main app) 4 | // description: row for 'rules' table (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Cocoa; 11 | 12 | @interface RuleRow : NSTableRowView 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Application/Application/RuleRow.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: RuleRow.m 3 | // project: OverSight (main app) 4 | // description: row for 'rules' table 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | #import "RuleRow.h" 11 | 12 | @implementation RuleRow 13 | 14 | //custom row selection 15 | -(void)drawSelectionInRect:(NSRect)dirtyRect 16 | { 17 | //selection rect 18 | NSRect selectionRect = {0}; 19 | 20 | //selection path 21 | NSBezierPath* selectionPath = nil; 22 | 23 | //selection color 24 | NSColor* selectionColor = nil; 25 | 26 | //highlight selected rows 27 | if(self.selectionHighlightStyle != NSTableViewSelectionHighlightStyleNone) 28 | { 29 | //make selection rect 30 | selectionRect = NSInsetRect(self.bounds, 2.5, 2.5); 31 | 32 | //init color 33 | selectionColor = [NSColor systemGrayColor]; 34 | 35 | //set to transparent 36 | selectionColor = [NSColor unemphasizedSelectedContentBackgroundColor]; 37 | 38 | //set stroke 39 | [selectionColor setStroke]; 40 | 41 | //set fill 42 | [selectionColor setFill]; 43 | 44 | //create selection path 45 | // with rounded corners (5x5) 46 | selectionPath = [NSBezierPath bezierPathWithRoundedRect:selectionRect xRadius:5 yRadius:5]; 47 | 48 | //fill 49 | [selectionPath fill]; 50 | 51 | //stroke 52 | [selectionPath stroke]; 53 | } 54 | 55 | return; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Application/Application/RuleRowCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: RuleRowCell.h 3 | // project: OverSight (main app) 4 | // description: cell for 'rules' table (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Cocoa; 11 | 12 | @interface RuleRowCell : NSTableCellView 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Application/Application/RuleRowCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: RuleRowCell.m 3 | // project: OverSight (main app) 4 | // description: cell for 'rules' table 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | #import "RuleRowCell.h" 11 | 12 | @implementation RuleRowCell 13 | 14 | //set background style 15 | -(void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle 16 | { 17 | //light 18 | [super setBackgroundStyle: NSBackgroundStyleRaised]; 19 | 20 | return; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Application/Application/RulesWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: RulesWindowController.h 3 | // project: OverSight (main app) 4 | // description: window controller for 'rules' table (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Cocoa; 11 | 12 | /* CONSTS */ 13 | 14 | //id (tag) for detailed text in category table 15 | #define TABLE_ROW_NAME_TAG 100 16 | 17 | //id (tag) for detailed text (file) 18 | #define TABLE_ROW_SUB_TEXT_FILE 101 19 | 20 | //id (tag) for detailed text (item) 21 | #define TABLE_ROW_SUB_TEXT_ITEM 102 22 | 23 | //id (tag) for delete button 24 | #define TABLE_ROW_DELETE_TAG 110 25 | 26 | //menu item for block 27 | #define MENU_ITEM_BLOCK 0 28 | 29 | //menu item for allow 30 | #define MENU_ITEM_ALLOW 1 31 | 32 | //menu item for delete 33 | #define MENU_ITEM_DELETE 2 34 | 35 | /* INTERFACE */ 36 | 37 | @interface RulesWindowController : NSWindowController 38 | { 39 | 40 | } 41 | 42 | /* PROPERTIES */ 43 | 44 | //overlay 45 | @property (weak) IBOutlet NSView *overlay; 46 | 47 | //observer for rules changed 48 | @property(nonatomic, retain)id rulesObserver; 49 | 50 | //table items 51 | // all of the rules 52 | @property(nonatomic, retain)NSMutableArray* rules; 53 | 54 | 55 | //top level view 56 | @property (weak) IBOutlet NSView *view; 57 | 58 | //table view 59 | @property (weak) IBOutlet NSTableView *tableView; 60 | 61 | //panel for 'add rule' 62 | @property (weak) IBOutlet NSView *addRulePanel; 63 | 64 | /* METHODS */ 65 | 66 | //configure (UI) 67 | -(void)configure; 68 | 69 | //get rules from daemon 70 | // then, re-load rules table 71 | -(void)loadRules; 72 | 73 | //delete a rule 74 | -(IBAction)deleteRule:(id)sender; 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /Application/Application/RulesWindowController.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: RulesWindowController.m 3 | // project: OverSight (main app) 4 | // description: window controller for 'rules' table 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | #import "consts.h" 11 | #import "RuleRow.h" 12 | #import "utilities.h" 13 | #import "AppDelegate.h" 14 | #import "RulesWindowController.h" 15 | 16 | /* GLOBALS */ 17 | 18 | //log handle 19 | extern os_log_t logHandle; 20 | 21 | @implementation RulesWindowController 22 | 23 | @synthesize rules; 24 | 25 | //alloc/init 26 | // get rules and listen for new ones 27 | -(void)windowDidLoad 28 | { 29 | //setup observer for new rules 30 | self.rulesObserver = [[NSNotificationCenter defaultCenter] addObserverForName:RULES_CHANGED object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) 31 | { 32 | //get new rules 33 | [self loadRules]; 34 | }]; 35 | 36 | return; 37 | } 38 | 39 | //configure (UI) 40 | -(void)configure 41 | { 42 | //load rules 43 | [self loadRules]; 44 | 45 | //center window 46 | [self.window center]; 47 | 48 | //show window 49 | [self showWindow:self]; 50 | 51 | //make it key window 52 | [self.window makeKeyAndOrderFront:self]; 53 | 54 | return; 55 | } 56 | 57 | 58 | //get rules from daemon 59 | // then, re-load rules table 60 | -(void)loadRules 61 | { 62 | //dbg msg 63 | os_log_debug(logHandle, "loading rules..."); 64 | 65 | //in background get rules 66 | // ...then load rule table table 67 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), 68 | ^{ 69 | //get rules 70 | self.rules = [[NSUserDefaults.standardUserDefaults objectForKey:PREFS_ALLOWED_ITEMS] mutableCopy]; 71 | 72 | //dbg msg 73 | os_log_debug(logHandle, "loaded %lu allowed items", (unsigned long)self.rules.count); 74 | 75 | //remove any non-existant (old) items 76 | for(NSInteger i = self.rules.count-1; i >= 0; i--) 77 | { 78 | //item path 79 | NSString* itemPath = nil; 80 | 81 | //extract 82 | itemPath = self.rules[i][EVENT_PROCESS_PATH]; 83 | 84 | //item no longer exists? 85 | if(YES != [NSFileManager.defaultManager fileExistsAtPath:itemPath]) 86 | { 87 | //dbg msg 88 | os_log_debug(logHandle, "removing allowed item %{public}@, as it no longer exists", itemPath); 89 | 90 | //remove 91 | [self.rules removeObjectAtIndex:i]; 92 | } 93 | } 94 | 95 | //save & sync cleaned up list 96 | [NSUserDefaults.standardUserDefaults setObject:self.rules forKey:PREFS_ALLOWED_ITEMS]; 97 | [NSUserDefaults.standardUserDefaults synchronize]; 98 | 99 | //sort 100 | // case insenstive on name 101 | self.rules = [[self.rules sortedArrayUsingComparator:^NSComparisonResult(NSDictionary* a, NSDictionary* b) 102 | { 103 | return [getProcessName(a[EVENT_PROCESS_PATH]) caseInsensitiveCompare: getProcessName(b[EVENT_PROCESS_PATH])]; 104 | 105 | }] mutableCopy]; 106 | 107 | //show rules in UI 108 | // ...gotta do this on the main thread 109 | dispatch_async(dispatch_get_main_queue(), ^{ 110 | 111 | //reload table 112 | [self.tableView reloadData]; 113 | 114 | //select first row 115 | [self.tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; 116 | 117 | //set overlay vibility 118 | self.overlay.hidden = !(0 == self.rules.count); 119 | 120 | }); 121 | 122 | }); 123 | 124 | return; 125 | } 126 | 127 | //delete an allowed item 128 | -(IBAction)deleteRule:(id)sender 129 | { 130 | //index of row 131 | // either clicked or selected row 132 | NSInteger row = 0; 133 | 134 | //allowed items 135 | NSMutableArray* allowedItems = nil; 136 | 137 | //item to delete 138 | NSDictionary* item = nil; 139 | 140 | //dbg msg 141 | os_log_debug(logHandle, "deleting allowed item"); 142 | 143 | //get selected row 144 | row = [self.tableView rowForView:sender]; 145 | if(-1 == row) goto bail; 146 | 147 | //get item 148 | item = self.rules[row]; 149 | 150 | //dbg msg 151 | os_log_debug(logHandle, "allowed item: %{public}@ (device: %@)", item[EVENT_PROCESS_PATH], item[EVENT_DEVICE]); 152 | 153 | //(re)load items 154 | allowedItems = [[NSUserDefaults.standardUserDefaults objectForKey:PREFS_ALLOWED_ITEMS] mutableCopy]; 155 | 156 | //find/remove item 157 | for (NSInteger i = allowedItems.count - 1; i >= 0; i--) 158 | { 159 | if( (item[EVENT_DEVICE] != allowedItems[i][EVENT_DEVICE]) || 160 | (item[EVENT_PROCESS_PATH] != allowedItems[i][EVENT_PROCESS_PATH]) ) 161 | { 162 | //no match 163 | continue; 164 | } 165 | 166 | //remove 167 | [allowedItems removeObjectAtIndex:i]; 168 | } 169 | 170 | //save & sync 171 | [NSUserDefaults.standardUserDefaults setObject:allowedItems forKey:PREFS_ALLOWED_ITEMS]; 172 | [NSUserDefaults.standardUserDefaults synchronize]; 173 | 174 | //reload rules 175 | [self loadRules]; 176 | 177 | bail: 178 | 179 | return; 180 | } 181 | 182 | #pragma mark - 183 | #pragma mark table delegate methods 184 | 185 | //number of rows 186 | -(NSInteger)numberOfRowsInTableView:(NSTableView *)tableView 187 | { 188 | //row's count 189 | return self.rules.count; 190 | } 191 | 192 | //cell for table column 193 | -(NSView*)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row 194 | { 195 | //cell 196 | NSTableCellView *tableCell = nil; 197 | 198 | //item 199 | NSDictionary* allowedItem = nil; 200 | 201 | //process path 202 | NSString* processPath = nil; 203 | 204 | //grab item 205 | allowedItem = self.rules[row]; 206 | 207 | //column: 'process' 208 | // set process icon, name and path 209 | if(tableColumn == tableView.tableColumns[0]) 210 | { 211 | //init table cell 212 | tableCell = [tableView makeViewWithIdentifier:@"processCell" owner:self]; 213 | if(nil == tableCell) 214 | { 215 | //bail 216 | goto bail; 217 | } 218 | 219 | //extract path 220 | processPath = allowedItem[EVENT_PROCESS_PATH]; 221 | 222 | //set icon 223 | tableCell.imageView.image = getIconForProcess(processPath); 224 | 225 | //set process name 226 | tableCell.textField.stringValue = getProcessName(processPath); 227 | 228 | //set sub text (path) 229 | ((NSTextField*)[tableCell viewWithTag:TABLE_ROW_SUB_TEXT_FILE]).stringValue = processPath; 230 | 231 | //set text color to gray 232 | ((NSTextField*)[tableCell viewWithTag:TABLE_ROW_SUB_TEXT_FILE]).textColor = [NSColor secondaryLabelColor]; 233 | } 234 | 235 | //column: 'rule' 236 | // set icon and rule action 237 | else 238 | { 239 | //init table cell 240 | tableCell = [tableView makeViewWithIdentifier:@"ruleCell" owner:self]; 241 | if(nil == tableCell) 242 | { 243 | //bail 244 | goto bail; 245 | } 246 | 247 | tableCell.textField.stringValue = (Device_Camera == [allowedItem[EVENT_DEVICE] intValue]) ? @"camera" : @"microphone"; 248 | } 249 | 250 | bail: 251 | 252 | return tableCell; 253 | } 254 | 255 | //row for view 256 | -(NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row 257 | { 258 | //row view 259 | RuleRow* rowView = nil; 260 | 261 | //row ID 262 | static NSString* const kRowIdentifier = @"RowView"; 263 | 264 | //try grab existing row view 265 | rowView = [tableView makeViewWithIdentifier:kRowIdentifier owner:self]; 266 | 267 | //make new if needed 268 | if(nil == rowView) 269 | { 270 | //create new 271 | // ->size doesn't matter 272 | rowView = [[RuleRow alloc] initWithFrame:NSZeroRect]; 273 | 274 | //set row ID 275 | rowView.identifier = kRowIdentifier; 276 | } 277 | 278 | return rowView; 279 | } 280 | 281 | //on window close 282 | // set activation policy 283 | -(void)windowWillClose:(NSNotification *)notification 284 | { 285 | //wait a bit, then set activation policy 286 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), 287 | ^{ 288 | //on main thread 289 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 290 | 291 | //set activation policy 292 | [((AppDelegate*)[[NSApplication sharedApplication] delegate]) setActivationPolicy]; 293 | 294 | }); 295 | }); 296 | 297 | return; 298 | } 299 | 300 | @end 301 | -------------------------------------------------------------------------------- /Application/Application/StatusBarItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: StatusBarMenu.h 3 | // project: OverSight (login item) 4 | // description: menu handler for status bar icon (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | 11 | @import Cocoa; 12 | 13 | @interface StatusBarItem : NSObject 14 | { 15 | 16 | } 17 | 18 | //status item 19 | @property(nonatomic, strong, readwrite)NSStatusItem *statusItem; 20 | 21 | //popover 22 | @property(retain, nonatomic)NSPopover *popover; 23 | 24 | //disabled flag 25 | @property BOOL isDisabled; 26 | 27 | /* METHODS */ 28 | 29 | //init 30 | -(id)init:(NSMenu*)menu; 31 | 32 | //update status item menu 33 | -(void)setActiveDevices:(NSArray*)activeDevices; 34 | 35 | //remove status item 36 | -(void)removeStatusItem; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Application/Application/StatusBarPopoverController.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: StatusBarPopoverController.h 3 | // project: OverSight (login item) 4 | // description: popover for status bar (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Cocoa; 11 | 12 | @interface StatusBarPopoverController : NSViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Application/Application/StatusBarPopoverController.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: StatusBarPopoverController.m 3 | // project: OverSight (login item) 4 | // description: popover for status bar 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | #import "AppDelegate.h" 11 | #import "StatusBarPopoverController.h" 12 | 13 | @implementation StatusBarPopoverController 14 | 15 | //'close' button handler 16 | // simply dismiss/close popover 17 | -(IBAction)closePopover:(NSControl *)sender 18 | { 19 | //close 20 | [[[self view] window] close]; 21 | 22 | return; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Application/Application/Update.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: Update.h 3 | // project: OverSight (shared) 4 | // description: checks for new versions (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | #ifndef Update_h 11 | #define Update_h 12 | 13 | @import Cocoa; 14 | @import Foundation; 15 | 16 | @interface Update : NSObject 17 | 18 | //check for an update 19 | // will invoke app delegate method to update UI when check completes 20 | -(void)checkForUpdate:(void (^)(NSUInteger result, NSString* latestVersion))completionHandler; 21 | 22 | @end 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Application/Application/Update.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: Update.m 3 | // project: OverSight (shared) 4 | // description: checks for new versions 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | @import OSLog; 11 | 12 | #import "consts.h" 13 | #import "Update.h" 14 | #import "utilities.h" 15 | #import "AppDelegate.h" 16 | 17 | /* GLOBALS */ 18 | 19 | //log handle 20 | extern os_log_t logHandle; 21 | 22 | @implementation Update 23 | 24 | //check for an update 25 | // ->will invoke app delegate method to update UI when check completes 26 | -(void)checkForUpdate:(void (^)(NSUInteger result, NSString* latestVersion))completionHandler 27 | { 28 | //info 29 | __block NSDictionary* productInfo = nil; 30 | 31 | //result 32 | __block NSInteger result = Update_None; 33 | 34 | //get latest version in background 35 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 36 | 37 | //latest version 38 | NSString* latestVersion = nil; 39 | 40 | //supported OS 41 | NSOperatingSystemVersion supportedOS = {0}; 42 | 43 | //get product info 44 | productInfo = [self getProductInfo:PRODUCT_NAME]; 45 | if(nil == productInfo) 46 | { 47 | //err msg 48 | os_log_error(logHandle, "ERROR: failed retrieve product info (for update check) from %{public}@", PRODUCT_VERSIONS_URL); 49 | 50 | //error 51 | result = Update_Error; 52 | } 53 | //got remote product info 54 | // check supported OS and latest version 55 | else 56 | { 57 | //init supported OS 58 | supportedOS.majorVersion = [productInfo[SUPPORTED_OS_MAJOR] intValue]; 59 | supportedOS.minorVersion = [productInfo[SUPPORTED_OS_MINOR] intValue]; 60 | 61 | //extract latest version 62 | latestVersion = productInfo[LATEST_VERSION]; 63 | 64 | //supported version of macOS? 65 | if(YES != [NSProcessInfo.processInfo isOperatingSystemAtLeastVersion:supportedOS]) 66 | { 67 | //dbg msg 68 | os_log_debug(logHandle, "latest version requires macOS %ld.%ld ...but current macOS is %{public}@", supportedOS.majorVersion, supportedOS.minorVersion, NSProcessInfo.processInfo.operatingSystemVersionString); 69 | 70 | //unsupported 71 | result = Update_NotSupported; 72 | } 73 | 74 | //latest version is new(er)? 75 | else if(nil != latestVersion) 76 | { 77 | //check app version and latest version 78 | if(NSOrderedAscending == [getAppVersion() compare:latestVersion options:NSNumericSearch]) 79 | { 80 | //new update! 81 | result = Update_Available; 82 | } 83 | } 84 | } 85 | 86 | //invoke app delegate method 87 | // will update UI/show popup if necessary 88 | dispatch_async(dispatch_get_main_queue(), 89 | ^{ 90 | completionHandler(result, latestVersion); 91 | }); 92 | }); 93 | 94 | return; 95 | } 96 | 97 | //read JSON file w/ products 98 | // return dictionary w/ info about this product 99 | -(NSDictionary*)getProductInfo:(NSString*)product 100 | { 101 | //product version(s) data 102 | NSDictionary* products = nil; 103 | 104 | //get json file (products) from remote URL 105 | @try 106 | { 107 | //convert 108 | products = [NSJSONSerialization JSONObjectWithData:[[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:PRODUCT_VERSIONS_URL]] options:0 error:nil]; 109 | } 110 | @catch(NSException* exception) 111 | { 112 | ; 113 | } 114 | 115 | bail: 116 | 117 | return products[product]; 118 | } 119 | 120 | @end 121 | -------------------------------------------------------------------------------- /Application/Application/UpdateWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: UpdateWindowController.m 3 | // project: OverSight (shared) 4 | // description: window handler for update window/popup (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Cocoa; 11 | 12 | @interface UpdateWindowController : NSWindowController 13 | { 14 | 15 | } 16 | 17 | /* PROPERTIES */ 18 | 19 | //version label/string 20 | @property(weak)IBOutlet NSTextField *infoLabel; 21 | 22 | //action button 23 | @property(weak)IBOutlet NSButton *actionButton; 24 | 25 | //label string 26 | @property(nonatomic, retain)NSString* infoLabelString; 27 | 28 | //first button ('update check') 29 | @property(weak)IBOutlet NSView *firstButton; 30 | 31 | //button title 32 | @property(nonatomic, retain)NSString* actionButtonTitle; 33 | 34 | //overlay view 35 | @property(weak)IBOutlet NSView *overlayView; 36 | 37 | //spinner 38 | @property(weak)IBOutlet NSProgressIndicator *progressIndicator; 39 | 40 | /* METHODS */ 41 | 42 | //save the main label's & button title's text 43 | -(void)configure:(NSString*)label buttonTitle:(NSString*)buttonTitle; 44 | 45 | //invoked when user clicks button 46 | // ->trigger action such as opening product website, updating, etc 47 | -(IBAction)buttonHandler:(id)sender; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Application/Application/UpdateWindowController.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: UpdateWindowController.m 3 | // project: OverSight (shared) 4 | // description: window handler for update window/popup 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | #import "consts.h" 11 | #import "utilities.h" 12 | #import "AppDelegate.h" 13 | #import "UpdateWindowController.h" 14 | 15 | 16 | @implementation UpdateWindowController 17 | 18 | @synthesize infoLabel; 19 | @synthesize overlayView; 20 | @synthesize firstButton; 21 | @synthesize actionButton; 22 | @synthesize infoLabelString; 23 | @synthesize actionButtonTitle; 24 | @synthesize progressIndicator; 25 | 26 | //automatically called when nib is loaded 27 | // ->center window 28 | -(void)awakeFromNib 29 | { 30 | //center 31 | [self.window center]; 32 | 33 | return; 34 | } 35 | 36 | //automatically invoked when window is loaded 37 | // ->set to white 38 | -(void)windowDidLoad 39 | { 40 | //super 41 | [super windowDidLoad]; 42 | 43 | //not in dark mode? 44 | // make window white 45 | if(YES != isDarkMode()) 46 | { 47 | //make white 48 | self.window.backgroundColor = NSColor.whiteColor; 49 | } 50 | 51 | //indicated title bar is tranparent (too) 52 | self.window.titlebarAppearsTransparent = YES; 53 | 54 | //set main label 55 | [self.infoLabel setStringValue:self.infoLabelString]; 56 | 57 | //set button text 58 | self.actionButton.title = self.actionButtonTitle; 59 | 60 | //hide 1st button on 'update' 61 | // ...don't need update check button 62 | if(YES == [self.actionButton.title isEqualToString:NSLocalizedString(@"Update", @"Update")]) 63 | { 64 | //hide 65 | self.firstButton.hidden = YES; 66 | 67 | //then make action button first responder 68 | [self.window makeFirstResponder:self.actionButton]; 69 | } 70 | 71 | //make it key window 72 | [self.window makeKeyAndOrderFront:self]; 73 | 74 | //make window front 75 | [NSApp activateIgnoringOtherApps:YES]; 76 | 77 | return; 78 | } 79 | 80 | //automatically invoked when window is closing 81 | // ->make ourselves unmodal 82 | -(void)windowWillClose:(NSNotification *)notification 83 | { 84 | //make un-modal 85 | [[NSApplication sharedApplication] stopModal]; 86 | 87 | return; 88 | } 89 | 90 | //save the main label's & button title's text 91 | // ->invoked before window is loaded (and thus buttons, etc are nil) 92 | -(void)configure:(NSString*)label buttonTitle:(NSString*)buttonTitle 93 | { 94 | //save label's string 95 | self.infoLabelString = label; 96 | 97 | //save button's title 98 | self.actionButtonTitle = buttonTitle; 99 | 100 | return; 101 | } 102 | 103 | //invoked when user clicks button 104 | // trigger action such as opening product website, updating, etc 105 | -(IBAction)buttonHandler:(id)sender 106 | { 107 | //handle 'update' / 'more info', etc 108 | // ->open OverSight's webpage, if they *didn't* click 'close' 109 | if(YES != [((NSButton*)sender).title isEqualToString:NSLocalizedString(@"Close", @"Close")]) 110 | { 111 | //open URL 112 | // ->invokes user's default browser 113 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:PRODUCT_URL]]; 114 | } 115 | 116 | //always close window 117 | [[self window] close]; 118 | 119 | return; 120 | } 121 | @end 122 | -------------------------------------------------------------------------------- /Application/Application/es.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Bundle name */ 2 | "CFBundleName" = "OverSight"; 3 | 4 | /* Copyright (human-readable) */ 5 | "NSHumanReadableCopyright" = "Copyright (c) 2021 Objective-See. Todos los derechos reservados."; 6 | 7 | -------------------------------------------------------------------------------- /Application/Application/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: main.m 3 | // project: OverSight (login item) 4 | // description: main; 'nuff said 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | //FOR LOGGING: 11 | // % log stream --level debug --predicate="subsystem='com.objective-see.oversight'" 12 | 13 | @import Cocoa; 14 | @import OSLog; 15 | 16 | #import "consts.h" 17 | #import "utilities.h" 18 | 19 | /* GLOBALS */ 20 | 21 | //log handle 22 | os_log_t logHandle = nil; 23 | 24 | //main interface 25 | // sanity checks, then kick off app 26 | int main(int argc, const char * argv[]) 27 | { 28 | //status 29 | int status = 0; 30 | 31 | //(v1.0) allowed items 32 | NSArray* allowedItems = nil; 33 | 34 | //init log 35 | logHandle = os_log_create(BUNDLE_ID, "application"); 36 | 37 | //dbg msg(s) 38 | os_log_debug(logHandle, "started: %{public}@ (pid: %d / uid: %d)", NSProcessInfo.processInfo.arguments.firstObject, getpid(), getuid()); 39 | os_log_debug(logHandle, "arguments: %{public}@", NSProcessInfo.processInfo.arguments); 40 | 41 | //upgrade allowed items? 42 | // convert into 'NSUserDefaults' and then exit 43 | if(YES == [NSProcessInfo.processInfo.arguments containsObject:CMD_UPGRADE]) 44 | { 45 | //dbg msg 46 | os_log_debug(logHandle, "upgrading allowed items (from: %@)", NSProcessInfo.processInfo.arguments.lastObject); 47 | 48 | //load rules 49 | allowedItems = [NSArray arrayWithContentsOfFile:NSProcessInfo.processInfo.arguments.lastObject]; 50 | if(0 != allowedItems.count) 51 | { 52 | //set & snyc 53 | [NSUserDefaults.standardUserDefaults setValue:allowedItems forKey:PREFS_ALLOWED_ITEMS]; 54 | [NSUserDefaults.standardUserDefaults synchronize]; 55 | } 56 | 57 | //done 58 | goto bail; 59 | } 60 | 61 | //initial launch? 62 | // set defaults/handle login item persistence 63 | if(YES == [NSProcessInfo.processInfo.arguments containsObject:INITIAL_LAUNCH]) 64 | { 65 | // autostart mode 66 | // not specified? set to true 67 | if(nil == [NSUserDefaults.standardUserDefaults objectForKey:PREF_AUTOSTART_MODE]) 68 | { 69 | //set & snyc 70 | [NSUserDefaults.standardUserDefaults setBool:YES forKey:PREF_AUTOSTART_MODE]; 71 | [NSUserDefaults.standardUserDefaults synchronize]; 72 | } 73 | 74 | //autostart mode enabled? 75 | // since this is initial launch, check that login item is set 76 | if(YES == [NSUserDefaults.standardUserDefaults boolForKey:PREF_AUTOSTART_MODE]) 77 | { 78 | //dbg msg 79 | os_log_debug(logHandle, "first launch + auto-start is set ...will ensure app is persisted as login item"); 80 | 81 | //persist 82 | toggleLoginItem([NSURL fileURLWithPath:NSBundle.mainBundle.bundlePath], NSControlStateValueOn); 83 | } 84 | } 85 | 86 | //launch app normally 87 | status = NSApplicationMain(argc, argv); 88 | 89 | bail: 90 | 91 | return status; 92 | } 93 | -------------------------------------------------------------------------------- /Application/Application/mul.lproj/AboutWindow.xcstrings: -------------------------------------------------------------------------------- 1 | { 2 | "sourceLanguage" : "en", 3 | "strings" : { 4 | "6g3-Pg-x3P.title" : { 5 | "comment" : "Class = \"NSButtonCell\"; title = \"Support Us!\"; ObjectID = \"6g3-Pg-x3P\";", 6 | "extractionState" : "extracted_with_value", 7 | "localizations" : { 8 | "en" : { 9 | "stringUnit" : { 10 | "state" : "new", 11 | "value" : "Support Us!" 12 | } 13 | }, 14 | "es" : { 15 | "stringUnit" : { 16 | "state" : "translated", 17 | "value" : "¡Apóyanos!" 18 | } 19 | } 20 | } 21 | }, 22 | "bBK-v0-ypq.title" : { 23 | "comment" : "Class = \"NSTextFieldCell\"; title = \"Version:\"; ObjectID = \"bBK-v0-ypq\";", 24 | "extractionState" : "extracted_with_value", 25 | "localizations" : { 26 | "en" : { 27 | "stringUnit" : { 28 | "state" : "new", 29 | "value" : "Version:" 30 | } 31 | }, 32 | "es" : { 33 | "stringUnit" : { 34 | "state" : "translated", 35 | "value" : "Versión:" 36 | } 37 | } 38 | } 39 | }, 40 | "fJg-qw-wDf.title" : { 41 | "comment" : "Class = \"NSTextFieldCell\"; title = \"Supporters/Patrons:\"; ObjectID = \"fJg-qw-wDf\";", 42 | "extractionState" : "extracted_with_value", 43 | "localizations" : { 44 | "en" : { 45 | "stringUnit" : { 46 | "state" : "new", 47 | "value" : "Supporters/Patrons:" 48 | } 49 | }, 50 | "es" : { 51 | "stringUnit" : { 52 | "state" : "translated", 53 | "value" : "Friends/Patrons:" 54 | } 55 | } 56 | } 57 | }, 58 | "J9x-sM-h9S.title" : { 59 | "comment" : "Class = \"NSButtonCell\"; title = \"More Info\"; ObjectID = \"J9x-sM-h9S\";", 60 | "extractionState" : "extracted_with_value", 61 | "localizations" : { 62 | "en" : { 63 | "stringUnit" : { 64 | "state" : "new", 65 | "value" : "More Info" 66 | } 67 | }, 68 | "es" : { 69 | "stringUnit" : { 70 | "state" : "translated", 71 | "value" : "Más Información" 72 | } 73 | } 74 | } 75 | } 76 | }, 77 | "version" : "1.0" 78 | } -------------------------------------------------------------------------------- /Application/Application/mul.lproj/MainMenu.xcstrings: -------------------------------------------------------------------------------- 1 | { 2 | "sourceLanguage" : "en", 3 | "strings" : { 4 | "1Xt-HY-uBw.title" : { 5 | "comment" : "Class = \"NSMenuItem\"; title = \"OverSight\"; ObjectID = \"1Xt-HY-uBw\";", 6 | "extractionState" : "extracted_with_value", 7 | "localizations" : { 8 | "en" : { 9 | "stringUnit" : { 10 | "state" : "new", 11 | "value" : "OverSight" 12 | } 13 | }, 14 | "es" : { 15 | "stringUnit" : { 16 | "state" : "translated", 17 | "value" : "OverSight" 18 | } 19 | } 20 | } 21 | }, 22 | "amL-48-7OW.title" : { 23 | "comment" : "Class = \"NSMenuItem\"; title = \"Uninstall OverSight...\"; ObjectID = \"amL-48-7OW\";", 24 | "extractionState" : "extracted_with_value", 25 | "localizations" : { 26 | "en" : { 27 | "stringUnit" : { 28 | "state" : "new", 29 | "value" : "Uninstall OverSight..." 30 | } 31 | }, 32 | "es" : { 33 | "stringUnit" : { 34 | "state" : "translated", 35 | "value" : "Desinstalar OverSight..." 36 | } 37 | } 38 | } 39 | }, 40 | "AYu-sK-qS6.title" : { 41 | "comment" : "Class = \"NSMenu\"; title = \"Main Menu\"; ObjectID = \"AYu-sK-qS6\";", 42 | "extractionState" : "extracted_with_value", 43 | "localizations" : { 44 | "en" : { 45 | "stringUnit" : { 46 | "state" : "new", 47 | "value" : "Main Menu" 48 | } 49 | }, 50 | "es" : { 51 | "stringUnit" : { 52 | "state" : "translated", 53 | "value" : "Menú Principal" 54 | } 55 | } 56 | } 57 | }, 58 | "FkZ-L3-H8o.title" : { 59 | "comment" : "Class = \"NSMenuItem\"; title = \"Quit OverSight\"; ObjectID = \"FkZ-L3-H8o\";", 60 | "extractionState" : "extracted_with_value", 61 | "localizations" : { 62 | "en" : { 63 | "stringUnit" : { 64 | "state" : "new", 65 | "value" : "Quit OverSight" 66 | } 67 | }, 68 | "es" : { 69 | "stringUnit" : { 70 | "state" : "translated", 71 | "value" : "Salir de OverSight" 72 | } 73 | } 74 | } 75 | }, 76 | "fTQ-KS-1uk.title" : { 77 | "comment" : "Class = \"NSMenuItem\"; title = \"OverSight: enabled\"; ObjectID = \"fTQ-KS-1uk\";", 78 | "extractionState" : "extracted_with_value", 79 | "localizations" : { 80 | "en" : { 81 | "stringUnit" : { 82 | "state" : "new", 83 | "value" : "OverSight: enabled" 84 | } 85 | }, 86 | "es" : { 87 | "stringUnit" : { 88 | "state" : "translated", 89 | "value" : "OverSight: activado" 90 | } 91 | } 92 | } 93 | }, 94 | "HRl-aW-6nn.title" : { 95 | "comment" : "Class = \"NSMenuItem\"; title = \"Active Devices\"; ObjectID = \"HRl-aW-6nn\";", 96 | "extractionState" : "extracted_with_value", 97 | "localizations" : { 98 | "en" : { 99 | "stringUnit" : { 100 | "state" : "new", 101 | "value" : "Active Devices" 102 | } 103 | }, 104 | "es" : { 105 | "stringUnit" : { 106 | "state" : "translated", 107 | "value" : "Dispositivos Activos" 108 | } 109 | } 110 | } 111 | }, 112 | "i2A-ax-9ff.title" : { 113 | "comment" : "Class = \"NSMenuItem\"; title = \"Allowed Items...\"; ObjectID = \"i2A-ax-9ff\";", 114 | "extractionState" : "extracted_with_value", 115 | "localizations" : { 116 | "en" : { 117 | "stringUnit" : { 118 | "state" : "new", 119 | "value" : "Allowed Items..." 120 | } 121 | }, 122 | "es" : { 123 | "stringUnit" : { 124 | "state" : "translated", 125 | "value" : "Ítems Permitidos..." 126 | } 127 | } 128 | } 129 | }, 130 | "l0V-ZX-X8S.title" : { 131 | "comment" : "Class = \"NSMenuItem\"; title = \"Allowed Items...\"; ObjectID = \"l0V-ZX-X8S\";", 132 | "extractionState" : "extracted_with_value", 133 | "localizations" : { 134 | "en" : { 135 | "stringUnit" : { 136 | "state" : "new", 137 | "value" : "Allowed Items..." 138 | } 139 | }, 140 | "es" : { 141 | "stringUnit" : { 142 | "state" : "translated", 143 | "value" : "Ítems Permitidos..." 144 | } 145 | } 146 | } 147 | }, 148 | "p8u-9L-hFY.title" : { 149 | "comment" : "Class = \"NSMenuItem\"; title = \"Disable\"; ObjectID = \"p8u-9L-hFY\";", 150 | "extractionState" : "extracted_with_value", 151 | "localizations" : { 152 | "en" : { 153 | "stringUnit" : { 154 | "state" : "new", 155 | "value" : "Disable" 156 | } 157 | }, 158 | "es" : { 159 | "stringUnit" : { 160 | "state" : "translated", 161 | "value" : "Deshabilitar" 162 | } 163 | } 164 | } 165 | }, 166 | "rfE-3I-qPr.title" : { 167 | "comment" : "Class = \"NSMenuItem\"; title = \"Close Window\"; ObjectID = \"rfE-3I-qPr\";", 168 | "extractionState" : "extracted_with_value", 169 | "localizations" : { 170 | "en" : { 171 | "stringUnit" : { 172 | "state" : "new", 173 | "value" : "Close Window" 174 | } 175 | }, 176 | "es" : { 177 | "stringUnit" : { 178 | "state" : "translated", 179 | "value" : "Cerrar Ventana" 180 | } 181 | } 182 | } 183 | }, 184 | "RPu-ap-wNj.title" : { 185 | "comment" : "Class = \"NSMenuItem\"; title = \"About OverSight\"; ObjectID = \"RPu-ap-wNj\";", 186 | "extractionState" : "extracted_with_value", 187 | "localizations" : { 188 | "en" : { 189 | "stringUnit" : { 190 | "state" : "new", 191 | "value" : "About OverSight" 192 | } 193 | }, 194 | "es" : { 195 | "stringUnit" : { 196 | "state" : "translated", 197 | "value" : "Sobre OverSight" 198 | } 199 | } 200 | } 201 | }, 202 | "uQy-DD-JDr.title" : { 203 | "comment" : "Class = \"NSMenu\"; title = \"OverSight\"; ObjectID = \"uQy-DD-JDr\";", 204 | "extractionState" : "extracted_with_value", 205 | "localizations" : { 206 | "en" : { 207 | "stringUnit" : { 208 | "state" : "new", 209 | "value" : "OverSight" 210 | } 211 | }, 212 | "es" : { 213 | "stringUnit" : { 214 | "state" : "translated", 215 | "value" : "OverSight" 216 | } 217 | } 218 | } 219 | }, 220 | "yfe-lu-f3I.title" : { 221 | "comment" : "Class = \"NSMenuItem\"; title = \"Settings...\"; ObjectID = \"yfe-lu-f3I\";", 222 | "extractionState" : "extracted_with_value", 223 | "localizations" : { 224 | "en" : { 225 | "stringUnit" : { 226 | "state" : "new", 227 | "value" : "Settings..." 228 | } 229 | }, 230 | "es" : { 231 | "stringUnit" : { 232 | "state" : "translated", 233 | "value" : "Configuración…" 234 | } 235 | } 236 | } 237 | }, 238 | "Zao-2v-WyJ.title" : { 239 | "comment" : "Class = \"NSMenuItem\"; title = \"Settings...\"; ObjectID = \"Zao-2v-WyJ\";", 240 | "extractionState" : "extracted_with_value", 241 | "localizations" : { 242 | "en" : { 243 | "stringUnit" : { 244 | "state" : "new", 245 | "value" : "Settings..." 246 | } 247 | }, 248 | "es" : { 249 | "stringUnit" : { 250 | "state" : "translated", 251 | "value" : "Configuración…" 252 | } 253 | } 254 | } 255 | } 256 | }, 257 | "version" : "1.0" 258 | } -------------------------------------------------------------------------------- /Application/Application/mul.lproj/Rules.xcstrings: -------------------------------------------------------------------------------- 1 | { 2 | "sourceLanguage" : "en", 3 | "strings" : { 4 | "2GD-5k-sEf.title" : { 5 | "comment" : "Class = \"NSTextFieldCell\"; title = \"Process\"; ObjectID = \"2GD-5k-sEf\";", 6 | "extractionState" : "extracted_with_value", 7 | "localizations" : { 8 | "en" : { 9 | "stringUnit" : { 10 | "state" : "new", 11 | "value" : "Process" 12 | } 13 | }, 14 | "es" : { 15 | "stringUnit" : { 16 | "state" : "translated", 17 | "value" : "Proceso" 18 | } 19 | } 20 | } 21 | }, 22 | "EZN-NC-GXx.title" : { 23 | "comment" : "Class = \"NSTextFieldCell\"; title = \"file:\"; ObjectID = \"EZN-NC-GXx\";", 24 | "extractionState" : "extracted_with_value", 25 | "localizations" : { 26 | "en" : { 27 | "stringUnit" : { 28 | "state" : "new", 29 | "value" : "file:" 30 | } 31 | }, 32 | "es" : { 33 | "stringUnit" : { 34 | "state" : "translated", 35 | "value" : "archivo:" 36 | } 37 | } 38 | } 39 | }, 40 | "ocl-vV-SZu.headerCell.title" : { 41 | "comment" : "Class = \"NSTableColumn\"; headerCell.title = \" Process\"; ObjectID = \"ocl-vV-SZu\";", 42 | "extractionState" : "extracted_with_value", 43 | "localizations" : { 44 | "en" : { 45 | "stringUnit" : { 46 | "state" : "new", 47 | "value" : " Process" 48 | } 49 | }, 50 | "es" : { 51 | "stringUnit" : { 52 | "state" : "translated", 53 | "value" : "Proceso" 54 | } 55 | } 56 | } 57 | }, 58 | "QUv-cU-tQS.headerCell.title" : { 59 | "comment" : "Class = \"NSTableColumn\"; headerCell.title = \"Allowed Device\"; ObjectID = \"QUv-cU-tQS\";", 60 | "extractionState" : "extracted_with_value", 61 | "localizations" : { 62 | "en" : { 63 | "stringUnit" : { 64 | "state" : "new", 65 | "value" : "Allowed Device" 66 | } 67 | }, 68 | "es" : { 69 | "stringUnit" : { 70 | "state" : "translated", 71 | "value" : "Dispositivo Permitido" 72 | } 73 | } 74 | } 75 | }, 76 | "UoV-OW-a04.title" : { 77 | "comment" : "Class = \"NSTextFieldCell\"; title = \"action\"; ObjectID = \"UoV-OW-a04\";", 78 | "extractionState" : "extracted_with_value", 79 | "localizations" : { 80 | "en" : { 81 | "stringUnit" : { 82 | "state" : "new", 83 | "value" : "action" 84 | } 85 | }, 86 | "es" : { 87 | "stringUnit" : { 88 | "state" : "translated", 89 | "value" : "acción" 90 | } 91 | } 92 | } 93 | }, 94 | "Wjb-RO-P6A.title" : { 95 | "comment" : "Class = \"NSTextFieldCell\"; title = \"Currently, there are no allowed items...\"; ObjectID = \"Wjb-RO-P6A\";", 96 | "extractionState" : "extracted_with_value", 97 | "localizations" : { 98 | "en" : { 99 | "stringUnit" : { 100 | "state" : "new", 101 | "value" : "Currently, there are no allowed items..." 102 | } 103 | }, 104 | "es" : { 105 | "stringUnit" : { 106 | "state" : "translated", 107 | "value" : "Actualmente, no hay ítems permitidos..." 108 | } 109 | } 110 | } 111 | } 112 | }, 113 | "version" : "1.0" 114 | } -------------------------------------------------------------------------------- /Application/Application/mul.lproj/StatusBarPopover.xcstrings: -------------------------------------------------------------------------------- 1 | { 2 | "sourceLanguage" : "en", 3 | "strings" : { 4 | "2jG-uf-4XV.title" : { 5 | "comment" : "Class = \"NSButtonCell\"; title = \"⌃\"; ObjectID = \"2jG-uf-4XV\";", 6 | "extractionState" : "extracted_with_value", 7 | "localizations" : { 8 | "en" : { 9 | "stringUnit" : { 10 | "state" : "new", 11 | "value" : "⌃" 12 | } 13 | }, 14 | "es" : { 15 | "stringUnit" : { 16 | "state" : "translated", 17 | "value" : "⌃" 18 | } 19 | } 20 | } 21 | }, 22 | "17.title" : { 23 | "comment" : "Class = \"NSTextFieldCell\"; title = \"OverSight up & running!\"; ObjectID = \"17\";", 24 | "extractionState" : "extracted_with_value", 25 | "localizations" : { 26 | "en" : { 27 | "stringUnit" : { 28 | "state" : "new", 29 | "value" : "OverSight up & running!" 30 | } 31 | }, 32 | "es" : { 33 | "stringUnit" : { 34 | "state" : "translated", 35 | "value" : "¡OverSight en funcionamiento!" 36 | } 37 | } 38 | } 39 | }, 40 | "22.title" : { 41 | "comment" : "Class = \"NSTextFieldCell\"; title = \"Access it from here anytime\"; ObjectID = \"22\";", 42 | "extractionState" : "extracted_with_value", 43 | "localizations" : { 44 | "en" : { 45 | "stringUnit" : { 46 | "state" : "new", 47 | "value" : "Access it from here anytime" 48 | } 49 | }, 50 | "es" : { 51 | "stringUnit" : { 52 | "state" : "translated", 53 | "value" : "Accede desde aquí en cualquier momento" 54 | } 55 | } 56 | } 57 | } 58 | }, 59 | "version" : "1.0" 60 | } -------------------------------------------------------------------------------- /Application/Application/mul.lproj/UpdateWindow.xcstrings: -------------------------------------------------------------------------------- 1 | { 2 | "sourceLanguage" : "en", 3 | "strings" : { 4 | 5 | }, 6 | "version" : "1.0" 7 | } -------------------------------------------------------------------------------- /Application/Application/security.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Contact 6 | security@objective-see.com 7 | Preferred-Languages 8 | en 9 | 10 | 11 | -------------------------------------------------------------------------------- /Installer/Helper/Helper.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: Helper.m 3 | // project: (open-source) installer 4 | // description: main/entry point of daemon 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | @import OSLog; 11 | @import Foundation; 12 | 13 | #import "consts.h" 14 | #import "XPCProtocol.h" 15 | #import "HelperListener.h" 16 | #import "HelperInterface.h" 17 | 18 | /* GLOBALS */ 19 | 20 | //log handle 21 | os_log_t logHandle = nil; 22 | 23 | //helper daemon entry point 24 | // create XPC listener object and then just wait 25 | int main(int argc, const char * argv[]) 26 | { 27 | //pragmas 28 | #pragma unused(argc) 29 | #pragma unused(argv) 30 | 31 | //status 32 | int status = -1; 33 | 34 | //init log 35 | logHandle = os_log_create(BUNDLE_ID, "installer (helper)"); 36 | 37 | //pool 38 | @autoreleasepool 39 | { 40 | //helper listener (XPC) obj 41 | HelperListener* helperListener = nil; 42 | 43 | //alloc/init helper listener XPC obj 44 | helperListener = [[HelperListener alloc] init]; 45 | if(nil == helperListener) 46 | { 47 | //err msg 48 | os_log_error(logHandle, "ERROR: failed to initialize user comms XPC listener"); 49 | 50 | //bail 51 | goto bail; 52 | } 53 | 54 | //dbg msg 55 | os_log_debug(logHandle, "listening for client XPC connections..."); 56 | 57 | //run loop 58 | [[NSRunLoop currentRunLoop] run]; 59 | 60 | } //pool 61 | 62 | //happy 63 | // though not sure how we'll ever get here? 64 | status = 0; 65 | 66 | bail: 67 | 68 | return status; 69 | } 70 | -------------------------------------------------------------------------------- /Installer/Helper/HelperInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: HelperInterface.h 3 | // project: (open-source) installer 4 | // description: interface for app installer comms (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Foundation; 11 | 12 | #import "XPCProtocol.h" 13 | #import "HelperInterface.h" 14 | 15 | @interface HelperInterface : NSObject 16 | { 17 | 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Installer/Helper/HelperListener.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: HelperListener.h 3 | // project: (open-source) installer 4 | // description: XPC listener for connections for user components (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Foundation; 11 | 12 | #import "HelperInterface.h" 13 | 14 | //function def 15 | OSStatus SecTaskValidateForRequirement(SecTaskRef task, CFStringRef requirement); 16 | 17 | @interface HelperListener : NSObject 18 | { 19 | 20 | } 21 | 22 | /* PROPERTIES */ 23 | 24 | //XPC listener obj 25 | @property(nonatomic, retain)NSXPCListener* listener; 26 | 27 | /* METHODS */ 28 | 29 | //setup XPC listener 30 | -(BOOL)initListener; 31 | 32 | //automatically invoked 33 | // allows NSXPCListener to configure/accept/resume a new incoming NSXPCConnection 34 | // note: we only allow binaries signed by Objective-See to talk to this to be extra safe :) 35 | -(BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Installer/Helper/HelperListener.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: HelperListener.m 3 | // project: (open-source) installer 4 | // description: XPC listener for connections for user components 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | @import OSLog; 11 | @import Foundation; 12 | 13 | #import "consts.h" 14 | #import "XPCProtocol.h" 15 | #import "HelperListener.h" 16 | #import "HelperInterface.h" 17 | 18 | #import 19 | #import 20 | #import 21 | 22 | /* GLOBALS */ 23 | 24 | //log handle 25 | extern os_log_t logHandle; 26 | 27 | //interface for 'extension' to NSXPCConnection 28 | // allows us to access the 'private' auditToken iVar 29 | @interface ExtendedNSXPCConnection : NSXPCConnection 30 | 31 | //private iVar 32 | @property (nonatomic) audit_token_t auditToken; 33 | 34 | @end 35 | 36 | //implementation for 'extension' to NSXPCConnection 37 | // allows us to access the 'private' auditToken iVar 38 | @implementation ExtendedNSXPCConnection 39 | 40 | //private iVar 41 | @synthesize auditToken; 42 | 43 | @end 44 | 45 | 46 | 47 | @implementation HelperListener 48 | 49 | 50 | @synthesize listener; 51 | 52 | //init 53 | // create XPC listener 54 | -(id)init 55 | { 56 | //init super 57 | self = [super init]; 58 | if(nil != self) 59 | { 60 | //setup XPC listener 61 | if(YES != [self initListener]) 62 | { 63 | //unset 64 | self = nil; 65 | 66 | //bail 67 | goto bail; 68 | } 69 | } 70 | 71 | bail: 72 | 73 | return self; 74 | } 75 | 76 | //setup XPC listener 77 | -(BOOL)initListener 78 | { 79 | //result 80 | BOOL result = NO; 81 | 82 | //code signing requirement 83 | NSString* requirement = nil; 84 | 85 | //init listener 86 | listener = [[NSXPCListener alloc] initWithMachServiceName:CONFIG_HELPER_ID]; 87 | if(nil == self.listener) 88 | { 89 | //err msg 90 | os_log_error(logHandle, "ERROR: failed to create mach service %@", CONFIG_HELPER_ID); 91 | 92 | //bail 93 | goto bail; 94 | } 95 | 96 | //macOS 13+ 97 | // set code signing requirement for clients via 'setConnectionCodeSigningRequirement' 98 | if(@available(macOS 13.0, *)) { 99 | 100 | //init requirement 101 | // OS Installer v2.0+ 102 | requirement = [NSString stringWithFormat:@"anchor apple generic and identifier \"%@\" and certificate leaf [subject.CN] = \"%@\" and info [CFBundleShortVersionString] >= \"2.0.0\"", INSTALLER_ID, SIGNING_AUTH]; 103 | 104 | //set requirement 105 | [self.listener setConnectionCodeSigningRequirement:requirement]; 106 | 107 | //dbg msg 108 | os_log_debug(logHandle, "set XPC requirement %{public}@", requirement); 109 | } 110 | 111 | //dbg msg 112 | os_log_debug(logHandle, "created mach service %@", CONFIG_HELPER_ID); 113 | 114 | //set delegate 115 | self.listener.delegate = self; 116 | 117 | //ready to accept connections 118 | [self.listener resume]; 119 | 120 | //happy 121 | result = YES; 122 | 123 | bail: 124 | 125 | return result; 126 | } 127 | 128 | #pragma mark - 129 | #pragma mark NSXPCConnection method overrides 130 | 131 | //automatically invoked 132 | // allows NSXPCListener to configure/accept/resume a new incoming NSXPCConnection 133 | // shoutout to: https://blog.obdev.at/what-we-have-learned-from-a-vulnerability/ 134 | -(BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection 135 | { 136 | //pragma 137 | #pragma unused(listener) 138 | 139 | //flag 140 | BOOL shouldAccept = NO; 141 | 142 | //status 143 | OSStatus status = !errSecSuccess; 144 | 145 | //audit token 146 | audit_token_t auditToken = {0}; 147 | 148 | //task ref 149 | SecTaskRef taskRef = 0; 150 | 151 | //code ref 152 | SecCodeRef codeRef = NULL; 153 | 154 | //code signing info 155 | CFDictionaryRef csInfo = NULL; 156 | 157 | //cs flags 158 | uint32_t csFlags = 0; 159 | 160 | //signing req string (main app) 161 | NSString* requirement = nil; 162 | 163 | //extract audit token 164 | auditToken = ((ExtendedNSXPCConnection*)newConnection).auditToken; 165 | 166 | //dbg msg 167 | os_log_debug(logHandle, "received request to connect to XPC interface"); 168 | 169 | //obtain dynamic code ref 170 | status = SecCodeCopyGuestWithAttributes(NULL, (__bridge CFDictionaryRef _Nullable)(@{(__bridge NSString *)kSecGuestAttributeAudit : [NSData dataWithBytes:&auditToken length:sizeof(audit_token_t)]}), kSecCSDefaultFlags, &codeRef); 171 | if(errSecSuccess != status) 172 | { 173 | //err msg 174 | os_log_error(logHandle, "ERROR: 'SecCodeCopyGuestWithAttributes' failed with': %#x", status); 175 | 176 | //bail 177 | goto bail; 178 | } 179 | 180 | //validate code 181 | status = SecCodeCheckValidity(codeRef, kSecCSDefaultFlags, NULL); 182 | if(errSecSuccess != status) 183 | { 184 | //err msg 185 | os_log_error(logHandle, "ERROR: 'SecCodeCheckValidity' failed with': %#x", status); 186 | 187 | //bail 188 | goto bail; 189 | } 190 | 191 | //get code signing info 192 | status = SecCodeCopySigningInformation(codeRef, kSecCSDynamicInformation, &csInfo); 193 | if(errSecSuccess != status) 194 | { 195 | //err msg 196 | os_log_error(logHandle, "ERROR: 'SecCodeCopySigningInformation' failed with': %#x", status); 197 | 198 | //bail 199 | goto bail; 200 | } 201 | 202 | //extract flags 203 | csFlags = [((__bridge NSDictionary *)csInfo)[(__bridge NSString *)kSecCodeInfoStatus] unsignedIntValue]; 204 | 205 | //dbg msg 206 | os_log_debug(logHandle, "code signing flags: %#x", csFlags); 207 | 208 | //gotta have hardened runtime 209 | if( !(CS_VALID & csFlags) && 210 | !(CS_RUNTIME & csFlags) ) 211 | { 212 | //err msg 213 | os_log_error(logHandle, "ERROR: invalid code signing flags: %#x", csFlags); 214 | 215 | //bail 216 | goto bail; 217 | } 218 | 219 | //dbg msg 220 | os_log_debug(logHandle, "code signing flags, ok ('CS_RUNTIME' is set)"); 221 | 222 | //init signing req 223 | requirement = [NSString stringWithFormat:@"anchor apple generic and identifier \"%@\" and certificate leaf [subject.CN] = \"%@\"", INSTALLER_ID, SIGNING_AUTH]; 224 | 225 | //step 1: create task ref 226 | // uses NSXPCConnection's (private) 'auditToken' iVar 227 | taskRef = SecTaskCreateWithAuditToken(NULL, ((ExtendedNSXPCConnection*)newConnection).auditToken); 228 | if(NULL == taskRef) 229 | { 230 | //bail 231 | goto bail; 232 | } 233 | 234 | //step 2: validate 235 | // check that client is signed with Objective-See's dev cert and it's the BB's installer 236 | if(0 != SecTaskValidateForRequirement(taskRef, (__bridge CFStringRef)(requirement))) 237 | { 238 | //err msg 239 | os_log_error(logHandle, "ERROR: failed to validate against %@", requirement); 240 | 241 | //bail 242 | goto bail; 243 | } 244 | 245 | //set the interface that the exported object implements 246 | newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(XPCProtocol)]; 247 | 248 | //set object exported by connection 249 | newConnection.exportedObject = [[HelperInterface alloc] init]; 250 | 251 | //resume 252 | [newConnection resume]; 253 | 254 | //dbg msg 255 | os_log_debug(logHandle, "allowed XPC connection: %{public}@", newConnection); 256 | 257 | //happy 258 | shouldAccept = YES; 259 | 260 | bail: 261 | 262 | //release task ref object 263 | if(NULL != taskRef) 264 | { 265 | //release 266 | CFRelease(taskRef); 267 | taskRef = NULL; 268 | } 269 | 270 | //free cs info 271 | if(NULL != csInfo) 272 | { 273 | //free 274 | CFRelease(csInfo); 275 | csInfo = NULL; 276 | } 277 | 278 | //free code ref 279 | if(NULL != codeRef) 280 | { 281 | //free 282 | CFRelease(codeRef); 283 | codeRef = NULL; 284 | } 285 | 286 | return shouldAccept; 287 | } 288 | 289 | @end 290 | -------------------------------------------------------------------------------- /Installer/Helper/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleIdentifier 8 | com.objective-see.oversight.uninstallHelper 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundleName 12 | helper 13 | CFBundleShortVersionString 14 | $(MARKETING_VERSION) 15 | CFBundleVersion 16 | $(CURRENT_PROJECT_VERSION) 17 | NSHumanReadableCopyright 18 | Copyright (c) 2020 Objective-See. All rights reserved. 19 | SMAuthorizedClients 20 | 21 | anchor apple generic and identifier "com.objective-see.oversight.installer" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = VBG97UB4TA) 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Installer/Helper/Launchd.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | com.objective-see.oversight.uninstallHelper 7 | MachServices 8 | 9 | com.objective-see.oversight.uninstallHelper 10 | 11 | 12 | EnableTransactions 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Installer/Installer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Installer/Installer.xcodeproj/xcshareddata/xcschemes/Installer Helper.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /Installer/Installer.xcodeproj/xcshareddata/xcschemes/Installer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 60 | 61 | 71 | 73 | 79 | 80 | 81 | 82 | 88 | 90 | 96 | 97 | 98 | 99 | 101 | 102 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /Installer/Localizable.xcstrings: -------------------------------------------------------------------------------- 1 | { 2 | "sourceLanguage" : "en", 3 | "strings" : { 4 | "☑️ %@: installed!\n" : { 5 | "comment" : "☑️ %@: installed!\n", 6 | "localizations" : { 7 | "es" : { 8 | "stringUnit" : { 9 | "state" : "translated", 10 | "value" : "☑️ %@: ¡instalado!" 11 | } 12 | } 13 | } 14 | }, 15 | "☑️ %@: uninstalled!\n" : { 16 | "comment" : "☑️ %@: uninstalled!\n", 17 | "localizations" : { 18 | "es" : { 19 | "stringUnit" : { 20 | "state" : "translated", 21 | "value" : "☑️ %@: ¡desinstalado!" 22 | } 23 | } 24 | } 25 | }, 26 | "⚠️ Error: %@ failed" : { 27 | "comment" : "⚠️ Error: %@ failed", 28 | "localizations" : { 29 | "es" : { 30 | "stringUnit" : { 31 | "state" : "translated", 32 | "value" : "⚠️ Error: %@ falló" 33 | } 34 | } 35 | } 36 | }, 37 | "Close" : { 38 | "comment" : "Close", 39 | "localizations" : { 40 | "es" : { 41 | "stringUnit" : { 42 | "state" : "translated", 43 | "value" : "Cerrar" 44 | } 45 | } 46 | } 47 | }, 48 | "ERROR: Insuffient Privileges." : { 49 | "comment" : "ERROR: Insuffient Privileges.", 50 | "localizations" : { 51 | "es" : { 52 | "stringUnit" : { 53 | "state" : "translated", 54 | "value" : "ERROR: Privilegios Insuficientes." 55 | } 56 | } 57 | } 58 | }, 59 | "Exit" : { 60 | "comment" : "Exit", 61 | "localizations" : { 62 | "es" : { 63 | "stringUnit" : { 64 | "state" : "translated", 65 | "value" : "Salir" 66 | } 67 | } 68 | } 69 | }, 70 | "For more info, from the terminal run:\r\nlog show --predicate=\"subsystem='com.objective-see.oversight'\"" : { 71 | "comment" : "For more info, from the terminal run:\r\nlog show --predicate=\"subsystem='com.objective-see.oversight'\"", 72 | "localizations" : { 73 | "es" : { 74 | "stringUnit" : { 75 | "state" : "translated", 76 | "value" : "Para más información, ejecuta en la terminal:\nlog show --predicate=\"subsystem='com.objective-see.oversight'" 77 | } 78 | } 79 | } 80 | }, 81 | "install" : { 82 | "comment" : "install", 83 | "localizations" : { 84 | "es" : { 85 | "stringUnit" : { 86 | "state" : "translated", 87 | "value" : "instalar" 88 | } 89 | } 90 | } 91 | }, 92 | "Installing..." : { 93 | "comment" : "Installing...", 94 | "localizations" : { 95 | "es" : { 96 | "stringUnit" : { 97 | "state" : "translated", 98 | "value" : "Instalando..." 99 | } 100 | } 101 | } 102 | }, 103 | "Next »" : { 104 | "comment" : "Next »", 105 | "localizations" : { 106 | "es" : { 107 | "stringUnit" : { 108 | "state" : "translated", 109 | "value" : "Siguiente »" 110 | } 111 | } 112 | } 113 | }, 114 | "OverSight can only be installed / run on accounts with administrative privileges" : { 115 | "comment" : "OverSight can only be installed / run on accounts with administrative privileges", 116 | "localizations" : { 117 | "es" : { 118 | "stringUnit" : { 119 | "state" : "translated", 120 | "value" : "OverSight solo puede ser instalado / ejecutado en cuentas con privilegios administrativos" 121 | } 122 | } 123 | } 124 | }, 125 | "Protects your webcam & microphone!" : { 126 | "comment" : "Protects your webcam & microphone!", 127 | "localizations" : { 128 | "es" : { 129 | "stringUnit" : { 130 | "state" : "translated", 131 | "value" : "¡Protege tu webcam & micrófono!" 132 | } 133 | } 134 | } 135 | }, 136 | "uninstall" : { 137 | "comment" : "uninstall", 138 | "localizations" : { 139 | "es" : { 140 | "stringUnit" : { 141 | "state" : "translated", 142 | "value" : "desinstalar" 143 | } 144 | } 145 | } 146 | }, 147 | "Uninstalling..." : { 148 | "comment" : "Uninstalling...", 149 | "localizations" : { 150 | "es" : { 151 | "stringUnit" : { 152 | "state" : "translated", 153 | "value" : "Desinstalando..." 154 | } 155 | } 156 | } 157 | }, 158 | "Upgrade" : { 159 | "comment" : "Upgrade", 160 | "localizations" : { 161 | "es" : { 162 | "stringUnit" : { 163 | "state" : "translated", 164 | "value" : "Actualizar" 165 | } 166 | } 167 | } 168 | }, 169 | "version %@" : { 170 | "comment" : "version %@", 171 | "localizations" : { 172 | "es" : { 173 | "stringUnit" : { 174 | "state" : "translated", 175 | "value" : "versión %@" 176 | } 177 | } 178 | } 179 | }, 180 | "Version: %@" : { 181 | "comment" : "Version: %@", 182 | "localizations" : { 183 | "es" : { 184 | "stringUnit" : { 185 | "state" : "translated", 186 | "value" : "Versión %@" 187 | } 188 | } 189 | } 190 | } 191 | }, 192 | "version" : "1.0" 193 | } -------------------------------------------------------------------------------- /Installer/Shared/XPCProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: XPCProtocol.h 3 | // project: OverSight (shared) 4 | // description: protocol for talking to the daemon 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | #ifndef userCommsInterface_h 11 | #define userCommsInterface_h 12 | 13 | @import Foundation; 14 | 15 | @protocol XPCProtocol 16 | 17 | //uninstall 18 | -(void)uninstall:(NSString*)app prefs:(NSString*)prefs reply:(void (^)(NSNumber*))reply; 19 | 20 | //cleanup 21 | // remove self 22 | -(void)cleanup:(void (^)(NSNumber*))reply; 23 | 24 | @end 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Installer/Source/AboutWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: AboutWindowController.h 3 | // project: OverSight (config) 4 | // description: about window display/controller (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Cocoa; 11 | 12 | @interface AboutWindowController : NSWindowController 13 | { 14 | 15 | } 16 | 17 | /* PROPERTIES */ 18 | 19 | //version label/string 20 | @property (weak, atomic) IBOutlet NSTextField *versionLabel; 21 | 22 | //patrons 23 | @property (unsafe_unretained, atomic) IBOutlet NSTextView *patrons; 24 | 25 | //'support us' button 26 | @property (weak, atomic) IBOutlet NSButton *supportUs; 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Installer/Source/AboutWindowController.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: AboutWindowController.m 3 | // project: OverSight (config) 4 | // description: about window display/controller 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | #import "consts.h" 11 | #import "utilities.h" 12 | #import "AboutWindowController.h" 13 | 14 | @implementation AboutWindowController 15 | 16 | @synthesize patrons; 17 | @synthesize supportUs; 18 | @synthesize versionLabel; 19 | 20 | //automatically called when nib is loaded 21 | // center window 22 | -(void)awakeFromNib 23 | { 24 | //center 25 | [self.window center]; 26 | } 27 | 28 | //automatically invoked when window is loaded 29 | // set to white 30 | -(void)windowDidLoad 31 | { 32 | //super 33 | [super windowDidLoad]; 34 | 35 | //not in dark mode? 36 | // make window white 37 | if(YES != isDarkMode()) 38 | { 39 | //make white 40 | self.window.backgroundColor = NSColor.whiteColor; 41 | } 42 | 43 | //set version sting 44 | self.versionLabel.stringValue = [NSString stringWithFormat:NSLocalizedString(@"Version: %@",@"Version: %@"), getAppVersion()]; 45 | 46 | //load patrons 47 | self.patrons.string = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"patrons" ofType:@"txt"] encoding:NSUTF8StringEncoding error:NULL]; 48 | 49 | //make 'support us' default 50 | [self.supportUs setKeyEquivalent:@"\r"]; 51 | 52 | //make first responder 53 | // calling this without a timeout sometimes fails :/ 54 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (100 * NSEC_PER_MSEC)), dispatch_get_main_queue(), ^{ 55 | 56 | //and make it first responder 57 | [self.window makeFirstResponder:self.supportUs]; 58 | 59 | }); 60 | 61 | return; 62 | } 63 | 64 | //automatically invoked when window is closing 65 | // make ourselves unmodal 66 | -(void)windowWillClose:(NSNotification *)notification 67 | { 68 | #pragma unused(notification) 69 | 70 | //make un-modal 71 | [[NSApplication sharedApplication] stopModal]; 72 | 73 | return; 74 | } 75 | 76 | //automatically invoked when user clicks any of the buttons 77 | // load patreon or products webpage in user's default browser 78 | -(IBAction)buttonHandler:(id)sender 79 | { 80 | //support us button 81 | if(((NSButton*)sender).tag == BUTTON_SUPPORT_US) 82 | { 83 | //open URL 84 | // invokes user's default browser 85 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:PATREON_URL]]; 86 | } 87 | 88 | //more info button 89 | else if(((NSButton*)sender).tag == BUTTON_MORE_INFO) 90 | { 91 | //open URL 92 | // invokes user's default browser 93 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:PRODUCT_URL]]; 94 | } 95 | 96 | return; 97 | } 98 | @end 99 | -------------------------------------------------------------------------------- /Installer/Source/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: AppDelegate.h 3 | // project: OverSight (config) 4 | // description: application main/delegate (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Cocoa; 11 | 12 | #import "Configure.h" 13 | #import "HelperComms.h" 14 | #import "AboutWindowController.h" 15 | #import "ConfigureWindowController.h" 16 | 17 | //block for install/uninstall 18 | typedef void (^block)(NSNumber*); 19 | 20 | @interface AppDelegate : NSObject 21 | { 22 | 23 | } 24 | 25 | //main menu 26 | @property (weak, nonatomic)IBOutlet NSMenu *mainMenu; 27 | 28 | //daemom comms object 29 | @property(nonatomic, retain)HelperComms* xpcComms; 30 | 31 | //status msg 32 | @property (nonatomic, weak)IBOutlet NSTextField *statusMsg; 33 | 34 | //about window controller 35 | @property(nonatomic, retain)AboutWindowController* aboutWindowController; 36 | 37 | //configure window controller 38 | @property(nonatomic, retain)ConfigureWindowController* configureWindowController; 39 | 40 | 41 | /* METHODS */ 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Installer/Source/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: AppDelegate.m 3 | // project: OverSight (config) 4 | // description: application main/delegate 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | #import "consts.h" 11 | #import "HelperComms.h" 12 | #import "AppDelegate.h" 13 | 14 | #import "Configure.h" 15 | #import "utilities.h" 16 | #import "AppDelegate.h" 17 | 18 | #import 19 | #import 20 | 21 | @implementation AppDelegate 22 | 23 | @synthesize xpcComms; 24 | @synthesize statusMsg; 25 | @synthesize aboutWindowController; 26 | @synthesize configureWindowController; 27 | 28 | //main app interface 29 | -(void)applicationDidFinishLaunching:(NSNotification *)notification 30 | { 31 | #pragma unused(notification) 32 | 33 | //don't relaunch 34 | [NSApp disableRelaunchOnLogin]; 35 | 36 | //center window 37 | [[[NSApplication sharedApplication] mainWindow] center]; 38 | 39 | //show config window 40 | [self displayConfigureWindow]; 41 | 42 | return; 43 | } 44 | 45 | //handler for menu 46 | -(IBAction)menuHandler:(id)sender 47 | { 48 | //handle selection 49 | switch(((NSButton*)sender).tag) 50 | { 51 | //about 52 | case MENU_ITEM_ABOUT: 53 | { 54 | //show about window 55 | [self displayAboutWindow]; 56 | 57 | break; 58 | } 59 | //quit 60 | case MENU_ITEM_QUIT: 61 | { 62 | //exit 63 | [NSApp terminate:self]; 64 | } 65 | } 66 | 67 | return; 68 | } 69 | 70 | //display configuration window 71 | // kicks off logic for un/install 72 | -(void)displayConfigureWindow 73 | { 74 | //alloc/init 75 | configureWindowController = [[ConfigureWindowController alloc] initWithWindowNibName:@"ConfigureWindowController"]; 76 | 77 | //display it 78 | // call this first to so that outlets are connected 79 | [self.configureWindowController display]; 80 | 81 | //configure it 82 | [self.configureWindowController configure]; 83 | 84 | return; 85 | } 86 | 87 | //menu handler for 'about' 88 | -(void)displayAboutWindow 89 | { 90 | //alloc/init settings window 91 | if(nil == self.aboutWindowController) 92 | { 93 | //alloc/init 94 | aboutWindowController = [[AboutWindowController alloc] initWithWindowNibName:@"AboutWindow"]; 95 | } 96 | 97 | //center window 98 | [[self.aboutWindowController window] center]; 99 | 100 | //show it 101 | [self.aboutWindowController showWindow:self]; 102 | 103 | return; 104 | } 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_16x16.png", 5 | "idiom" : "mac", 6 | "scale" : "1x", 7 | "size" : "16x16" 8 | }, 9 | { 10 | "filename" : "icon_16x16@2x.png", 11 | "idiom" : "mac", 12 | "scale" : "2x", 13 | "size" : "16x16" 14 | }, 15 | { 16 | "filename" : "icon_32x32.png", 17 | "idiom" : "mac", 18 | "scale" : "1x", 19 | "size" : "32x32" 20 | }, 21 | { 22 | "filename" : "icon_32x32@2x.png", 23 | "idiom" : "mac", 24 | "scale" : "2x", 25 | "size" : "32x32" 26 | }, 27 | { 28 | "filename" : "icon_128x128.png", 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "filename" : "icon_128x128@2x.png", 35 | "idiom" : "mac", 36 | "scale" : "2x", 37 | "size" : "128x128" 38 | }, 39 | { 40 | "filename" : "icon_256x256.png", 41 | "idiom" : "mac", 42 | "scale" : "1x", 43 | "size" : "256x256" 44 | }, 45 | { 46 | "filename" : "icon_256x256@2x.png", 47 | "idiom" : "mac", 48 | "scale" : "2x", 49 | "size" : "256x256" 50 | }, 51 | { 52 | "filename" : "icon_512x512.png", 53 | "idiom" : "mac", 54 | "scale" : "1x", 55 | "size" : "512x512" 56 | }, 57 | { 58 | "filename" : "icon_512x512@2x.png", 59 | "idiom" : "mac", 60 | "scale" : "2x", 61 | "size" : "512x512" 62 | } 63 | ], 64 | "info" : { 65 | "author" : "xcode", 66 | "version" : 1 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_128x128.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_16x16.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_256x256.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_32x32.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_512x512.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/DoNotDisturb.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "darkMode 1.png", 5 | "idiom" : "mac" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "light" 12 | } 13 | ], 14 | "filename" : "lightMode.png", 15 | "idiom" : "mac" 16 | }, 17 | { 18 | "appearances" : [ 19 | { 20 | "appearance" : "luminosity", 21 | "value" : "dark" 22 | } 23 | ], 24 | "filename" : "darkMode.png", 25 | "idiom" : "mac" 26 | }, 27 | { 28 | "idiom" : "mac", 29 | "locale" : "es" 30 | }, 31 | { 32 | "appearances" : [ 33 | { 34 | "appearance" : "luminosity", 35 | "value" : "light" 36 | } 37 | ], 38 | "filename" : "lightMode_es.png", 39 | "idiom" : "mac", 40 | "locale" : "es" 41 | }, 42 | { 43 | "appearances" : [ 44 | { 45 | "appearance" : "luminosity", 46 | "value" : "dark" 47 | } 48 | ], 49 | "filename" : "darkMode_es.png", 50 | "idiom" : "mac", 51 | "locale" : "es" 52 | } 53 | ], 54 | "info" : { 55 | "author" : "xcode", 56 | "version" : 1 57 | }, 58 | "properties" : { 59 | "localizable" : true, 60 | "preserves-vector-representation" : true 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/DoNotDisturb.imageset/darkMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/DoNotDisturb.imageset/darkMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/DoNotDisturb.imageset/darkMode_es.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/DoNotDisturb.imageset/darkMode_es.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/DoNotDisturb.imageset/lightMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/DoNotDisturb.imageset/lightMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/DoNotDisturb.imageset/lightMode_es.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/DoNotDisturb.imageset/lightMode_es.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Friends1Password.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "darkMode.png", 5 | "idiom" : "mac" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "light" 12 | } 13 | ], 14 | "filename" : "lightMode.png", 15 | "idiom" : "mac" 16 | }, 17 | { 18 | "appearances" : [ 19 | { 20 | "appearance" : "luminosity", 21 | "value" : "dark" 22 | } 23 | ], 24 | "filename" : "darkMode.png", 25 | "idiom" : "mac" 26 | } 27 | ], 28 | "info" : { 29 | "author" : "xcode", 30 | "version" : 1 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Friends1Password.imageset/darkMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/Friends1Password.imageset/darkMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Friends1Password.imageset/lightMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/Friends1Password.imageset/lightMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsHuntress.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "darkMode.png", 5 | "idiom" : "mac" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "light" 12 | } 13 | ], 14 | "filename" : "lightMode.png", 15 | "idiom" : "mac" 16 | }, 17 | { 18 | "appearances" : [ 19 | { 20 | "appearance" : "luminosity", 21 | "value" : "dark" 22 | } 23 | ], 24 | "filename" : "darkMode.png", 25 | "idiom" : "mac" 26 | } 27 | ], 28 | "info" : { 29 | "author" : "xcode", 30 | "version" : 1 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsHuntress.imageset/darkMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsHuntress.imageset/darkMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsHuntress.imageset/lightMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsHuntress.imageset/lightMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsJamf.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "filename" : "darkMode.png" 6 | }, 7 | { 8 | "idiom" : "mac", 9 | "filename" : "lightMode.png", 10 | "appearances" : [ 11 | { 12 | "appearance" : "luminosity", 13 | "value" : "light" 14 | } 15 | ] 16 | }, 17 | { 18 | "idiom" : "mac", 19 | "filename" : "darkMode.png", 20 | "appearances" : [ 21 | { 22 | "appearance" : "luminosity", 23 | "value" : "dark" 24 | } 25 | ] 26 | } 27 | ], 28 | "info" : { 29 | "version" : 1, 30 | "author" : "xcode" 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsJamf.imageset/darkMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsJamf.imageset/darkMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsJamf.imageset/lightMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsJamf.imageset/lightMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsKandji.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "filename" : "darkMode.png" 6 | }, 7 | { 8 | "idiom" : "mac", 9 | "filename" : "lightMode.png", 10 | "appearances" : [ 11 | { 12 | "appearance" : "luminosity", 13 | "value" : "light" 14 | } 15 | ] 16 | }, 17 | { 18 | "idiom" : "mac", 19 | "filename" : "darkMode.png", 20 | "appearances" : [ 21 | { 22 | "appearance" : "luminosity", 23 | "value" : "dark" 24 | } 25 | ] 26 | } 27 | ], 28 | "info" : { 29 | "version" : 1, 30 | "author" : "xcode" 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsKandji.imageset/darkMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsKandji.imageset/darkMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsKandji.imageset/lightMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsKandji.imageset/lightMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsKolide.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "filename" : "darkMode.png" 6 | }, 7 | { 8 | "idiom" : "mac", 9 | "filename" : "lightMode.png", 10 | "appearances" : [ 11 | { 12 | "appearance" : "luminosity", 13 | "value" : "light" 14 | } 15 | ] 16 | }, 17 | { 18 | "idiom" : "mac", 19 | "filename" : "darkMode.png", 20 | "appearances" : [ 21 | { 22 | "appearance" : "luminosity", 23 | "value" : "dark" 24 | } 25 | ] 26 | } 27 | ], 28 | "info" : { 29 | "version" : 1, 30 | "author" : "xcode" 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsKolide.imageset/darkMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsKolide.imageset/darkMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsKolide.imageset/lightMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsKolide.imageset/lightMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsMacPaw.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "filename" : "darkMode.png" 6 | }, 7 | { 8 | "idiom" : "mac", 9 | "filename" : "lightMode.png", 10 | "appearances" : [ 11 | { 12 | "appearance" : "luminosity", 13 | "value" : "light" 14 | } 15 | ] 16 | }, 17 | { 18 | "idiom" : "mac", 19 | "filename" : "darkMode.png", 20 | "appearances" : [ 21 | { 22 | "appearance" : "luminosity", 23 | "value" : "dark" 24 | } 25 | ] 26 | } 27 | ], 28 | "info" : { 29 | "version" : 1, 30 | "author" : "xcode" 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsMacPaw.imageset/darkMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsMacPaw.imageset/darkMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsMacPaw.imageset/lightMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsMacPaw.imageset/lightMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsMalwarebytes.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "filename" : "malwarebytes.png" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "preserves-vector-representation" : true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsMalwarebytes.imageset/malwarebytes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsMalwarebytes.imageset/malwarebytes.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsMosyle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "darkMode.png", 5 | "idiom" : "mac" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "light" 12 | } 13 | ], 14 | "filename" : "lightMode.png", 15 | "idiom" : "mac" 16 | }, 17 | { 18 | "appearances" : [ 19 | { 20 | "appearance" : "luminosity", 21 | "value" : "dark" 22 | } 23 | ], 24 | "filename" : "darkMode.png", 25 | "idiom" : "mac" 26 | } 27 | ], 28 | "info" : { 29 | "author" : "xcode", 30 | "version" : 1 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsMosyle.imageset/darkMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsMosyle.imageset/darkMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsMosyle.imageset/lightMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsMosyle.imageset/lightMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsPANW.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "darkMode.png", 5 | "idiom" : "mac" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "light" 12 | } 13 | ], 14 | "filename" : "lightMode.png", 15 | "idiom" : "mac" 16 | }, 17 | { 18 | "appearances" : [ 19 | { 20 | "appearance" : "luminosity", 21 | "value" : "dark" 22 | } 23 | ], 24 | "filename" : "darkMode.png", 25 | "idiom" : "mac" 26 | } 27 | ], 28 | "info" : { 29 | "author" : "xcode", 30 | "version" : 1 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsPANW.imageset/darkMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsPANW.imageset/darkMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsPANW.imageset/lightMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsPANW.imageset/lightMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsiVerify.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "filename" : "iVerify.png" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "preserves-vector-representation" : true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/FriendsiVerify.imageset/iVerify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/FriendsiVerify.imageset/iVerify.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac" 5 | }, 6 | { 7 | "appearances" : [ 8 | { 9 | "appearance" : "luminosity", 10 | "value" : "light" 11 | } 12 | ], 13 | "filename" : "icon.png", 14 | "idiom" : "mac" 15 | }, 16 | { 17 | "appearances" : [ 18 | { 19 | "appearance" : "luminosity", 20 | "value" : "dark" 21 | } 22 | ], 23 | "filename" : "icon.png", 24 | "idiom" : "mac" 25 | } 26 | ], 27 | "info" : { 28 | "author" : "xcode", 29 | "version" : 1 30 | }, 31 | "properties" : { 32 | "preserves-vector-representation" : true 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Icon.imageset/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/Icon.imageset/icon.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Love.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "filename" : "heart_light-1.pdf" 6 | }, 7 | { 8 | "idiom" : "mac", 9 | "filename" : "heart_light.pdf", 10 | "appearances" : [ 11 | { 12 | "appearance" : "luminosity", 13 | "value" : "light" 14 | } 15 | ] 16 | }, 17 | { 18 | "idiom" : "mac", 19 | "filename" : "heart_dark.pdf", 20 | "appearances" : [ 21 | { 22 | "appearance" : "luminosity", 23 | "value" : "dark" 24 | } 25 | ] 26 | } 27 | ], 28 | "info" : { 29 | "version" : 1, 30 | "author" : "xcode" 31 | }, 32 | "properties" : { 33 | "preserves-vector-representation" : true 34 | } 35 | } -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Love.imageset/heart_dark.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/Love.imageset/heart_dark.pdf -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Love.imageset/heart_light-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/Love.imageset/heart_light-1.pdf -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Love.imageset/heart_light.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/Love.imageset/heart_light.pdf -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Notifications.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "darkMode.png", 5 | "idiom" : "mac" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "light" 12 | } 13 | ], 14 | "filename" : "lightMode.png", 15 | "idiom" : "mac" 16 | }, 17 | { 18 | "appearances" : [ 19 | { 20 | "appearance" : "luminosity", 21 | "value" : "dark" 22 | } 23 | ], 24 | "filename" : "darkMode.png", 25 | "idiom" : "mac" 26 | }, 27 | { 28 | "idiom" : "mac", 29 | "locale" : "es" 30 | }, 31 | { 32 | "appearances" : [ 33 | { 34 | "appearance" : "luminosity", 35 | "value" : "light" 36 | } 37 | ], 38 | "filename" : "lightMode_es.png", 39 | "idiom" : "mac", 40 | "locale" : "es" 41 | }, 42 | { 43 | "appearances" : [ 44 | { 45 | "appearance" : "luminosity", 46 | "value" : "dark" 47 | } 48 | ], 49 | "filename" : "darkMode_es.png", 50 | "idiom" : "mac", 51 | "locale" : "es" 52 | } 53 | ], 54 | "info" : { 55 | "author" : "xcode", 56 | "version" : 1 57 | }, 58 | "properties" : { 59 | "localizable" : true, 60 | "preserves-vector-representation" : true 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Notifications.imageset/darkMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/Notifications.imageset/darkMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Notifications.imageset/darkMode_es.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/Notifications.imageset/darkMode_es.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Notifications.imageset/lightMode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/Notifications.imageset/lightMode.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/Notifications.imageset/lightMode_es.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/Notifications.imageset/lightMode_es.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/OverSight.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "overSight.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/OverSight.imageset/overSight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/OverSight.imageset/overSight.png -------------------------------------------------------------------------------- /Installer/Source/Assets.xcassets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Installer/Source/Assets.xcassets/icon.png -------------------------------------------------------------------------------- /Installer/Source/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Installer/Source/Configure.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: Configure.h 3 | // project: OverSight (config) 4 | // description: install/uninstall logic (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | #import "HelperComms.h" 11 | #import 12 | 13 | @interface Configure : NSObject 14 | { 15 | 16 | } 17 | 18 | /* PROPERTIES */ 19 | 20 | //error 21 | @property(nonatomic)NSInteger errorCode; 22 | 23 | //helper installed & connected 24 | @property(nonatomic) BOOL gotHelp; 25 | 26 | //daemom comms object 27 | @property(nonatomic, retain) HelperComms* xpcComms; 28 | 29 | /* METHODS */ 30 | 31 | //determine if installed 32 | -(BOOL)isInstalled; 33 | 34 | //old version installed? 35 | -(BOOL)isV1Installed; 36 | 37 | //invokes appropriate install || uninstall logic 38 | -(BOOL)configure:(NSInteger)parameter; 39 | 40 | //install 41 | -(BOOL)install; 42 | 43 | //uninstall 44 | -(BOOL)uninstall:(BOOL)full; 45 | 46 | //remove helper (daemon) 47 | -(BOOL)removeHelper; 48 | 49 | @end 50 | 51 | -------------------------------------------------------------------------------- /Installer/Source/ConfigureWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: ConfigureWindowController.h 3 | // project: OverSight (config) 4 | // description: install/uninstall window logic (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | 11 | @import Cocoa; 12 | 13 | @interface ConfigureWindowController : NSWindowController 14 | { 15 | 16 | } 17 | 18 | /* PROPERTIES */ 19 | 20 | //config object 21 | @property(nonatomic, retain) Configure* configureObj; 22 | 23 | //uninstall button 24 | @property (weak, nonatomic) IBOutlet NSButton *uninstallButton; 25 | 26 | //install button 27 | @property (weak, nonatomic) IBOutlet NSButton *installButton; 28 | 29 | //status msg 30 | @property (weak, nonatomic) IBOutlet NSTextField *statusMsg; 31 | 32 | //debug msg 33 | @property (weak, nonatomic) IBOutlet NSTextField *debugMsg; 34 | 35 | //more info button 36 | @property (weak, nonatomic) IBOutlet NSButton *moreInfoButton; 37 | 38 | //spinner 39 | @property (weak, nonatomic) IBOutlet NSProgressIndicator *activityIndicator; 40 | 41 | /* INFO ABOUT NOTIFICATIONS */ 42 | 43 | //notifications view 44 | @property (strong, nonatomic) IBOutlet NSView *notificationsView; 45 | 46 | //support us 47 | @property (weak, nonatomic) IBOutlet NSButton *gotoDNDView; 48 | 49 | //do not disturb view 50 | @property (strong, nonatomic) IBOutlet NSView *doNotDisturbView; 51 | 52 | //support us 53 | @property (weak, nonatomic) IBOutlet NSButton *gotoSupportView; 54 | 55 | /* SUPPORT US */ 56 | 57 | //support us view 58 | @property (strong, nonatomic) IBOutlet NSView *supportView; 59 | 60 | //support us 61 | @property (weak, nonatomic) IBOutlet NSButton *supportButton; 62 | 63 | //observer for app activation 64 | @property(nonatomic, retain)id appActivationObserver; 65 | 66 | /* METHODS */ 67 | 68 | //install/uninstall button handler 69 | -(IBAction)configureButtonHandler:(id)sender; 70 | 71 | //(more) info button handler 72 | -(IBAction)info:(id)sender; 73 | 74 | //configure window/buttons 75 | -(void)configure; 76 | 77 | //display (show) window 78 | -(void)display; 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /Installer/Source/HelperComms.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: HelperComms.h 3 | // project: OverSight (config) 4 | // description: interface to talk to blessed installer (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Foundation; 11 | 12 | #import "XPCProtocol.h" 13 | 14 | @interface HelperComms : NSObject 15 | 16 | //remote deamon proxy object 17 | @property(nonatomic, retain) id daemon; 18 | 19 | //xpc connection 20 | @property (atomic, strong, readwrite) NSXPCConnection* xpcServiceConnection; 21 | 22 | /* METHODS */ 23 | 24 | //uninstall 25 | -(BOOL)uninstall:(NSString*)prefsDirectory; 26 | 27 | //cleanup 28 | // remove self 29 | -(BOOL)cleanup; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Installer/Source/HelperComms.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: HelperComms.h 3 | // project: OverSight (config) 4 | // description: interface to talk to blessed installer (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | @import OSLog; 11 | @import Foundation; 12 | 13 | #import "consts.h" 14 | #import "AppDelegate.h" 15 | #import "HelperComms.h" 16 | 17 | /* GLOBALS */ 18 | 19 | //log handle 20 | extern os_log_t logHandle; 21 | 22 | @implementation HelperComms 23 | 24 | @synthesize daemon; 25 | @synthesize xpcServiceConnection; 26 | 27 | //init 28 | // create XPC connection & set remote obj interface 29 | -(id)init 30 | { 31 | //super 32 | self = [super init]; 33 | if(nil != self) 34 | { 35 | //alloc/init 36 | xpcServiceConnection = [[NSXPCConnection alloc] initWithMachServiceName:CONFIG_HELPER_ID options:0]; 37 | 38 | //set remote object interface 39 | self.xpcServiceConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(XPCProtocol)]; 40 | 41 | //resume 42 | [self.xpcServiceConnection resume]; 43 | } 44 | 45 | return self; 46 | } 47 | 48 | //uninstall 49 | -(BOOL)uninstall:(NSString*)prefsDirectory 50 | { 51 | //result 52 | __block BOOL result = NO; 53 | 54 | //dbg msg 55 | os_log_debug(logHandle, "invoking 'uninstall' XPC method, with %{public}@", prefsDirectory); 56 | 57 | //uninstall 58 | [[self.xpcServiceConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * proxyError) 59 | { 60 | //err msg 61 | os_log_error(logHandle, "ERROR: failed to execute 'uninstall' method on helper tool (error: %@)", proxyError); 62 | 63 | }] uninstall:[[NSBundle mainBundle] bundlePath] prefs:prefsDirectory reply:^(NSNumber* xpcResult) 64 | { 65 | //capture results 66 | result = [xpcResult boolValue]; 67 | }]; 68 | 69 | return result; 70 | } 71 | 72 | //cleanup 73 | -(BOOL)cleanup 74 | { 75 | //result 76 | __block BOOL result = NO; 77 | 78 | //dbg msg 79 | os_log_debug(logHandle, "invoking 'cleanup' XPC method"); 80 | 81 | //remove 82 | [[(NSXPCConnection*)self.xpcServiceConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * proxyError) 83 | { 84 | //err msg 85 | os_log_error(logHandle, "ERROR: failed to execute 'remove' method on helper tool (error: %@)", proxyError); 86 | 87 | }] cleanup:^(NSNumber* xpcResult) 88 | { 89 | //capture results 90 | result = [xpcResult boolValue]; 91 | }]; 92 | 93 | return result; 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /Installer/Source/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleShortVersionString 16 | $(MARKETING_VERSION) 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright (c) 2020 Objective-See. All rights reserved. 23 | NSMainNibFile 24 | MainMenu 25 | NSPrincipalClass 26 | NSApplication 27 | SMPrivilegedExecutables 28 | 29 | com.objective-see.oversight.uninstallHelper 30 | anchor apple generic and identifier "com.objective-see.oversight.uninstallHelper" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = VBG97UB4TA) 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Installer/Source/Script/configure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # file: configure.sh 5 | # project: OverSight (configure) 6 | # description: v1.* uninstaller logic 7 | # 8 | # created by Patrick Wardle 9 | # copyright (c) 2021 Objective-See. All rights reserved. 10 | # 11 | 12 | #auth check 13 | # gotta be root 14 | if [ "${EUID}" -ne 0 ]; then 15 | echo "" 16 | echo "ERROR: must be run as root" 17 | echo "" 18 | exit -1 19 | fi 20 | 21 | #check args 22 | if [ "$#" -ne 2 ] || ! [ "${1}" == "-uninstall" ]; then 23 | echo "" 24 | echo "ERROR: invalid arguments" 25 | echo "" 26 | exit -1 27 | fi 28 | 29 | #dbg msg 30 | echo "uninstalling" 31 | 32 | #remove application 33 | rm -rf "/Applications/OverSight.app" 34 | 35 | #remove preferences, etc. 36 | if [ -n "$2" ]; then 37 | rm -rf "$2" 38 | fi 39 | 40 | killall "OverSight" 2> /dev/null 41 | killall "com.objective-see.OverSight.helper" 2> /dev/null 42 | killall "OverSight Helper" 2> /dev/null 43 | 44 | #happy 45 | exit 0 46 | -------------------------------------------------------------------------------- /Installer/Source/es.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Copyright (human-readable) */ 2 | "NSHumanReadableCopyright" = "Copyright (c) 2020 Objective-See. Todos los derechos reservados. "; 3 | 4 | -------------------------------------------------------------------------------- /Installer/Source/main.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: main.m 3 | // project: OverSight (config app) 4 | // description: main interface, for config (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | #ifndef main_h 11 | #define main_h 12 | 13 | /* FUNCTION DECLARATIONS */ 14 | 15 | //cmdline interface 16 | // install or uninstall 17 | BOOL cmdlineInterface(int action); 18 | 19 | #endif /* main_h */ 20 | -------------------------------------------------------------------------------- /Installer/Source/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // file: main.m 3 | // project: OverSight (config app) 4 | // description: main interface, for config 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2018 Objective-See. All rights reserved. 8 | // 9 | 10 | @import Cocoa; 11 | @import OSLog; 12 | 13 | #import "main.h" 14 | #import "consts.h" 15 | #import "utilities.h" 16 | #import "Configure.h" 17 | 18 | /* GLOBALS */ 19 | 20 | //log handle 21 | os_log_t logHandle = nil; 22 | 23 | //main interface 24 | int main(int argc, char *argv[]) 25 | { 26 | //status 27 | int status = -1; 28 | 29 | //init log 30 | logHandle = os_log_create(BUNDLE_ID, "installer"); 31 | 32 | //user gotta be admin 33 | if(YES != hasAdminPrivileges()) 34 | { 35 | //show alert 36 | showAlert(NSLocalizedString(@"ERROR: Insuffient Privileges.", @"ERROR: Insuffient Privileges."), NSLocalizedString(@"OverSight can only be installed / run on accounts with administrative privileges", @"OverSight can only be installed / run on accounts with administrative privileges"), NSLocalizedString(@"Exit", @"Exit")); 37 | 38 | //bail 39 | goto bail; 40 | } 41 | 42 | //cmdline install? 43 | if(YES == [NSProcessInfo.processInfo.arguments containsObject:CMD_INSTALL]) 44 | { 45 | //dbg msg 46 | os_log_debug(logHandle, "performing commandline install"); 47 | 48 | //install 49 | if(YES != cmdlineInterface(ACTION_INSTALL_FLAG)) 50 | { 51 | //err msg 52 | printf("\n%s ERROR: install failed\n\n", PRODUCT_NAME.uppercaseString.UTF8String); 53 | 54 | //bail 55 | goto bail; 56 | } 57 | 58 | //dbg msg 59 | printf("%s: install ok!\n\n", PRODUCT_NAME.uppercaseString.UTF8String); 60 | 61 | //happy 62 | status = 0; 63 | 64 | //done 65 | goto bail; 66 | } 67 | 68 | //cmdline uninstall? 69 | else if(YES == [[[NSProcessInfo processInfo] arguments] containsObject:CMD_UNINSTALL]) 70 | { 71 | //dbg msg 72 | os_log_debug(logHandle, "performing commandline uninstall"); 73 | 74 | //install 75 | if(YES != cmdlineInterface(ACTION_UNINSTALL_FLAG)) 76 | { 77 | //err msg 78 | printf("\n%s ERROR: uninstall failed\n\n", PRODUCT_NAME.uppercaseString.UTF8String); 79 | 80 | //bail 81 | goto bail; 82 | } 83 | 84 | //dbg msg 85 | printf("%s: uninstall ok!\n\n", PRODUCT_NAME.uppercaseString.UTF8String); 86 | 87 | //happy 88 | status = 0; 89 | 90 | //done 91 | goto bail; 92 | } 93 | 94 | //default run mode 95 | // just kick off main app logic 96 | status = NSApplicationMain(argc, (const char **)argv); 97 | 98 | bail: 99 | 100 | return status; 101 | } 102 | 103 | //cmdline interface 104 | // install or uninstall 105 | BOOL cmdlineInterface(int action) 106 | { 107 | //flag 108 | BOOL wasConfigured = NO; 109 | 110 | //configure obj 111 | Configure* configure = nil; 112 | 113 | //ignore SIGPIPE 114 | signal(SIGPIPE, SIG_IGN); 115 | 116 | //alloc/init 117 | configure = [[Configure alloc] init]; 118 | 119 | //first check root 120 | if(0 != geteuid()) 121 | { 122 | //err msg 123 | printf("\n%s ERROR: cmdline interface actions require root!\n\n", PRODUCT_NAME.uppercaseString.UTF8String); 124 | 125 | //bail 126 | goto bail; 127 | } 128 | 129 | //configure 130 | wasConfigured = [configure configure:action]; 131 | if(YES != wasConfigured) 132 | { 133 | //bail 134 | goto bail; 135 | } 136 | 137 | 138 | //happy 139 | wasConfigured = YES; 140 | 141 | bail: 142 | 143 | //cleanup 144 | if(nil != configure) 145 | { 146 | //cleanup 147 | [configure removeHelper]; 148 | } 149 | 150 | return wasConfigured; 151 | } 152 | -------------------------------------------------------------------------------- /Installer/Source/mul.lproj/AboutWindow.xcstrings: -------------------------------------------------------------------------------- 1 | { 2 | "sourceLanguage" : "en", 3 | "strings" : { 4 | "6g3-Pg-x3P.title" : { 5 | "comment" : "Class = \"NSButtonCell\"; title = \"Support Us!\"; ObjectID = \"6g3-Pg-x3P\";", 6 | "extractionState" : "extracted_with_value", 7 | "localizations" : { 8 | "en" : { 9 | "stringUnit" : { 10 | "state" : "new", 11 | "value" : "Support Us!" 12 | } 13 | }, 14 | "es" : { 15 | "stringUnit" : { 16 | "state" : "translated", 17 | "value" : "¡Apóyanos!" 18 | } 19 | } 20 | } 21 | }, 22 | "bBK-v0-ypq.title" : { 23 | "comment" : "Class = \"NSTextFieldCell\"; title = \"Version:\"; ObjectID = \"bBK-v0-ypq\";", 24 | "extractionState" : "extracted_with_value", 25 | "localizations" : { 26 | "en" : { 27 | "stringUnit" : { 28 | "state" : "new", 29 | "value" : "Version:" 30 | } 31 | }, 32 | "es" : { 33 | "stringUnit" : { 34 | "state" : "translated", 35 | "value" : "Versión:" 36 | } 37 | } 38 | } 39 | }, 40 | "fJg-qw-wDf.title" : { 41 | "comment" : "Class = \"NSTextFieldCell\"; title = \"Supporters/Patrons:\"; ObjectID = \"fJg-qw-wDf\";", 42 | "extractionState" : "extracted_with_value", 43 | "localizations" : { 44 | "en" : { 45 | "stringUnit" : { 46 | "state" : "new", 47 | "value" : "Supporters/Patrons:" 48 | } 49 | }, 50 | "es" : { 51 | "stringUnit" : { 52 | "state" : "translated", 53 | "value" : "Friends/Patrons:" 54 | } 55 | } 56 | } 57 | }, 58 | "J9x-sM-h9S.title" : { 59 | "comment" : "Class = \"NSButtonCell\"; title = \"More Info\"; ObjectID = \"J9x-sM-h9S\";", 60 | "extractionState" : "extracted_with_value", 61 | "localizations" : { 62 | "en" : { 63 | "stringUnit" : { 64 | "state" : "new", 65 | "value" : "More Info" 66 | } 67 | }, 68 | "es" : { 69 | "stringUnit" : { 70 | "state" : "translated", 71 | "value" : "Más Información" 72 | } 73 | } 74 | } 75 | } 76 | }, 77 | "version" : "1.0" 78 | } -------------------------------------------------------------------------------- /Installer/Source/mul.lproj/ConfigureWindowController.xcstrings: -------------------------------------------------------------------------------- 1 | { 2 | "sourceLanguage" : "en", 3 | "strings" : { 4 | "0wd-cy-xEw.title" : { 5 | "comment" : "Class = \"NSButtonCell\"; title = \"Next »\"; ObjectID = \"0wd-cy-xEw\";", 6 | "extractionState" : "extracted_with_value", 7 | "localizations" : { 8 | "en" : { 9 | "stringUnit" : { 10 | "state" : "new", 11 | "value" : "Next »" 12 | } 13 | }, 14 | "es" : { 15 | "stringUnit" : { 16 | "state" : "translated", 17 | "value" : "Siguiente »" 18 | } 19 | } 20 | } 21 | }, 22 | "1hy-8F-qxt.title" : { 23 | "comment" : "Class = \"NSButtonCell\"; title = \"Install\"; ObjectID = \"1hy-8F-qxt\";", 24 | "extractionState" : "extracted_with_value", 25 | "localizations" : { 26 | "en" : { 27 | "stringUnit" : { 28 | "state" : "new", 29 | "value" : "Install" 30 | } 31 | }, 32 | "es" : { 33 | "stringUnit" : { 34 | "state" : "translated", 35 | "value" : "Instalar" 36 | } 37 | } 38 | } 39 | }, 40 | "8dX-bb-vf1.title" : { 41 | "comment" : "Class = \"NSTextFieldCell\"; title = \"If prompted, please allow OverSight to show notifications, setting the style to \\\"Alerts\\\"\"; ObjectID = \"8dX-bb-vf1\";", 42 | "extractionState" : "extracted_with_value", 43 | "localizations" : { 44 | "en" : { 45 | "stringUnit" : { 46 | "state" : "new", 47 | "value" : "If prompted, please allow OverSight to show notifications, setting the style to \"Alerts\"" 48 | } 49 | }, 50 | "es" : { 51 | "stringUnit" : { 52 | "state" : "translated", 53 | "value" : "Si solicitado, permite que OverSight muestre notificaciones, configurando el estilo en \"Alertas\"" 54 | } 55 | } 56 | } 57 | }, 58 | "DHG-bQ-JvA.title" : { 59 | "comment" : "Class = \"NSButtonCell\"; title = \"Next »\"; ObjectID = \"DHG-bQ-JvA\";", 60 | "extractionState" : "extracted_with_value", 61 | "localizations" : { 62 | "en" : { 63 | "stringUnit" : { 64 | "state" : "new", 65 | "value" : "Next »" 66 | } 67 | }, 68 | "es" : { 69 | "stringUnit" : { 70 | "state" : "translated", 71 | "value" : "Siguiente »" 72 | } 73 | } 74 | } 75 | }, 76 | "E5X-AO-6V1.title" : { 77 | "comment" : "Class = \"NSButtonCell\"; title = \"Yes!\"; ObjectID = \"E5X-AO-6V1\";", 78 | "extractionState" : "extracted_with_value", 79 | "localizations" : { 80 | "en" : { 81 | "stringUnit" : { 82 | "state" : "new", 83 | "value" : "Yes!" 84 | } 85 | }, 86 | "es" : { 87 | "stringUnit" : { 88 | "state" : "translated", 89 | "value" : "¡Sí!" 90 | } 91 | } 92 | } 93 | }, 94 | "G7H-Q1-04P.title" : { 95 | "comment" : "Class = \"NSButtonCell\"; title = \"Uninstall\"; ObjectID = \"G7H-Q1-04P\";", 96 | "extractionState" : "extracted_with_value", 97 | "localizations" : { 98 | "en" : { 99 | "stringUnit" : { 100 | "state" : "new", 101 | "value" : "Uninstall" 102 | } 103 | }, 104 | "es" : { 105 | "stringUnit" : { 106 | "state" : "translated", 107 | "value" : "Desinstalar" 108 | } 109 | } 110 | } 111 | }, 112 | "hLy-Nm-ajB.title" : { 113 | "comment" : "Class = \"NSTextFieldCell\"; title = \"Support OverSight?\"; ObjectID = \"hLy-Nm-ajB\";", 114 | "extractionState" : "extracted_with_value", 115 | "localizations" : { 116 | "en" : { 117 | "stringUnit" : { 118 | "state" : "new", 119 | "value" : "Support OverSight?" 120 | } 121 | }, 122 | "es" : { 123 | "stringUnit" : { 124 | "state" : "translated", 125 | "value" : "¿Apoyas OverSight?" 126 | } 127 | } 128 | } 129 | }, 130 | "Hvk-zS-1VC.title" : { 131 | "comment" : "Class = \"NSTextFieldCell\"; title = \"Show some love? \"; ObjectID = \"Hvk-zS-1VC\";", 132 | "extractionState" : "extracted_with_value", 133 | "localizations" : { 134 | "en" : { 135 | "stringUnit" : { 136 | "state" : "new", 137 | "value" : "Show some love? " 138 | } 139 | }, 140 | "es" : { 141 | "stringUnit" : { 142 | "state" : "translated", 143 | "value" : "¿Nos das tu apoyo?" 144 | } 145 | } 146 | } 147 | }, 148 | "IEz-R9-W5R.title" : { 149 | "comment" : "Class = \"NSButtonCell\"; title = \"No\"; ObjectID = \"IEz-R9-W5R\";", 150 | "extractionState" : "extracted_with_value", 151 | "localizations" : { 152 | "en" : { 153 | "stringUnit" : { 154 | "state" : "new", 155 | "value" : "No" 156 | } 157 | }, 158 | "es" : { 159 | "stringUnit" : { 160 | "state" : "translated", 161 | "value" : "No" 162 | } 163 | } 164 | } 165 | }, 166 | "OYn-6J-Cfb.title" : { 167 | "comment" : "Class = \"NSTextFieldCell\"; title = \"Mahalo to the \\\"Friends Objective-See\\\"\"; ObjectID = \"OYn-6J-Cfb\";", 168 | "extractionState" : "extracted_with_value", 169 | "localizations" : { 170 | "en" : { 171 | "stringUnit" : { 172 | "state" : "new", 173 | "value" : "Mahalo to the \"Friends Objective-See\"" 174 | } 175 | }, 176 | "es" : { 177 | "stringUnit" : { 178 | "state" : "translated", 179 | "value" : "Mahalo a los \"Friends de Objective-See\"" 180 | } 181 | } 182 | } 183 | }, 184 | "WLJ-8f-ExO.title" : { 185 | "comment" : "Class = \"NSTextFieldCell\"; title = \"It's free, open-source, and written by a single (mac-loving) coder!\"; ObjectID = \"WLJ-8f-ExO\";", 186 | "extractionState" : "extracted_with_value", 187 | "localizations" : { 188 | "en" : { 189 | "stringUnit" : { 190 | "state" : "new", 191 | "value" : "It's free, open-source, and written by a single (mac-loving) coder!" 192 | } 193 | }, 194 | "es" : { 195 | "stringUnit" : { 196 | "state" : "translated", 197 | "value" : "Sin cargo, open-source y desarrollado por un único programador (amante de Mac)! " 198 | } 199 | } 200 | } 201 | }, 202 | "zdX-7L-hfX.title" : { 203 | "comment" : "Class = \"NSTextFieldCell\"; title = \"If \\\"Do Not Disturb\\\" mode is activated, OverSight's alerts won't be shown\"; ObjectID = \"zdX-7L-hfX\";", 204 | "extractionState" : "extracted_with_value", 205 | "localizations" : { 206 | "en" : { 207 | "stringUnit" : { 208 | "state" : "new", 209 | "value" : "If \"Do Not Disturb\" mode is activated, OverSight's alerts won't be shown" 210 | } 211 | }, 212 | "es" : { 213 | "stringUnit" : { 214 | "state" : "translated", 215 | "value" : "Si el modo \"No Molestar\" está activado, las alertas de OverSight no se mostrarán" 216 | } 217 | } 218 | } 219 | } 220 | }, 221 | "version" : "1.0" 222 | } -------------------------------------------------------------------------------- /Installer/Source/mul.lproj/MainMenu.xcstrings: -------------------------------------------------------------------------------- 1 | { 2 | "sourceLanguage" : "en", 3 | "strings" : { 4 | "Cgo-Jp-sNo.title" : { 5 | "comment" : "Class = \"NSMenuItem\"; title = \"About OverSight\"; ObjectID = \"Cgo-Jp-sNo\";", 6 | "extractionState" : "extracted_with_value", 7 | "localizations" : { 8 | "en" : { 9 | "stringUnit" : { 10 | "state" : "new", 11 | "value" : "About OverSight" 12 | } 13 | }, 14 | "es" : { 15 | "stringUnit" : { 16 | "state" : "translated", 17 | "value" : "Acerca de OverSight" 18 | } 19 | } 20 | } 21 | }, 22 | "Ihj-A9-cAO.title" : { 23 | "comment" : "Class = \"NSMenuItem\"; title = \"OverSight\"; ObjectID = \"Ihj-A9-cAO\";", 24 | "extractionState" : "extracted_with_value", 25 | "localizations" : { 26 | "en" : { 27 | "stringUnit" : { 28 | "state" : "new", 29 | "value" : "OverSight" 30 | } 31 | }, 32 | "es" : { 33 | "stringUnit" : { 34 | "state" : "translated", 35 | "value" : "OverSight" 36 | } 37 | } 38 | } 39 | }, 40 | "sPv-lJ-f9j.title" : { 41 | "comment" : "Class = \"NSMenu\"; title = \"Main Menu\"; ObjectID = \"sPv-lJ-f9j\";", 42 | "extractionState" : "extracted_with_value", 43 | "localizations" : { 44 | "en" : { 45 | "stringUnit" : { 46 | "state" : "new", 47 | "value" : "Main Menu" 48 | } 49 | }, 50 | "es" : { 51 | "stringUnit" : { 52 | "state" : "translated", 53 | "value" : "Menú Principal" 54 | } 55 | } 56 | } 57 | }, 58 | "VQ8-yZ-1ga.title" : { 59 | "comment" : "Class = \"NSMenu\"; title = \"OverSight\"; ObjectID = \"VQ8-yZ-1ga\";", 60 | "extractionState" : "extracted_with_value", 61 | "localizations" : { 62 | "en" : { 63 | "stringUnit" : { 64 | "state" : "new", 65 | "value" : "OverSight" 66 | } 67 | }, 68 | "es" : { 69 | "stringUnit" : { 70 | "state" : "translated", 71 | "value" : "OverSight" 72 | } 73 | } 74 | } 75 | } 76 | }, 77 | "version" : "1.0" 78 | } -------------------------------------------------------------------------------- /OverSight.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /OverSight.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OverSight 2 | Mac malware often spies on users by recording audio and video sessions...sometimes in an undetected manner. 3 | OverSight monitors a mac's mic and webcam, alerting the user when the internal mic is activated, or whenever a process accesses the webcam: 4 | 5 |

6 | 7 | For more details, see its [product page](https://objective-see.com/products/oversight.html). 8 | -------------------------------------------------------------------------------- /Shared/Consts.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: consts.h 3 | // project: OverSight (shared) 4 | // description: #defines and what not 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2020 Objective-See. All rights reserved. 8 | // 9 | 10 | #ifndef consts_h 11 | #define consts_h 12 | 13 | //start at login 14 | #define PREF_AUTOSTART_MODE @"startAtLogin" 15 | 16 | //disable 'inactive' alerts 17 | #define PREF_DISABLE_INACTIVE @"disableInactive" 18 | 19 | //pref 20 | // execute action 21 | #define PREF_EXECUTE_ACTION @"executeAction" 22 | 23 | //pref 24 | // execution path 25 | #define PREF_EXECUTE_PATH @"executePath" 26 | 27 | //pref 28 | // execute action 29 | #define PREF_EXECUTE_ACTION_ARGS @"executeActionArgs" 30 | 31 | //cs consts 32 | // from: cs_blobs.h 33 | #define CS_VALID 0x00000001 34 | #define CS_ADHOC 0x0000002 35 | #define CS_RUNTIME 0x00010000 36 | 37 | //patreon url 38 | #define PATREON_URL @"https://www.patreon.com/join/objective_see" 39 | 40 | //app name 41 | #define PRODUCT_NAME @"OverSight" 42 | 43 | //bundle ID 44 | #define BUNDLE_ID "com.objective-see.oversight" 45 | 46 | //main app bundle id 47 | #define MAIN_APP_ID @"com.objective-see.oversight" 48 | 49 | //helper (login item) ID 50 | #define HELPER_ID @"com.objective-see.oversight.helper" 51 | 52 | //installer (app) ID 53 | #define INSTALLER_ID @"com.objective-see.oversight.installer" 54 | 55 | //installer (helper) ID 56 | #define CONFIG_HELPER_ID @"com.objective-see.oversight.uninstallHelper" 57 | 58 | //signing auth 59 | #define SIGNING_AUTH @"Developer ID Application: Objective-See, LLC (VBG97UB4TA)" 60 | 61 | //product version url 62 | #define PRODUCT_VERSIONS_URL @"https://objective-see.org/products.json" 63 | 64 | //product url 65 | #define PRODUCT_URL @"https://objective-see.org/products/oversight.html" 66 | 67 | //error(s) url 68 | #define ERRORS_URL @"https://objective-see.org/errors.html" 69 | 70 | //os major 71 | #define SUPPORTED_OS_MAJOR @"OSMajor" 72 | 73 | //os minor 74 | #define SUPPORTED_OS_MINOR @"OSMinor" 75 | 76 | //latest version 77 | #define LATEST_VERSION @"version" 78 | 79 | //close category 80 | #define CATEGORY_CLOSE @"close" 81 | 82 | //action category 83 | #define CATEGORY_ACTION @"action" 84 | 85 | //support us button tag 86 | #define BUTTON_SUPPORT_US 100 87 | 88 | //more info button tag 89 | #define BUTTON_MORE_INFO 101 90 | 91 | //install cmd 92 | #define CMD_INSTALL @"-install" 93 | 94 | //uninstall cmd 95 | #define CMD_UNINSTALL @"-uninstall" 96 | 97 | //install cmd 98 | #define CMD_UPGRADE @"-upgrade" 99 | 100 | //flag to uninstall 101 | #define ACTION_UNINSTALL_FLAG 0 102 | 103 | //flag to install 104 | #define ACTION_INSTALL_FLAG 1 105 | 106 | //flag for partial uninstall 107 | // leave preferences file, etc. 108 | #define UNINSTALL_PARTIAL 0 109 | 110 | //flag for full uninstall 111 | #define UNINSTALL_FULL 1 112 | 113 | //add rule, block 114 | #define BUTTON_BLOCK 0 115 | 116 | //add rule, allow 117 | #define BUTTON_ALLOW 1 118 | 119 | //preferences file 120 | #define PREFERENCES @"/Library/Preferences/com.objective-see.oversight.plist" 121 | 122 | //prefs 123 | // disabled status 124 | #define PREF_IS_DISABLED @"disabled" 125 | 126 | //prefs 127 | // icon mode 128 | #define PREF_NO_ICON_MODE @"noIconMode" 129 | 130 | //prefs 131 | // no external devices mode 132 | #define PREF_NO_EXTERNAL_DEVICES_MODE @"noExternalDevicesMode" 133 | 134 | //prefs 135 | // update mode 136 | #define PREF_NO_UPDATE_MODE @"noupdateMode" 137 | 138 | //allowed items (key) 139 | #define PREFS_ALLOWED_ITEMS @"allowedItems" 140 | 141 | //general error URL 142 | #define FATAL_ERROR_URL @"https://objective-see.org/errors.html" 143 | 144 | //key for exit code 145 | #define EXIT_CODE @"exitCode" 146 | 147 | //rules changed 148 | #define RULES_CHANGED @"com.objective-see.oversight.rulesChanged" 149 | 150 | //first time flag 151 | #define INITIAL_LAUNCH @"-initialLaunch" 152 | 153 | /* INSTALLER */ 154 | 155 | //menu: 'about' 156 | #define MENU_ITEM_ABOUT 0 157 | 158 | //menu: 'quit' 159 | #define MENU_ITEM_QUIT 1 160 | 161 | //app name 162 | #define APP_NAME @"OverSight.app" 163 | 164 | //apps folder 165 | #define APPS_FOLDER @"/Applications" 166 | 167 | //frame shift 168 | // for status msg to avoid activity indicator 169 | #define FRAME_SHIFT 45 170 | 171 | //flag to close 172 | #define ACTION_CLOSE_FLAG -1 173 | 174 | //cmdline flag to uninstall 175 | #define ACTION_UNINSTALL @"-uninstall" 176 | 177 | //uninstall via UI 178 | #define CMD_UNINSTALL_VIA_UI @"-uninstallViaUI" 179 | 180 | //flag to uninstall 181 | #define ACTION_UNINSTALL_FLAG 0 182 | 183 | //cmdline flag to uninstall 184 | #define ACTION_INSTALL @"-install" 185 | 186 | //flag to install 187 | #define ACTION_INSTALL_FLAG 1 188 | 189 | //show info about notifications 190 | #define ACTION_SHOW_NOTIFICATION_VIEW 2 191 | 192 | //show info about do not disturb 193 | #define ACTION_SHOW_DND_VIEW 3 194 | 195 | //show friends 196 | #define ACTION_SHOW_SUPPORT_VIEW 4 197 | 198 | //support us 199 | #define ACTION_SUPPORT 5 200 | 201 | //path to chmod 202 | #define CHMOD @"/bin/chmod" 203 | 204 | //path to xattr 205 | #define XATTR @"/usr/bin/xattr" 206 | 207 | //path to open 208 | #define OPEN @"/usr/bin/open" 209 | 210 | //path to launchctl 211 | #define LAUNCHCTL @"/bin/launchctl" 212 | 213 | //path to kill all 214 | #define KILL_ALL @"/usr/bin/killall" 215 | 216 | //path to shell 217 | #define SHELL @"/bin/bash" 218 | 219 | //path to facetime 220 | #define FACE_TIME @"/System/Applications/FaceTime.app/Contents/MacOS/FaceTime" 221 | 222 | //rules window 223 | #define WINDOW_RULES 0 224 | 225 | //preferences window 226 | #define WINDOW_PREFERENCES 1 227 | 228 | //key for stdout output 229 | #define STDOUT @"stdOutput" 230 | 231 | //key for stderr output 232 | #define STDERR @"stdError" 233 | 234 | //key for exit code 235 | #define EXIT_CODE @"exitCode" 236 | 237 | //event keys 238 | #define EVENT_DEVICE @"device" 239 | #define EVENT_TIMESTAMP @"timeStamp" 240 | #define EVENT_DEVICE_STATUS @"status" 241 | #define EVENT_PROCESS_ID @"processID" 242 | #define EVENT_PROCESS_PATH @"processPath" 243 | 244 | #define NOTIFICATION_ERROR -1 245 | #define NOTIFICATION_SPURIOUS 0 246 | #define NOTIFICATION_SKIPPED 1 247 | #define NOTIFICATION_DELIVER 2 248 | 249 | //av devices 250 | typedef enum {Device_Camera, Device_Microphone} AVDevice; 251 | 252 | //updates 253 | typedef enum {Update_Error, Update_None, Update_NotSupported, Update_Available} UpdateStatus; 254 | 255 | //log levels 256 | typedef enum {Log_Level_Default, Log_Level_Info, Log_Level_Debug} LogLevels; 257 | 258 | #endif 259 | -------------------------------------------------------------------------------- /Shared/Images/overSight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Shared/Images/overSight.png -------------------------------------------------------------------------------- /Shared/Libraries/libFileMonitor.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Shared/Libraries/libFileMonitor.a -------------------------------------------------------------------------------- /Shared/Utilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // file: utilities.h 3 | // project: OverSight (shared) 4 | // description: various helper/utility functions (header) 5 | // 6 | // created by Patrick Wardle 7 | // copyright (c) 2017 Objective-See. All rights reserved. 8 | // 9 | 10 | #ifndef Utilities_h 11 | #define Utilities_h 12 | 13 | #import 14 | #import 15 | 16 | /* FUNCTIONS */ 17 | 18 | //give path to app 19 | // get full path to its binary 20 | NSString* getAppBinary(NSString* appPath); 21 | 22 | //given an app binary 23 | // try get app's bundle 24 | NSBundle* getAppBundle(NSString* binaryPath); 25 | 26 | //get path to (main) app 27 | // login item is in app bundle, so parse up to get main app 28 | NSString* getMainAppPath(void); 29 | 30 | //get app's version 31 | // ->extracted from Info.plist 32 | NSString* getAppVersion(void); 33 | 34 | //get (true) parent 35 | NSDictionary* getRealParent(pid_t pid); 36 | 37 | //extract value from plist 38 | // takes optional wait time... 39 | id getValueFromPlist(NSString* plistFile, NSString* key, BOOL insensitive, float maxWait); 40 | 41 | //find 'top-level' app of binary 42 | // useful to determine if binary (or other app) is embedded in a 'parent' app bundle 43 | NSString* topLevelApp(NSString* binaryPath); 44 | 45 | //verify that an app bundle is 46 | // a) signed 47 | // b) signed with signing auth 48 | OSStatus verifyApp(NSString* path, NSString* signingAuth); 49 | 50 | //get user id of logged in user 51 | uid_t getConsoleUserID(void); 52 | 53 | //check if process is alive 54 | BOOL isProcessAlive(pid_t processID); 55 | 56 | //set dir's|file's group/owner 57 | BOOL setFileOwner(NSString* path, NSNumber* groupID, NSNumber* ownerID, BOOL recursive); 58 | 59 | //set permissions for file 60 | BOOL setFilePermissions(NSString* file, int permissions, BOOL recursive); 61 | 62 | //given a path to binary 63 | // parse it back up to find app's bundle 64 | NSBundle* findAppBundle(NSString* binaryPath); 65 | 66 | //get process's path 67 | NSString* getProcessPath(pid_t pid); 68 | 69 | //get process name 70 | // either via app bundle, or path 71 | NSString* getProcessName(NSString* path); 72 | 73 | //given a process path and user 74 | // return array of all matching pids 75 | NSMutableArray* getProcessIDs(NSString* processPath, int userID); 76 | 77 | //given a pid, get its parent (ppid) 78 | pid_t getParentID(int pid); 79 | 80 | //figure out binary's name 81 | // either via app bundle, or from path 82 | NSString* getBinaryName(NSString* path); 83 | 84 | //enable/disable a menu 85 | void toggleMenu(NSMenu* menu, BOOL shouldEnable); 86 | 87 | //toggle login item 88 | // either add (install) or remove (uninstall) 89 | BOOL toggleLoginItem(NSURL* loginItem, int toggleFlag); 90 | 91 | //get an icon for a process 92 | // for apps, this will be app's icon, otherwise just a standard system one 93 | NSImage* getIconForProcess(NSString* path); 94 | 95 | //wait until a window is non nil 96 | // then make it modal 97 | void makeModal(NSWindowController* windowController); 98 | 99 | //find a process by name 100 | pid_t findProcess(NSString* processName); 101 | 102 | //hash a file (sha256) 103 | NSMutableString* hashFile(NSString* filePath); 104 | 105 | //exec a process with args 106 | // if 'shouldWait' is set, wait and return stdout/in and termination status 107 | NSMutableDictionary* execTask(NSString* binaryPath, NSArray* arguments, BOOL shouldWait, BOOL grabOutput); 108 | 109 | //loads a framework 110 | // note: assumes is in 'Framework' dir 111 | NSBundle* loadFramework(NSString* name); 112 | 113 | //in dark mode? 114 | BOOL isDarkMode(void); 115 | 116 | //check if a file is restricted (SIP) 117 | BOOL isFileRestricted(NSString* file); 118 | 119 | //check if something is nil 120 | // if so, return a default ('unknown') value 121 | NSString* valueForStringItem(NSString* item); 122 | 123 | //determine if path is translocated 124 | // thanks: http://lapcatsoftware.com/articles/detect-app-translocation.html 125 | BOOL isTranslocated(NSString* path); 126 | 127 | //show an alert 128 | NSModalResponse showAlert(NSString* messageText, NSString* informativeText, NSString* buttonTitle); 129 | 130 | //does console user have admin privs? 131 | BOOL hasAdminPrivileges(void); 132 | 133 | //get Do Not Distrub state 134 | BOOL DNDState(void); 135 | 136 | #endif 137 | -------------------------------------------------------------------------------- /Shared/images/objectiveSeeLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Shared/images/objectiveSeeLogo.png -------------------------------------------------------------------------------- /Shared/images/objectiveSeeText.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objective-see/OverSight/58e4a643a32018b861d378ac8b51f4662328f5af/Shared/images/objectiveSeeText.png -------------------------------------------------------------------------------- /Shared/patrons.txt: -------------------------------------------------------------------------------- 1 | Patrons (2^6+): 2 | Jan Koum, Matt Mullenweg, Christian Blümlein, Shain Singh, Andreas Fink, Nuno, Rabi Rob Thomas, Mikhail 3 | 4 | Friends of Objective-See: 5 | Kandji, Jamf, Mosyle, CleanMyMac X, Kolide, Palo Alto Networks, SmugMug, Guardian Mobile Firewall, iVerify, Halo Privacy, The Mitten Mac 6 | -------------------------------------------------------------------------------- /contributors.txt: -------------------------------------------------------------------------------- 1 | patrick wardle 2 | --------------------------------------------------------------------------------