Skip to content

Commit

Permalink
v2.2.1
Browse files Browse the repository at this point in the history
bug fix for #71
  • Loading branch information
objective-see committed Jan 5, 2024
1 parent d252534 commit b60a615
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 27 deletions.
8 changes: 4 additions & 4 deletions Application/Application.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -508,15 +508,15 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Developer ID Application";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.2.0;
CURRENT_PROJECT_VERSION = 2.2.1;
DEVELOPMENT_TEAM = VBG97UB4TA;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = "";
INFOPLIST_FILE = Application/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(LD_RUNPATH_SEARCH_PATHS_$(IS_MACCATALYST)) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.2.0;
MARKETING_VERSION = 2.2.1;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.objective-see.blockblock.helper";
PRODUCT_NAME = "BlockBlock Helper";
Expand All @@ -530,15 +530,15 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Developer ID Application";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.2.0;
CURRENT_PROJECT_VERSION = 2.2.1;
DEVELOPMENT_TEAM = VBG97UB4TA;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = "";
INFOPLIST_FILE = Application/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(LD_RUNPATH_SEARCH_PATHS_$(IS_MACCATALYST)) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.2.0;
MARKETING_VERSION = 2.2.1;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.objective-see.blockblock.helper";
PRODUCT_NAME = "BlockBlock Helper";
Expand Down
8 changes: 4 additions & 4 deletions Daemon/Daemon.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@
CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/Daemon/BlockBlock.entitlements";
CODE_SIGN_IDENTITY = "Developer ID Application";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.2.0;
CURRENT_PROJECT_VERSION = 2.2.1;
DEVELOPMENT_TEAM = VBG97UB4TA;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = "";
Expand All @@ -555,7 +555,7 @@
"$(SDKROOT)/usr/lib/system",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.2.0;
MARKETING_VERSION = 2.2.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = "-DDAEMON_BUILD=1";
PRODUCT_BUNDLE_IDENTIFIER = "com.objective-see.blockblock";
Expand All @@ -572,7 +572,7 @@
CODE_SIGN_ENTITLEMENTS = "$(SRCROOT)/Daemon/BlockBlock.entitlements";
CODE_SIGN_IDENTITY = "Developer ID Application";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.2.0;
CURRENT_PROJECT_VERSION = 2.2.1;
DEVELOPMENT_TEAM = VBG97UB4TA;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = "";
Expand All @@ -584,7 +584,7 @@
"$(SDKROOT)/usr/lib/system",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.2.0;
MARKETING_VERSION = 2.2.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = "-DDAEMON_BUILD=1";
PRODUCT_BUNDLE_IDENTIFIER = "com.objective-see.blockblock";
Expand Down
2 changes: 1 addition & 1 deletion Daemon/Daemon/Event.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ -(NSMutableDictionary*)toAlert
alert[ALERT_PROCESS_NAME] = valueForStringItem(self.process.name);

//add alert msg
alert[ALERT_MESSAGE] = [plugin alertMessage:self];
alert[ALERT_MESSAGE] = [self.plugin alertMessage:self];

//add pid
alert[ALERT_PROCESS_ID] = [NSNumber numberWithUnsignedInt:self.process.pid];
Expand Down
34 changes: 31 additions & 3 deletions Daemon/Daemon/Monitor.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ -(BOOL)start
//flag
BOOL started = NO;

//btm plugin
PluginBase* btmPlugin = nil;

//process plugin
PluginBase* processPlugin = nil;

//events of interest for file monitor
// also pass in process exec/exit to capture args
es_event_type_t events[] = {ES_EVENT_TYPE_NOTIFY_CREATE, ES_EVENT_TYPE_NOTIFY_WRITE, ES_EVENT_TYPE_NOTIFY_RENAME, ES_EVENT_TYPE_NOTIFY_EXEC, ES_EVENT_TYPE_NOTIFY_EXIT};
Expand Down Expand Up @@ -123,11 +129,22 @@ -(BOOL)start
goto bail;
}

//find process plugin
processPlugin = [self findPluginByName:@"Processes"];
if(nil == processPlugin)
{
//err msg
logMsg(LOG_ERR, @"failed to find process plugin");

//bail
goto bail;
}

//alloc
self.processMonitor = [[ProcessMonitor alloc] init];

//start process monitor
if(YES != [self.processMonitor start: [self findPluginByName:@"Process"]])
if(YES != [self.processMonitor start:processPlugin])
{
//err msg
logMsg(LOG_ERR, @"failed to start process monitor");
Expand All @@ -140,11 +157,22 @@ -(BOOL)start
// can use BTM events
if(@available(macOS 14, *))
{
btmPlugin = [self findPluginByName:@"Btm"];
if(nil == btmPlugin)
{
//err msg
logMsg(LOG_ERR, @"failed to find btm plugin");

//bail
goto bail;
}


//alloc
self.btmMonitor = [[BTMMonitor alloc] init];

//start
if(YES != [self.btmMonitor start:[self findPluginByName:@"Btm"]])
if(YES != [self.btmMonitor start:btmPlugin])
{
//err msg
logMsg(LOG_ERR, @"failed to start btm monitor");
Expand Down
2 changes: 1 addition & 1 deletion Daemon/Daemon/Monitors/ProcessMonitor.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ -(BOOL)start:(PluginBase*)plugin

//dbg msg
logMsg(LOG_DEBUG, @"starting process monitor...");

//create client
// and handle process (auth exec) events
result = es_new_client(&_endpointClient, ^(es_client_t *client, const es_message_t *message)
Expand Down
10 changes: 5 additions & 5 deletions Daemon/Daemon/Plugins/Btm.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
//user client
extern XPCUserClient* xpcUserClient;


@implementation Btm

//init
Expand Down Expand Up @@ -52,10 +51,10 @@ -(NSString*)alertMessage:(Event*)event
//init alert based on btm type
switch(event.esMessage->event.btm_launch_item_add->item->item_type)
{
//user item
//user item (is ingored for now)
//case ES_BTM_ITEM_TYPE_USER_ITEM:
// alert = @"installed a user item";
// break;
//alert = @"installed a user item";
//break;

//app / login item
case ES_BTM_ITEM_TYPE_APP:
Expand All @@ -73,8 +72,9 @@ -(NSString*)alertMessage:(Event*)event
alert = @"installed a launch daemon";
break;

//default
default:
;
alert = [NSString stringWithFormat:@"installed an background item of unknown type (%d)", event.esMessage->event.btm_launch_item_add->item->item_type];
}

return alert;
Expand Down
18 changes: 9 additions & 9 deletions Installer/Installer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#archive build\nif [[ $BUILT_PRODUCTS_DIR = *\"ArchiveIntermediates\"* ]]; then\n cp -R -f \"$PROJECT_TEMP_ROOT/UninstalledProducts/macosx/BlockBlock.app\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources\"\n cp -R -f \"$PROJECT_TEMP_ROOT/UninstalledProducts/macosx/BlockBlock Helper.app\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources\"\n \n#normal build\nelse\n\nrm -rf \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources/BlockBlock.app\"\nrm -rf \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources/BlockBlock Helper.app\"\n\n#cp daemon/app\ncp -R -f \"$BUILT_PRODUCTS_DIR/BlockBlock.app\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources\"\ncp -R -f \"$BUILT_PRODUCTS_DIR/BlockBlock Helper.app\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources\"\n\nfi\n\n";
shellScript = "#archive build\nif [[ $BUILT_PRODUCTS_DIR = *\"ArchiveIntermediates\"* ]]; then\n cp -R -f \"$PROJECT_TEMP_ROOT/UninstalledProducts/macosx/BlockBlock.app\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources\"\n cp -R -f \"$PROJECT_TEMP_ROOT/UninstalledProducts/macosx/BlockBlock Helper.app\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources\"\n \n#normal build\nelse\n\nrm -rf \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources/BlockBlock.app\"\nrm -rf \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources/BlockBlock Helper.app\"\n\n#cp daemon/app\ncp -R -f \"$BUILT_PRODUCTS_DIR/BlockBlock.app\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources\"\ncp -R -f \"$BUILT_PRODUCTS_DIR/BlockBlock Helper.app\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Resources\"\n\nfi\n\n\n\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -399,14 +399,14 @@
CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2.2.0;
CURRENT_PROJECT_VERSION = 2.2.1;
DEVELOPMENT_TEAM = VBG97UB4TA;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO;
INFOPLIST_FILE = Helper/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.2.0;
MARKETING_VERSION = 2.2.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_CODE_SIGN_FLAGS = "";
OTHER_LDFLAGS = (
Expand Down Expand Up @@ -434,14 +434,14 @@
CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2.2.0;
CURRENT_PROJECT_VERSION = 2.2.1;
DEVELOPMENT_TEAM = VBG97UB4TA;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO;
INFOPLIST_FILE = Helper/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.2.0;
MARKETING_VERSION = 2.2.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_CODE_SIGN_FLAGS = "";
OTHER_LDFLAGS = (
Expand Down Expand Up @@ -470,7 +470,7 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.2.0;
CURRENT_PROJECT_VERSION = 2.2.1;
DEVELOPMENT_TEAM = VBG97UB4TA;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = "";
Expand All @@ -479,7 +479,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(LD_RUNPATH_SEARCH_PATHS_$(IS_MACCATALYST)) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.2.0;
MARKETING_VERSION = 2.2.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_CODE_SIGN_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.objective-see.blockblock.installer";
Expand All @@ -497,7 +497,7 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.2.0;
CURRENT_PROJECT_VERSION = 2.2.1;
DEVELOPMENT_TEAM = VBG97UB4TA;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = "";
Expand All @@ -506,7 +506,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(LD_RUNPATH_SEARCH_PATHS_$(IS_MACCATALYST)) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.2.0;
MARKETING_VERSION = 2.2.1;
OTHER_CODE_SIGN_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.objective-see.blockblock.installer";
PRODUCT_NAME = "BlockBlock Installer";
Expand Down

0 comments on commit b60a615

Please sign in to comment.