From 6190e7851d26c088209661f384334dec292e3c2e Mon Sep 17 00:00:00 2001 From: Patrick Wardle Date: Fri, 7 Jul 2023 18:41:02 +0200 Subject: [PATCH] v2.4.2: Removed error reporting Error reporting made the build process more involved, introduced external dependencies, and was causing crashes on older versions of macOS. --- Cartfile | 1 - Cartfile.resolved | 1 - Consts.h | 6 ------ KnockKnock.xcodeproj/project.pbxproj | 14 ++++---------- Utilities.m | 21 ++------------------- main.m | 11 ----------- 6 files changed, 6 insertions(+), 48 deletions(-) delete mode 100644 Cartfile delete mode 100644 Cartfile.resolved diff --git a/Cartfile b/Cartfile deleted file mode 100644 index f56b57d..0000000 --- a/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "getsentry/sentry-cocoa" "8.4.0" diff --git a/Cartfile.resolved b/Cartfile.resolved deleted file mode 100644 index f56b57d..0000000 --- a/Cartfile.resolved +++ /dev/null @@ -1 +0,0 @@ -github "getsentry/sentry-cocoa" "8.4.0" diff --git a/Consts.h b/Consts.h index 53f6289..5b2956b 100755 --- a/Consts.h +++ b/Consts.h @@ -18,12 +18,6 @@ //supported plugins static NSString * const SUPPORTED_PLUGINS[] = {@"AuthorizationPlugins", @"BrowserExtensions", @"BTM", @"CronJobs", @"DirectoryServicesPlugins", @"EventRules", @"Extensions", @"Kexts", @"LaunchItems", @"DylibInserts", @"DylibProxies", @"LoginItems", @"LogInOutHooks", @"PeriodicScripts", @"QuicklookPlugins", @"SpotlightImporters", @"StartupScripts", @"SystemExtensions"}; -//static NSString * const SUPPORTED_PLUGINS[] = {@"BTM"}; - - -//sentry crash reporting URL -#define SENTRY_DSN @"https://ba5d094e87014a529b25d90bae010b1c@sentry.io/1321683" - //button text, start scan #define START_SCAN @"Start Scan" diff --git a/KnockKnock.xcodeproj/project.pbxproj b/KnockKnock.xcodeproj/project.pbxproj index 5994123..d71c1ec 100755 --- a/KnockKnock.xcodeproj/project.pbxproj +++ b/KnockKnock.xcodeproj/project.pbxproj @@ -47,8 +47,6 @@ CD6BBBEB1B50DF7100506D0D /* signedAppleIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = CD6BBBEA1B50DF7100506D0D /* signedAppleIcon.png */; }; CD6BBBED1B51C62B00506D0D /* unknown.png in Resources */ = {isa = PBXBuildFile; fileRef = CD6BBBEC1B51C62B00506D0D /* unknown.png */; }; CD6BBBF01B52032D00506D0D /* NSApplicationKeyEvents.m in Sources */ = {isa = PBXBuildFile; fileRef = CD6BBBEF1B52032D00506D0D /* NSApplicationKeyEvents.m */; }; - CD6DE4D1219E9AD30058094E /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD6DE4D0219E9AD30058094E /* Sentry.framework */; }; - CD6DE4D3219E9C560058094E /* Sentry.framework in Copy Framework(s) */ = {isa = PBXBuildFile; fileRef = CD6DE4D0219E9AD30058094E /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; CD7B9F4D1ACB959200DF3C71 /* logoAppleOver.png in Resources */ = {isa = PBXBuildFile; fileRef = CD7B9F4C1ACB959200DF3C71 /* logoAppleOver.png */; }; CD7B9F531ACBAE2900DF3C71 /* SpotlightImporters.m in Sources */ = {isa = PBXBuildFile; fileRef = CD7B9F521ACBAE2900DF3C71 /* SpotlightImporters.m */; }; CD7B9FA41ACBCFAD00DF3C71 /* spotlightIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = CD7B9FA31ACBCFAD00DF3C71 /* spotlightIcon.png */; }; @@ -140,7 +138,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - CD6DE4D3219E9C560058094E /* Sentry.framework in Copy Framework(s) */, ); name = "Copy Framework(s)"; runOnlyForDeploymentPostprocessing = 0; @@ -209,7 +206,6 @@ CD6BBBEC1B51C62B00506D0D /* unknown.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = unknown.png; path = images/unknown.png; sourceTree = SOURCE_ROOT; }; CD6BBBEE1B52032D00506D0D /* NSApplicationKeyEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSApplicationKeyEvents.h; sourceTree = ""; }; CD6BBBEF1B52032D00506D0D /* NSApplicationKeyEvents.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSApplicationKeyEvents.m; sourceTree = ""; }; - CD6DE4D0219E9AD30058094E /* Sentry.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sentry.framework; path = Carthage/Build/Mac/Sentry.framework; sourceTree = ""; }; CD7B9F4C1ACB959200DF3C71 /* logoAppleOver.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = logoAppleOver.png; path = images/logoAppleOver.png; sourceTree = SOURCE_ROOT; }; CD7B9F511ACBAE2900DF3C71 /* SpotlightImporters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SpotlightImporters.h; path = Plugins/SpotlightImporters.h; sourceTree = ""; }; CD7B9F521ACBAE2900DF3C71 /* SpotlightImporters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SpotlightImporters.m; path = Plugins/SpotlightImporters.m; sourceTree = ""; }; @@ -336,7 +332,6 @@ files = ( CDCA2C212A49B71500E8DD57 /* libDumpBTM.a in Frameworks */, CDBE491A1B5B25E30031FC22 /* SystemConfiguration.framework in Frameworks */, - CD6DE4D1219E9AD30058094E /* Sentry.framework in Frameworks */, CDBFE3992A49B8B9005A9819 /* libDumpBTM.a in Frameworks */, CDDBC2301B04771100B021E0 /* ServiceManagement.framework in Frameworks */, CDF08CEA1AC8D97B009B3423 /* Quartz.framework in Frameworks */, @@ -388,7 +383,6 @@ isa = PBXGroup; children = ( CDCA2C202A49B71500E8DD57 /* libDumpBTM.a */, - CD6DE4D0219E9AD30058094E /* Sentry.framework */, CDBE49191B5B25E30031FC22 /* SystemConfiguration.framework */, CDDBC22F1B04771100B021E0 /* ServiceManagement.framework */, CDF08CE91AC8D97B009B3423 /* Quartz.framework */, @@ -968,7 +962,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 2.4.1; + CURRENT_PROJECT_VERSION = 2.4.2; DEVELOPMENT_TEAM = VBG97UB4TA; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -985,7 +979,7 @@ "$(PROJECT_DIR)/Libraries/BTM", ); MACOSX_DEPLOYMENT_TARGET = 10.11; - MARKETING_VERSION = 2.4.1; + MARKETING_VERSION = 2.4.2; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.objective-see.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = KnockKnock; @@ -1002,7 +996,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 2.4.1; + CURRENT_PROJECT_VERSION = 2.4.2; DEVELOPMENT_TEAM = VBG97UB4TA; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -1019,7 +1013,7 @@ "$(PROJECT_DIR)/Libraries/BTM", ); MACOSX_DEPLOYMENT_TARGET = 10.11; - MARKETING_VERSION = 2.4.1; + MARKETING_VERSION = 2.4.2; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.objective-see.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = KnockKnock; diff --git a/Utilities.m b/Utilities.m index 2d1c4ee..d930bf6 100755 --- a/Utilities.m +++ b/Utilities.m @@ -40,26 +40,9 @@ SInt32 getVersion(OSType selector) return version; } -//disable std err -void disableSTDERR(void) -{ - //file handle - int devNull = -1; - - //open /dev/null - devNull = open("/dev/null", O_RDWR); - - //dup - dup2(devNull, STDERR_FILENO); - - //close - close(devNull); - - return; -} //get name of logged in user -NSString* getConsoleUser() +NSString* getConsoleUser(void) { //copy/return user return CFBridgingRelease(SCDynamicStoreCopyConsoleUser(NULL, NULL, NULL)); @@ -67,7 +50,7 @@ void disableSTDERR(void) //get all user // includes name/home directory -NSMutableDictionary* allUsers() +NSMutableDictionary* allUsers(void) { //users NSMutableDictionary* users = nil; diff --git a/main.m b/main.m index c5fbaa6..f6c7628 100755 --- a/main.m +++ b/main.m @@ -6,7 +6,6 @@ // Copyright (c) 2015 Objective-See. All rights reserved. // -@import Sentry; #import "main.h" int main(int argc, char *argv[]) @@ -16,16 +15,6 @@ int main(int argc, char *argv[]) @autoreleasepool { - //disable stderr - // sentry dumps to this, and we want only JSON to output... - disableSTDERR(); - - //init crash reporting - [SentrySDK startWithConfigureOptions:^(SentryOptions *options) { - options.dsn = SENTRY_DSN; - options.debug = YES; - }]; - //handle '-h' or '-help' if( (YES == [[[NSProcessInfo processInfo] arguments] containsObject:@"-h"]) || (YES == [[[NSProcessInfo processInfo] arguments] containsObject:@"-help"]) )