From 7bb2c921a29112badb5852c37ba9825c64975416 Mon Sep 17 00:00:00 2001 From: Nish Patel Date: Sat, 6 Apr 2024 13:54:44 -0500 Subject: [PATCH 1/3] Fix - Added more configs like dev and prod to separate env variables for running and testing out At this stage, we can now begin to add env variable for dev and prod environment. --- LibrePass.xcodeproj/project.pbxproj | 272 ++++++++++++++++-- .../xcschemes/LibrePass(Dev).xcscheme | 78 +++++ .../xcschemes/LibrePass(Prod).xcscheme | 78 +++++ .../xcshareddata/WorkspaceSettings.xcsettings | 5 - LibrePass/Environment.swift | 26 ++ LibrePass/Info.plist | 5 +- LibrePass/LibrePassRegistrationWindow.swift | 6 +- 7 files changed, 434 insertions(+), 36 deletions(-) create mode 100644 LibrePass.xcodeproj/xcshareddata/xcschemes/LibrePass(Dev).xcscheme create mode 100644 LibrePass.xcodeproj/xcshareddata/xcschemes/LibrePass(Prod).xcscheme delete mode 100644 LibrePass.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 LibrePass/Environment.swift diff --git a/LibrePass.xcodeproj/project.pbxproj b/LibrePass.xcodeproj/project.pbxproj index 0348a81..5c1c439 100644 --- a/LibrePass.xcodeproj/project.pbxproj +++ b/LibrePass.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 176A30622BC1C103005C143E /* Environment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 176A30612BC1C103005C143E /* Environment.swift */; }; 3975184DC26DCD2D852A7C08 /* Pods_LibrePass.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A927B022513678BA42B54FCF /* Pods_LibrePass.framework */; }; B23D44F82BA62C6B00097960 /* OATH.swift in Sources */ = {isa = PBXBuildFile; fileRef = B23D44F72BA62C6B00097960 /* OATH.swift */; }; B25257BB2B91149D0028ABF3 /* LibrePassAccountSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = B25257BA2B91149D0028ABF3 /* LibrePassAccountSettings.swift */; }; @@ -34,7 +35,10 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 2816A09CADE280F72E52A29A /* Pods-LibrePass.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LibrePass.release.xcconfig"; path = "Target Support Files/Pods-LibrePass/Pods-LibrePass.release.xcconfig"; sourceTree = ""; }; + 176A30612BC1C103005C143E /* Environment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Environment.swift; sourceTree = ""; }; + 176A306A2BC1C8D8005C143E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 29FBE69442CBC35BD7E5388E /* Pods-LibrePass.debug(dev).xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LibrePass.debug(dev).xcconfig"; path = "Target Support Files/Pods-LibrePass/Pods-LibrePass.debug(dev).xcconfig"; sourceTree = ""; }; + 7F00EDC76A8230916D3D0E6C /* Pods-LibrePass.release(dev).xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LibrePass.release(dev).xcconfig"; path = "Target Support Files/Pods-LibrePass/Pods-LibrePass.release(dev).xcconfig"; sourceTree = ""; }; A927B022513678BA42B54FCF /* Pods_LibrePass.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LibrePass.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B23D44F72BA62C6B00097960 /* OATH.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OATH.swift; sourceTree = ""; }; B25257BA2B91149D0028ABF3 /* LibrePassAccountSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibrePassAccountSettings.swift; sourceTree = ""; }; @@ -62,7 +66,8 @@ B2D91A1C2B8393C70004561A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; B2D91A1F2B8393C70004561A /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; B2DD90702B8D10D4003D84B7 /* NetworkMonitor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkMonitor.swift; sourceTree = ""; }; - F596AB355AB5D89D17A58912 /* Pods-LibrePass.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LibrePass.debug.xcconfig"; path = "Target Support Files/Pods-LibrePass/Pods-LibrePass.debug.xcconfig"; sourceTree = ""; }; + C8B00C4C0AD732FFFB50F596 /* Pods-LibrePass.debug(prod).xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LibrePass.debug(prod).xcconfig"; path = "Target Support Files/Pods-LibrePass/Pods-LibrePass.debug(prod).xcconfig"; sourceTree = ""; }; + D34431269757FABB868039F0 /* Pods-LibrePass.release(prod).xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LibrePass.release(prod).xcconfig"; path = "Target Support Files/Pods-LibrePass/Pods-LibrePass.release(prod).xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -126,19 +131,21 @@ B2D91A172B8393C60004561A /* LibrePass */ = { isa = PBXGroup; children = ( + 176A306A2BC1C8D8005C143E /* Info.plist */, B2D444772B87CFF00031A685 /* API */, + B2D91A1C2B8393C70004561A /* Assets.xcassets */, + 176A30612BC1C103005C143E /* Environment.swift */, + B253F1E22B8394EE00D048F9 /* LibrePass-Bridging-Header.h */, + B25257BA2B91149D0028ABF3 /* LibrePassAccountSettings.swift */, B253F1D22B83942B00D048F9 /* LibrePassApp.swift */, - B2780F052B8A43C200835EE3 /* LibrePassRegistrationWindow.swift */, - B253F1CE2B83942B00D048F9 /* LibrePassLoginWindow.swift */, + B253F1CC2B83942B00D048F9 /* LibrePassCipherView.swift */, B253F1CD2B83942B00D048F9 /* LibrePassLocalLogin.swift */, + B253F1CE2B83942B00D048F9 /* LibrePassLoginWindow.swift */, B253F1CF2B83942B00D048F9 /* LibrePassManagerWindow.swift */, - B253F1CC2B83942B00D048F9 /* LibrePassCipherView.swift */, - B25257BA2B91149D0028ABF3 /* LibrePassAccountSettings.swift */, + B2780F052B8A43C200835EE3 /* LibrePassRegistrationWindow.swift */, B2DD90702B8D10D4003D84B7 /* NetworkMonitor.swift */, - B28E061F2B8BBD1900F48661 /* Utils.swift */, - B253F1E22B8394EE00D048F9 /* LibrePass-Bridging-Header.h */, - B2D91A1C2B8393C70004561A /* Assets.xcassets */, B2D91A1E2B8393C70004561A /* Preview Content */, + B28E061F2B8BBD1900F48661 /* Utils.swift */, ); path = LibrePass; sourceTree = ""; @@ -162,8 +169,10 @@ C4BF8AE2A13C542780EBE854 /* Pods */ = { isa = PBXGroup; children = ( - F596AB355AB5D89D17A58912 /* Pods-LibrePass.debug.xcconfig */, - 2816A09CADE280F72E52A29A /* Pods-LibrePass.release.xcconfig */, + 29FBE69442CBC35BD7E5388E /* Pods-LibrePass.debug(dev).xcconfig */, + C8B00C4C0AD732FFFB50F596 /* Pods-LibrePass.debug(prod).xcconfig */, + 7F00EDC76A8230916D3D0E6C /* Pods-LibrePass.release(dev).xcconfig */, + D34431269757FABB868039F0 /* Pods-LibrePass.release(prod).xcconfig */, ); path = Pods; sourceTree = ""; @@ -301,6 +310,7 @@ B253F1D82B83942B00D048F9 /* LibrePassLocalLogin.swift in Sources */, B23D44F82BA62C6B00097960 /* OATH.swift in Sources */, B25257BB2B91149D0028ABF3 /* LibrePassAccountSettings.swift in Sources */, + 176A30622BC1C103005C143E /* Environment.swift in Sources */, B253F1E12B83942B00D048F9 /* LibrePassEncryptedCipher.swift in Sources */, B253F1DB2B83942B00D048F9 /* CredentialsDatabase.swift in Sources */, B253F1DA2B83942B00D048F9 /* LibrePassManagerWindow.swift in Sources */, @@ -310,8 +320,209 @@ /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ - B2D91A212B8393C70004561A /* Debug */ = { + 176A30632BC1C4D6005C143E /* Debug(Prod) */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C8B00C4C0AD732FFFB50F596 /* Pods-LibrePass.debug(prod).xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + 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; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = "Debug(Prod)"; + }; + 176A30642BC1C4D6005C143E /* Debug(Prod) */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C8B00C4C0AD732FFFB50F596 /* Pods-LibrePass.debug(prod).xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"LibrePass/Preview Content\""; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = LibrePass/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.2.0; + PRODUCT_BUNDLE_IDENTIFIER = com.github.zapomnij.LibrePass; + PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "LibrePass/LibrePass-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = "Debug(Prod)"; + }; + 176A30652BC1C4D9005C143E /* Release(Prod) */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D34431269757FABB868039F0 /* Pods-LibrePass.release(prod).xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + 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; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + VALIDATE_PRODUCT = YES; + }; + name = "Release(Prod)"; + }; + 176A30662BC1C4D9005C143E /* Release(Prod) */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D34431269757FABB868039F0 /* Pods-LibrePass.release(prod).xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"LibrePass/Preview Content\""; + DEVELOPMENT_TEAM = ""; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = LibrePass/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.2.0; + PRODUCT_BUNDLE_IDENTIFIER = com.github.zapomnij.LibrePass; + PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "LibrePass/LibrePass-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = "Release(Prod)"; + }; + B2D91A212B8393C70004561A /* Debug(Dev) */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 29FBE69442CBC35BD7E5388E /* Pods-LibrePass.debug(dev).xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; @@ -371,10 +582,11 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; - name = Debug; + name = "Debug(Dev)"; }; - B2D91A222B8393C70004561A /* Release */ = { + B2D91A222B8393C70004561A /* Release(Dev) */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 7F00EDC76A8230916D3D0E6C /* Pods-LibrePass.release(dev).xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; @@ -427,11 +639,11 @@ SWIFT_COMPILATION_MODE = wholemodule; VALIDATE_PRODUCT = YES; }; - name = Release; + name = "Release(Dev)"; }; - B2D91A242B8393C70004561A /* Debug */ = { + B2D91A242B8393C70004561A /* Debug(Dev) */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F596AB355AB5D89D17A58912 /* Pods-LibrePass.debug.xcconfig */; + baseConfigurationReference = 29FBE69442CBC35BD7E5388E /* Pods-LibrePass.debug(dev).xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -442,6 +654,7 @@ DEVELOPMENT_TEAM = ""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = LibrePass/Info.plist; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; @@ -466,11 +679,11 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; - name = Debug; + name = "Debug(Dev)"; }; - B2D91A252B8393C70004561A /* Release */ = { + B2D91A252B8393C70004561A /* Release(Dev) */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2816A09CADE280F72E52A29A /* Pods-LibrePass.release.xcconfig */; + baseConfigurationReference = 7F00EDC76A8230916D3D0E6C /* Pods-LibrePass.release(dev).xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -481,6 +694,7 @@ DEVELOPMENT_TEAM = ""; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = LibrePass/Info.plist; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; @@ -504,7 +718,7 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; - name = Release; + name = "Release(Dev)"; }; /* End XCBuildConfiguration section */ @@ -512,20 +726,24 @@ B2D91A102B8393C60004561A /* Build configuration list for PBXProject "LibrePass" */ = { isa = XCConfigurationList; buildConfigurations = ( - B2D91A212B8393C70004561A /* Debug */, - B2D91A222B8393C70004561A /* Release */, + B2D91A212B8393C70004561A /* Debug(Dev) */, + 176A30632BC1C4D6005C143E /* Debug(Prod) */, + B2D91A222B8393C70004561A /* Release(Dev) */, + 176A30652BC1C4D9005C143E /* Release(Prod) */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = "Release(Dev)"; }; B2D91A232B8393C70004561A /* Build configuration list for PBXNativeTarget "LibrePass" */ = { isa = XCConfigurationList; buildConfigurations = ( - B2D91A242B8393C70004561A /* Debug */, - B2D91A252B8393C70004561A /* Release */, + B2D91A242B8393C70004561A /* Debug(Dev) */, + 176A30642BC1C4D6005C143E /* Debug(Prod) */, + B2D91A252B8393C70004561A /* Release(Dev) */, + 176A30662BC1C4D9005C143E /* Release(Prod) */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = "Release(Dev)"; }; /* End XCConfigurationList section */ }; diff --git a/LibrePass.xcodeproj/xcshareddata/xcschemes/LibrePass(Dev).xcscheme b/LibrePass.xcodeproj/xcshareddata/xcschemes/LibrePass(Dev).xcscheme new file mode 100644 index 0000000..b8bd2eb --- /dev/null +++ b/LibrePass.xcodeproj/xcshareddata/xcschemes/LibrePass(Dev).xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LibrePass.xcodeproj/xcshareddata/xcschemes/LibrePass(Prod).xcscheme b/LibrePass.xcodeproj/xcshareddata/xcschemes/LibrePass(Prod).xcscheme new file mode 100644 index 0000000..28421f9 --- /dev/null +++ b/LibrePass.xcodeproj/xcshareddata/xcschemes/LibrePass(Prod).xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LibrePass.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/LibrePass.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index 0c67376..0000000 --- a/LibrePass.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/LibrePass/Environment.swift b/LibrePass/Environment.swift new file mode 100644 index 0000000..f5c20e5 --- /dev/null +++ b/LibrePass/Environment.swift @@ -0,0 +1,26 @@ +// +// Environment.swift +// LibrePass +// +// Created by Nish on 2024-04-06. +// + +import Foundation + +public enum Environment { + private static let infoDictionary: [String: Any] = { + guard let dict = Bundle.main.infoDictionary else { + fatalError("Plist file not found") + } + return dict + }() + + static let rootURL: String = { + guard let rootURLstring = Environment.infoDictionary["ROOT_URL"] as? String else { + fatalError("Root URL not set in plist for this environment") + } + + return rootURLstring + }() +} + diff --git a/LibrePass/Info.plist b/LibrePass/Info.plist index 0c67376..ae847ca 100644 --- a/LibrePass/Info.plist +++ b/LibrePass/Info.plist @@ -1,5 +1,8 @@ - + + ROOT_URL + ${ROOT_URL} + diff --git a/LibrePass/LibrePassRegistrationWindow.swift b/LibrePass/LibrePassRegistrationWindow.swift index 68be982..a76e620 100644 --- a/LibrePass/LibrePassRegistrationWindow.swift +++ b/LibrePass/LibrePassRegistrationWindow.swift @@ -8,11 +8,11 @@ import SwiftUI struct LibrePassRegistrationWindow: View { - @Environment(\.presentationMode) var presentationMode +// @Environment(\.presentationMode) var presentationMode @Binding var lClient: LibrePassClient - @State var apiServer = "https://api.librepass.org" + @State var apiServer = Environment.rootURL @State var email = String() @State var password = String() @State var confirmPassword = String() @@ -62,7 +62,7 @@ struct LibrePassRegistrationWindow: View { Button("OK", role: .cancel) { if self.registered { self.registered = false - self.presentationMode.wrappedValue.dismiss() +// self.presentationMode.wrappedValue.dismiss() } } } From 45bbe33e127827a05bb5bd19cc2e919ba9df3266 Mon Sep 17 00:00:00 2001 From: Nish Patel Date: Sat, 6 Apr 2024 14:13:40 -0500 Subject: [PATCH 2/3] Fix - Changed Environment file name to CustomEnvironment that resolve the issue of dismiss view due to conflicts of keywords --- LibrePass.xcodeproj/project.pbxproj | 8 ++++---- LibrePass/{Environment.swift => CustomEnvironment.swift} | 4 ++-- LibrePass/LibrePassRegistrationWindow.swift | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) rename LibrePass/{Environment.swift => CustomEnvironment.swift} (78%) diff --git a/LibrePass.xcodeproj/project.pbxproj b/LibrePass.xcodeproj/project.pbxproj index 5c1c439..0efe77f 100644 --- a/LibrePass.xcodeproj/project.pbxproj +++ b/LibrePass.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 176A30622BC1C103005C143E /* Environment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 176A30612BC1C103005C143E /* Environment.swift */; }; + 176A30622BC1C103005C143E /* CustomEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 176A30612BC1C103005C143E /* CustomEnvironment.swift */; }; 3975184DC26DCD2D852A7C08 /* Pods_LibrePass.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A927B022513678BA42B54FCF /* Pods_LibrePass.framework */; }; B23D44F82BA62C6B00097960 /* OATH.swift in Sources */ = {isa = PBXBuildFile; fileRef = B23D44F72BA62C6B00097960 /* OATH.swift */; }; B25257BB2B91149D0028ABF3 /* LibrePassAccountSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = B25257BA2B91149D0028ABF3 /* LibrePassAccountSettings.swift */; }; @@ -35,7 +35,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 176A30612BC1C103005C143E /* Environment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Environment.swift; sourceTree = ""; }; + 176A30612BC1C103005C143E /* CustomEnvironment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomEnvironment.swift; sourceTree = ""; }; 176A306A2BC1C8D8005C143E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29FBE69442CBC35BD7E5388E /* Pods-LibrePass.debug(dev).xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LibrePass.debug(dev).xcconfig"; path = "Target Support Files/Pods-LibrePass/Pods-LibrePass.debug(dev).xcconfig"; sourceTree = ""; }; 7F00EDC76A8230916D3D0E6C /* Pods-LibrePass.release(dev).xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LibrePass.release(dev).xcconfig"; path = "Target Support Files/Pods-LibrePass/Pods-LibrePass.release(dev).xcconfig"; sourceTree = ""; }; @@ -134,7 +134,7 @@ 176A306A2BC1C8D8005C143E /* Info.plist */, B2D444772B87CFF00031A685 /* API */, B2D91A1C2B8393C70004561A /* Assets.xcassets */, - 176A30612BC1C103005C143E /* Environment.swift */, + 176A30612BC1C103005C143E /* CustomEnvironment.swift */, B253F1E22B8394EE00D048F9 /* LibrePass-Bridging-Header.h */, B25257BA2B91149D0028ABF3 /* LibrePassAccountSettings.swift */, B253F1D22B83942B00D048F9 /* LibrePassApp.swift */, @@ -310,7 +310,7 @@ B253F1D82B83942B00D048F9 /* LibrePassLocalLogin.swift in Sources */, B23D44F82BA62C6B00097960 /* OATH.swift in Sources */, B25257BB2B91149D0028ABF3 /* LibrePassAccountSettings.swift in Sources */, - 176A30622BC1C103005C143E /* Environment.swift in Sources */, + 176A30622BC1C103005C143E /* CustomEnvironment.swift in Sources */, B253F1E12B83942B00D048F9 /* LibrePassEncryptedCipher.swift in Sources */, B253F1DB2B83942B00D048F9 /* CredentialsDatabase.swift in Sources */, B253F1DA2B83942B00D048F9 /* LibrePassManagerWindow.swift in Sources */, diff --git a/LibrePass/Environment.swift b/LibrePass/CustomEnvironment.swift similarity index 78% rename from LibrePass/Environment.swift rename to LibrePass/CustomEnvironment.swift index f5c20e5..bd06658 100644 --- a/LibrePass/Environment.swift +++ b/LibrePass/CustomEnvironment.swift @@ -7,7 +7,7 @@ import Foundation -public enum Environment { +public enum CustomEnvironment { private static let infoDictionary: [String: Any] = { guard let dict = Bundle.main.infoDictionary else { fatalError("Plist file not found") @@ -16,7 +16,7 @@ public enum Environment { }() static let rootURL: String = { - guard let rootURLstring = Environment.infoDictionary["ROOT_URL"] as? String else { + guard let rootURLstring = CustomEnvironment.infoDictionary["ROOT_URL"] as? String else { fatalError("Root URL not set in plist for this environment") } diff --git a/LibrePass/LibrePassRegistrationWindow.swift b/LibrePass/LibrePassRegistrationWindow.swift index a76e620..796c4a0 100644 --- a/LibrePass/LibrePassRegistrationWindow.swift +++ b/LibrePass/LibrePassRegistrationWindow.swift @@ -8,11 +8,11 @@ import SwiftUI struct LibrePassRegistrationWindow: View { -// @Environment(\.presentationMode) var presentationMode + @Environment(\.presentationMode) var presentationMode @Binding var lClient: LibrePassClient - @State var apiServer = Environment.rootURL + @State var apiServer = CustomEnvironment.rootURL @State var email = String() @State var password = String() @State var confirmPassword = String() @@ -62,7 +62,7 @@ struct LibrePassRegistrationWindow: View { Button("OK", role: .cancel) { if self.registered { self.registered = false -// self.presentationMode.wrappedValue.dismiss() + self.presentationMode.wrappedValue.dismiss() } } } From 204f787c65501bdcc5c05d510bf0a2f06e028d29 Mon Sep 17 00:00:00 2001 From: Nish Patel Date: Sat, 6 Apr 2024 14:56:06 -0500 Subject: [PATCH 3/3] Fix - Remove auto signing --- LibrePass.xcodeproj/project.pbxproj | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/LibrePass.xcodeproj/project.pbxproj b/LibrePass.xcodeproj/project.pbxproj index 0efe77f..74b921e 100644 --- a/LibrePass.xcodeproj/project.pbxproj +++ b/LibrePass.xcodeproj/project.pbxproj @@ -391,7 +391,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"LibrePass/Preview Content\""; DEVELOPMENT_TEAM = ""; @@ -412,6 +412,7 @@ MARKETING_VERSION = 1.2.0; PRODUCT_BUNDLE_IDENTIFIER = com.github.zapomnij.LibrePass; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -488,7 +489,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"LibrePass/Preview Content\""; DEVELOPMENT_TEAM = ""; @@ -509,6 +510,7 @@ MARKETING_VERSION = 1.2.0; PRODUCT_BUNDLE_IDENTIFIER = com.github.zapomnij.LibrePass; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -648,7 +650,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"LibrePass/Preview Content\""; DEVELOPMENT_TEAM = ""; @@ -669,6 +671,7 @@ MARKETING_VERSION = 1.2.0; PRODUCT_BUNDLE_IDENTIFIER = com.github.zapomnij.LibrePass; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -688,7 +691,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"LibrePass/Preview Content\""; DEVELOPMENT_TEAM = ""; @@ -709,6 +712,7 @@ MARKETING_VERSION = 1.2.0; PRODUCT_BUNDLE_IDENTIFIER = com.github.zapomnij.LibrePass; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;