From 1fb6ec4a6f274367928a68321f3790852bfedf31 Mon Sep 17 00:00:00 2001 From: Chen Yihu Date: Fri, 12 Oct 2018 17:51:04 +0800 Subject: [PATCH 1/2] Add macOS support. --- Logan.podspec | 1 + Logan/iOS/Logan.m | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/Logan.podspec b/Logan.podspec index c6b4a1e..d8cb2c0 100644 --- a/Logan.podspec +++ b/Logan.podspec @@ -9,6 +9,7 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/Meituan-Dianping/Logan.git', :tag => s.version.to_s } s.ios.deployment_target = '8.0' + s.osx.deployment_target = '10.9' s.source_files = "Logan/iOS/*", "Logan/Clogan/*.{h,c}" diff --git a/Logan/iOS/Logan.m b/Logan/iOS/Logan.m index 0362863..9cb9ee5 100644 --- a/Logan/iOS/Logan.m +++ b/Logan/iOS/Logan.m @@ -25,6 +25,12 @@ #include #include "clogan_core.h" +#if TARGET_OS_IPHONE +#import +#else /* if TARGET_OS_IPHONE */ +#import +#endif /* if TARGET_OS_IPHONE */ + BOOL LOGANUSEASL = NO; NSData *__AES_KEY; NSData *__AES_IV; @@ -254,9 +260,20 @@ NSString *_Nonnull loganTodaysDate(void) { } #pragma mark - notification - (void)addNotification { + // App Extension + if ( [[[NSBundle mainBundle] bundlePath] hasSuffix:@".appex"] ) { + return ; + } +#if TARGET_OS_IPHONE [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillEnterForeground) name:UIApplicationWillEnterForegroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillTerminate) name:UIApplicationWillTerminateNotification object:nil]; +#else /* if TARGET_OS_IPHONE */ + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillEnterForeground) name:NSApplicationWillBecomeActiveNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidEnterBackground) name:NSApplicationDidResignActiveNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillTerminate) name:NSApplicationWillTerminateNotification object:nil]; +#endif /* if TARGET_OS_IPHONE */ + } - (void)appWillResignActive { From bf4ea34d53e7a81525852fd7e7c81ba4d6dd3479 Mon Sep 17 00:00:00 2001 From: Chen Yihu Date: Sat, 13 Oct 2018 22:41:50 +0800 Subject: [PATCH 2/2] Add macOS example. --- .../Logan-macOS.xcodeproj/project.pbxproj | 542 +++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + Example/Logan-macOS/Logan-macOS/AppDelegate.h | 29 + Example/Logan-macOS/Logan-macOS/AppDelegate.m | 117 +++ .../AppIcon.appiconset/Contents.json | 58 ++ .../Logan-macOS/Assets.xcassets/Contents.json | 6 + .../Logan-macOS/Base.lproj/MainMenu.xib | 758 ++++++++++++++++++ Example/Logan-macOS/Logan-macOS/Info.plist | 32 + .../Logan-macOS/Logan_macOS.entitlements | 10 + Example/Logan-macOS/Logan-macOS/main.m | 27 + .../Logan-macOS/Logan-macOSTests/Info.plist | 22 + .../Logan-macOSTests/Logan_macOSTests.m | 51 ++ Logan/clogan.xcodeproj/project.pbxproj | 252 ++++++ Logan/iOS/Logan.m | 8 +- 15 files changed, 1923 insertions(+), 4 deletions(-) create mode 100644 Example/Logan-macOS/Logan-macOS.xcodeproj/project.pbxproj create mode 100644 Example/Logan-macOS/Logan-macOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Example/Logan-macOS/Logan-macOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Example/Logan-macOS/Logan-macOS/AppDelegate.h create mode 100644 Example/Logan-macOS/Logan-macOS/AppDelegate.m create mode 100644 Example/Logan-macOS/Logan-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Example/Logan-macOS/Logan-macOS/Assets.xcassets/Contents.json create mode 100644 Example/Logan-macOS/Logan-macOS/Base.lproj/MainMenu.xib create mode 100644 Example/Logan-macOS/Logan-macOS/Info.plist create mode 100644 Example/Logan-macOS/Logan-macOS/Logan_macOS.entitlements create mode 100644 Example/Logan-macOS/Logan-macOS/main.m create mode 100644 Example/Logan-macOS/Logan-macOSTests/Info.plist create mode 100644 Example/Logan-macOS/Logan-macOSTests/Logan_macOSTests.m diff --git a/Example/Logan-macOS/Logan-macOS.xcodeproj/project.pbxproj b/Example/Logan-macOS/Logan-macOS.xcodeproj/project.pbxproj new file mode 100644 index 0000000..83a3c67 --- /dev/null +++ b/Example/Logan-macOS/Logan-macOS.xcodeproj/project.pbxproj @@ -0,0 +1,542 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 84C23A9A217233F400588A19 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C23A99217233F400588A19 /* AppDelegate.m */; }; + 84C23A9C217233F600588A19 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84C23A9B217233F600588A19 /* Assets.xcassets */; }; + 84C23A9F217233F600588A19 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 84C23A9D217233F600588A19 /* MainMenu.xib */; }; + 84C23AA2217233F600588A19 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C23AA1217233F600588A19 /* main.m */; }; + 84C23AAD217233F600588A19 /* Logan_macOSTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C23AAC217233F600588A19 /* Logan_macOSTests.m */; }; + 84C23BB62172382B00588A19 /* Logan.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C23BB22172382B00588A19 /* Logan.m */; }; + 84C23C1821723A6B00588A19 /* libclogan-macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84C23C1721723A6800588A19 /* libclogan-macOS.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 84C23AA9217233F600588A19 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 84C23A8D217233F400588A19 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 84C23A94217233F400588A19; + remoteInfo = "Logan-macOS"; + }; + 84C23ABC2172343E00588A19 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 84C23AB72172343D00588A19 /* clogan.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = A7C4885B20F74AC5001F74C0; + remoteInfo = clogan; + }; + 84C23AC02172345200588A19 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 84C23AB72172343D00588A19 /* clogan.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 84C23BB921723A1900588A19; + remoteInfo = "clogan-macOS"; + }; + 84C23C1621723A6800588A19 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 84C23AB72172343D00588A19 /* clogan.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 84C23C1421723A1900588A19; + remoteInfo = "clogan-macOS"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 84C23A95217233F400588A19 /* Logan-macOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Logan-macOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 84C23A98217233F400588A19 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 84C23A99217233F400588A19 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 84C23A9B217233F600588A19 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 84C23A9E217233F600588A19 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 84C23AA0217233F600588A19 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 84C23AA1217233F600588A19 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 84C23AA3217233F600588A19 /* Logan_macOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Logan_macOS.entitlements; sourceTree = ""; }; + 84C23AA8217233F600588A19 /* Logan-macOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Logan-macOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 84C23AAC217233F600588A19 /* Logan_macOSTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Logan_macOSTests.m; sourceTree = ""; }; + 84C23AAE217233F600588A19 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 84C23AB72172343D00588A19 /* clogan.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = clogan.xcodeproj; path = ../../../Logan/clogan.xcodeproj; sourceTree = ""; }; + 84C23BB12172382B00588A19 /* Logan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Logan.h; sourceTree = ""; }; + 84C23BB22172382B00588A19 /* Logan.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Logan.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 84C23A92217233F400588A19 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 84C23C1821723A6B00588A19 /* libclogan-macOS.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 84C23AA5217233F600588A19 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 84C23A8C217233F400588A19 = { + isa = PBXGroup; + children = ( + 84C23A97217233F400588A19 /* Logan-macOS */, + 84C23AAB217233F600588A19 /* Logan-macOSTests */, + 84C23A96217233F400588A19 /* Products */, + 84C23BB72172397F00588A19 /* Frameworks */, + ); + sourceTree = ""; + }; + 84C23A96217233F400588A19 /* Products */ = { + isa = PBXGroup; + children = ( + 84C23A95217233F400588A19 /* Logan-macOS.app */, + 84C23AA8217233F600588A19 /* Logan-macOSTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 84C23A97217233F400588A19 /* Logan-macOS */ = { + isa = PBXGroup; + children = ( + 84C23BB02172382B00588A19 /* iOS */, + 84C23AB72172343D00588A19 /* clogan.xcodeproj */, + 84C23A98217233F400588A19 /* AppDelegate.h */, + 84C23A99217233F400588A19 /* AppDelegate.m */, + 84C23A9B217233F600588A19 /* Assets.xcassets */, + 84C23A9D217233F600588A19 /* MainMenu.xib */, + 84C23AA0217233F600588A19 /* Info.plist */, + 84C23AA1217233F600588A19 /* main.m */, + 84C23AA3217233F600588A19 /* Logan_macOS.entitlements */, + ); + path = "Logan-macOS"; + sourceTree = ""; + }; + 84C23AAB217233F600588A19 /* Logan-macOSTests */ = { + isa = PBXGroup; + children = ( + 84C23AAC217233F600588A19 /* Logan_macOSTests.m */, + 84C23AAE217233F600588A19 /* Info.plist */, + ); + path = "Logan-macOSTests"; + sourceTree = ""; + }; + 84C23AB82172343D00588A19 /* Products */ = { + isa = PBXGroup; + children = ( + 84C23ABD2172343E00588A19 /* libclogan.a */, + 84C23C1721723A6800588A19 /* libclogan-macOS.a */, + ); + name = Products; + sourceTree = ""; + }; + 84C23BB02172382B00588A19 /* iOS */ = { + isa = PBXGroup; + children = ( + 84C23BB12172382B00588A19 /* Logan.h */, + 84C23BB22172382B00588A19 /* Logan.m */, + ); + name = iOS; + path = ../../../Logan/iOS; + sourceTree = ""; + }; + 84C23BB72172397F00588A19 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 84C23A94217233F400588A19 /* Logan-macOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 84C23AB1217233F600588A19 /* Build configuration list for PBXNativeTarget "Logan-macOS" */; + buildPhases = ( + 84C23A91217233F400588A19 /* Sources */, + 84C23A92217233F400588A19 /* Frameworks */, + 84C23A93217233F400588A19 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 84C23AC12172345200588A19 /* PBXTargetDependency */, + ); + name = "Logan-macOS"; + productName = "Logan-macOS"; + productReference = 84C23A95217233F400588A19 /* Logan-macOS.app */; + productType = "com.apple.product-type.application"; + }; + 84C23AA7217233F600588A19 /* Logan-macOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 84C23AB4217233F600588A19 /* Build configuration list for PBXNativeTarget "Logan-macOSTests" */; + buildPhases = ( + 84C23AA4217233F600588A19 /* Sources */, + 84C23AA5217233F600588A19 /* Frameworks */, + 84C23AA6217233F600588A19 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 84C23AAA217233F600588A19 /* PBXTargetDependency */, + ); + name = "Logan-macOSTests"; + productName = "Logan-macOSTests"; + productReference = 84C23AA8217233F600588A19 /* Logan-macOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 84C23A8D217233F400588A19 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1000; + ORGANIZATIONNAME = "Chen Yihu"; + TargetAttributes = { + 84C23A94217233F400588A19 = { + CreatedOnToolsVersion = 10.0; + }; + 84C23AA7217233F600588A19 = { + CreatedOnToolsVersion = 10.0; + TestTargetID = 84C23A94217233F400588A19; + }; + }; + }; + buildConfigurationList = 84C23A90217233F400588A19 /* Build configuration list for PBXProject "Logan-macOS" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 84C23A8C217233F400588A19; + productRefGroup = 84C23A96217233F400588A19 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 84C23AB82172343D00588A19 /* Products */; + ProjectRef = 84C23AB72172343D00588A19 /* clogan.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 84C23A94217233F400588A19 /* Logan-macOS */, + 84C23AA7217233F600588A19 /* Logan-macOSTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 84C23ABD2172343E00588A19 /* libclogan.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libclogan.a; + remoteRef = 84C23ABC2172343E00588A19 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 84C23C1721723A6800588A19 /* libclogan-macOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libclogan-macOS.a"; + remoteRef = 84C23C1621723A6800588A19 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 84C23A93217233F400588A19 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 84C23A9C217233F600588A19 /* Assets.xcassets in Resources */, + 84C23A9F217233F600588A19 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 84C23AA6217233F600588A19 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 84C23A91217233F400588A19 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 84C23BB62172382B00588A19 /* Logan.m in Sources */, + 84C23AA2217233F600588A19 /* main.m in Sources */, + 84C23A9A217233F400588A19 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 84C23AA4217233F600588A19 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 84C23AAD217233F600588A19 /* Logan_macOSTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 84C23AAA217233F600588A19 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 84C23A94217233F400588A19 /* Logan-macOS */; + targetProxy = 84C23AA9217233F600588A19 /* PBXContainerItemProxy */; + }; + 84C23AC12172345200588A19 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "clogan-macOS"; + targetProxy = 84C23AC02172345200588A19 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 84C23A9D217233F600588A19 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 84C23A9E217233F600588A19 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 84C23AAF217233F600588A19 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "../../Logan/Clogan/**", + "../../Logan/mbedtls/include/**", + ); + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 84C23AB0217233F600588A19 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "../../Logan/Clogan/**", + "../../Logan/mbedtls/include/**", + ); + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + }; + name = Release; + }; + 84C23AB2217233F600588A19 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "Logan-macOS/Logan_macOS.entitlements"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "Logan-macOS/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.Logan-macOS-Example.Logan-macOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 84C23AB3217233F600588A19 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "Logan-macOS/Logan_macOS.entitlements"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "Logan-macOS/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.Logan-macOS-Example.Logan-macOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 84C23AB5217233F600588A19 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "Logan-macOSTests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.Logan-macOS-Example.Logan-macOSTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Logan-macOS.app/Contents/MacOS/Logan-macOS"; + }; + name = Debug; + }; + 84C23AB6217233F600588A19 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = "Logan-macOSTests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.Logan-macOS-Example.Logan-macOSTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Logan-macOS.app/Contents/MacOS/Logan-macOS"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 84C23A90217233F400588A19 /* Build configuration list for PBXProject "Logan-macOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 84C23AAF217233F600588A19 /* Debug */, + 84C23AB0217233F600588A19 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 84C23AB1217233F600588A19 /* Build configuration list for PBXNativeTarget "Logan-macOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 84C23AB2217233F600588A19 /* Debug */, + 84C23AB3217233F600588A19 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 84C23AB4217233F600588A19 /* Build configuration list for PBXNativeTarget "Logan-macOSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 84C23AB5217233F600588A19 /* Debug */, + 84C23AB6217233F600588A19 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 84C23A8D217233F400588A19 /* Project object */; +} diff --git a/Example/Logan-macOS/Logan-macOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/Logan-macOS/Logan-macOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..bcdaee1 --- /dev/null +++ b/Example/Logan-macOS/Logan-macOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Example/Logan-macOS/Logan-macOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/Logan-macOS/Logan-macOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/Logan-macOS/Logan-macOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/Logan-macOS/Logan-macOS/AppDelegate.h b/Example/Logan-macOS/Logan-macOS/AppDelegate.h new file mode 100644 index 0000000..c7c423b --- /dev/null +++ b/Example/Logan-macOS/Logan-macOS/AppDelegate.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018-present, 美团点评 + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import + +@interface AppDelegate : NSObject + + +@end + diff --git a/Example/Logan-macOS/Logan-macOS/AppDelegate.m b/Example/Logan-macOS/Logan-macOS/AppDelegate.m new file mode 100644 index 0000000..ff7dc3d --- /dev/null +++ b/Example/Logan-macOS/Logan-macOS/AppDelegate.m @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2018-present, 美团点评 + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "AppDelegate.h" +#import "Logan.h" + +typedef enum : NSUInteger { + LoganTypeAction = 1, //用户行为日志 + LoganTypeNetwork = 2, //网络级日志 +} LoganType; + + +@interface AppDelegate () + +@property (weak) IBOutlet NSWindow *window; + +@property (nonatomic, assign) int count; +//@property (weak, nonatomic) IBOutlet UITextView *filesInfo; +//@property (weak, nonatomic) IBOutlet UITextField *ipText; +@property (weak) IBOutlet NSTextField *filesInfo; +@property (weak) IBOutlet NSTextField *ipText; + +@end + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + // Insert code here to initialize your application + + NSData *keydata = [@"0123456789012345" dataUsingEncoding:NSUTF8StringEncoding]; + NSData *ivdata = [@"0123456789012345" dataUsingEncoding:NSUTF8StringEncoding]; + uint64_t file_max = 10 * 1024 * 1024; + // logan初始化,传入16位key,16位iv,写入文件最大大小(byte) + loganInit(keydata, ivdata, file_max); + // 将日志输出至控制台 + loganUseASL(YES); +} + + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + // Insert code here to tear down your application +} + +- (IBAction)lllog:(id)sender { + for (int i = 0; i < 10; i++) { + //行为日志 + [self eventLogType:1 forLabel:[NSString stringWithFormat:@"click button %d", _count++]]; + } +} + +- (IBAction)allFilesInfo:(id)sender { + NSDictionary *files = loganAllFilesInfo(); + + NSMutableString *str = [[NSMutableString alloc] init]; + for (NSString *k in files.allKeys) { + [str appendFormat:@"文件日期 %@,大小 %@byte\n", k, [files objectForKey:k]]; + } + + self.filesInfo.stringValue = str; +} + +- (IBAction)uploadFile:(id)sender { + loganUploadFilePath(loganTodaysDate(), ^(NSString *_Nullable filePatch) { + if (filePatch == nil) { + return; + } + NSString *urlStr = [NSString stringWithFormat:@"http://%@:3000/logupload", self.ipText.stringValue ?: @"127.0.0.1"]; + NSURL *url = [NSURL URLWithString:urlStr]; + NSMutableURLRequest *req = [[NSMutableURLRequest alloc] initWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60]; + [req setHTTPMethod:@"POST"]; + [req addValue:@"binary/octet-stream" forHTTPHeaderField:@"Content-Type"]; + NSURL *fileUrl = [NSURL fileURLWithPath:filePatch]; + NSURLSessionUploadTask *task = [[NSURLSession sharedSession] uploadTaskWithRequest:req fromFile:fileUrl completionHandler:^(NSData *_Nullable data, NSURLResponse *_Nullable response, NSError *_Nullable error) { + if (error == nil) { + NSLog(@"上传完成"); + } else { + NSLog(@"上传失败 error:%@", error); + } + }]; + [task resume]; + }); +} + +/** + 用户行为日志 + + @param eventType 事件类型 + @param label 描述 + */ +- (void)eventLogType:(NSInteger)eventType forLabel:(NSString *)label { + NSMutableString *s = [NSMutableString string]; + [s appendFormat:@"%d\t", (int)eventType]; + [s appendFormat:@"%@\t", label]; + logan(LoganTypeAction, s); +} + + +@end diff --git a/Example/Logan-macOS/Logan-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/Logan-macOS/Logan-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2db2b1c --- /dev/null +++ b/Example/Logan-macOS/Logan-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Logan-macOS/Logan-macOS/Assets.xcassets/Contents.json b/Example/Logan-macOS/Logan-macOS/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Example/Logan-macOS/Logan-macOS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Logan-macOS/Logan-macOS/Base.lproj/MainMenu.xib b/Example/Logan-macOS/Logan-macOS/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..612b4e4 --- /dev/null +++ b/Example/Logan-macOS/Logan-macOS/Base.lproj/MainMenu.xib @@ -0,0 +1,758 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Logan-macOS/Logan-macOS/Info.plist b/Example/Logan-macOS/Logan-macOS/Info.plist new file mode 100644 index 0000000..31b7a60 --- /dev/null +++ b/Example/Logan-macOS/Logan-macOS/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2018 Chen Yihu. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/Example/Logan-macOS/Logan-macOS/Logan_macOS.entitlements b/Example/Logan-macOS/Logan-macOS/Logan_macOS.entitlements new file mode 100644 index 0000000..f2ef3ae --- /dev/null +++ b/Example/Logan-macOS/Logan-macOS/Logan_macOS.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/Example/Logan-macOS/Logan-macOS/main.m b/Example/Logan-macOS/Logan-macOS/main.m new file mode 100644 index 0000000..fb0094b --- /dev/null +++ b/Example/Logan-macOS/Logan-macOS/main.m @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018-present, 美团点评 + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import + +int main(int argc, const char * argv[]) { + return NSApplicationMain(argc, argv); +} diff --git a/Example/Logan-macOS/Logan-macOSTests/Info.plist b/Example/Logan-macOS/Logan-macOSTests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/Example/Logan-macOS/Logan-macOSTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/Example/Logan-macOS/Logan-macOSTests/Logan_macOSTests.m b/Example/Logan-macOS/Logan-macOSTests/Logan_macOSTests.m new file mode 100644 index 0000000..4357293 --- /dev/null +++ b/Example/Logan-macOS/Logan-macOSTests/Logan_macOSTests.m @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2018-present, 美团点评 + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import + +@interface Logan_macOSTests : XCTestCase + +@end + +@implementation Logan_macOSTests + +- (void)setUp { + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. +} + +- (void)testExample { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. +} + +- (void)testPerformanceExample { + // This is an example of a performance test case. + [self measureBlock:^{ + // Put the code you want to measure the time of here. + }]; +} + +@end diff --git a/Logan/clogan.xcodeproj/project.pbxproj b/Logan/clogan.xcodeproj/project.pbxproj index 4855f8b..22e49ba 100644 --- a/Logan/clogan.xcodeproj/project.pbxproj +++ b/Logan/clogan.xcodeproj/project.pbxproj @@ -7,6 +7,89 @@ objects = { /* Begin PBXBuildFile section */ + 84C23BBB21723A1900588A19 /* x509.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4890F20F74AFD001F74C0 /* x509.c */; }; + 84C23BBC21723A1900588A19 /* Makefile in Sources */ = {isa = PBXBuildFile; fileRef = A7C488E920F74AFD001F74C0 /* Makefile */; }; + 84C23BBD21723A1900588A19 /* ssl_cli.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488FE20F74AFD001F74C0 /* ssl_cli.c */; }; + 84C23BBE21723A1900588A19 /* havege.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488F320F74AFD001F74C0 /* havege.c */; }; + 84C23BBF21723A1900588A19 /* clogan_core.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4887F20F74AED001F74C0 /* clogan_core.c */; }; + 84C23BC021723A1900588A19 /* md4.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488D820F74AFD001F74C0 /* md4.c */; }; + 84C23BC121723A1900588A19 /* ripemd160.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488FD20F74AFD001F74C0 /* ripemd160.c */; }; + 84C23BC221723A1900588A19 /* aes.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488D720F74AFD001F74C0 /* aes.c */; }; + 84C23BC321723A1900588A19 /* camellia.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488DA20F74AFD001F74C0 /* camellia.c */; }; + 84C23BC421723A1900588A19 /* x509write_crt.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891620F74AFD001F74C0 /* x509write_crt.c */; }; + 84C23BC521723A1900588A19 /* cipher_wrap.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488E120F74AFD001F74C0 /* cipher_wrap.c */; }; + 84C23BC621723A1900588A19 /* pk_wrap.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488DB20F74AFD001F74C0 /* pk_wrap.c */; }; + 84C23BC721723A1900588A19 /* error.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4890320F74AFD001F74C0 /* error.c */; }; + 84C23BC821723A1900588A19 /* aesni.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488E520F74AFD001F74C0 /* aesni.c */; }; + 84C23BC921723A1900588A19 /* oid.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4890220F74AFD001F74C0 /* oid.c */; }; + 84C23BCA21723A1900588A19 /* pkcs5.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4890020F74AFD001F74C0 /* pkcs5.c */; }; + 84C23BCB21723A1900588A19 /* x509_crl.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488E020F74AFD001F74C0 /* x509_crl.c */; }; + 84C23BCC21723A1900588A19 /* bignum.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488FA20F74AFD001F74C0 /* bignum.c */; }; + 84C23BCD21723A1900588A19 /* ecdh.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488DE20F74AFD001F74C0 /* ecdh.c */; }; + 84C23BCE21723A1900588A19 /* platform.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488F820F74AFD001F74C0 /* platform.c */; }; + 84C23BCF21723A1900588A19 /* ssl_cookie.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488E320F74AFD001F74C0 /* ssl_cookie.c */; }; + 84C23BD021723A1900588A19 /* gcm.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488F020F74AFD001F74C0 /* gcm.c */; }; + 84C23BD121723A1900588A19 /* debug.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488FC20F74AFD001F74C0 /* debug.c */; }; + 84C23BD221723A1900588A19 /* entropy.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891A20F74AFD001F74C0 /* entropy.c */; }; + 84C23BD321723A1900588A19 /* xtea.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891520F74AFD001F74C0 /* xtea.c */; }; + 84C23BD421723A1900588A19 /* sha1.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488F120F74AFD001F74C0 /* sha1.c */; }; + 84C23BD521723A1900588A19 /* ccm.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488F420F74AFD001F74C0 /* ccm.c */; }; + 84C23BD621723A1900588A19 /* construct_data.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4887720F74AED001F74C0 /* construct_data.c */; }; + 84C23BD721723A1900588A19 /* pk.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488DC20F74AFD001F74C0 /* pk.c */; }; + 84C23BD821723A1900588A19 /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4890B20F74AFD001F74C0 /* base64.c */; }; + 84C23BD921723A1900588A19 /* dhm.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488E620F74AFD001F74C0 /* dhm.c */; }; + 84C23BDA21723A1900588A19 /* ssl_cache.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488E720F74AFD001F74C0 /* ssl_cache.c */; }; + 84C23BDB21723A1900588A19 /* timing.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891420F74AFD001F74C0 /* timing.c */; }; + 84C23BDC21723A1900588A19 /* aes_util.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4887C20F74AED001F74C0 /* aes_util.c */; }; + 84C23BDD21723A1900588A19 /* base_util.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4887420F74AED001F74C0 /* base_util.c */; }; + 84C23BDE21723A1900588A19 /* pkcs12.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891920F74AFD001F74C0 /* pkcs12.c */; }; + 84C23BDF21723A1900588A19 /* threading.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891720F74AFD001F74C0 /* threading.c */; }; + 84C23BE021723A1900588A19 /* ssl_tls.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488DF20F74AFD001F74C0 /* ssl_tls.c */; }; + 84C23BE121723A1900588A19 /* mmap_util.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4887120F74AED001F74C0 /* mmap_util.c */; }; + 84C23BE221723A1900588A19 /* version.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4890E20F74AFD001F74C0 /* version.c */; }; + 84C23BE321723A1900588A19 /* x509_csr.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4890620F74AFD001F74C0 /* x509_csr.c */; }; + 84C23BE421723A1900588A19 /* ssl_srv.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488D920F74AFD001F74C0 /* ssl_srv.c */; }; + 84C23BE521723A1900588A19 /* blowfish.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488FF20F74AFD001F74C0 /* blowfish.c */; }; + 84C23BE621723A1900588A19 /* des.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488E220F74AFD001F74C0 /* des.c */; }; + 84C23BE721723A1900588A19 /* version_features.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488F520F74AFD001F74C0 /* version_features.c */; }; + 84C23BE821723A1900588A19 /* hmac_drbg.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488EA20F74AFD001F74C0 /* hmac_drbg.c */; }; + 84C23BE921723A1900588A19 /* x509_create.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488D520F74AFD001F74C0 /* x509_create.c */; }; + 84C23BEA21723A1900588A19 /* zlib_util.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4887520F74AED001F74C0 /* zlib_util.c */; }; + 84C23BEB21723A1900588A19 /* entropy_poll.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488F620F74AFD001F74C0 /* entropy_poll.c */; }; + 84C23BEC21723A1900588A19 /* sha512.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891C20F74AFD001F74C0 /* sha512.c */; }; + 84C23BED21723A1900588A19 /* pkparse.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488FB20F74AFD001F74C0 /* pkparse.c */; }; + 84C23BEE21723A1900588A19 /* memory_buffer_alloc.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4890C20F74AFD001F74C0 /* memory_buffer_alloc.c */; }; + 84C23BEF21723A1900588A19 /* md_wrap.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4890520F74AFD001F74C0 /* md_wrap.c */; }; + 84C23BF021723A1900588A19 /* certs.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488EE20F74AFD001F74C0 /* certs.c */; }; + 84C23BF121723A1900588A19 /* cJSON.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4887620F74AED001F74C0 /* cJSON.c */; }; + 84C23BF221723A1900588A19 /* padlock.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891820F74AFD001F74C0 /* padlock.c */; }; + 84C23BF321723A1900588A19 /* ecdsa.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4892020F74AFD001F74C0 /* ecdsa.c */; }; + 84C23BF421723A1900588A19 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891220F74AFD001F74C0 /* md5.c */; }; + 84C23BF521723A1900588A19 /* md2.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4890420F74AFD001F74C0 /* md2.c */; }; + 84C23BF621723A1900588A19 /* cmac.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488F920F74AFD001F74C0 /* cmac.c */; }; + 84C23BF721723A1900588A19 /* ecp.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4890D20F74AFD001F74C0 /* ecp.c */; }; + 84C23BF821723A1900588A19 /* json_util.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4887D20F74AED001F74C0 /* json_util.c */; }; + 84C23BF921723A1900588A19 /* ecjpake.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891E20F74AFD001F74C0 /* ecjpake.c */; }; + 84C23BFA21723A1900588A19 /* asn1parse.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488ED20F74AFD001F74C0 /* asn1parse.c */; }; + 84C23BFB21723A1900588A19 /* x509_crt.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488D620F74AFD001F74C0 /* x509_crt.c */; }; + 84C23BFC21723A1900588A19 /* ctr_drbg.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488E420F74AFD001F74C0 /* ctr_drbg.c */; }; + 84C23BFD21723A1900588A19 /* x509write_csr.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488F720F74AFD001F74C0 /* x509write_csr.c */; }; + 84C23BFE21723A1900588A19 /* rsa.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488EB20F74AFD001F74C0 /* rsa.c */; }; + 84C23BFF21723A1900588A19 /* cipher.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891F20F74AFD001F74C0 /* cipher.c */; }; + 84C23C0021723A1900588A19 /* arc4.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891320F74AFD001F74C0 /* arc4.c */; }; + 84C23C0121723A1900588A19 /* ssl_ticket.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488EC20F74AFD001F74C0 /* ssl_ticket.c */; }; + 84C23C0221723A1900588A19 /* pem.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4890120F74AFD001F74C0 /* pem.c */; }; + 84C23C0321723A1900588A19 /* pkwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488EF20F74AFD001F74C0 /* pkwrite.c */; }; + 84C23C0421723A1900588A19 /* console_util.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4886B20F74AED001F74C0 /* console_util.c */; }; + 84C23C0521723A1900588A19 /* pkcs11.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4890A20F74AFD001F74C0 /* pkcs11.c */; }; + 84C23C0621723A1900588A19 /* directory_util.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4886E20F74AED001F74C0 /* directory_util.c */; }; + 84C23C0721723A1900588A19 /* md.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891D20F74AFD001F74C0 /* md.c */; }; + 84C23C0821723A1900588A19 /* net_sockets.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891B20F74AFD001F74C0 /* net_sockets.c */; }; + 84C23C0921723A1900588A19 /* ssl_ciphersuites.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488E820F74AFD001F74C0 /* ssl_ciphersuites.c */; }; + 84C23C0A21723A1900588A19 /* sha256.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891020F74AFD001F74C0 /* sha256.c */; }; + 84C23C0B21723A1900588A19 /* ecp_curves.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4891120F74AFD001F74C0 /* ecp_curves.c */; }; + 84C23C0C21723A1900588A19 /* asn1write.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C488F220F74AFD001F74C0 /* asn1write.c */; }; + 84C23C1021723A1900588A19 /* clogan_core.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C4887020F74AED001F74C0 /* clogan_core.h */; settings = {ATTRIBUTES = (Public, ); }; }; A7C4888020F74AED001F74C0 /* console_util.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4886B20F74AED001F74C0 /* console_util.c */; }; A7C4888120F74AED001F74C0 /* directory_util.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4886E20F74AED001F74C0 /* directory_util.c */; }; A7C4888220F74AED001F74C0 /* mmap_util.c in Sources */ = {isa = PBXBuildFile; fileRef = A7C4887120F74AED001F74C0 /* mmap_util.c */; }; @@ -93,6 +176,15 @@ /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ + 84C23C0E21723A1900588A19 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; A7C4885920F74AC5001F74C0 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -105,6 +197,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 84C23C1421723A1900588A19 /* libclogan-macOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libclogan-macOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A7C4885B20F74AC5001F74C0 /* libclogan.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libclogan.a; sourceTree = BUILT_PRODUCTS_DIR; }; A7C4886820F74AED001F74C0 /* zlib_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zlib_util.h; sourceTree = ""; }; A7C4886920F74AED001F74C0 /* base_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base_util.h; sourceTree = ""; }; @@ -275,6 +368,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 84C23C0D21723A1900588A19 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; A7C4885820F74AC5001F74C0 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -298,6 +398,7 @@ isa = PBXGroup; children = ( A7C4885B20F74AC5001F74C0 /* libclogan.a */, + 84C23C1421723A1900588A19 /* libclogan-macOS.a */, ); name = Products; sourceTree = ""; @@ -509,6 +610,14 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + 84C23C0F21723A1900588A19 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 84C23C1021723A1900588A19 /* clogan_core.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; A7C489B620F750E8001F74C0 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -520,6 +629,24 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 84C23BB921723A1900588A19 /* clogan-macOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 84C23C1121723A1900588A19 /* Build configuration list for PBXNativeTarget "clogan-macOS" */; + buildPhases = ( + 84C23BBA21723A1900588A19 /* Sources */, + 84C23C0D21723A1900588A19 /* Frameworks */, + 84C23C0E21723A1900588A19 /* CopyFiles */, + 84C23C0F21723A1900588A19 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "clogan-macOS"; + productName = clogan; + productReference = 84C23C1421723A1900588A19 /* libclogan-macOS.a */; + productType = "com.apple.product-type.library.static"; + }; A7C4885A20F74AC5001F74C0 /* clogan */ = { isa = PBXNativeTarget; buildConfigurationList = A7C4886420F74AC5001F74C0 /* Build configuration list for PBXNativeTarget "clogan" */; @@ -565,11 +692,101 @@ projectRoot = ""; targets = ( A7C4885A20F74AC5001F74C0 /* clogan */, + 84C23BB921723A1900588A19 /* clogan-macOS */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ + 84C23BBA21723A1900588A19 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 84C23BBB21723A1900588A19 /* x509.c in Sources */, + 84C23BBC21723A1900588A19 /* Makefile in Sources */, + 84C23BBD21723A1900588A19 /* ssl_cli.c in Sources */, + 84C23BBE21723A1900588A19 /* havege.c in Sources */, + 84C23BBF21723A1900588A19 /* clogan_core.c in Sources */, + 84C23BC021723A1900588A19 /* md4.c in Sources */, + 84C23BC121723A1900588A19 /* ripemd160.c in Sources */, + 84C23BC221723A1900588A19 /* aes.c in Sources */, + 84C23BC321723A1900588A19 /* camellia.c in Sources */, + 84C23BC421723A1900588A19 /* x509write_crt.c in Sources */, + 84C23BC521723A1900588A19 /* cipher_wrap.c in Sources */, + 84C23BC621723A1900588A19 /* pk_wrap.c in Sources */, + 84C23BC721723A1900588A19 /* error.c in Sources */, + 84C23BC821723A1900588A19 /* aesni.c in Sources */, + 84C23BC921723A1900588A19 /* oid.c in Sources */, + 84C23BCA21723A1900588A19 /* pkcs5.c in Sources */, + 84C23BCB21723A1900588A19 /* x509_crl.c in Sources */, + 84C23BCC21723A1900588A19 /* bignum.c in Sources */, + 84C23BCD21723A1900588A19 /* ecdh.c in Sources */, + 84C23BCE21723A1900588A19 /* platform.c in Sources */, + 84C23BCF21723A1900588A19 /* ssl_cookie.c in Sources */, + 84C23BD021723A1900588A19 /* gcm.c in Sources */, + 84C23BD121723A1900588A19 /* debug.c in Sources */, + 84C23BD221723A1900588A19 /* entropy.c in Sources */, + 84C23BD321723A1900588A19 /* xtea.c in Sources */, + 84C23BD421723A1900588A19 /* sha1.c in Sources */, + 84C23BD521723A1900588A19 /* ccm.c in Sources */, + 84C23BD621723A1900588A19 /* construct_data.c in Sources */, + 84C23BD721723A1900588A19 /* pk.c in Sources */, + 84C23BD821723A1900588A19 /* base64.c in Sources */, + 84C23BD921723A1900588A19 /* dhm.c in Sources */, + 84C23BDA21723A1900588A19 /* ssl_cache.c in Sources */, + 84C23BDB21723A1900588A19 /* timing.c in Sources */, + 84C23BDC21723A1900588A19 /* aes_util.c in Sources */, + 84C23BDD21723A1900588A19 /* base_util.c in Sources */, + 84C23BDE21723A1900588A19 /* pkcs12.c in Sources */, + 84C23BDF21723A1900588A19 /* threading.c in Sources */, + 84C23BE021723A1900588A19 /* ssl_tls.c in Sources */, + 84C23BE121723A1900588A19 /* mmap_util.c in Sources */, + 84C23BE221723A1900588A19 /* version.c in Sources */, + 84C23BE321723A1900588A19 /* x509_csr.c in Sources */, + 84C23BE421723A1900588A19 /* ssl_srv.c in Sources */, + 84C23BE521723A1900588A19 /* blowfish.c in Sources */, + 84C23BE621723A1900588A19 /* des.c in Sources */, + 84C23BE721723A1900588A19 /* version_features.c in Sources */, + 84C23BE821723A1900588A19 /* hmac_drbg.c in Sources */, + 84C23BE921723A1900588A19 /* x509_create.c in Sources */, + 84C23BEA21723A1900588A19 /* zlib_util.c in Sources */, + 84C23BEB21723A1900588A19 /* entropy_poll.c in Sources */, + 84C23BEC21723A1900588A19 /* sha512.c in Sources */, + 84C23BED21723A1900588A19 /* pkparse.c in Sources */, + 84C23BEE21723A1900588A19 /* memory_buffer_alloc.c in Sources */, + 84C23BEF21723A1900588A19 /* md_wrap.c in Sources */, + 84C23BF021723A1900588A19 /* certs.c in Sources */, + 84C23BF121723A1900588A19 /* cJSON.c in Sources */, + 84C23BF221723A1900588A19 /* padlock.c in Sources */, + 84C23BF321723A1900588A19 /* ecdsa.c in Sources */, + 84C23BF421723A1900588A19 /* md5.c in Sources */, + 84C23BF521723A1900588A19 /* md2.c in Sources */, + 84C23BF621723A1900588A19 /* cmac.c in Sources */, + 84C23BF721723A1900588A19 /* ecp.c in Sources */, + 84C23BF821723A1900588A19 /* json_util.c in Sources */, + 84C23BF921723A1900588A19 /* ecjpake.c in Sources */, + 84C23BFA21723A1900588A19 /* asn1parse.c in Sources */, + 84C23BFB21723A1900588A19 /* x509_crt.c in Sources */, + 84C23BFC21723A1900588A19 /* ctr_drbg.c in Sources */, + 84C23BFD21723A1900588A19 /* x509write_csr.c in Sources */, + 84C23BFE21723A1900588A19 /* rsa.c in Sources */, + 84C23BFF21723A1900588A19 /* cipher.c in Sources */, + 84C23C0021723A1900588A19 /* arc4.c in Sources */, + 84C23C0121723A1900588A19 /* ssl_ticket.c in Sources */, + 84C23C0221723A1900588A19 /* pem.c in Sources */, + 84C23C0321723A1900588A19 /* pkwrite.c in Sources */, + 84C23C0421723A1900588A19 /* console_util.c in Sources */, + 84C23C0521723A1900588A19 /* pkcs11.c in Sources */, + 84C23C0621723A1900588A19 /* directory_util.c in Sources */, + 84C23C0721723A1900588A19 /* md.c in Sources */, + 84C23C0821723A1900588A19 /* net_sockets.c in Sources */, + 84C23C0921723A1900588A19 /* ssl_ciphersuites.c in Sources */, + 84C23C0A21723A1900588A19 /* sha256.c in Sources */, + 84C23C0B21723A1900588A19 /* ecp_curves.c in Sources */, + 84C23C0C21723A1900588A19 /* asn1write.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; A7C4885720F74AC5001F74C0 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -662,6 +879,32 @@ /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ + 84C23C1221723A1900588A19 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + HEADER_SEARCH_PATHS = mbedtls/include/; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 84C23C1321723A1900588A19 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + HEADER_SEARCH_PATHS = mbedtls/include/; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; A7C4886220F74AC5001F74C0 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -799,6 +1042,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 84C23C1121723A1900588A19 /* Build configuration list for PBXNativeTarget "clogan-macOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 84C23C1221723A1900588A19 /* Debug */, + 84C23C1321723A1900588A19 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; A7C4885620F74AC5001F74C0 /* Build configuration list for PBXProject "clogan" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Logan/iOS/Logan.m b/Logan/iOS/Logan.m index 9cb9ee5..cff2bfe 100644 --- a/Logan/iOS/Logan.m +++ b/Logan/iOS/Logan.m @@ -27,9 +27,9 @@ #if TARGET_OS_IPHONE #import -#else /* if TARGET_OS_IPHONE */ +#else #import -#endif /* if TARGET_OS_IPHONE */ +#endif BOOL LOGANUSEASL = NO; NSData *__AES_KEY; @@ -268,11 +268,11 @@ NSString *_Nonnull loganTodaysDate(void) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillEnterForeground) name:UIApplicationWillEnterForegroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillTerminate) name:UIApplicationWillTerminateNotification object:nil]; -#else /* if TARGET_OS_IPHONE */ +#else [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillEnterForeground) name:NSApplicationWillBecomeActiveNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidEnterBackground) name:NSApplicationDidResignActiveNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillTerminate) name:NSApplicationWillTerminateNotification object:nil]; -#endif /* if TARGET_OS_IPHONE */ +#endif }