Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Refactor shared methods to VaultUtils framework, cleanup unused methods (#520)

Leendert de Borstd9588acf0018
diff --git a/apps/mobile-app/ios/.swiftlint.yml b/apps/mobile-app/ios/.swiftlint.yml
index c3eec9928..51e6b8e3c 100644
--- a/apps/mobile-app/ios/.swiftlint.yml
+++ b/apps/mobile-app/ios/.swiftlint.yml
@@ -5,6 +5,8 @@ included:
- VaultStoreKit
- VaultStoreKitTests
- VaultUI
+ - VaultUITests
+ - VaultUtils
excluded:
- Pods
diff --git a/apps/mobile-app/ios/AliasVault.xcodeproj/project.pbxproj b/apps/mobile-app/ios/AliasVault.xcodeproj/project.pbxproj
index 3ec5169cf..e517b3831 100644
--- a/apps/mobile-app/ios/AliasVault.xcodeproj/project.pbxproj
+++ b/apps/mobile-app/ios/AliasVault.xcodeproj/project.pbxproj
@@ -23,6 +23,12 @@
CE48FD632DBEA3B800E5E3D6 /* VaultUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEE4816A2DBE8AC800F4A367 /* VaultUI.framework */; };
CE59C7632E4F47FE0024A246 /* VaultUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEE4816A2DBE8AC800F4A367 /* VaultUI.framework */; };
CE73B3A02DFC8A0C0081B6CB /* AliasVault.icon in Resources */ = {isa = PBXBuildFile; fileRef = CE73B39F2DFC8A0C0081B6CB /* AliasVault.icon */; };
+ CE7782632EA1822400A75E6F /* VaultUtils.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE77825D2EA1822400A75E6F /* VaultUtils.framework */; };
+ CE7782642EA1822400A75E6F /* VaultUtils.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CE77825D2EA1822400A75E6F /* VaultUtils.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+ CE77826E2EA18A2F00A75E6F /* VaultUtils.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE77825D2EA1822400A75E6F /* VaultUtils.framework */; };
+ CE77826F2EA18A2F00A75E6F /* VaultUtils.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CE77825D2EA1822400A75E6F /* VaultUtils.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+ CE7782732EA18A3500A75E6F /* VaultUtils.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE77825D2EA1822400A75E6F /* VaultUtils.framework */; };
+ CE7782742EA18A3500A75E6F /* VaultUtils.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CE77825D2EA1822400A75E6F /* VaultUtils.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
CE9A58FC2DBA982100CB0A4C /* RCTNativeVaultManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE9A58FB2DBA982100CB0A4C /* RCTNativeVaultManager.mm */; };
CE9A5A022DBAAE5000CB0A4C /* RCTNativeVaultManager.h in Sources */ = {isa = PBXBuildFile; fileRef = CE9A58FA2DBA982100CB0A4C /* RCTNativeVaultManager.h */; };
CED3AB3C2E70CF8700F3FDEB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CED3AB3B2E70CF8700F3FDEB /* AppDelegate.swift */; };
@@ -57,6 +63,27 @@
remoteGlobalIDString = CEE481692DBE8AC800F4A367;
remoteInfo = VaultUI;
};
+ CE7782612EA1822400A75E6F /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = CE77825C2EA1822400A75E6F;
+ remoteInfo = VaultUtils;
+ };
+ CE7782702EA18A2F00A75E6F /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = CE77825C2EA1822400A75E6F;
+ remoteInfo = VaultUtils;
+ };
+ CE7782752EA18A3500A75E6F /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = CE77825C2EA1822400A75E6F;
+ remoteInfo = VaultUtils;
+ };
CEE480932DBE86DD00F4A367 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
@@ -109,6 +136,28 @@
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
+ CE7782722EA18A3000A75E6F /* Embed Frameworks */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ CE77826F2EA18A2F00A75E6F /* VaultUtils.framework in Embed Frameworks */,
+ );
+ name = "Embed Frameworks";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ CE7782772EA18A3500A75E6F /* Embed Frameworks */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ CE7782742EA18A3500A75E6F /* VaultUtils.framework in Embed Frameworks */,
+ );
+ name = "Embed Frameworks";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
CEE480A12DBE86DD00F4A367 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
@@ -116,6 +165,7 @@
dstSubfolderSpec = 10;
files = (
CEE4809D2DBE86DD00F4A367 /* VaultStoreKit.framework in Embed Frameworks */,
+ CE7782642EA1822400A75E6F /* VaultUtils.framework in Embed Frameworks */,
CEE481802DBE8AC800F4A367 /* VaultUI.framework in Embed Frameworks */,
CEE482C02DBE8EFF00F4A367 /* VaultModels.framework in Embed Frameworks */,
);
@@ -180,6 +230,7 @@
CE3AE2B02DC7ACD700E7745E /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = "<group>"; };
CE59C75F2E4F47FD0024A246 /* VaultUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VaultUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
CE73B39F2DFC8A0C0081B6CB /* AliasVault.icon */ = {isa = PBXFileReference; lastKnownFileType = folder.iconcomposer.icon; path = AliasVault.icon; sourceTree = "<group>"; };
+ CE77825D2EA1822400A75E6F /* VaultUtils.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = VaultUtils.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CE9A58FA2DBA982100CB0A4C /* RCTNativeVaultManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTNativeVaultManager.h; sourceTree = "<group>"; };
CE9A58FB2DBA982100CB0A4C /* RCTNativeVaultManager.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTNativeVaultManager.mm; sourceTree = "<group>"; };
CE9A5B662DBAE42B00CB0A4C /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
@@ -209,6 +260,7 @@
/* Begin PBXFileSystemSynchronizedRootGroup section */
CE59C7602E4F47FD0024A246 /* VaultUITests */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = VaultUITests; sourceTree = "<group>"; };
+ CE77825E2EA1822400A75E6F /* VaultUtils */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = VaultUtils; sourceTree = "<group>"; };
CEE480882DBE86DC00F4A367 /* VaultStoreKit */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = VaultStoreKit; sourceTree = "<group>"; };
CEE480972DBE86DD00F4A367 /* VaultStoreKitTests */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = VaultStoreKitTests; sourceTree = "<group>"; };
CEE4816B2DBE8AC800F4A367 /* VaultUI */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = VaultUI; sourceTree = "<group>"; };
@@ -225,6 +277,7 @@
CEE482BF2DBE8EFF00F4A367 /* VaultModels.framework in Frameworks */,
CEE4809C2DBE86DD00F4A367 /* VaultStoreKit.framework in Frameworks */,
3D1B0279B0714C8FF732D2D3 /* libPods-AliasVault.a in Frameworks */,
+ CE7782632EA1822400A75E6F /* VaultUtils.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -237,11 +290,19 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ CE77825A2EA1822400A75E6F /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
CEE480842DBE86DC00F4A367 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
CE48FCEC2DBE939A00E5E3D6 /* VaultModels.framework in Frameworks */,
+ CE7782732EA18A3500A75E6F /* VaultUtils.framework in Frameworks */,
9E8B9B9318C79E9CBB868429 /* libPods-VaultStoreKit.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -260,6 +321,7 @@
buildActionMask = 2147483647;
files = (
CEE482CB2DBE8F2B00F4A367 /* VaultModels.framework in Frameworks */,
+ CE77826E2EA18A2F00A75E6F /* VaultUtils.framework in Frameworks */,
1381C2F6D317F2404928BA59 /* libPods-VaultUI.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -335,11 +397,12 @@
13B07FAE1A68108700A75B9A /* AliasVault */,
CEE909812DA548C7008D568F /* Autofill */,
D7E4C46ADA2E9064B798F356 /* ExpoModulesProviders */,
+ CEE482AB2DBE8EFE00F4A367 /* VaultModels */,
CEE480882DBE86DC00F4A367 /* VaultStoreKit */,
CEE480972DBE86DD00F4A367 /* VaultStoreKitTests */,
CEE4816B2DBE8AC800F4A367 /* VaultUI */,
- CEE482AB2DBE8EFE00F4A367 /* VaultModels */,
CE59C7602E4F47FD0024A246 /* VaultUITests */,
+ CE77825E2EA1822400A75E6F /* VaultUtils */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
D65327D7A22EEC0BE12398D9 /* Pods */,
@@ -360,6 +423,7 @@
CEE4816A2DBE8AC800F4A367 /* VaultUI.framework */,
CEE482AA2DBE8EFE00F4A367 /* VaultModels.framework */,
CE59C75F2E4F47FD0024A246 /* VaultUITests.xctest */,
+ CE77825D2EA1822400A75E6F /* VaultUtils.framework */,
);
name = Products;
sourceTree = "<group>";
@@ -426,6 +490,13 @@
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
+ CE7782582EA1822400A75E6F /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
CEE480822DBE86DC00F4A367 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
@@ -473,6 +544,7 @@
CEE4809B2DBE86DD00F4A367 /* PBXTargetDependency */,
CEE4817E2DBE8AC800F4A367 /* PBXTargetDependency */,
CEE482BE2DBE8EFF00F4A367 /* PBXTargetDependency */,
+ CE7782622EA1822400A75E6F /* PBXTargetDependency */,
);
name = AliasVault;
productName = AliasVault;
@@ -501,6 +573,29 @@
productReference = CE59C75F2E4F47FD0024A246 /* VaultUITests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
+ CE77825C2EA1822400A75E6F /* VaultUtils */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = CE7782652EA1822400A75E6F /* Build configuration list for PBXNativeTarget "VaultUtils" */;
+ buildPhases = (
+ CE7782582EA1822400A75E6F /* Headers */,
+ CE7782592EA1822400A75E6F /* Sources */,
+ CE77825A2EA1822400A75E6F /* Frameworks */,
+ CE77825B2EA1822400A75E6F /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ fileSystemSynchronizedGroups = (
+ CE77825E2EA1822400A75E6F /* VaultUtils */,
+ );
+ name = VaultUtils;
+ packageProductDependencies = (
+ );
+ productName = VaultUtils;
+ productReference = CE77825D2EA1822400A75E6F /* VaultUtils.framework */;
+ productType = "com.apple.product-type.framework";
+ };
CEE480862DBE86DC00F4A367 /* VaultStoreKit */ = {
isa = PBXNativeTarget;
buildConfigurationList = CEE4809E2DBE86DD00F4A367 /* Build configuration list for PBXNativeTarget "VaultStoreKit" */;
@@ -510,10 +605,12 @@
CEE480832DBE86DC00F4A367 /* Sources */,
CEE480842DBE86DC00F4A367 /* Frameworks */,
CEE480852DBE86DC00F4A367 /* Resources */,
+ CE7782772EA18A3500A75E6F /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
+ CE7782762EA18A3500A75E6F /* PBXTargetDependency */,
);
fileSystemSynchronizedGroups = (
CEE480882DBE86DC00F4A367 /* VaultStoreKit */,
@@ -555,10 +652,12 @@
CEE481662DBE8AC800F4A367 /* Sources */,
CEE481672DBE8AC800F4A367 /* Frameworks */,
CEE481682DBE8AC800F4A367 /* Resources */,
+ CE7782722EA18A3000A75E6F /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
+ CE7782712EA18A2F00A75E6F /* PBXTargetDependency */,
);
fileSystemSynchronizedGroups = (
CEE4816B2DBE8AC800F4A367 /* VaultUI */,
@@ -620,7 +719,7 @@
83CBB9F71A601CBA00E9B192 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastSwiftUpdateCheck = 1640;
+ LastSwiftUpdateCheck = 2600;
LastUpgradeCheck = 1130;
TargetAttributes = {
13B07F861A680F5B00A75B9A = {
@@ -629,6 +728,9 @@
CE59C75E2E4F47FD0024A246 = {
CreatedOnToolsVersion = 16.4;
};
+ CE77825C2EA1822400A75E6F = {
+ CreatedOnToolsVersion = 26.0.1;
+ };
CEE480862DBE86DC00F4A367 = {
CreatedOnToolsVersion = 16.3;
};
@@ -684,6 +786,7 @@
CEE481692DBE8AC800F4A367 /* VaultUI */,
CE59C75E2E4F47FD0024A246 /* VaultUITests */,
CEE482A92DBE8EFE00F4A367 /* VaultModels */,
+ CE77825C2EA1822400A75E6F /* VaultUtils */,
);
};
/* End PBXProject section */
@@ -708,6 +811,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ CE77825B2EA1822400A75E6F /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
CEE480852DBE86DC00F4A367 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -1051,6 +1161,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ CE7782592EA1822400A75E6F /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
CEE480832DBE86DC00F4A367 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -1099,6 +1216,21 @@
target = CEE481692DBE8AC800F4A367 /* VaultUI */;
targetProxy = CE59C7642E4F47FE0024A246 /* PBXContainerItemProxy */;
};
+ CE7782622EA1822400A75E6F /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = CE77825C2EA1822400A75E6F /* VaultUtils */;
+ targetProxy = CE7782612EA1822400A75E6F /* PBXContainerItemProxy */;
+ };
+ CE7782712EA18A2F00A75E6F /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = CE77825C2EA1822400A75E6F /* VaultUtils */;
+ targetProxy = CE7782702EA18A2F00A75E6F /* PBXContainerItemProxy */;
+ };
+ CE7782762EA18A3500A75E6F /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = CE77825C2EA1822400A75E6F /* VaultUtils */;
+ targetProxy = CE7782752EA18A3500A75E6F /* PBXContainerItemProxy */;
+ };
CEE480942DBE86DD00F4A367 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = CEE480862DBE86DC00F4A367 /* VaultStoreKit */;
@@ -1399,6 +1531,116 @@
};
name = Release;
};
+ CE7782662EA1822400A75E6F /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ DEVELOPMENT_TEAM = 8PHW4HN3F7;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ ENABLE_MODULE_VERIFIER = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GENERATE_INFOPLIST_FILE = YES;
+ INFOPLIST_KEY_NSHumanReadableCopyright = "";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ IPHONEOS_DEPLOYMENT_TARGET = 26.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MARKETING_VERSION = 1.0;
+ MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
+ MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = net.aliasvault.app.VaultUtils;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ SKIP_INSTALL = YES;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
+ SWIFT_APPROACHABLE_CONCURRENCY = YES;
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_INSTALL_MODULE = YES;
+ SWIFT_INSTALL_OBJC_HEADER = NO;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = Debug;
+ };
+ CE7782672EA1822400A75E6F /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_STYLE = Automatic;
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DEVELOPMENT_TEAM = 8PHW4HN3F7;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ ENABLE_MODULE_VERIFIER = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GENERATE_INFOPLIST_FILE = YES;
+ INFOPLIST_KEY_NSHumanReadableCopyright = "";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ IPHONEOS_DEPLOYMENT_TARGET = 26.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@loader_path/Frameworks",
+ );
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MARKETING_VERSION = 1.0;
+ MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
+ MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
+ MTL_FAST_MATH = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = net.aliasvault.app.VaultUtils;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ SKIP_INSTALL = YES;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
+ SWIFT_APPROACHABLE_CONCURRENCY = YES;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_INSTALL_MODULE = YES;
+ SWIFT_INSTALL_OBJC_HEADER = NO;
+ SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = Release;
+ };
CEE4809F2DBE86DD00F4A367 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 09DFCC3CBA13D19073CBCC7F /* Pods-VaultStoreKit.debug.xcconfig */;
@@ -1890,6 +2132,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ CE7782652EA1822400A75E6F /* Build configuration list for PBXNativeTarget "VaultUtils" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ CE7782662EA1822400A75E6F /* Debug */,
+ CE7782672EA1822400A75E6F /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
CEE4809E2DBE86DD00F4A367 /* Build configuration list for PBXNativeTarget "VaultStoreKit" */ = {
isa = XCConfigurationList;
buildConfigurations = (
diff --git a/apps/mobile-app/ios/VaultStoreKit/CredentialIdentityStore.swift b/apps/mobile-app/ios/VaultStoreKit/CredentialIdentityStore.swift
index ecd6a54d2..91b14b9ab 100644
--- a/apps/mobile-app/ios/VaultStoreKit/CredentialIdentityStore.swift
+++ b/apps/mobile-app/ios/VaultStoreKit/CredentialIdentityStore.swift
@@ -1,5 +1,6 @@
import AuthenticationServices
import VaultModels
+import VaultUtils
/**
* Native iOS implementation of the CredentialIdentityStore protocol.
@@ -68,7 +69,7 @@ public class CredentialIdentityStore {
)
// Use the same logic as the UI for determining the identifier
- let identifier = Helpers.usernameOrEmail(credential: credential)
+ let identifier = CredentialHelpers.usernameOrEmail(credential: credential)
guard !identifier.isEmpty else {
return nil // Skip credentials with no identifier
}
@@ -107,7 +108,7 @@ public class CredentialIdentityStore {
}
// Use the same logic as the UI for determining the identifier
- let identifier = Helpers.usernameOrEmail(credential: credential)
+ let identifier = CredentialHelpers.usernameOrEmail(credential: credential)
guard !identifier.isEmpty else {
return nil // Skip credentials with no identifier
}
@@ -137,7 +138,7 @@ public class CredentialIdentityStore {
.compactMap { passkey in
// Get the userName for display in iOS AutoFill UI
// Passkeys don't store userName in the database, so we use the credential's username or email
- let userName = passkey.userName ?? Helpers.usernameOrEmail(credential: credential)
+ let userName = passkey.userName ?? CredentialHelpers.usernameOrEmail(credential: credential)
// Convert passkey.Id to bytes for credentialID
let credentialId = try? PasskeyHelper.guidToBytes(passkey.id.uuidString)
diff --git a/apps/mobile-app/ios/VaultStoreKit/Utils/Helpers.swift b/apps/mobile-app/ios/VaultStoreKit/Utils/Helpers.swift
deleted file mode 100644
index 6790b573d..000000000
--- a/apps/mobile-app/ios/VaultStoreKit/Utils/Helpers.swift
+++ /dev/null
@@ -1,20 +0,0 @@
-import Foundation
-import VaultModels
-
-/**
- * Helpers
- * -------------------------
- * Generic utility class for general helper functions.
- */
-public class Helpers {
- /// Returns username or email depending on if they are not null
- public static func usernameOrEmail(credential: Credential) -> String {
- if let username = credential.username, !username.isEmpty {
- return username
- }
- if let email = credential.alias?.email, !email.isEmpty {
- return email
- }
- return ""
- }
-}
diff --git a/apps/mobile-app/ios/VaultStoreKit/VaultStore+Auth.swift b/apps/mobile-app/ios/VaultStoreKit/VaultStore+Auth.swift
index d6776a67d..e6f800a95 100644
--- a/apps/mobile-app/ios/VaultStoreKit/VaultStore+Auth.swift
+++ b/apps/mobile-app/ios/VaultStoreKit/VaultStore+Auth.swift
@@ -41,16 +41,4 @@ extension VaultStore {
public func getAuthMethods() -> AuthMethods {
return self.enabledAuthMethods
}
-
- /// Get the enabled authentication methods for the vault as strings
- public func getAuthMethodsAsStrings() -> [String] {
- var methods: [String] = []
- if self.enabledAuthMethods.contains(.faceID) {
- methods.append("faceid")
- }
- if self.enabledAuthMethods.contains(.password) {
- methods.append("password")
- }
- return methods
- }
}
diff --git a/apps/mobile-app/ios/VaultStoreKit/VaultStore+Crypto.swift b/apps/mobile-app/ios/VaultStoreKit/VaultStore+Crypto.swift
index c598845e7..3d675061b 100644
--- a/apps/mobile-app/ios/VaultStoreKit/VaultStore+Crypto.swift
+++ b/apps/mobile-app/ios/VaultStoreKit/VaultStore+Crypto.swift
@@ -65,11 +65,6 @@ extension VaultStore {
print("Stored key in memory, will be persisted in keychain upon succesful decrypt operation")
}
- /// Check if a encryption key is stored in memory
- public func hasEncryptionKeyInMemory() -> Bool {
- return self.encryptionKey != nil
- }
-
/// Store the key derivation parameters used for deriving the encryption key from the plain text password
public func storeEncryptionKeyDerivationParams(_ keyDerivationParams: String) throws {
// Store the key derivation params in memory
diff --git a/apps/mobile-app/ios/VaultStoreKit/VaultStore+Passkey.swift b/apps/mobile-app/ios/VaultStoreKit/VaultStore+Passkey.swift
index 15e9e5d8f..dd6fdfc13 100644
--- a/apps/mobile-app/ios/VaultStoreKit/VaultStore+Passkey.swift
+++ b/apps/mobile-app/ios/VaultStoreKit/VaultStore+Passkey.swift
@@ -1,6 +1,7 @@
import Foundation
import SQLite
import VaultModels
+import VaultUtils
/**
* VaultStore+Passkey
@@ -179,8 +180,8 @@ extension VaultStore {
}
// Parse dates
- guard let createdAt = parseDateString(createdAtString),
- let updatedAt = parseDateString(updatedAtString) else {
+ guard let createdAt = DateHelpers.parseDateString(createdAtString),
+ let updatedAt = DateHelpers.parseDateString(updatedAtString) else {
print("VaultStore+Passkey: Invalid date in passkey row - created=\(createdAtString), updated=\(updatedAtString)")
return nil
}
@@ -462,54 +463,6 @@ extension VaultStore {
try insertPasskey(updatedPasskey)
}
-
- /**
- * Parse a date string to a Date object for use in queries.
- */
- private func parseDateString(_ dateString: String) -> Date? {
- struct StaticFormatters {
- static let formatterWithMillis: DateFormatter = {
- let formatter = DateFormatter()
- formatter.dateFormat = "yyyy-MM-dd HH:mm:ss.SSS"
- formatter.locale = Locale(identifier: "en_US_POSIX")
- formatter.timeZone = TimeZone(secondsFromGMT: 0)
- return formatter
- }()
-
- static let formatterWithoutMillis: DateFormatter = {
- let formatter = DateFormatter()
- formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
- formatter.locale = Locale(identifier: "en_US_POSIX")
- formatter.timeZone = TimeZone(secondsFromGMT: 0)
- return formatter
- }()
-
- static let isoFormatter: ISO8601DateFormatter = {
- let formatter = ISO8601DateFormatter()
- formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
- formatter.timeZone = TimeZone(secondsFromGMT: 0)
- return formatter
- }()
- }
-
- let cleanedDateString = dateString.trimmingCharacters(in: .whitespacesAndNewlines)
-
- if cleanedDateString.contains("Z") || cleanedDateString.contains("+") || cleanedDateString.contains("-") {
- if let isoDate = StaticFormatters.isoFormatter.date(from: cleanedDateString) {
- return isoDate
- }
- }
-
- if let dateWithMillis = StaticFormatters.formatterWithMillis.date(from: cleanedDateString) {
- return dateWithMillis
- }
-
- if let dateWithoutMillis = StaticFormatters.formatterWithoutMillis.date(from: cleanedDateString) {
- return dateWithoutMillis
- }
-
- return nil
- }
}
/**
diff --git a/apps/mobile-app/ios/VaultStoreKit/VaultStore+Query.swift b/apps/mobile-app/ios/VaultStoreKit/VaultStore+Query.swift
index 71baf15da..1ef9ea4e4 100644
--- a/apps/mobile-app/ios/VaultStoreKit/VaultStore+Query.swift
+++ b/apps/mobile-app/ios/VaultStoreKit/VaultStore+Query.swift
@@ -1,6 +1,7 @@
import Foundation
import SQLite
import VaultModels
+import VaultUtils
/// Extension for the VaultStore class to handle query management
extension VaultStore {
@@ -222,8 +223,8 @@ extension VaultStore {
continue
}
- guard let createdAt = parseDateString(createdAtString),
- let updatedAt = parseDateString(updatedAtString) else {
+ guard let createdAt = DateHelpers.parseDateString(createdAtString),
+ let updatedAt = DateHelpers.parseDateString(updatedAtString) else {
continue
}
@@ -234,8 +235,8 @@ extension VaultStore {
let serviceCreatedAtString = row[11] as? String,
let serviceUpdatedAtString = row[12] as? String,
let serviceIsDeletedInt64 = row[13] as? Int64,
- let serviceCreatedAt = parseDateString(serviceCreatedAtString),
- let serviceUpdatedAt = parseDateString(serviceUpdatedAtString) else {
+ let serviceCreatedAt = DateHelpers.parseDateString(serviceCreatedAtString),
+ let serviceUpdatedAt = DateHelpers.parseDateString(serviceUpdatedAtString) else {
continue
}
@@ -256,14 +257,14 @@ extension VaultStore {
let aliasCreatedAtString = row[26] as? String,
let aliasUpdatedAtString = row[27] as? String,
let aliasIsDeletedInt64 = row[28] as? Int64,
- let aliasCreatedAt = parseDateString(aliasCreatedAtString),
- let aliasUpdatedAt = parseDateString(aliasUpdatedAtString) {
+ let aliasCreatedAt = DateHelpers.parseDateString(aliasCreatedAtString),
+ let aliasUpdatedAt = DateHelpers.parseDateString(aliasUpdatedAtString) {
let aliasIsDeleted = aliasIsDeletedInt64 == 1
let aliasBirthDate: Date
if let aliasBirthDateString = row[24] as? String,
- let parsedBirthDate = parseDateString(aliasBirthDateString) {
+ let parsedBirthDate = DateHelpers.parseDateString(aliasBirthDateString) {
aliasBirthDate = parsedBirthDate
} else {
// Use 0001-01-01 00:00 as the default date if birthDate is null
@@ -297,8 +298,8 @@ extension VaultStore {
let passwordCreatedAtString = row[16] as? String,
let passwordUpdatedAtString = row[17] as? String,
let passwordIsDeletedInt64 = row[18] as? Int64,
- let passwordCreatedAt = parseDateString(passwordCreatedAtString),
- let passwordUpdatedAt = parseDateString(passwordUpdatedAtString) {
+ let passwordCreatedAt = DateHelpers.parseDateString(passwordCreatedAtString),
+ let passwordUpdatedAt = DateHelpers.parseDateString(passwordUpdatedAtString) {
let passwordIsDeleted = passwordIsDeletedInt64 == 1
@@ -346,55 +347,4 @@ extension VaultStore {
return credentials
}
-
- /// Parse a date string to a Date object for use in queries.
- private func parseDateString(_ dateString: String) -> Date? {
- // Static date formatters for performance
- struct StaticFormatters {
- static let formatterWithMillis: DateFormatter = {
- let formatter = DateFormatter()
- formatter.dateFormat = "yyyy-MM-dd HH:mm:ss.SSS"
- formatter.locale = Locale(identifier: "en_US_POSIX")
- formatter.timeZone = TimeZone(secondsFromGMT: 0)
- return formatter
- }()
-
- static let formatterWithoutMillis: DateFormatter = {
- let formatter = DateFormatter()
- formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
- formatter.locale = Locale(identifier: "en_US_POSIX")
- formatter.timeZone = TimeZone(secondsFromGMT: 0)
- return formatter
- }()
-
- static let isoFormatter: ISO8601DateFormatter = {
- let formatter = ISO8601DateFormatter()
- formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
- formatter.timeZone = TimeZone(secondsFromGMT: 0)
- return formatter
- }()
- }
-
- let cleanedDateString = dateString.trimmingCharacters(in: .whitespacesAndNewlines)
-
- // If ends with 'Z' or contains timezone, attempt ISO8601 parsing
- if cleanedDateString.contains("Z") || cleanedDateString.contains("+") || cleanedDateString.contains("-") {
- if let isoDate = StaticFormatters.isoFormatter.date(from: cleanedDateString) {
- return isoDate
- }
- }
-
- // Try parsing with milliseconds
- if let dateWithMillis = StaticFormatters.formatterWithMillis.date(from: cleanedDateString) {
- return dateWithMillis
- }
-
- // Try parsing without milliseconds
- if let dateWithoutMillis = StaticFormatters.formatterWithoutMillis.date(from: cleanedDateString) {
- return dateWithoutMillis
- }
-
- // If parsing still fails, return nil
- return nil
- }
}
diff --git a/apps/mobile-app/ios/VaultUI/Selection/Components/CredentialCardView.swift b/apps/mobile-app/ios/VaultUI/Selection/Components/CredentialCardView.swift
index e988d4d50..1538b2c48 100644
--- a/apps/mobile-app/ios/VaultUI/Selection/Components/CredentialCardView.swift
+++ b/apps/mobile-app/ios/VaultUI/Selection/Components/CredentialCardView.swift
@@ -1,5 +1,6 @@
import SwiftUI
import VaultModels
+import VaultUtils
/// Credential card view
public struct CredentialCard: View {
@@ -28,7 +29,7 @@ public struct CredentialCard: View {
.font(.headline)
.foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)
- Text(truncateText(usernameOrEmail(credential: credential), limit: 26))
+ Text(truncateText(CredentialHelpers.usernameOrEmail(credential: credential), limit: 26))
.font(.subheadline)
.foregroundColor(colorScheme == .dark ? ColorConstants.Dark.textMuted : ColorConstants.Light.textMuted)
}
@@ -139,17 +140,6 @@ public struct CredentialCard: View {
}
}
-/// Returns username or email depending on if they are not null
-public func usernameOrEmail(credential: Credential) -> String {
- if let username = credential.username, !username.isEmpty {
- return username
- }
- if let email = credential.alias?.email, !email.isEmpty {
- return email
- }
- return ""
-}
-
/// Truncate text to a maximum limit and appends "..." at the end
public func truncateText(_ text: String?, limit: Int) -> String {
guard let text = text else { return "" }
diff --git a/apps/mobile-app/ios/VaultUtils/CredentialHelpers.swift b/apps/mobile-app/ios/VaultUtils/CredentialHelpers.swift
new file mode 100644
index 000000000..0559bb061
--- /dev/null
+++ b/apps/mobile-app/ios/VaultUtils/CredentialHelpers.swift
@@ -0,0 +1,23 @@
+import Foundation
+import VaultModels
+
+/**
+ * CredentialHelpers
+ * -------------------------
+ * Utility functions for working with Credential objects.
+ */
+public class CredentialHelpers {
+ /// Returns username or email from a credential, depending on which is available.
+ /// Prioritizes username over email.
+ /// - Parameter credential: The credential to extract the identifier from
+ /// - Returns: Username if available, otherwise email, or empty string if neither exists
+ public static func usernameOrEmail(credential: Credential) -> String {
+ if let username = credential.username, !username.isEmpty {
+ return username
+ }
+ if let email = credential.alias?.email, !email.isEmpty {
+ return email
+ }
+ return ""
+ }
+}
diff --git a/apps/mobile-app/ios/VaultUtils/DateHelpers.swift b/apps/mobile-app/ios/VaultUtils/DateHelpers.swift
new file mode 100644
index 000000000..016dda063
--- /dev/null
+++ b/apps/mobile-app/ios/VaultUtils/DateHelpers.swift
@@ -0,0 +1,63 @@
+import Foundation
+
+/**
+ * DateHelpers
+ * -------------------------
+ * Utility functions for date parsing and formatting in the Vault system.
+ */
+public class DateHelpers {
+ /// Parse a date string to a Date object for use in queries.
+ /// Supports multiple formats:
+ /// - ISO8601 with fractional seconds and timezone
+ /// - "yyyy-MM-dd HH:mm:ss.SSS"
+ /// - "yyyy-MM-dd HH:mm:ss"
+ public static func parseDateString(_ dateString: String) -> Date? {
+ // Static date formatters for performance
+ struct StaticFormatters {
+ static let formatterWithMillis: DateFormatter = {
+ let formatter = DateFormatter()
+ formatter.dateFormat = "yyyy-MM-dd HH:mm:ss.SSS"
+ formatter.locale = Locale(identifier: "en_US_POSIX")
+ formatter.timeZone = TimeZone(secondsFromGMT: 0)
+ return formatter
+ }()
+
+ static let formatterWithoutMillis: DateFormatter = {
+ let formatter = DateFormatter()
+ formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
+ formatter.locale = Locale(identifier: "en_US_POSIX")
+ formatter.timeZone = TimeZone(secondsFromGMT: 0)
+ return formatter
+ }()
+
+ static let isoFormatter: ISO8601DateFormatter = {
+ let formatter = ISO8601DateFormatter()
+ formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
+ formatter.timeZone = TimeZone(secondsFromGMT: 0)
+ return formatter
+ }()
+ }
+
+ let cleanedDateString = dateString.trimmingCharacters(in: .whitespacesAndNewlines)
+
+ // If ends with 'Z' or contains timezone, attempt ISO8601 parsing
+ if cleanedDateString.contains("Z") || cleanedDateString.contains("+") || cleanedDateString.contains("-") {
+ if let isoDate = StaticFormatters.isoFormatter.date(from: cleanedDateString) {
+ return isoDate
+ }
+ }
+
+ // Try parsing with milliseconds
+ if let dateWithMillis = StaticFormatters.formatterWithMillis.date(from: cleanedDateString) {
+ return dateWithMillis
+ }
+
+ // Try parsing without milliseconds
+ if let dateWithoutMillis = StaticFormatters.formatterWithoutMillis.date(from: cleanedDateString) {
+ return dateWithoutMillis
+ }
+
+ // If parsing still fails, return nil
+ return nil
+ }
+}