Merge branch 'mikunj/loki-kit'

This commit is contained in:
Mikunj 2019-05-03 11:24:10 +10:00
commit e45afca912
25 changed files with 777 additions and 5 deletions

50
LokiKit/LokiKit.podspec Normal file
View File

@ -0,0 +1,50 @@
#
# Be sure to run `pod spec lint LokiKit.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#
Pod::Spec.new do |s|
s.name = "LokiKit"
s.version = "0.0.1"
s.summary = "A library used to add loki functionality to the messenger"
s.description = <<-DESC
A library used to add loki functionality to the messenger
DESC
s.homepage = "https://loki.network/"
s.license = "GPLv3"
s.source = { :path => '.' }
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
s.author = { "Loki Network" => "team@loki.network" }
s.platform = :ios, '9.0'
s.requires_arc = true
s.source_files = 'src/**/*.{h,m,mm,swift}'
# We want to use modules to avoid clobbering CocoaLumberjack macros defined
# by other OWS modules which *also* import CocoaLumberjack. But because we
# also use Objective-C++, modules are disabled unless we explicitly enable
# them
# s.compiler_flags = "-fcxx-modules"
# s.prefix_header_file = 'SignalServiceKit/src/TSPrefix.h'
# s.xcconfig = { 'OTHER_CFLAGS' => '$(inherited) -DSQLITE_HAS_CODEC' }
# s.resources = ["SignalServiceKit/Resources/Certificates/*"]
s.dependency 'Curve25519Kit'
s.dependency 'CryptoSwift'
s.dependency 'SignalCoreKit'
s.test_spec 'Tests' do |test_spec|
test_spec.source_files = 'LokiKitTests/**/*.{h,m,swift}'
end
end

View File

@ -0,0 +1,587 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
2470AF66227BD02E00D2F01F /* ECKeyPair.m in Sources */ = {isa = PBXBuildFile; fileRef = 2470AF5B227BD02D00D2F01F /* ECKeyPair.m */; };
2470AF67227BD02E00D2F01F /* ECKeyPair.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2470AF5C227BD02D00D2F01F /* ECKeyPair.swift */; };
2470AF68227BD02E00D2F01F /* japanese.txt in Resources */ = {isa = PBXBuildFile; fileRef = 2470AF5E227BD02E00D2F01F /* japanese.txt */; };
2470AF69227BD02E00D2F01F /* Mnemonic.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2470AF5F227BD02E00D2F01F /* Mnemonic.swift */; };
2470AF6A227BD02E00D2F01F /* english.txt in Resources */ = {isa = PBXBuildFile; fileRef = 2470AF60227BD02E00D2F01F /* english.txt */; };
2470AF6B227BD02E00D2F01F /* spanish.txt in Resources */ = {isa = PBXBuildFile; fileRef = 2470AF61227BD02E00D2F01F /* spanish.txt */; };
2470AF6C227BD02E00D2F01F /* portuguese.txt in Resources */ = {isa = PBXBuildFile; fileRef = 2470AF62227BD02E00D2F01F /* portuguese.txt */; };
2470AF6D227BD02E00D2F01F /* ProofOfWork.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2470AF63227BD02E00D2F01F /* ProofOfWork.swift */; };
2470AF6E227BD02E00D2F01F /* BuildConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2470AF64227BD02E00D2F01F /* BuildConfiguration.swift */; };
2470AF6F227BD02E00D2F01F /* ECKeyPair.h in Headers */ = {isa = PBXBuildFile; fileRef = 2470AF65227BD02E00D2F01F /* ECKeyPair.h */; settings = {ATTRIBUTES = (Public, ); }; };
24B23964227BBA2D008EFC1C /* LokiKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24B2395A227BBA2D008EFC1C /* LokiKit.framework */; };
24B23969227BBA2D008EFC1C /* LokiKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24B23968227BBA2D008EFC1C /* LokiKitTests.swift */; };
24B2396B227BBA2D008EFC1C /* LokiKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 24B2395D227BBA2D008EFC1C /* LokiKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
F61025585B2E8A504887E1F9 /* Pods_LokiKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 090A2756AF3B96A1A6F7208C /* Pods_LokiKit.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
24B23965227BBA2D008EFC1C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 24B23951227BBA2D008EFC1C /* Project object */;
proxyType = 1;
remoteGlobalIDString = 24B23959227BBA2D008EFC1C;
remoteInfo = LokiKit;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
090A2756AF3B96A1A6F7208C /* Pods_LokiKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LokiKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2470AF5B227BD02D00D2F01F /* ECKeyPair.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ECKeyPair.m; sourceTree = "<group>"; };
2470AF5C227BD02D00D2F01F /* ECKeyPair.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ECKeyPair.swift; sourceTree = "<group>"; };
2470AF5E227BD02E00D2F01F /* japanese.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = japanese.txt; sourceTree = "<group>"; };
2470AF5F227BD02E00D2F01F /* Mnemonic.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Mnemonic.swift; sourceTree = "<group>"; };
2470AF60227BD02E00D2F01F /* english.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = english.txt; sourceTree = "<group>"; };
2470AF61227BD02E00D2F01F /* spanish.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = spanish.txt; sourceTree = "<group>"; };
2470AF62227BD02E00D2F01F /* portuguese.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = portuguese.txt; sourceTree = "<group>"; };
2470AF63227BD02E00D2F01F /* ProofOfWork.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProofOfWork.swift; sourceTree = "<group>"; };
2470AF64227BD02E00D2F01F /* BuildConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BuildConfiguration.swift; sourceTree = "<group>"; };
2470AF65227BD02E00D2F01F /* ECKeyPair.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ECKeyPair.h; sourceTree = "<group>"; };
24B2395A227BBA2D008EFC1C /* LokiKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LokiKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
24B2395D227BBA2D008EFC1C /* LokiKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LokiKit.h; sourceTree = "<group>"; };
24B2395E227BBA2D008EFC1C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
24B23963227BBA2D008EFC1C /* LokiKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LokiKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
24B23968227BBA2D008EFC1C /* LokiKitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LokiKitTests.swift; sourceTree = "<group>"; };
24B2396A227BBA2D008EFC1C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
24B2398B227BBB21008EFC1C /* LokiKit.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; fileEncoding = 4; path = LokiKit.podspec; sourceTree = SOURCE_ROOT; };
24B2398E227BBEDA008EFC1C /* CryptoSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CryptoSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
24B23990227BBEDC008EFC1C /* Curve25519Kit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Curve25519Kit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
24B23992227BBEE2008EFC1C /* SignalServiceKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SignalServiceKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D5C29CCA1A7CDF6063649ED2 /* Pods-LokiKit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LokiKit.release.xcconfig"; path = "../Pods/Target Support Files/Pods-LokiKit/Pods-LokiKit.release.xcconfig"; sourceTree = "<group>"; };
E08CB8D0C89F4717B2D51D41 /* Pods-LokiKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LokiKit.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-LokiKit/Pods-LokiKit.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
24B23957227BBA2D008EFC1C /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F61025585B2E8A504887E1F9 /* Pods_LokiKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
24B23960227BBA2D008EFC1C /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
24B23964227BBA2D008EFC1C /* LokiKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
2470AF5A227BD01100D2F01F /* Supporting Files */ = {
isa = PBXGroup;
children = (
24B2395D227BBA2D008EFC1C /* LokiKit.h */,
24B2395E227BBA2D008EFC1C /* Info.plist */,
);
path = "Supporting Files";
sourceTree = "<group>";
};
2470AF5D227BD02E00D2F01F /* Mnemonic */ = {
isa = PBXGroup;
children = (
2470AF5E227BD02E00D2F01F /* japanese.txt */,
2470AF5F227BD02E00D2F01F /* Mnemonic.swift */,
2470AF60227BD02E00D2F01F /* english.txt */,
2470AF61227BD02E00D2F01F /* spanish.txt */,
2470AF62227BD02E00D2F01F /* portuguese.txt */,
);
path = Mnemonic;
sourceTree = "<group>";
};
24B23950227BBA2D008EFC1C = {
isa = PBXGroup;
children = (
24B2395C227BBA2D008EFC1C /* LokiKit */,
24B23967227BBA2D008EFC1C /* LokiKitTests */,
24B2395B227BBA2D008EFC1C /* Products */,
24B2398D227BBED9008EFC1C /* Frameworks */,
E103B305EE1E5ECDD2D72DDC /* Pods */,
);
sourceTree = "<group>";
};
24B2395B227BBA2D008EFC1C /* Products */ = {
isa = PBXGroup;
children = (
24B2395A227BBA2D008EFC1C /* LokiKit.framework */,
24B23963227BBA2D008EFC1C /* LokiKitTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
24B2395C227BBA2D008EFC1C /* LokiKit */ = {
isa = PBXGroup;
children = (
2470AF64227BD02E00D2F01F /* BuildConfiguration.swift */,
2470AF65227BD02E00D2F01F /* ECKeyPair.h */,
2470AF5B227BD02D00D2F01F /* ECKeyPair.m */,
2470AF5C227BD02D00D2F01F /* ECKeyPair.swift */,
2470AF5D227BD02E00D2F01F /* Mnemonic */,
2470AF63227BD02E00D2F01F /* ProofOfWork.swift */,
2470AF5A227BD01100D2F01F /* Supporting Files */,
24B2398A227BBB14008EFC1C /* Pod */,
);
path = LokiKit;
sourceTree = "<group>";
};
24B23967227BBA2D008EFC1C /* LokiKitTests */ = {
isa = PBXGroup;
children = (
24B23968227BBA2D008EFC1C /* LokiKitTests.swift */,
24B2396A227BBA2D008EFC1C /* Info.plist */,
);
path = LokiKitTests;
sourceTree = "<group>";
};
24B2398A227BBB14008EFC1C /* Pod */ = {
isa = PBXGroup;
children = (
24B2398B227BBB21008EFC1C /* LokiKit.podspec */,
);
name = Pod;
sourceTree = "<group>";
};
24B2398D227BBED9008EFC1C /* Frameworks */ = {
isa = PBXGroup;
children = (
24B23992227BBEE2008EFC1C /* SignalServiceKit.framework */,
24B23990227BBEDC008EFC1C /* Curve25519Kit.framework */,
24B2398E227BBEDA008EFC1C /* CryptoSwift.framework */,
090A2756AF3B96A1A6F7208C /* Pods_LokiKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
E103B305EE1E5ECDD2D72DDC /* Pods */ = {
isa = PBXGroup;
children = (
E08CB8D0C89F4717B2D51D41 /* Pods-LokiKit.debug.xcconfig */,
D5C29CCA1A7CDF6063649ED2 /* Pods-LokiKit.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
24B23955227BBA2D008EFC1C /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
2470AF6F227BD02E00D2F01F /* ECKeyPair.h in Headers */,
24B2396B227BBA2D008EFC1C /* LokiKit.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
24B23959227BBA2D008EFC1C /* LokiKit */ = {
isa = PBXNativeTarget;
buildConfigurationList = 24B2396E227BBA2D008EFC1C /* Build configuration list for PBXNativeTarget "LokiKit" */;
buildPhases = (
3BE8E7BCCD2DD9377DDC1A50 /* [CP] Check Pods Manifest.lock */,
24B23955227BBA2D008EFC1C /* Headers */,
24B23956227BBA2D008EFC1C /* Sources */,
24B23957227BBA2D008EFC1C /* Frameworks */,
24B23958227BBA2D008EFC1C /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = LokiKit;
productName = LokiKit;
productReference = 24B2395A227BBA2D008EFC1C /* LokiKit.framework */;
productType = "com.apple.product-type.framework";
};
24B23962227BBA2D008EFC1C /* LokiKitTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 24B23971227BBA2D008EFC1C /* Build configuration list for PBXNativeTarget "LokiKitTests" */;
buildPhases = (
24B2395F227BBA2D008EFC1C /* Sources */,
24B23960227BBA2D008EFC1C /* Frameworks */,
24B23961227BBA2D008EFC1C /* Resources */,
);
buildRules = (
);
dependencies = (
24B23966227BBA2D008EFC1C /* PBXTargetDependency */,
);
name = LokiKitTests;
productName = LokiKitTests;
productReference = 24B23963227BBA2D008EFC1C /* LokiKitTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
24B23951227BBA2D008EFC1C /* Project object */ = {
isa = PBXProject;
attributes = {
DefaultBuildSystemTypeForWorkspace = Original;
LastSwiftUpdateCheck = 1020;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "loki network";
TargetAttributes = {
24B23959227BBA2D008EFC1C = {
CreatedOnToolsVersion = 10.2.1;
LastSwiftMigration = 1020;
};
24B23962227BBA2D008EFC1C = {
CreatedOnToolsVersion = 10.2.1;
};
};
};
buildConfigurationList = 24B23954227BBA2D008EFC1C /* Build configuration list for PBXProject "LokiKit" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 24B23950227BBA2D008EFC1C;
productRefGroup = 24B2395B227BBA2D008EFC1C /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
24B23959227BBA2D008EFC1C /* LokiKit */,
24B23962227BBA2D008EFC1C /* LokiKitTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
24B23958227BBA2D008EFC1C /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2470AF68227BD02E00D2F01F /* japanese.txt in Resources */,
2470AF6B227BD02E00D2F01F /* spanish.txt in Resources */,
2470AF6A227BD02E00D2F01F /* english.txt in Resources */,
2470AF6C227BD02E00D2F01F /* portuguese.txt in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
24B23961227BBA2D008EFC1C /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3BE8E7BCCD2DD9377DDC1A50 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-LokiKit-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
24B23956227BBA2D008EFC1C /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2470AF6E227BD02E00D2F01F /* BuildConfiguration.swift in Sources */,
2470AF69227BD02E00D2F01F /* Mnemonic.swift in Sources */,
2470AF66227BD02E00D2F01F /* ECKeyPair.m in Sources */,
2470AF6D227BD02E00D2F01F /* ProofOfWork.swift in Sources */,
2470AF67227BD02E00D2F01F /* ECKeyPair.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
24B2395F227BBA2D008EFC1C /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
24B23969227BBA2D008EFC1C /* LokiKitTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
24B23966227BBA2D008EFC1C /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 24B23959227BBA2D008EFC1C /* LokiKit */;
targetProxy = 24B23965227BBA2D008EFC1C /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
24B2396C227BBA2D008EFC1C /* 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 = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
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;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
24B2396D227BBA2D008EFC1C /* 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 = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
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;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
24B2396F227BBA2D008EFC1C /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E08CB8D0C89F4717B2D51D41 /* Pods-LokiKit.debug.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "LokiKit/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.loki-network.Loki-Messenger.LokiKit";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
24B23970227BBA2D008EFC1C /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D5C29CCA1A7CDF6063649ED2 /* Pods-LokiKit.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "LokiKit/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.loki-network.Loki-Messenger.LokiKit";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
24B23972227BBA2D008EFC1C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = LokiKitTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.loki-network.Loki-Messenger.LokiKitTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
24B23973227BBA2D008EFC1C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = LokiKitTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.loki-network.Loki-Messenger.LokiKitTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
24B23954227BBA2D008EFC1C /* Build configuration list for PBXProject "LokiKit" */ = {
isa = XCConfigurationList;
buildConfigurations = (
24B2396C227BBA2D008EFC1C /* Debug */,
24B2396D227BBA2D008EFC1C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
24B2396E227BBA2D008EFC1C /* Build configuration list for PBXNativeTarget "LokiKit" */ = {
isa = XCConfigurationList;
buildConfigurations = (
24B2396F227BBA2D008EFC1C /* Debug */,
24B23970227BBA2D008EFC1C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
24B23971227BBA2D008EFC1C /* Build configuration list for PBXNativeTarget "LokiKitTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
24B23972227BBA2D008EFC1C /* Debug */,
24B23973227BBA2D008EFC1C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 24B23951227BBA2D008EFC1C /* Project object */;
}

View File

@ -1,4 +1,5 @@
#import "ECKeyPair.h"
#import <SignalCoreKit/OWSAsserts.h>
extern void curve25519_donna(unsigned char *output, const unsigned char *a, const unsigned char *b);

View File

@ -1,5 +1,5 @@
extension ECKeyPair {
public extension ECKeyPair {
var hexEncodedPrivateKey: String {
return privateKey.map { String(format: "%02hhx", $0) }.joined()

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>

View File

@ -0,0 +1,16 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for LokiKit.
FOUNDATION_EXPORT double LokiKitVersionNumber;
//! Project version string for LokiKit.
FOUNDATION_EXPORT const unsigned char LokiKitVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <LokiKit/PublicHeader.h>
#import "ECKeyPair.h"

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -0,0 +1,30 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
import XCTest
@testable import LokiKit
class LokiKitTests: XCTestCase {
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}

19
Podfile
View File

@ -6,6 +6,12 @@ inhibit_all_warnings!
def shared_pods
###
# Loki Kit
###
pod 'LokiKit', path: './LokiKit', testspecs: ["Tests"]
###
# OWS Pods
###
@ -65,7 +71,12 @@ def shared_pods
pod 'CryptoSwift', :inhibit_warnings => true
end
workspace 'Signal'
project 'Signal'
project 'LokiKit/LokiKit'
target 'Signal' do
project 'Signal'
shared_pods
pod 'SSZipArchive', :inhibit_warnings => true
@ -75,13 +86,21 @@ target 'Signal' do
end
target 'SignalShareExtension' do
project 'Signal'
shared_pods
end
target 'SignalMessaging' do
project 'Signal'
shared_pods
end
target 'LokiKit' do
project 'LokiKit/LokiKit'
pod 'Curve25519Kit', git: 'https://github.com/signalapp/Curve25519Kit', testspecs: ["Tests"]
pod 'CryptoSwift', :inhibit_warnings => true
end
post_install do |installer|
enable_extension_support_for_purelayout(installer)
end

View File

@ -44,6 +44,14 @@ PODS:
- CocoaLumberjack
- SignalCoreKit
- libPhoneNumber-iOS (0.9.13)
- LokiKit (0.0.1):
- CryptoSwift
- Curve25519Kit
- SignalCoreKit
- LokiKit/Tests (0.0.1):
- CryptoSwift
- Curve25519Kit
- SignalCoreKit
- Mantle (2.1.0):
- Mantle/extobjc (= 2.1.0)
- Mantle/extobjc (2.1.0)
@ -86,6 +94,7 @@ PODS:
- Curve25519Kit
- GRKOpenSSLFramework
- libPhoneNumber-iOS
- LokiKit
- Mantle
- PromiseKit (~> 6.0)
- Reachability
@ -102,6 +111,7 @@ PODS:
- Curve25519Kit
- GRKOpenSSLFramework
- libPhoneNumber-iOS
- LokiKit
- Mantle
- PromiseKit (~> 6.0)
- Reachability
@ -195,6 +205,8 @@ DEPENDENCIES:
- GRKOpenSSLFramework (from `https://github.com/signalapp/GRKOpenSSLFramework`)
- HKDFKit (from `https://github.com/signalapp/HKDFKit.git`)
- HKDFKit/Tests (from `https://github.com/signalapp/HKDFKit.git`)
- LokiKit (from `./LokiKit`)
- LokiKit/Tests (from `./LokiKit`)
- Mantle (from `https://github.com/signalapp/Mantle`, branch `signal-master`)
- PromiseKit (= 6.5.3)
- PureLayout
@ -236,6 +248,8 @@ EXTERNAL SOURCES:
:git: https://github.com/signalapp/GRKOpenSSLFramework
HKDFKit:
:git: https://github.com/signalapp/HKDFKit.git
LokiKit:
:path: "./LokiKit"
Mantle:
:branch: signal-master
:git: https://github.com/signalapp/Mantle
@ -290,6 +304,7 @@ SPEC CHECKSUMS:
GRKOpenSSLFramework: 8a3735ad41e7dc1daff460467bccd32ca5d6ae3e
HKDFKit: 3b6dbbb9d59c221cc6c52c3aa915700cbf24e376
libPhoneNumber-iOS: e444379ac18bbfbdefad571da735b2cd7e096caa
LokiKit: e18a5ac18b9f2b788b0fa7d0619d9a2a0511dd54
Mantle: 2fa750afa478cd625a94230fbf1c13462f29395b
PromiseKit: c609029bdd801f792551a504c695c7d3098b42cd
PureLayout: f08c01b8dec00bb14a1fefa3de4c7d9c265df85e
@ -297,7 +312,7 @@ SPEC CHECKSUMS:
SAMKeychain: 483e1c9f32984d50ca961e26818a534283b4cd5c
SignalCoreKit: c2d8132cdedb95d35eb2f8ae7eac0957695d0a8b
SignalMetadataKit: 6fa5e9a53c7f104568662521a2f3874672ff7a02
SignalServiceKit: c637b66e485538dda76836a1ec560dc556035430
SignalServiceKit: 81b569196f3da6c3964f33b688f7b9ea2bc9a271
SQLCipher: efbdb52cdbe340bcd892b1b14297df4e07241b7f
SSZipArchive: cefe1364104a0231268a5deb8495bdf2861f52f0
Starscream: ef3ece99d765eeccb67de105bfa143f929026cf5
@ -305,6 +320,6 @@ SPEC CHECKSUMS:
YapDatabase: b418a4baa6906e8028748938f9159807fd039af4
YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54
PODFILE CHECKSUM: 7ccaed3947d300293e21ab9e118dae7de7592743
PODFILE CHECKSUM: c2f870c82713a0d73cf24dfe89e1a37ade0bc166
COCOAPODS: 1.5.3

2
Pods

@ -1 +1 @@
Subproject commit 34ae9f4f2dd47c4d66de7525fbe1054f4f573512
Subproject commit 7151257f8e01a018939a1956659c334c7365fc2b

View File

@ -3294,6 +3294,7 @@
"${BUILT_PRODUCTS_DIR}/Curve25519Kit/Curve25519Kit.framework",
"${PODS_ROOT}/GRKOpenSSLFramework/OpenSSL-iOS/bin/openssl.framework",
"${BUILT_PRODUCTS_DIR}/HKDFKit/HKDFKit.framework",
"${BUILT_PRODUCTS_DIR}/LokiKit/LokiKit.framework",
"${BUILT_PRODUCTS_DIR}/Mantle/Mantle.framework",
"${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework",
"${BUILT_PRODUCTS_DIR}/PureLayout/PureLayout.framework",
@ -3319,6 +3320,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Curve25519Kit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HKDFKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LokiKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mantle.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PureLayout.framework",
@ -3372,6 +3374,7 @@
"${BUILT_PRODUCTS_DIR}/Curve25519Kit/Curve25519Kit.framework",
"${PODS_ROOT}/GRKOpenSSLFramework/OpenSSL-iOS/bin/openssl.framework",
"${BUILT_PRODUCTS_DIR}/HKDFKit/HKDFKit.framework",
"${BUILT_PRODUCTS_DIR}/LokiKit/LokiKit.framework",
"${BUILT_PRODUCTS_DIR}/Mantle/Mantle.framework",
"${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework",
"${BUILT_PRODUCTS_DIR}/PureLayout/PureLayout.framework",
@ -3396,6 +3399,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Curve25519Kit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HKDFKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LokiKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mantle.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PureLayout.framework",

View File

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:LokiKit/LokiKit.xcodeproj">
</FileRef>
<FileRef
location = "group:Signal.xcodeproj">
</FileRef>

View File

@ -17,7 +17,6 @@
#import "DateUtil.h"
#import "DebugUIPage.h"
#import "DebugUITableViewController.h"
#import "ECKeyPair.h"
#import "FingerprintViewController.h"
#import "HomeViewCell.h"
#import "HomeViewController.h"
@ -126,3 +125,4 @@
#import <WebRTC/RTCAudioSession.h>
#import <WebRTC/RTCCameraPreviewView.h>
#import <YYImage/YYImage.h>
#import <LokiKit/LokiKit.h>

View File

@ -1,3 +1,4 @@
import LokiKit
final class OnboardingKeyPairViewController : OnboardingBaseViewController {
private var mode: Mode = .register { didSet { if mode != oldValue { handleModeChanged() } } }

View File

@ -1,4 +1,5 @@
import PromiseKit
import LokiKit
public struct LokiMessagingAPI {

View File

@ -52,6 +52,7 @@ An Objective-C library for communicating with the Signal messaging service.
s.dependency 'SwiftProtobuf'
s.dependency 'SignalCoreKit'
s.dependency 'SignalMetadataKit'
s.dependency 'LokiKit'
s.dependency 'PromiseKit', "~> 6.0"